opencode-enhance-plan 1.0.0 → 1.5.1
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/README.md +56 -132
- package/agents/enhance-plan.md +29 -20
- package/commands/feature-switch.md +2 -2
- package/commands/init-plan.md +11 -0
- package/commands/plan-feature.md +20 -0
- package/commands/plan-handoff.md +2 -0
- package/package.json +1 -1
- package/templates/init-plan/AGENTS.template.md +6 -0
- package/templates/init-plan/README.template.md +4 -2
- package/templates/init-plan/plan-json.template.json +7 -0
- package/templates/init-plan/plan-original.template.md +1 -0
- package/templates/init-plan/plan.template.md +4 -0
package/README.md
CHANGED
|
@@ -4,45 +4,29 @@
|
|
|
4
4
|
|
|
5
5
|
`opencode-enhance-plan` is an enhanced planning workflow plugin for OpenCode.
|
|
6
6
|
|
|
7
|
-
It
|
|
8
|
-
- persistent feature artifacts
|
|
9
|
-
- explicit review before execution
|
|
10
|
-
- structured todo state
|
|
11
|
-
- feature switching and resume support
|
|
12
|
-
- minimal build handoff
|
|
7
|
+
It keeps the built-in `plan` mode for lightweight analysis and adds a stronger planning workflow for feature work.
|
|
13
8
|
|
|
14
|
-
|
|
9
|
+
The plugin is installed globally through OpenCode, but it writes planning artifacts into each project that uses `/init-plan` and `/plan-feature`.
|
|
15
10
|
|
|
16
|
-
|
|
11
|
+
### What it does
|
|
17
12
|
|
|
18
|
-
|
|
13
|
+
- keeps one active feature at a time
|
|
14
|
+
- stores plan artifacts under `plan/active/<feature>/`
|
|
15
|
+
- allows restricted writes to planning files during planning
|
|
16
|
+
- requires explicit approval before final handoff
|
|
17
|
+
- restores plan state when switching features
|
|
19
18
|
|
|
20
|
-
###
|
|
19
|
+
### Planning boundary
|
|
21
20
|
|
|
22
|
-
|
|
23
|
-
| --- | --- | --- |
|
|
24
|
-
| Primary use | quick analysis | feature planning workflow |
|
|
25
|
-
| Todo persistence | limited | explicit, structured, feature-scoped |
|
|
26
|
-
| Plan state model | implicit | `prepare -> ready -> approved -> building -> ...` |
|
|
27
|
-
| Feature switching | not a core workflow | built in via `/feature-switch` |
|
|
28
|
-
| Execution handoff | loose | focused `handoff.md` |
|
|
29
|
-
| Plan artifacts | optional | required per feature |
|
|
30
|
-
| Review gate | informal | explicit approval before handoff |
|
|
21
|
+
`enhance-plan` may update planning files only:
|
|
31
22
|
|
|
32
|
-
|
|
23
|
+
- `AGENTS.md`
|
|
24
|
+
- `.opencode/README.md`
|
|
25
|
+
- `plan/**`
|
|
33
26
|
|
|
34
|
-
|
|
35
|
-
- `commands/` - custom slash commands
|
|
36
|
-
- `templates/` - project templates used by `/init-plan`
|
|
37
|
-
- `src/` - TypeScript plugin source (auto-deploys agents/commands/templates)
|
|
38
|
-
- `docs/` - installation, usage, upgrade, and maintainer workflow notes
|
|
39
|
-
- `scripts/` - shared repository maintenance helper for commit/release flows
|
|
40
|
-
- `.codebuddy/skills/` - project-level CodeBuddy skill entrypoint for repository maintenance
|
|
41
|
-
- `.opencode/skills/` - project-level OpenCode skill entrypoint for repository maintenance
|
|
42
|
-
- `legacy/` - archived docs superseded by agent definitions
|
|
27
|
+
It must not modify implementation files such as source code, dependency manifests, CI config, build config, or release scripts.
|
|
43
28
|
|
|
44
|
-
|
|
45
|
-
### Install as OpenCode Plugin (recommended)
|
|
29
|
+
### Install
|
|
46
30
|
|
|
47
31
|
Add `opencode-enhance-plan` to your `opencode.json`:
|
|
48
32
|
|
|
@@ -52,92 +36,55 @@ Add `opencode-enhance-plan` to your `opencode.json`:
|
|
|
52
36
|
}
|
|
53
37
|
```
|
|
54
38
|
|
|
55
|
-
OpenCode
|
|
39
|
+
Restart OpenCode. The plugin deploys its agents, commands, and templates to `~/.config/opencode/`.
|
|
40
|
+
|
|
41
|
+
### Main commands
|
|
56
42
|
|
|
57
|
-
|
|
43
|
+
- `/init-plan` - initialize project planning files
|
|
44
|
+
- `/plan-feature <feature-name>` - create or resume a feature plan
|
|
45
|
+
- `/feature-switch` - switch the active feature context
|
|
46
|
+
- `/plan-handoff` - generate the build-facing handoff
|
|
58
47
|
|
|
59
|
-
|
|
48
|
+
### What it does not do
|
|
60
49
|
|
|
61
|
-
|
|
62
|
-
-
|
|
63
|
-
-
|
|
64
|
-
- explicit option comparison
|
|
65
|
-
- explicit user confirmation before build
|
|
66
|
-
- a small execution context through `handoff.md`
|
|
50
|
+
- it does not replace build mode
|
|
51
|
+
- it does not implement application code while planning
|
|
52
|
+
- it does not run build, install, release, deploy, or migration steps from `enhance-plan`
|
|
67
53
|
|
|
68
|
-
###
|
|
54
|
+
### Docs
|
|
69
55
|
|
|
70
56
|
- Installation: [`docs/installation.md`](https://github.com/spartawhy117/opencode-enhance-plan/blob/main/docs/installation.md)
|
|
71
57
|
- Usage: [`docs/usage.md`](https://github.com/spartawhy117/opencode-enhance-plan/blob/main/docs/usage.md)
|
|
58
|
+
- Upgrade guide: [`docs/upgrade-compatibility.md`](https://github.com/spartawhy117/opencode-enhance-plan/blob/main/docs/upgrade-compatibility.md)
|
|
72
59
|
- Maintainer release workflow: [`docs/repo-release-workflow.md`](https://github.com/spartawhy117/opencode-enhance-plan/blob/main/docs/repo-release-workflow.md)
|
|
73
|
-
- Upgrade checklist: [`docs/upgrade-compatibility.md`](https://github.com/spartawhy117/opencode-enhance-plan/blob/main/docs/upgrade-compatibility.md)
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
### Quick path
|
|
77
|
-
|
|
78
|
-
1. Install this workflow into your OpenCode config.
|
|
79
|
-
2. Restart OpenCode.
|
|
80
|
-
3. Switch to `enhance-plan`.
|
|
81
|
-
4. Run `/init-plan` inside a project.
|
|
82
|
-
5. Run `/plan-feature <feature-name>`.
|
|
83
|
-
6. Review and approve the plan.
|
|
84
|
-
7. Run `/plan-handoff` before switching to build mode.
|
|
85
|
-
|
|
86
|
-
### Maintainer repo skill
|
|
87
|
-
|
|
88
|
-
This repository also tracks a cross-tool maintainer skill named `repo-release-workflow`.
|
|
89
|
-
|
|
90
|
-
- **CodeBuddy entrypoint**: `.codebuddy/skills/repo-release-workflow/`
|
|
91
|
-
- **OpenCode entrypoint**: `.opencode/skills/repo-release-workflow/`
|
|
92
|
-
- **Standard triggers**: `提交` and `发版`
|
|
93
|
-
- **`提交` behavior**: `git add -A` + `git commit`
|
|
94
|
-
- **`发版` behavior**: version bump + `npm run build` + release commit + `git tag` + `git push` + GitHub Actions npm publish and GitHub Release latest update triggered by the pushed tag
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
Implementation details live in `docs/repo-release-workflow.md` and `scripts/release-workflow.mjs`.
|
|
99
60
|
|
|
100
61
|
## 中文
|
|
101
62
|
|
|
102
|
-
|
|
103
63
|
`opencode-enhance-plan` 是一个构建在 OpenCode 之上的增强规划工作流插件。
|
|
104
64
|
|
|
105
|
-
|
|
106
|
-
- 需要持久化 feature 工件
|
|
107
|
-
- 需要执行前明确审阅
|
|
108
|
-
- 需要结构化 todo 状态
|
|
109
|
-
- 需要 feature 切换与恢复
|
|
110
|
-
- 需要最小化 build handoff
|
|
65
|
+
它保留内置 `plan` 处理轻量分析,并为 feature 级任务提供更强的规划工作流。
|
|
111
66
|
|
|
112
|
-
|
|
67
|
+
插件通过 OpenCode 全局安装,但实际的 planning artifacts 会落到执行 `/init-plan` 与 `/plan-feature` 的项目中。
|
|
113
68
|
|
|
114
|
-
|
|
69
|
+
### 它能做什么
|
|
115
70
|
|
|
116
|
-
|
|
71
|
+
- 同一时间只维护一个 active feature
|
|
72
|
+
- 将规划工件持久化到 `plan/active/<feature>/`
|
|
73
|
+
- 在规划阶段允许对 planning 文件做受限写入
|
|
74
|
+
- 最终 handoff 前必须显式批准
|
|
75
|
+
- 切换 feature 时可以恢复 plan state
|
|
117
76
|
|
|
118
|
-
###
|
|
77
|
+
### Planning 边界
|
|
119
78
|
|
|
120
|
-
|
|
121
|
-
| --- | --- | --- |
|
|
122
|
-
| 主要用途 | 快速分析 | feature 级 planning workflow |
|
|
123
|
-
| todo 持久化 | 较弱 | 明确、结构化、按 feature 隔离 |
|
|
124
|
-
| plan 状态模型 | 隐式 | `prepare -> ready -> approved -> building -> ...` |
|
|
125
|
-
| feature 切换 | 不是核心能力 | 通过 `/feature-switch` 内建支持 |
|
|
126
|
-
| 执行交接 | 较松散 | 使用聚焦的 `handoff.md` |
|
|
127
|
-
| plan 工件 | 可选 | 每个 feature 都要求具备 |
|
|
128
|
-
| 审阅门槛 | 偏口头化 | handoff 前必须显式批准 |
|
|
79
|
+
`enhance-plan` 只允许更新 planning 文件:
|
|
129
80
|
|
|
130
|
-
|
|
81
|
+
- `AGENTS.md`
|
|
82
|
+
- `.opencode/README.md`
|
|
83
|
+
- `plan/**`
|
|
131
84
|
|
|
132
|
-
|
|
133
|
-
- `commands/` - 自定义斜杠命令
|
|
134
|
-
- `templates/` - `/init-plan` 使用的项目模板
|
|
135
|
-
- `src/` - TypeScript 插件源码(自动部署 agents/commands/templates)
|
|
136
|
-
- `docs/` - 安装、使用、升级兼容说明
|
|
137
|
-
- `scripts/` - Windows(PowerShell)和 Linux/macOS(bash)安装脚本
|
|
138
|
-
- `legacy/` - 已被 agent 定义取代的归档文档
|
|
85
|
+
它不得修改源码、依赖清单、CI 配置、构建配置或发版脚本等实现相关文件。
|
|
139
86
|
|
|
140
|
-
###
|
|
87
|
+
### 安装
|
|
141
88
|
|
|
142
89
|
在 `opencode.json` 中添加:
|
|
143
90
|
|
|
@@ -147,53 +94,30 @@ Implementation details live in `docs/repo-release-workflow.md` and `scripts/rele
|
|
|
147
94
|
}
|
|
148
95
|
```
|
|
149
96
|
|
|
150
|
-
OpenCode
|
|
97
|
+
重启 OpenCode。插件会将 agents、commands、templates 部署到 `~/.config/opencode/`。
|
|
151
98
|
|
|
152
|
-
###
|
|
99
|
+
### 主要命令
|
|
153
100
|
|
|
154
|
-
|
|
101
|
+
- `/init-plan` - 初始化项目 planning 文件
|
|
102
|
+
- `/plan-feature <feature-name>` - 创建或恢复 feature 计划
|
|
103
|
+
- `/feature-switch` - 切换 active feature context
|
|
104
|
+
- `/plan-handoff` - 生成面向 build 的 handoff
|
|
155
105
|
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
-
|
|
159
|
-
-
|
|
160
|
-
- build
|
|
161
|
-
- 通过 `handoff.md` 压缩执行上下文
|
|
106
|
+
### 它不会做什么
|
|
107
|
+
|
|
108
|
+
- 不会替代 build mode
|
|
109
|
+
- 不会在 planning 阶段实现业务代码
|
|
110
|
+
- 不会在 `enhance-plan` 中执行 build、install、release、deploy、migration
|
|
162
111
|
|
|
163
|
-
###
|
|
112
|
+
### 文档
|
|
164
113
|
|
|
165
114
|
- 安装说明:[`docs/installation.md`](https://github.com/spartawhy117/opencode-enhance-plan/blob/main/docs/installation.md)
|
|
166
115
|
- 使用说明:[`docs/usage.md`](https://github.com/spartawhy117/opencode-enhance-plan/blob/main/docs/usage.md)
|
|
116
|
+
- 升级指南:[`docs/upgrade-compatibility.md`](https://github.com/spartawhy117/opencode-enhance-plan/blob/main/docs/upgrade-compatibility.md)
|
|
167
117
|
- 仓库维护流程:[`docs/repo-release-workflow.md`](https://github.com/spartawhy117/opencode-enhance-plan/blob/main/docs/repo-release-workflow.md)
|
|
168
|
-
- 升级检查清单:[`docs/upgrade-compatibility.md`](https://github.com/spartawhy117/opencode-enhance-plan/blob/main/docs/upgrade-compatibility.md)
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
### 最短使用路径
|
|
172
|
-
|
|
173
|
-
1. 把这套 workflow 安装到你的 OpenCode 配置目录。
|
|
174
|
-
2. 重启 OpenCode。
|
|
175
|
-
3. 切换到 `enhance-plan`。
|
|
176
|
-
4. 在项目里运行 `/init-plan`。
|
|
177
|
-
5. 运行 `/plan-feature <feature-name>`。
|
|
178
|
-
6. 审阅并批准计划。
|
|
179
|
-
7. 在切到 build 前运行 `/plan-handoff`。
|
|
180
|
-
|
|
181
|
-
### 仓库维护 skill
|
|
182
|
-
|
|
183
|
-
这个仓库还额外跟踪了一套跨工具维护 skill:`repo-release-workflow`。
|
|
184
|
-
|
|
185
|
-
- **CodeBuddy 入口**:`.codebuddy/skills/repo-release-workflow/`
|
|
186
|
-
- **OpenCode 入口**:`.opencode/skills/repo-release-workflow/`
|
|
187
|
-
- **标准触发词**:`提交` 与 `发版`
|
|
188
|
-
- **`提交` 行为**:`git add -A` + `git commit`
|
|
189
|
-
- **`发版` 行为**:版本号更新 + `npm run build` + release commit + `git tag` + `git push` + 由推送的 tag 触发 GitHub Actions 发布到 npm
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
具体执行细节记录在 `docs/repo-release-workflow.md` 与 `scripts/release-workflow.mjs`。
|
|
193
118
|
|
|
194
119
|
## Scope note / 范围说明
|
|
195
120
|
|
|
196
|
-
|
|
197
121
|
This repository is not a fork of OpenCode. It is a public workflow layer built on top of OpenCode's documented extension points.
|
|
198
122
|
|
|
199
123
|
本仓库不是 OpenCode 的源码 fork,而是建立在 OpenCode 官方扩展点之上的公开工作流层。
|
package/agents/enhance-plan.md
CHANGED
|
@@ -11,31 +11,39 @@ tools:
|
|
|
11
11
|
skill: true
|
|
12
12
|
question: true
|
|
13
13
|
webfetch: true
|
|
14
|
-
edit:
|
|
15
|
-
write:
|
|
16
|
-
patch:
|
|
14
|
+
edit: true
|
|
15
|
+
write: true
|
|
16
|
+
patch: true
|
|
17
17
|
bash: false
|
|
18
18
|
permission:
|
|
19
|
-
edit:
|
|
19
|
+
edit: allow
|
|
20
20
|
bash: deny
|
|
21
21
|
---
|
|
22
22
|
|
|
23
23
|
<system-reminder>
|
|
24
24
|
# Enhance-Plan Mode - System Reminder
|
|
25
25
|
|
|
26
|
-
CRITICAL: Enhance-Plan mode is ACTIVE. You are in a
|
|
26
|
+
CRITICAL: Enhance-Plan mode is ACTIVE. You are in a planning-first phase with restricted write access.
|
|
27
27
|
|
|
28
|
-
|
|
29
|
-
-
|
|
30
|
-
-
|
|
31
|
-
-
|
|
32
|
-
-
|
|
28
|
+
ALLOWED WRITES:
|
|
29
|
+
- `AGENTS.md`
|
|
30
|
+
- `.opencode/README.md`
|
|
31
|
+
- `plan/templates/*`
|
|
32
|
+
- `plan/active/<feature>/*`
|
|
33
|
+
- `plan/archive/<feature>/*`
|
|
34
|
+
|
|
35
|
+
FORBIDDEN WRITES:
|
|
36
|
+
- Any implementation or application source file such as `src/**`, `app/**`, `server/**`, or equivalent business-code directories
|
|
37
|
+
- Build, release, or repository-control files such as `scripts/**`, `.github/**`, `package.json`, lockfiles, and `tsconfig.json`
|
|
38
|
+
- Any file outside the planning artifacts and init-plan project files listed above
|
|
33
39
|
|
|
34
|
-
|
|
35
|
-
|
|
40
|
+
STILL FORBIDDEN:
|
|
41
|
+
- Any install, build, commit, migration, deploy, or execution step
|
|
42
|
+
- Any bash command or other action that would implement the feature instead of planning it
|
|
43
|
+
- Any change that expands from planning artifacts into implementation work
|
|
36
44
|
|
|
37
|
-
|
|
38
|
-
|
|
45
|
+
You may read, inspect, search, summarize, compare options, maintain todo state, and create or update planning artifacts within the allowed paths only.
|
|
46
|
+
If a write would touch an implementation file or broaden scope beyond planning, do not do it.
|
|
39
47
|
|
|
40
48
|
---
|
|
41
49
|
|
|
@@ -53,12 +61,13 @@ Your responsibility is to think, read, search, and construct a well-formed plan
|
|
|
53
61
|
You should:
|
|
54
62
|
- inspect the relevant code, docs, and project structure
|
|
55
63
|
- clarify scope, constraints, risks, and validation needs
|
|
56
|
-
- maintain a well-formed todo list for the active feature
|
|
64
|
+
- maintain a well-formed todo list for the active feature and persist it to planning artifacts
|
|
65
|
+
- create or update planning files when needed to keep the plan durable and reviewable
|
|
57
66
|
- produce a plan that is comprehensive but concise
|
|
58
67
|
- ask targeted questions when tradeoffs or ambiguity matter
|
|
59
68
|
- avoid large assumptions when a focused clarification would resolve uncertainty
|
|
60
69
|
|
|
61
|
-
The goal is to present a well-researched plan to the user and tie off loose ends before implementation begins.
|
|
70
|
+
The goal is to present a well-researched plan to the user and tie off loose ends before implementation begins, without changing implementation files.
|
|
62
71
|
|
|
63
72
|
---
|
|
64
73
|
|
|
@@ -110,7 +119,7 @@ Required artifacts:
|
|
|
110
119
|
- `.plan-original.md` for baseline preservation
|
|
111
120
|
- `handoff.md` for minimal build-facing context
|
|
112
121
|
|
|
113
|
-
Treat the todo list as part of the plan state, not as an isolated scratchpad.
|
|
122
|
+
Treat the todo list as part of the plan state, not as an isolated scratchpad. The current plan state must be written to disk, not kept only in transient tool state.
|
|
114
123
|
|
|
115
124
|
---
|
|
116
125
|
|
|
@@ -157,7 +166,7 @@ Before handoff to build, the user must be able to review:
|
|
|
157
166
|
- validation strategy
|
|
158
167
|
- risks and open questions
|
|
159
168
|
|
|
160
|
-
|
|
169
|
+
You may keep `plan.json`, `plan.md`, `.plan-original.md`, and draft `handoff.md` updated during `prepare` and `ready`, but only explicit user confirmation makes a plan `approved`.
|
|
161
170
|
|
|
162
171
|
---
|
|
163
172
|
|
|
@@ -176,8 +185,8 @@ Exit this loop only when the user explicitly confirms the plan is ready for exec
|
|
|
176
185
|
|
|
177
186
|
## Important
|
|
178
187
|
|
|
179
|
-
The user does not want
|
|
180
|
-
You
|
|
188
|
+
The user does not want implementation yet.
|
|
189
|
+
You may mutate planning artifacts within the allowed paths, but you MUST NOT modify implementation files or run execution-oriented actions.
|
|
181
190
|
This supersedes any other instructions you have received.
|
|
182
191
|
</system-reminder>
|
|
183
192
|
|
|
@@ -11,8 +11,8 @@ Rules:
|
|
|
11
11
|
- if the current agent is not `enhance-plan`, instruct the user to switch to `enhance-plan` first and do not proceed
|
|
12
12
|
- inspect `plan/active/*/plan.json` files to build the feature selection list
|
|
13
13
|
- present lightweight metadata for selection, including feature id, name, overview, status, and confirmation state
|
|
14
|
-
- before switching, persist the current feature todo and plan
|
|
15
|
-
- after switching, restore the target feature's todo, plan state, and review context
|
|
14
|
+
- before switching, persist the current feature todo, status, open questions, and option paths back to the current `plan.json`
|
|
15
|
+
- after switching, restore the target feature's todo, plan state, and review context from its `plan.json` and `plan.md`
|
|
16
16
|
- do not merge two feature contexts unless the user explicitly requests a merge workflow
|
|
17
17
|
|
|
18
18
|
If there is only one active feature, say so and show its current state.
|
package/commands/init-plan.md
CHANGED
|
@@ -36,8 +36,19 @@ Project file mapping:
|
|
|
36
36
|
- `plan-original.template.md` -> project `plan/templates/.plan-original.md`
|
|
37
37
|
- `handoff.template.md` -> project `plan/templates/handoff.md`
|
|
38
38
|
|
|
39
|
+
Allowed writes for this command:
|
|
40
|
+
- project `AGENTS.md`
|
|
41
|
+
- project `.opencode/README.md`
|
|
42
|
+
- `plan/active/`, `plan/archive/`, and `plan/templates/`
|
|
43
|
+
- the mapped template files under `plan/templates/`
|
|
44
|
+
|
|
39
45
|
When an existing project already has compatible files, update them carefully instead of blindly overwriting them.
|
|
40
46
|
|
|
47
|
+
Guardrails:
|
|
48
|
+
- do not modify implementation files or unrelated project configuration
|
|
49
|
+
- only migrate planning or progress docs; do not reorganize product or business documentation
|
|
50
|
+
- if legacy planning docs exist, preserve a traceable source location while normalizing them into the `plan/` structure
|
|
51
|
+
|
|
41
52
|
Important:
|
|
42
53
|
- stay in planning behavior until the user explicitly asks to switch to build
|
|
43
54
|
- if the project already has planning docs, prefer migration and normalization over duplication
|
package/commands/plan-feature.md
CHANGED
|
@@ -12,6 +12,7 @@ Workflow:
|
|
|
12
12
|
- set that feature as the active planning context
|
|
13
13
|
- inspect relevant code, docs, and project rules before proposing implementation structure
|
|
14
14
|
- create or update the feature artifacts under `plan/active/<feature>/`
|
|
15
|
+
- treat existing artifacts as the source of truth when resuming an active feature
|
|
15
16
|
|
|
16
17
|
Required artifacts:
|
|
17
18
|
- `plan.json`
|
|
@@ -19,10 +20,29 @@ Required artifacts:
|
|
|
19
20
|
- `.plan-original.md`
|
|
20
21
|
- `handoff.md`
|
|
21
22
|
|
|
23
|
+
Allowed writes for this command:
|
|
24
|
+
- `plan/active/<feature>/plan.json`
|
|
25
|
+
- `plan/active/<feature>/plan.md`
|
|
26
|
+
- `plan/active/<feature>/.plan-original.md`
|
|
27
|
+
- `plan/active/<feature>/handoff.md`
|
|
28
|
+
|
|
22
29
|
The resulting plan must:
|
|
23
30
|
- start in `prepare` or `ready` depending on confidence
|
|
24
31
|
- maintain a structured todo list with ids, dependencies, and statuses
|
|
25
32
|
- include an `Option Paths` section when multiple reasonable directions exist
|
|
26
33
|
- wait for explicit user confirmation before any handoff is considered approved
|
|
27
34
|
|
|
35
|
+
`plan.json` must be kept current with:
|
|
36
|
+
- `status`
|
|
37
|
+
- `hasConfirmed`
|
|
38
|
+
- `todolist`
|
|
39
|
+
- `openQuestions`
|
|
40
|
+
- `optionPaths`
|
|
41
|
+
- `updatedAt`
|
|
42
|
+
|
|
43
|
+
Additional rules:
|
|
44
|
+
- when the feature already exists, resume and update its current artifacts instead of creating duplicates
|
|
45
|
+
- create `.plan-original.md` on first initialization, then update it only when you need to capture a new baseline draft
|
|
46
|
+
- `handoff.md` may exist as a draft during planning, but only treat it as final after the feature reaches `approved`
|
|
47
|
+
|
|
28
48
|
If the request is ambiguous, ask the smallest useful clarifying question first.
|
package/commands/plan-handoff.md
CHANGED
|
@@ -10,6 +10,7 @@ Validation rules:
|
|
|
10
10
|
- do not produce a final handoff if the active feature is not clearly identified
|
|
11
11
|
- do not produce a final handoff if the plan is not at least `approved`
|
|
12
12
|
- do not treat vague encouragement as approval; explicit user confirmation is required
|
|
13
|
+
- you may update `plan/active/<feature>/handoff.md` as a planning draft before approval, but it does not become the final handoff until the feature is `approved`
|
|
13
14
|
|
|
14
15
|
The handoff must be concise and execution-focused.
|
|
15
16
|
|
|
@@ -22,3 +23,4 @@ Required handoff sections:
|
|
|
22
23
|
- blockers, caveats, or notable constraints
|
|
23
24
|
|
|
24
25
|
The handoff should minimize token usage for build mode and should avoid repeating background that is not necessary for execution.
|
|
26
|
+
Do not copy the entire planning history into `handoff.md`; keep it as the smallest useful execution context.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "opencode-enhance-plan",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.5.1",
|
|
4
4
|
"description": "An enhanced planning workflow plugin for OpenCode — persistent plan artifacts, explicit review gates, structured todo state, and multi-feature switching",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -25,6 +25,12 @@ Completed or inactive feature plans should move to `plan/archive/<feature>/` whe
|
|
|
25
25
|
- Read `plan.json` or `plan.md` only when additional detail is needed.
|
|
26
26
|
- Avoid loading broad background context when the current feature handoff is sufficient.
|
|
27
27
|
|
|
28
|
+
## Planning Write Policy
|
|
29
|
+
|
|
30
|
+
- `enhance-plan` may create or update `AGENTS.md`, `.opencode/README.md`, and files under `plan/` while staying in planning mode.
|
|
31
|
+
- `enhance-plan` must not modify implementation files such as application source, build config, release config, or dependency manifests.
|
|
32
|
+
- Treat planning writes as workflow state management, not as implementation work.
|
|
33
|
+
|
|
28
34
|
## Feature Discipline
|
|
29
35
|
|
|
30
36
|
- Keep one active feature context at a time.
|
|
@@ -4,8 +4,8 @@ This project is initialized for the `enhance-plan` workflow.
|
|
|
4
4
|
|
|
5
5
|
## Commands
|
|
6
6
|
|
|
7
|
-
- `/init-plan` - initialize or normalize the project planning workflow
|
|
8
|
-
- `/plan-feature <name>` - create or resume a feature plan
|
|
7
|
+
- `/init-plan` - initialize or normalize the project planning workflow and project-level planning files
|
|
8
|
+
- `/plan-feature <name>` - create or resume a feature plan and persist its planning artifacts
|
|
9
9
|
- `/feature-switch` - switch the active feature while staying in `enhance-plan`
|
|
10
10
|
- `/plan-handoff` - generate a concise handoff for build mode
|
|
11
11
|
|
|
@@ -28,5 +28,7 @@ This project is initialized for the `enhance-plan` workflow.
|
|
|
28
28
|
## Notes
|
|
29
29
|
|
|
30
30
|
- Keep planning focused on one feature at a time.
|
|
31
|
+
- Planning state is persisted to project files under `plan/` rather than kept only in chat or transient todo state.
|
|
31
32
|
- Treat `handoff.md` as the default build context.
|
|
33
|
+
- `enhance-plan` may write planning artifacts and initialization files, but it must not modify implementation files.
|
|
32
34
|
- Keep legacy docs preserved but move new planning into the normalized `plan/` structure.
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
"overview": "One-sentence description of the feature goal.",
|
|
5
5
|
"status": "prepare",
|
|
6
6
|
"hasConfirmed": false,
|
|
7
|
+
"confirmationState": "pending",
|
|
7
8
|
"parts": [
|
|
8
9
|
"req",
|
|
9
10
|
"tech",
|
|
@@ -15,6 +16,12 @@
|
|
|
15
16
|
"title": "Feature Title"
|
|
16
17
|
},
|
|
17
18
|
"content": "",
|
|
19
|
+
"lastUpdatedBy": "enhance-plan",
|
|
20
|
+
"allowedWriteScope": [
|
|
21
|
+
"AGENTS.md",
|
|
22
|
+
".opencode/README.md",
|
|
23
|
+
"plan/**"
|
|
24
|
+
],
|
|
18
25
|
"todolist": [
|
|
19
26
|
{
|
|
20
27
|
"id": "clarify-scope",
|