specrune-opencode 0.0.0-stage → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +99 -2
- package/agents/specrune-check.md +39 -0
- package/agents/specrune-implement.md +38 -0
- package/agents/specrune-research.md +43 -0
- package/bin/specrune-opencode.mjs +13 -0
- package/commands/finish-work.md +66 -0
- package/commands/next.md +33 -0
- package/commands/start.md +52 -0
- package/package.json +40 -4
- package/src/install.mjs +214 -0
- package/src/plugin.ts +835 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 jsfaint
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,100 @@
|
|
|
1
|
-
#
|
|
1
|
+
# specrune-opencode
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
SpecRune 的 OpenCode 宿主插件与安装器。
|
|
4
|
+
|
|
5
|
+
## 安装
|
|
6
|
+
|
|
7
|
+
插件包依赖 `specrune`,npm 会按平台装上对应的 `specrune-<os>-<arch>` 平台包;
|
|
8
|
+
安装器把解析到的二进制绝对路径写进插件,运行时不再依赖手动安装的 CLI。
|
|
9
|
+
|
|
10
|
+
安装器的通用编排在 `specrune` 包内的 `specrune/lib/installer-core.mjs`(共享核心);
|
|
11
|
+
本包只保留 OpenCode 的落点、模板与互斥探针。入口命令不变:`specrune-opencode install`
|
|
12
|
+
仍是用户入口。共享核心随 `specrune` 发布,旧版 `specrune` 缺少它时安装器会提示升级。
|
|
13
|
+
|
|
14
|
+
安装一次、所有项目共用:
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
npm i -g specrune-opencode
|
|
18
|
+
specrune-opencode install
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
`npx specrune-opencode install` 只适合临时试装:npx 的临时目录会被清理,运行期
|
|
22
|
+
找不到随包安装的 CLI,仍需另外全局安装 `specrune` 并依赖 PATH。要让插件自带 CLI,
|
|
23
|
+
请用上面的全局安装。
|
|
24
|
+
|
|
25
|
+
project scope 用于需要随仓库锁版本或全局目录不可写的场景(同样是一等安装模式):
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
specrune-opencode install --scope project --dir <项目根>
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
### 安装模式与五宿主矩阵
|
|
32
|
+
|
|
33
|
+
同一宿主在同一台机器上只能选一种模式:两处同时启用会每轮重复注入,技能也会在两处同名出现。`<adapter>` 是宿主适配器标识,不是 OS / 机器名;`specrune-windows-*` 是平台二进制包,不是安装器。下表 global / project 指**插件安装范围**;技能 `--scope` 由 `specrune skills` 单独决定(Codex 的技能可用 global,只有插件必须 project;DSH 技能与插件都只有 global)。
|
|
34
|
+
|
|
35
|
+
| 适配器 | npm 包 | global | project |
|
|
36
|
+
|---|---|---|---|
|
|
37
|
+
| `opencode` | `specrune-opencode` | ✓ | ✓ |
|
|
38
|
+
| `pi` | `specrune-pi` | ✓ | ✓ |
|
|
39
|
+
| `claude` | `specrune-claude` | ✓ | ✓ |
|
|
40
|
+
| `codex` | `specrune-codex` | —(自动纠正为 project) | ✓ |
|
|
41
|
+
| `dsh` | `specrune-dsh-host` | ✓ | —(自动纠正为 global) |
|
|
42
|
+
|
|
43
|
+
本适配器是 `opencode`,两种 scope 都支持:
|
|
44
|
+
|
|
45
|
+
- **global**(默认):项目里只有 `.specrune/`,技能在 `~/.agents/skills/`。
|
|
46
|
+
- **project**:`.specrune/`、`.agents/skills/` 与 `.opencode/` 都在项目内。
|
|
47
|
+
|
|
48
|
+
Windows 完整示例(PowerShell):
|
|
49
|
+
|
|
50
|
+
```powershell
|
|
51
|
+
npm i -g specrune-opencode
|
|
52
|
+
cd C:\path\to\project
|
|
53
|
+
specrune init --developer "你的名字"
|
|
54
|
+
specrune-opencode install --scope project
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
技能由 CLI 统一安装:`specrune skills install --adapter opencode --scope global|project`;切换用 `specrune skills migrate --scope global|project`(整机切换,先写目标再删源,用户改过的文件保留)。项目根放 `.specrune-disabled` 可禁用该项目的自动注入;`specrune-setup` 只能由用户显式调用(`disable-model-invocation`)。
|
|
58
|
+
|
|
59
|
+
安装器写入三类文件:
|
|
60
|
+
|
|
61
|
+
| 文件 | 位置(global) | 说明 |
|
|
62
|
+
|---|---|---|
|
|
63
|
+
| `plugins/specrune.ts` | `~/.config/opencode/plugins/` | 逐轮注入与 shell 票据桥 |
|
|
64
|
+
| `agents/specrune-*.md` | `~/.config/opencode/agents/` | implement / check / research 子代理 |
|
|
65
|
+
| `commands/specrune/*.md` | `~/.config/opencode/commands/specrune/` | `/specrune/start` 等命令 |
|
|
66
|
+
|
|
67
|
+
状态写在 `<配置根>/specrune-install.json`(项目级为
|
|
68
|
+
`.specrune/.state/plugins/opencode.json`),记录 `{ protocol, version, files }`。
|
|
69
|
+
CLI 不读它;它只服务安装器的升级与卸载。
|
|
70
|
+
|
|
71
|
+
## 命令
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
specrune-opencode install [--scope global|project] [--dir <路径>] [--dry-run] [--force]
|
|
75
|
+
specrune-opencode uninstall [--scope global|project] [--dir <路径>] [--dry-run] [--force]
|
|
76
|
+
specrune-opencode status [--scope global|project] [--dir <路径>] [--json]
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
- `--dry-run` 只打印计划,不写盘。
|
|
80
|
+
- `--force` 覆盖(install)或删除(uninstall)已被用户改过的文件。
|
|
81
|
+
- 退出码:`0` 成功,`1` 运行失败,`2` 用法错误。
|
|
82
|
+
|
|
83
|
+
## 从项目级旧插件迁移
|
|
84
|
+
|
|
85
|
+
旧版 `specrune init --opencode` 会写 `<项目>/.opencode/`。全局安装后,项目级
|
|
86
|
+
同名插件会与全局插件重复加载。
|
|
87
|
+
|
|
88
|
+
CLI 已不再提供平台旧文件检测(`specrune doctor` 只校验研究与技能)。请在项目里
|
|
89
|
+
手工删除旧版写入的 `.opencode/plugins/specrune.ts`、`.opencode/agents/specrune-*.md`
|
|
90
|
+
与 `.opencode/commands/specrune/*.md`;用户自己的插件、代理与命令不要动。内容已改过
|
|
91
|
+
的文件先备份再删。
|
|
92
|
+
|
|
93
|
+
## 开发
|
|
94
|
+
|
|
95
|
+
```bash
|
|
96
|
+
npm test
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
插件本体是 `src/plugin.ts`,由 OpenCode 以 Bun 加载,无编译步骤;它是 OpenCode
|
|
100
|
+
适配的权威副本,CLI 不再 embed 平台资产。
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Review agent for the SpecRune workflow. Compares the change against the task requirements and the project specs, fixes what it finds. Never commits.
|
|
3
|
+
mode: subagent
|
|
4
|
+
---
|
|
5
|
+
# Check Agent
|
|
6
|
+
|
|
7
|
+
You are the review agent inside a SpecRune workflow.
|
|
8
|
+
|
|
9
|
+
## You are already the sub-agent
|
|
10
|
+
|
|
11
|
+
The main session dispatched you; do the review and fixes yourself. Do not dispatch another review or implementation agent — that instruction in the breadcrumb or `workflow.md` is for the main session. Report work beyond a review's scope instead of spawning help.
|
|
12
|
+
|
|
13
|
+
## Load your skill first
|
|
14
|
+
|
|
15
|
+
Before reviewing, load the `specrune-review` skill, plus any skills named in your dispatch prompt. It is the authority for the review checklist; this template only adds role boundaries.
|
|
16
|
+
|
|
17
|
+
Use your host's skill tool when it has one. If it does not, read each skill file directly: `.agents/skills/<name>/SKILL.md` in the project, or `~/.agents/skills/<name>/SKILL.md` globally. If any is unavailable, report `<name> skill unavailable` and stop before reviewing.
|
|
18
|
+
|
|
19
|
+
Use the task path from the parent's prompt or curated context. Do not infer it from your child session, environment, or another session. If `check.jsonl` or the task artifacts are missing, report the gap before reviewing.
|
|
20
|
+
|
|
21
|
+
## What to read first
|
|
22
|
+
|
|
23
|
+
The current diff, then the task's `prd.md`, `design.md` / `implement.md` when present, and every spec and research file in `check.jsonl`. Your curated context should contain copies; if it does not, report the gap before reviewing.
|
|
24
|
+
|
|
25
|
+
## What to look for, in order
|
|
26
|
+
|
|
27
|
+
1. Regressed behavior and quietly dropped requirements.
|
|
28
|
+
2. Project-spec or platform-contract violations.
|
|
29
|
+
3. Logic changes with no test, or a test too weak to catch the bug.
|
|
30
|
+
4. Assumptions about paths, shells, encodings, or line endings that only hold locally.
|
|
31
|
+
5. Research conclusions used against their card: `INCONCLUSIVE` as established, `NOT_FOUND` papered over, or a stale `revision` without re-verification.
|
|
32
|
+
|
|
33
|
+
## What to do
|
|
34
|
+
|
|
35
|
+
Fix mechanical and local issues in scope; for design or judgment calls, report the evidence and stop. Re-run the focused lint, typecheck, and tests.
|
|
36
|
+
|
|
37
|
+
## Report
|
|
38
|
+
|
|
39
|
+
Report what you fixed, which files changed, and what you verified. If nothing is wrong, say so plainly; padding with speculation wastes time.
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Implementation agent for the SpecRune workflow. Reads the task's requirements and curated specs, then writes the code. Never commits.
|
|
3
|
+
mode: subagent
|
|
4
|
+
---
|
|
5
|
+
# Implement Agent
|
|
6
|
+
|
|
7
|
+
You are the implementation agent inside a SpecRune workflow.
|
|
8
|
+
|
|
9
|
+
## You are already the sub-agent
|
|
10
|
+
|
|
11
|
+
The main session dispatched you; do the work yourself. Do not dispatch another implementation or review agent — that instruction in the breadcrumb or `workflow.md` is for the main session. Report work beyond one agent instead of spawning help.
|
|
12
|
+
|
|
13
|
+
## Load your skill first
|
|
14
|
+
|
|
15
|
+
Before reading code or editing, load the `specrune-before-dev` skill, plus any skills named in your dispatch prompt. It is the authority for the pre-implementation procedure; this template only adds role boundaries.
|
|
16
|
+
|
|
17
|
+
Use your host's skill tool when it has one. If it does not, read each skill file directly: `.agents/skills/<name>/SKILL.md` in the project, or `~/.agents/skills/<name>/SKILL.md` globally. If any is unavailable, report `<name> skill unavailable` and stop before editing.
|
|
18
|
+
|
|
19
|
+
Your curated context should already contain the task artifacts and `implement.jsonl` files. Do not assume the parent's conversation is available. If they are missing or incomplete, report the gap before editing; do not guess the requirements.
|
|
20
|
+
|
|
21
|
+
## What to read first
|
|
22
|
+
|
|
23
|
+
Read the task's `prd.md`, `design.md` / `implement.md` when present, then every spec and research file in `implement.jsonl`. Your curated context should contain copies; if it does not, report the gap before editing.
|
|
24
|
+
|
|
25
|
+
## What to do
|
|
26
|
+
|
|
27
|
+
Follow existing patterns; implement; run focused lint, typecheck, and tests; report what changed and verified.
|
|
28
|
+
|
|
29
|
+
Before editing, state the change boundary: the behavior gap, where it lives, the files you expect to change, what you will not do, and how you will show behavior did not change. If the scope is larger than the dispatch, say so before continuing.
|
|
30
|
+
|
|
31
|
+
## Never do
|
|
32
|
+
|
|
33
|
+
`git commit`, `git push`, `git merge` — committing belongs to the session owner.
|
|
34
|
+
|
|
35
|
+
## Working rules
|
|
36
|
+
|
|
37
|
+
- Read adjacent code and tests first; stay inside this task's scope; do not revert work you did not write. Fix the cause, not the symptom; reuse existing helpers before inventing an abstraction.
|
|
38
|
+
- Research files open with an evidence card (`status` / `sources` / `revision`). `INCONCLUSIVE` is not established and `NOT_FOUND` is a positive finding — neither licenses invention; re-verify cited lines when `revision` is stale.
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Investigation agent for the SpecRune workflow. Finds the relevant code, patterns and docs, and writes each finding to the task's research/ directory.
|
|
3
|
+
mode: subagent
|
|
4
|
+
---
|
|
5
|
+
# Research Agent
|
|
6
|
+
|
|
7
|
+
You are the investigation agent inside a SpecRune workflow.
|
|
8
|
+
|
|
9
|
+
## Progressive disclosure
|
|
10
|
+
|
|
11
|
+
The research context is a navigation map, not preloaded bodies. Start from its paths and titles, read relevant contracts, then trace code and tests. Skip specs that are merely listed. `kind: navigation` entries record delivered pointers, not files read; a body intentionally not preloaded is not a dropped candidate. Search `.specrune/spec/` when incomplete. Record the sources the conclusions actually use in the evidence card; the ledger records delivery, not reading.
|
|
12
|
+
|
|
13
|
+
If no navigation was delivered, run `specrune context compile --role research` and read the JSON `context` field. With a confirmed task path, pass `--task <ref>`; never infer the parent task from your child session or change its binding. Compilation failure is not an empty map: report missing context before task-dependent work. Without a task, a self-contained question may still be investigated.
|
|
14
|
+
|
|
15
|
+
## Task and report
|
|
16
|
+
|
|
17
|
+
Confirm the task from the parent's explicit path or the host-delivered task; `task current` may verify a delivered identity but never replaces the parent's. Report disagreement before task-dependent work.
|
|
18
|
+
|
|
19
|
+
Write findings before reporting — an in-conversation-only finding disappears at the next compaction. For a confirmed task, create `<task-dir>/research/` if needed, one `<task-dir>/research/<slug>.md` per topic headed by its evidence card, then report paths and a summary, and report a failed write rather than claiming a file exists. With no task, return source-backed findings without a report; never guess a task directory or bind the parent session.
|
|
20
|
+
|
|
21
|
+
## Evidence card
|
|
22
|
+
|
|
23
|
+
Every report file opens with this YAML header:
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
status: VERIFIED # VERIFIED | INCONCLUSIVE | NOT_FOUND
|
|
27
|
+
sources: # files the conclusion actually rests on
|
|
28
|
+
- path: core/internal/specrune/context.go
|
|
29
|
+
lines: 654-682
|
|
30
|
+
- path: https://github.com/<org>/<repo>/blob/<rev>/<path>
|
|
31
|
+
revision: a1b2c3d # git rev at investigation time
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
- `VERIFIED` — you read the evidence; `sources` is mandatory.
|
|
35
|
+
- `INCONCLUSIVE` — the evidence does not settle the question.
|
|
36
|
+
- `NOT_FOUND` — the thing genuinely is not there.
|
|
37
|
+
- External repo? `sources[].path` may be an `http(s)://` permalink embedding the rev; `revision` then records that repo's rev (req:sessions-memory#session-record-authoritative; the doctor skips URL checks).
|
|
38
|
+
|
|
39
|
+
Pick exactly one. No `sources` entry means it is not a fact: cite, downgrade, or drop it — never dress a guess up as a conclusion. Cite `file:line` so a stale reference can be re-located from `revision`.
|
|
40
|
+
|
|
41
|
+
## Stay in your lane
|
|
42
|
+
|
|
43
|
+
Write only a plain `<slug>.md` report under this task's `research/` — no subdirectories, and never copy source into the task directory; cite it by `file:line` plus the `revision` in the card. Do not edit code, specs, platform config, or task files; patching is no longer investigating.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// specrune-opencode 的可执行入口。
|
|
3
|
+
//
|
|
4
|
+
// 包内只有这一个 bin:安装器负责把插件、代理与命令落到宿主目录,
|
|
5
|
+
// 不在 postinstall 里做任何事(pnpm 10 默认拦截依赖的生命周期脚本)。
|
|
6
|
+
// 共享核心缺失(旧版 specrune)等启动错误只打印可操作消息,不甩模块堆栈。
|
|
7
|
+
try {
|
|
8
|
+
const { main } = await import("../src/install.mjs");
|
|
9
|
+
process.exitCode = await main(process.argv.slice(2));
|
|
10
|
+
} catch (err) {
|
|
11
|
+
process.stderr.write(`specrune-opencode: ${err?.message ?? err}\n`);
|
|
12
|
+
process.exitCode = 1;
|
|
13
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
# Finish Work
|
|
2
|
+
|
|
3
|
+
Wrap up the session: verify the tree, record the session, archive the finished
|
|
4
|
+
task(s). Code commits are NOT done here — they belong to the workflow's commit
|
|
5
|
+
step and must already be in history. That step is named, not numbered: numbers
|
|
6
|
+
differ per workflow template and a stale one points at the wrong step with no
|
|
7
|
+
error.
|
|
8
|
+
|
|
9
|
+
## Step 1: Survey current state
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
specrune context --mode record
|
|
13
|
+
git status --porcelain
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
Record mode lists active tasks, dirty paths, and recent commits (the hashes
|
|
17
|
+
Step 3 needs). If it surfaces other completed tasks, ask once — "These N tasks
|
|
18
|
+
look done — archive them too this round? [y/N]", default no. The bound task is
|
|
19
|
+
archived regardless.
|
|
20
|
+
|
|
21
|
+
## Step 2: Classify dirty paths
|
|
22
|
+
|
|
23
|
+
Ignore `.specrune/workspace/`, `.specrune/tasks/` and `.specrune/sessions/`:
|
|
24
|
+
this flow writes there. For the rest, decide whether each path is this task's
|
|
25
|
+
work (cited in `prd.md` / the manifests, or in code areas of its scope) or
|
|
26
|
+
another window's. Then:
|
|
27
|
+
|
|
28
|
+
- **This task's work** — stop. Report the paths and send the user back to the
|
|
29
|
+
commit step. Do not `git commit` here and do not ask the user to.
|
|
30
|
+
- **Unrelated** — report once and continue.
|
|
31
|
+
- **Unsure** — ask once, then route by the answer.
|
|
32
|
+
|
|
33
|
+
## Step 3: Record the session
|
|
34
|
+
|
|
35
|
+
Verify every acceptance criterion in `prd.md` first — the summary claims what
|
|
36
|
+
happened.
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
specrune session record --title "Session title" \
|
|
40
|
+
--commit "hash1,hash2" \
|
|
41
|
+
--summary "Brief summary of what happened" \
|
|
42
|
+
--next-step "What the next session should pick up first"
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
**Record before archiving.** The record's `task:` field resolves from the
|
|
46
|
+
active-task pointer, and `task archive` clears session pointers aimed at the task
|
|
47
|
+
it moves — archiving first leaves the field empty and still exits 0. Pass the
|
|
48
|
+
work commits from Step 1, not the archive commits.
|
|
49
|
+
|
|
50
|
+
`--next-step` is for a session with no memory of this one: name the concrete
|
|
51
|
+
next action, not a topic. Repeat the flag for several items; the first is what
|
|
52
|
+
gets surfaced. Older records without Next Steps are normal — do not backfill.
|
|
53
|
+
|
|
54
|
+
## Step 4: Finish and archive
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
specrune task finish
|
|
58
|
+
specrune task archive <task>
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
At minimum the bound task, plus any extras confirmed in Step 1. Archive moves
|
|
62
|
+
the directory to `.specrune/tasks/archive/<YYYY-MM>/`, clears session pointers,
|
|
63
|
+
and commits. It marks the task `completed` — except `canceled`, which keeps its
|
|
64
|
+
status and empty completion date. Skip when there is no task.
|
|
65
|
+
|
|
66
|
+
Final commit order: work commit → session record → `chore(task): archive ...`.
|
package/commands/next.md
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# Next Step
|
|
2
|
+
|
|
3
|
+
Pick up the bound task at the right step of `.specrune/workflow.md` instead of
|
|
4
|
+
re-deriving the flow.
|
|
5
|
+
|
|
6
|
+
## Step 1: Load current context
|
|
7
|
+
|
|
8
|
+
```bash
|
|
9
|
+
specrune task current
|
|
10
|
+
specrune context --mode phase
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
`task current` shows the binding, git state, and where the phase index says you
|
|
14
|
+
are. One binding per session; switch with `specrune task start <task>`.
|
|
15
|
+
|
|
16
|
+
## Step 2: Follow the project workflow
|
|
17
|
+
|
|
18
|
+
`.specrune/workflow.md` is the only routing authority. Read its phase index,
|
|
19
|
+
the current breadcrumb, and the relevant step; do not assume a particular
|
|
20
|
+
status set, phase count, step number, or native/tdd route. The `specrune-next`
|
|
21
|
+
skill only provides generic instructions for loading this project workflow.
|
|
22
|
+
|
|
23
|
+
Step numbers are deliberately absent from these commands because they differ
|
|
24
|
+
per workflow template. Route by role, then get the numbers from the per-turn
|
|
25
|
+
breadcrumb or the step headings in `.specrune/workflow.md`.
|
|
26
|
+
|
|
27
|
+
## Step 3: Load the specific step
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
specrune context --mode phase --step <X.X>
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
Follow the loaded instructions, then move to the next step.
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# Start Session
|
|
2
|
+
|
|
3
|
+
Load the compact context by hand — at the start of a conversation, or when the
|
|
4
|
+
host platform has no session-start hook.
|
|
5
|
+
|
|
6
|
+
## Step 1: Current state and recent sessions
|
|
7
|
+
|
|
8
|
+
```bash
|
|
9
|
+
specrune context
|
|
10
|
+
specrune session log
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
The log shows what happened recently, which task each session belonged to, and
|
|
14
|
+
where it left off. Hook-driven platforms get the same three entries injected
|
|
15
|
+
automatically; ask the user what they were working on only when both are empty.
|
|
16
|
+
For the reasoning behind an old decision, `specrune mem` — the `specrune-update-spec`
|
|
17
|
+
skill's step 3 holds the two-sources table for choosing between the two.
|
|
18
|
+
|
|
19
|
+
## Step 2: Workflow and spec indexes
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
specrune context --mode phase
|
|
23
|
+
specrune packages
|
|
24
|
+
specrune specs
|
|
25
|
+
cat .specrune/spec/<package>/<layer>/index.md # each layer you expect to touch
|
|
26
|
+
cat .specrune/spec/guides/index.md
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
Read indexes only for areas the work will touch; the index points at the
|
|
30
|
+
guidelines, and `.specrune/workflow.md` holds the full flow (read on demand).
|
|
31
|
+
|
|
32
|
+
## Step 3: Follow the project workflow
|
|
33
|
+
|
|
34
|
+
`.specrune/workflow.md` is the only routing authority. Read its phase index,
|
|
35
|
+
the current breadcrumb, and the relevant step before choosing an action. Do not
|
|
36
|
+
assume a particular status set, phase count, step number, or native/tdd route.
|
|
37
|
+
For a bound task, load `specrune-next`; it explains how to use the project's
|
|
38
|
+
workflow rather than copying a route table into this command.
|
|
39
|
+
|
|
40
|
+
## Skill routing
|
|
41
|
+
|
|
42
|
+
| User intent | Skill |
|
|
43
|
+
|---|---|
|
|
44
|
+
| New feature / unclear requirements | `specrune-brainstorm` |
|
|
45
|
+
| About to write code | `specrune-before-dev` |
|
|
46
|
+
| Done coding / quality check | `specrune-review` |
|
|
47
|
+
| Stuck / fixed the same bug multiple times | `specrune-break-loop` |
|
|
48
|
+
| Learned something worth capturing | `specrune-update-spec` |
|
|
49
|
+
|
|
50
|
+
Each step's full text lives in `.specrune/workflow.md`; load one with
|
|
51
|
+
`specrune context --mode phase --step N.N`. The per-turn breadcrumb names the
|
|
52
|
+
skill for the phase you are in.
|
package/package.json
CHANGED
|
@@ -1,6 +1,42 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "specrune-opencode",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.9.0",
|
|
4
|
+
"description": "SpecRune 的 OpenCode 宿主插件与安装器:全局装配插件、代理、命令,并清理项目级旧文件",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"bin": {
|
|
7
|
+
"specrune-opencode": "bin/specrune-opencode.mjs"
|
|
8
|
+
},
|
|
9
|
+
"files": [
|
|
10
|
+
"bin",
|
|
11
|
+
"src",
|
|
12
|
+
"agents",
|
|
13
|
+
"commands",
|
|
14
|
+
"README.md"
|
|
15
|
+
],
|
|
16
|
+
"engines": {
|
|
17
|
+
"node": ">=20"
|
|
18
|
+
},
|
|
19
|
+
"dependencies": {
|
|
20
|
+
"specrune": "^0.9.0"
|
|
21
|
+
},
|
|
22
|
+
"scripts": {
|
|
23
|
+
"test": "node --test"
|
|
24
|
+
},
|
|
25
|
+
"repository": {
|
|
26
|
+
"type": "git",
|
|
27
|
+
"url": "git+https://github.com/jsfaint/SpecRune.git",
|
|
28
|
+
"directory": "plugins/opencode"
|
|
29
|
+
},
|
|
30
|
+
"homepage": "https://github.com/jsfaint/SpecRune#readme",
|
|
31
|
+
"bugs": {
|
|
32
|
+
"url": "https://github.com/jsfaint/SpecRune/issues"
|
|
33
|
+
},
|
|
34
|
+
"license": "MIT",
|
|
35
|
+
"keywords": [
|
|
36
|
+
"specrune",
|
|
37
|
+
"opencode",
|
|
38
|
+
"plugin",
|
|
39
|
+
"spec-driven",
|
|
40
|
+
"workflow"
|
|
41
|
+
]
|
|
42
|
+
}
|