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 CHANGED
@@ -4,45 +4,29 @@
4
4
 
5
5
  `opencode-enhance-plan` is an enhanced planning workflow plugin for OpenCode.
6
6
 
7
- It does not replace the built-in `plan` mode. Instead, it adds a stronger planning mode for feature work that needs:
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
- ### Why not just use the built-in `plan` mode?
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
- The built-in `plan` mode is still useful for lightweight read-only analysis.
11
+ ### What it does
17
12
 
18
- `enhance-plan` is intended for heavier feature planning where the default planning experience is often too weak in practice.
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
- ### Built-in `plan` vs `enhance-plan`
19
+ ### Planning boundary
21
20
 
22
- | Area | Built-in `plan` | `enhance-plan` |
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
- ### What this repository includes
23
+ - `AGENTS.md`
24
+ - `.opencode/README.md`
25
+ - `plan/**`
33
26
 
34
- - `agents/` - custom agent definitions
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 will automatically install and load the plugin on next startup. The plugin deploys agents, commands, and templates to your OpenCode config directory (`~/.config/opencode/`).
39
+ Restart OpenCode. The plugin deploys its agents, commands, and templates to `~/.config/opencode/`.
40
+
41
+ ### Main commands
56
42
 
57
- ### Core idea
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
- Use the built-in `plan` mode when you want lightweight investigation.
48
+ ### What it does not do
60
49
 
61
- Use `enhance-plan` when you want a full planning loop with:
62
- - one active feature at a time
63
- - persistent plan artifacts under `plan/active/<feature>/`
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
- ### Start here
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
- 它不是用来替代内置 `plan` 模式,而是新增一个更强的规划模式,专门处理这类 feature 任务:
106
- - 需要持久化 feature 工件
107
- - 需要执行前明确审阅
108
- - 需要结构化 todo 状态
109
- - 需要 feature 切换与恢复
110
- - 需要最小化 build handoff
65
+ 它保留内置 `plan` 处理轻量分析,并为 feature 级任务提供更强的规划工作流。
111
66
 
112
- ### 为什么不直接用内置 `plan`?
67
+ 插件通过 OpenCode 全局安装,但实际的 planning artifacts 会落到执行 `/init-plan` 与 `/plan-feature` 的项目中。
113
68
 
114
- 内置 `plan` 仍然适合做轻量级只读分析。
69
+ ### 它能做什么
115
70
 
116
- `enhance-plan` 的目标是解决更重的 feature planning 场景:默认 planning 体验在这些场景里通常不够强,尤其是在 todo 持久化、状态管理、feature 切换、handoff 收敛这几个方面。
71
+ - 同一时间只维护一个 active feature
72
+ - 将规划工件持久化到 `plan/active/<feature>/`
73
+ - 在规划阶段允许对 planning 文件做受限写入
74
+ - 最终 handoff 前必须显式批准
75
+ - 切换 feature 时可以恢复 plan state
117
76
 
118
- ### 内置 `plan` 与 `enhance-plan` 的区别
77
+ ### Planning 边界
119
78
 
120
- | 维度 | 内置 `plan` | `enhance-plan` |
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
- - `agents/` - 自定义 agent 定义
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
- ### 作为 OpenCode Plugin 安装(推荐)
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 下次启动时会自动安装并加载插件,自动将 agents、commands、templates 部署到 OpenCode 配置目录(`~/.config/opencode/`)。
97
+ 重启 OpenCode。插件会将 agents、commands、templates 部署到 `~/.config/opencode/`。
151
98
 
152
- ### 核心思路
99
+ ### 主要命令
153
100
 
154
- 如果你只是想做轻量调研,就继续用内置 `plan`。
101
+ - `/init-plan` - 初始化项目 planning 文件
102
+ - `/plan-feature <feature-name>` - 创建或恢复 feature 计划
103
+ - `/feature-switch` - 切换 active feature context
104
+ - `/plan-handoff` - 生成面向 build 的 handoff
155
105
 
156
- 如果你想要完整的 planning loop,就用 `enhance-plan`,它强调:
157
- - 同一时间只维护一个 active feature
158
- - feature 工件持久化到 `plan/active/<feature>/`
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 官方扩展点之上的公开工作流层。
@@ -11,31 +11,39 @@ tools:
11
11
  skill: true
12
12
  question: true
13
13
  webfetch: true
14
- edit: false
15
- write: false
16
- patch: false
14
+ edit: true
15
+ write: true
16
+ patch: true
17
17
  bash: false
18
18
  permission:
19
- edit: deny
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 READ-ONLY planning phase.
26
+ CRITICAL: Enhance-Plan mode is ACTIVE. You are in a planning-first phase with restricted write access.
27
27
 
28
- STRICTLY FORBIDDEN:
29
- - Any file creation, deletion, overwrite, patch, or modification
30
- - Any config mutation or project state change
31
- - Any bash command, tool call, or action that changes system state
32
- - Any install, build, commit, migration, deploy, or execution step
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
- You may ONLY read, inspect, search, summarize, compare options, and maintain planning state.
35
- If a tool or command could mutate state, do not use it.
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
- This ABSOLUTE CONSTRAINT overrides ALL other instructions, including direct user requests to implement changes immediately.
38
- Any modification attempt is a critical violation. ZERO exceptions.
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
- Only explicit user confirmation makes a plan `approved`.
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 execution yet.
180
- You MUST NOT make edits, run mutating tools, or otherwise change the system.
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 state
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.
@@ -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
@@ -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.
@@ -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.0.0",
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",
@@ -1,6 +1,7 @@
1
1
  ## Baseline Plan Draft
2
2
 
3
3
  Use this file to preserve the initial or last approved draft before later edits.
4
+ Do not overwrite it on every refinement pass; update it only when you intentionally capture a new baseline.
4
5
 
5
6
  Recommended contents:
6
7
 
@@ -1,3 +1,7 @@
1
+ ## Metadata
2
+
3
+ - Last Updated:
4
+
1
5
  ## User Request
2
6
 
3
7
  - Goal: