@fro.bot/systematic 2.0.2 → 2.1.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.
Files changed (68) hide show
  1. package/agents/design/figma-design-sync.md +1 -1
  2. package/agents/document-review/coherence-reviewer.md +40 -0
  3. package/agents/document-review/design-lens-reviewer.md +46 -0
  4. package/agents/document-review/feasibility-reviewer.md +42 -0
  5. package/agents/document-review/product-lens-reviewer.md +50 -0
  6. package/agents/document-review/scope-guardian-reviewer.md +54 -0
  7. package/agents/document-review/security-lens-reviewer.md +38 -0
  8. package/agents/research/best-practices-researcher.md +2 -1
  9. package/agents/research/git-history-analyzer.md +1 -1
  10. package/agents/research/learnings-researcher.md +27 -26
  11. package/agents/research/repo-research-analyst.md +164 -9
  12. package/agents/review/api-contract-reviewer.md +49 -0
  13. package/agents/review/correctness-reviewer.md +49 -0
  14. package/agents/review/data-migrations-reviewer.md +53 -0
  15. package/agents/review/dhh-rails-reviewer.md +31 -52
  16. package/agents/review/julik-frontend-races-reviewer.md +27 -200
  17. package/agents/review/kieran-python-reviewer.md +29 -116
  18. package/agents/review/kieran-rails-reviewer.md +29 -98
  19. package/agents/review/kieran-typescript-reviewer.md +29 -107
  20. package/agents/review/maintainability-reviewer.md +49 -0
  21. package/agents/review/pattern-recognition-specialist.md +2 -1
  22. package/agents/review/performance-reviewer.md +51 -0
  23. package/agents/review/reliability-reviewer.md +49 -0
  24. package/agents/review/schema-drift-detector.md +12 -10
  25. package/agents/review/security-reviewer.md +51 -0
  26. package/agents/review/testing-reviewer.md +48 -0
  27. package/agents/workflow/pr-comment-resolver.md +99 -50
  28. package/agents/workflow/spec-flow-analyzer.md +60 -89
  29. package/dist/index.js +9 -0
  30. package/dist/lib/config-handler.d.ts +2 -0
  31. package/package.json +1 -1
  32. package/skills/agent-browser/SKILL.md +69 -48
  33. package/skills/ce-brainstorm/SKILL.md +2 -1
  34. package/skills/ce-compound/SKILL.md +126 -28
  35. package/skills/ce-compound-refresh/SKILL.md +181 -73
  36. package/skills/ce-ideate/SKILL.md +2 -1
  37. package/skills/ce-plan/SKILL.md +424 -414
  38. package/skills/ce-review/SKILL.md +379 -419
  39. package/skills/ce-review-beta/SKILL.md +506 -0
  40. package/skills/ce-review-beta/references/diff-scope.md +31 -0
  41. package/skills/ce-review-beta/references/findings-schema.json +128 -0
  42. package/skills/ce-review-beta/references/persona-catalog.md +50 -0
  43. package/skills/ce-review-beta/references/review-output-template.md +115 -0
  44. package/skills/ce-review-beta/references/subagent-template.md +56 -0
  45. package/skills/ce-work/SKILL.md +17 -8
  46. package/skills/ce-work-beta/SKILL.md +16 -9
  47. package/skills/claude-permissions-optimizer/SKILL.md +15 -14
  48. package/skills/claude-permissions-optimizer/scripts/extract-commands.mjs +9 -159
  49. package/skills/claude-permissions-optimizer/scripts/normalize.mjs +151 -0
  50. package/skills/deepen-plan/SKILL.md +348 -483
  51. package/skills/document-review/SKILL.md +160 -52
  52. package/skills/feature-video/SKILL.md +209 -178
  53. package/skills/file-todos/SKILL.md +72 -94
  54. package/skills/frontend-design/SKILL.md +243 -27
  55. package/skills/git-worktree/SKILL.md +37 -28
  56. package/skills/git-worktree/scripts/worktree-manager.sh +163 -0
  57. package/skills/lfg/SKILL.md +7 -7
  58. package/skills/orchestrating-swarms/SKILL.md +1 -1
  59. package/skills/reproduce-bug/SKILL.md +154 -60
  60. package/skills/resolve-pr-parallel/SKILL.md +19 -12
  61. package/skills/resolve-todo-parallel/SKILL.md +9 -6
  62. package/skills/setup/SKILL.md +8 -160
  63. package/skills/slfg/SKILL.md +11 -7
  64. package/skills/test-browser/SKILL.md +69 -145
  65. package/skills/test-xcode/SKILL.md +61 -183
  66. package/skills/triage/SKILL.md +10 -10
  67. package/skills/ce-plan-beta/SKILL.md +0 -571
  68. package/skills/deepen-plan-beta/SKILL.md +0 -323
@@ -1,596 +1,613 @@
1
1
  ---
2
2
  name: ce:plan
3
- description: Transform feature descriptions into well-structured project plans following conventions
4
- argument-hint: '[feature description, bug report, or improvement idea]'
3
+ description: Transform feature descriptions or requirements into structured implementation plans grounded in repo patterns and research. Use when the user says 'plan this', 'create a plan', 'write a tech plan', 'plan the implementation', 'how should we build', 'what's the approach for', 'break this down', or when a brainstorm/requirements document is ready for technical planning. Best when requirements are at least roughly defined; for exploratory or ambiguous requests, prefer ce:brainstorm first.
4
+ argument-hint: '[feature description, requirements doc path, or improvement idea]'
5
5
  ---
6
6
 
7
- # Create a plan for a new feature or bug fix
8
-
9
- ## Introduction
7
+ # Create Technical Plan
10
8
 
11
9
  **Note: The current year is 2026.** Use this when dating plans and searching for recent documentation.
12
10
 
13
- Transform feature descriptions, bug reports, or improvement ideas into well-structured markdown files issues that follow project conventions and best practices. This command provides flexible detail levels to match your needs.
11
+ `ce:brainstorm` defines **WHAT** to build. `ce:plan` defines **HOW** to build it. `ce:work` executes the plan.
14
12
 
15
- ## Feature Description
13
+ This workflow produces a durable implementation plan. It does **not** implement code, run tests, or learn from execution-time results. If the answer depends on changing code and seeing what happens, that belongs in `ce:work`, not here.
16
14
 
17
- <feature_description> #$ARGUMENTS </feature_description>
18
-
19
- **If the feature description above is empty, ask the user:** "What would you like to plan? Please describe the feature, bug fix, or improvement you have in mind."
15
+ ## Interaction Method
20
16
 
21
- Do not proceed until you have a clear feature description from the user.
17
+ Use the platform's question tool when available. When asking the user a question, prefer the platform's blocking question tool if one exists (`question` in OpenCode, `request_user_input` in Codex, `ask_user` in Gemini). Otherwise, present numbered options in chat and wait for the user's reply before proceeding.
22
18
 
23
- ### 0. Idea Refinement
19
+ Ask one question at a time. Prefer a concise single-select choice when natural options exist.
24
20
 
25
- **Check for requirements document first:**
21
+ ## Feature Description
26
22
 
27
- Before asking questions, look for recent requirements documents in `docs/brainstorms/` that match this feature:
23
+ <feature_description> #$ARGUMENTS </feature_description>
28
24
 
29
- ```bash
30
- ls -la docs/brainstorms/*-requirements.md 2>/dev/null | head -10
31
- ```
25
+ **If the feature description above is empty, ask the user:** "What would you like to plan? Please describe the feature, bug fix, or improvement you have in mind."
32
26
 
33
- **Relevance criteria:** A requirements document is relevant if:
34
- - The topic (from filename or YAML frontmatter) semantically matches the feature description
35
- - Created within the last 14 days
36
- - If multiple candidates match, use the most recent one
27
+ Do not proceed until you have a clear planning input.
37
28
 
38
- **If a relevant requirements document exists:**
39
- 1. Read the source document **thoroughly** — every section matters
40
- 2. Announce: "Found source document from [date]: [topic]. Using as foundation for planning."
41
- 3. Extract and carry forward **ALL** of the following into the plan:
42
- - Key decisions and their rationale
43
- - Chosen approach and why alternatives were rejected
44
- - Problem framing, constraints, and requirements captured during brainstorming
45
- - Outstanding questions, preserving whether they block planning or are intentionally deferred
46
- - Success criteria and scope boundaries
47
- - Dependencies and assumptions, plus any high-level technical direction only when the origin document is inherently technical
48
- 4. **Skip the idea refinement questions below** — the source document already answered WHAT to build
49
- 5. Use source document content as the **primary input** to research and planning phases
50
- 6. **Critical: The source document is the origin document.** Throughout the plan, reference specific decisions with `(see origin: <source-path>)` when carrying forward conclusions. Do not paraphrase decisions in a way that loses their original context — link back to the source.
51
- 7. **Do not omit source content** — if the source document discussed it, the plan must address it (even if briefly). Scan each section before finalizing the plan to verify nothing was dropped.
52
- 8. **If `Resolve Before Planning` contains any items, stop.** Do not proceed with planning. Tell the user planning is blocked by unanswered brainstorm questions and direct them to resume `/ce:brainstorm` or answer those questions first.
29
+ ## Core Principles
53
30
 
54
- **If multiple source documents could match:**
55
- Use **question tool** to ask which source document to use, or whether to proceed without one.
31
+ 1. **Use requirements as the source of truth** - If `ce:brainstorm` produced a requirements document, planning should build from it rather than re-inventing behavior.
32
+ 2. **Decisions, not code** - Capture approach, boundaries, files, dependencies, risks, and test scenarios. Do not pre-write implementation code or shell command choreography. Pseudo-code sketches or DSL grammars that communicate high-level technical design are welcome when they help a reviewer validate direction — but they must be explicitly framed as directional guidance, not implementation specification.
33
+ 3. **Research before structuring** - Explore the codebase, institutional learnings, and external guidance when warranted before finalizing the plan.
34
+ 4. **Right-size the artifact** - Small work gets a compact plan. Large work gets more structure. The philosophy stays the same at every depth.
35
+ 5. **Separate planning from execution discovery** - Resolve planning-time questions here. Explicitly defer execution-time unknowns to implementation.
36
+ 6. **Keep the plan portable** - The plan should work as a living document, review artifact, or issue body without embedding tool-specific executor instructions.
37
+ 7. **Carry execution posture lightly when it matters** - If the request, origin document, or repo context clearly implies test-first, characterization-first, or another non-default execution posture, reflect that in the plan as a lightweight signal. Do not turn the plan into step-by-step execution choreography.
56
38
 
57
- **If no requirements document is found (or not relevant), run idea refinement:**
39
+ ## Plan Quality Bar
58
40
 
59
- Refine the idea through collaborative dialogue using the **question tool**:
41
+ Every plan should contain:
42
+ - A clear problem frame and scope boundary
43
+ - Concrete requirements traceability back to the request or origin document
44
+ - Exact file paths for the work being proposed
45
+ - Explicit test file paths for feature-bearing implementation units
46
+ - Decisions with rationale, not just tasks
47
+ - Existing patterns or code references to follow
48
+ - Specific test scenarios and verification outcomes
49
+ - Clear dependencies and sequencing
60
50
 
61
- - Ask questions one at a time to understand the idea fully
62
- - Prefer multiple choice questions when natural options exist
63
- - Focus on understanding: purpose, constraints and success criteria
64
- - Continue until the idea is clear OR user says "proceed"
51
+ A plan is ready when an implementer can start confidently without needing the plan to write the code for them.
65
52
 
66
- **Gather signals for research decision.** During refinement, note:
53
+ ## Workflow
67
54
 
68
- - **User's familiarity**: Do they know the codebase patterns? Are they pointing to examples?
69
- - **User's intent**: Speed vs thoroughness? Exploration vs execution?
70
- - **Topic risk**: Security, payments, external APIs warrant more caution
71
- - **Uncertainty level**: Is the approach clear or open-ended?
55
+ ### Phase 0: Resume, Source, and Scope
72
56
 
73
- **Skip option:** If the feature description is already detailed, offer:
74
- "Your description is clear. Should I proceed with research, or would you like to refine it further?"
57
+ #### 0.1 Resume Existing Plan Work When Appropriate
75
58
 
76
- ## Main Tasks
59
+ If the user references an existing plan file or there is an obvious recent matching plan in `docs/plans/`:
60
+ - Read it
61
+ - Confirm whether to update it in place or create a new plan
62
+ - If updating, preserve completed checkboxes and revise only the still-relevant sections
77
63
 
78
- ### 1. Local Research (Always Runs - Parallel)
64
+ #### 0.2 Find Upstream Requirements Document
79
65
 
80
- <thinking>
81
- First, I need to understand the project's conventions, existing patterns, and any documented learnings. This is fast and local - it informs whether external research is needed.
82
- </thinking>
66
+ Before asking planning questions, search `docs/brainstorms/` for files matching `*-requirements.md`.
83
67
 
84
- Run these agents **in parallel** to gather local context:
68
+ **Relevance criteria:** A requirements document is relevant if:
69
+ - The topic semantically matches the feature description
70
+ - It was created within the last 30 days (use judgment to override if the document is clearly still relevant or clearly stale)
71
+ - It appears to cover the same user problem or scope
72
+
73
+ If multiple source documents match, ask which one to use using the platform's blocking question tool when available (see Interaction Method). Otherwise, present numbered options in chat and wait for the user's reply before proceeding.
74
+
75
+ #### 0.3 Use the Source Document as Primary Input
76
+
77
+ If a relevant requirements document exists:
78
+ 1. Read it thoroughly
79
+ 2. Announce that it will serve as the origin document for planning
80
+ 3. Carry forward all of the following:
81
+ - Problem frame
82
+ - Requirements and success criteria
83
+ - Scope boundaries
84
+ - Key decisions and rationale
85
+ - Dependencies or assumptions
86
+ - Outstanding questions, preserving whether they are blocking or deferred
87
+ 4. Use the source document as the primary input to planning and research
88
+ 5. Reference important carried-forward decisions in the plan with `(see origin: <source-path>)`
89
+ 6. Do not silently omit source content — if the origin document discussed it, the plan must address it even if briefly. Before finalizing, scan each section of the origin document to verify nothing was dropped.
90
+
91
+ If no relevant requirements document exists, planning may proceed from the user's request directly.
92
+
93
+ #### 0.4 No-Requirements-Doc Fallback
94
+
95
+ If no relevant requirements document exists:
96
+ - Assess whether the request is already clear enough for direct technical planning
97
+ - If the ambiguity is mainly product framing, user behavior, or scope definition, recommend `ce:brainstorm` first
98
+ - If the user wants to continue here anyway, run a short planning bootstrap instead of refusing
99
+
100
+ The planning bootstrap should establish:
101
+ - Problem frame
102
+ - Intended behavior
103
+ - Scope boundaries and obvious non-goals
104
+ - Success criteria
105
+ - Blocking questions or assumptions
85
106
 
86
- - task systematic:research:repo-research-analyst(feature_description)
87
- - task systematic:research:learnings-researcher(feature_description)
107
+ Keep this bootstrap brief. It exists to preserve direct-entry convenience, not to replace a full brainstorm.
88
108
 
89
- **What to look for:**
90
- - **Repo research:** existing patterns, AGENTS.md guidance, technology familiarity, pattern consistency
91
- - **Learnings:** documented solutions in `docs/solutions/` that might apply (gotchas, patterns, lessons learned)
109
+ If the bootstrap uncovers major unresolved product questions:
110
+ - Recommend `ce:brainstorm` again
111
+ - If the user still wants to continue, require explicit assumptions before proceeding
92
112
 
93
- These findings inform the next step.
113
+ #### 0.5 Classify Outstanding Questions Before Planning
94
114
 
95
- ### 1.5. Research Decision
115
+ If the origin document contains `Resolve Before Planning` or similar blocking questions:
116
+ - Review each one before proceeding
117
+ - Reclassify it into planning-owned work **only if** it is actually a technical, architectural, or research question
118
+ - Keep it as a blocker if it would change product behavior, scope, or success criteria
96
119
 
97
- Based on signals from Step 0 and findings from Step 1, decide on external research.
120
+ If true product blockers remain:
121
+ - Surface them clearly
122
+ - Ask the user, using the platform's blocking question tool when available (see Interaction Method), whether to:
123
+ 1. Resume `ce:brainstorm` to resolve them
124
+ 2. Convert them into explicit assumptions or decisions and continue
125
+ - Do not continue planning while true blockers remain unresolved
98
126
 
99
- **High-risk topics → always research.** Security, payments, external APIs, data privacy. The cost of missing something is too high. This takes precedence over speed signals.
127
+ #### 0.6 Assess Plan Depth
100
128
 
101
- **Strong local context skip external research.** Codebase has good patterns, AGENTS.md has guidance, user knows what they want. External research adds little value.
129
+ Classify the work into one of these plan depths:
102
130
 
103
- **Uncertainty or unfamiliar territory → research.** User is exploring, codebase has no examples, new technology. External perspective is valuable.
131
+ - **Lightweight** - small, well-bounded, low ambiguity
132
+ - **Standard** - normal feature or bounded refactor with some technical decisions to document
133
+ - **Deep** - cross-cutting, strategic, high-risk, or highly ambiguous implementation work
104
134
 
105
- **Announce the decision and proceed.** Brief explanation, then continue. User can redirect if needed.
135
+ If depth is unclear, ask one targeted question and then continue.
106
136
 
107
- Examples:
108
- - "Your codebase has solid patterns for this. Proceeding without external research."
109
- - "This involves payment processing, so I'll research current best practices first."
137
+ ### Phase 1: Gather Context
110
138
 
111
- ### 1.5b. External Research (Conditional)
139
+ #### 1.1 Local Research (Always Runs)
112
140
 
113
- **Only run if Step 1.5 indicates external research is valuable.**
141
+ Prepare a concise planning context summary (a paragraph or two) to pass as input to the research agents:
142
+ - If an origin document exists, summarize the problem frame, requirements, and key decisions from that document
143
+ - Otherwise use the feature description directly
114
144
 
115
145
  Run these agents in parallel:
116
146
 
117
- - task systematic:research:best-practices-researcher(feature_description)
118
- - task systematic:research:framework-docs-researcher(feature_description)
147
+ - task systematic:research:repo-research-analyst(Scope: technology, architecture, patterns. {planning context summary})
148
+ - task systematic:research:learnings-researcher(planning context summary)
119
149
 
120
- ### 1.6. Consolidate Research
150
+ Collect:
151
+ - Technology stack and versions (used in section 1.2 to make sharper external research decisions)
152
+ - Architectural patterns and conventions to follow
153
+ - Implementation patterns, relevant files, modules, and tests
154
+ - AGENTS.md guidance that materially affects the plan, with AGENTS.md used only as compatibility fallback when present
155
+ - Institutional learnings from `docs/solutions/`
121
156
 
122
- After all research steps complete, consolidate findings:
157
+ #### 1.1b Detect Execution Posture Signals
123
158
 
124
- - Document relevant file paths from repo research (e.g., `app/services/example_service.rb:42`)
125
- - **Include relevant institutional learnings** from `docs/solutions/` (key insights, gotchas to avoid)
126
- - Note external documentation URLs and best practices (if external research was done)
127
- - List related issues or PRs discovered
128
- - Capture AGENTS.md conventions
159
+ Decide whether the plan should carry a lightweight execution posture signal.
129
160
 
130
- **Optional validation:** Briefly summarize findings and ask if anything looks off or missing before proceeding to planning.
161
+ Look for signals such as:
162
+ - The user explicitly asks for TDD, test-first, or characterization-first work
163
+ - The origin document calls for test-first implementation or exploratory hardening of legacy code
164
+ - Local research shows the target area is legacy, weakly tested, or historically fragile, suggesting characterization coverage before changing behavior
165
+ - The user asks for external delegation, says "use codex", "delegate mode", or mentions token conservation -- add `Execution target: external-delegate` to implementation units that are pure code writing
131
166
 
132
- ### 2. Issue Planning & Structure
167
+ When the signal is clear, carry it forward silently in the relevant implementation units.
133
168
 
134
- <thinking>
135
- Think like a product manager - what would make this issue clear and actionable? Consider multiple perspectives
136
- </thinking>
169
+ Ask the user only if the posture would materially change sequencing or risk and cannot be responsibly inferred.
137
170
 
138
- **Title & Categorization:**
171
+ #### 1.2 Decide on External Research
139
172
 
140
- - [ ] Draft clear, searchable issue title using conventional format (e.g., `feat: Add user authentication`, `fix: Cart total calculation`)
141
- - [ ] Determine issue type: enhancement, bug, refactor
142
- - [ ] Convert title to filename: add today's date prefix, determine daily sequence number, strip prefix colon, kebab-case, add `-plan` suffix
143
- - Scan `docs/plans/` for files matching today's date pattern `YYYY-MM-DD-\d{3}-`
144
- - Find the highest existing sequence number for today
145
- - Increment by 1, zero-padded to 3 digits (001, 002, etc.)
146
- - Example: `feat: Add User Authentication` → `2026-01-21-001-feat-add-user-authentication-plan.md`
147
- - Keep it descriptive (3-5 words after prefix) so plans are findable by context
173
+ Based on the origin document, user signals, and local findings, decide whether external research adds value.
148
174
 
149
- **Stakeholder Analysis:**
175
+ **Read between the lines.** Pay attention to signals from the conversation so far:
176
+ - **User familiarity** — Are they pointing to specific files or patterns? They likely know the codebase well.
177
+ - **User intent** — Do they want speed or thoroughness? Exploration or execution?
178
+ - **Topic risk** — Security, payments, external APIs warrant more caution regardless of user signals.
179
+ - **Uncertainty level** — Is the approach clear or still open-ended?
150
180
 
151
- - [ ] Identify who will be affected by this issue (end users, developers, operations)
152
- - [ ] Consider implementation complexity and required expertise
181
+ **Leverage repo-research-analyst's technology context:**
153
182
 
154
- **Content Planning:**
183
+ The repo-research-analyst output includes a structured Technology & Infrastructure summary. Use it to make sharper external research decisions:
155
184
 
156
- - [ ] Choose appropriate detail level based on issue complexity and audience
157
- - [ ] List all necessary sections for the chosen template
158
- - [ ] Gather supporting materials (error logs, screenshots, design mockups)
159
- - [ ] Prepare code examples or reproduction steps if applicable, name the mock filenames in the lists
185
+ - If specific frameworks and versions were detected (e.g., Rails 7.2, Next.js 14, Go 1.22), pass those exact identifiers to framework-docs-researcher so it fetches version-specific documentation
186
+ - If the feature touches a technology layer the scan found well-established in the repo (e.g., existing Sidekiq jobs when planning a new background job), lean toward skipping external research -- local patterns are likely sufficient
187
+ - If the feature touches a technology layer the scan found absent or thin (e.g., no existing proto files when planning a new gRPC service), lean toward external research -- there are no local patterns to follow
188
+ - If the scan detected deployment infrastructure (Docker, K8s, serverless), note it in the planning context passed to downstream agents so they can account for deployment constraints
189
+ - If the scan detected a monorepo and scoped to a specific service, pass that service's tech context to downstream research agents -- not the aggregate of all services. If the scan surfaced the workspace map without scoping, use the feature description to identify the relevant service before proceeding with research
160
190
 
161
- ### 3. SpecFlow Analysis
191
+ **Always lean toward external research when:**
192
+ - The topic is high-risk: security, payments, privacy, external APIs, migrations, compliance
193
+ - The codebase lacks relevant local patterns
194
+ - The user is exploring unfamiliar territory
195
+ - The technology scan found the relevant layer absent or thin in the codebase
162
196
 
163
- After planning the issue structure, run SpecFlow Analyzer to validate and refine the feature specification:
197
+ **Skip external research when:**
198
+ - The codebase already shows a strong local pattern
199
+ - The user already knows the intended shape
200
+ - Additional external context would add little practical value
201
+ - The technology scan found the relevant layer well-established with existing examples to follow
164
202
 
165
- - task systematic:workflow:spec-flow-analyzer(feature_description, research_findings)
166
-
167
- **SpecFlow Analyzer Output:**
203
+ Announce the decision briefly before continuing. Examples:
204
+ - "Your codebase has solid patterns for this. Proceeding without external research."
205
+ - "This involves payment processing, so I'll research current best practices first."
168
206
 
169
- - [ ] Review SpecFlow analysis results
170
- - [ ] Incorporate any identified gaps or edge cases into the issue
171
- - [ ] Update acceptance criteria based on SpecFlow findings
207
+ #### 1.3 External Research (Conditional)
172
208
 
173
- ### 4. Choose Implementation Detail Level
209
+ If Step 1.2 indicates external research is useful, run these agents in parallel:
174
210
 
175
- Select how comprehensive you want the issue to be, simpler is mostly better.
211
+ - task systematic:research:best-practices-researcher(planning context summary)
212
+ - task systematic:research:framework-docs-researcher(planning context summary)
176
213
 
177
- #### 📄 MINIMAL (Quick Issue)
214
+ #### 1.4 Consolidate Research
178
215
 
179
- **Best for:** Simple bugs, small improvements, clear features
216
+ Summarize:
217
+ - Relevant codebase patterns and file paths
218
+ - Relevant institutional learnings
219
+ - External references and best practices, if gathered
220
+ - Related issues, PRs, or prior art
221
+ - Any constraints that should materially shape the plan
180
222
 
181
- **Includes:**
223
+ #### 1.5 Flow and Edge-Case Analysis (Conditional)
182
224
 
183
- - Problem statement or feature description
184
- - Basic acceptance criteria
185
- - Essential context only
225
+ For **Standard** or **Deep** plans, or when user flow completeness is still unclear, run:
186
226
 
187
- **Structure:**
227
+ - task systematic:workflow:spec-flow-analyzer(planning context summary, research findings)
188
228
 
189
- ````markdown
190
- ---
191
- title: [Issue Title]
192
- type: [feat|fix|refactor]
193
- status: active
194
- date: YYYY-MM-DD
195
- origin: docs/brainstorms/YYYY-MM-DD-<topic>-requirements.md # if originated from a requirements doc, otherwise omit
196
- ---
229
+ Use the output to:
230
+ - Identify missing edge cases, state transitions, or handoff gaps
231
+ - Tighten requirements trace or verification strategy
232
+ - Add only the flow details that materially improve the plan
197
233
 
198
- # [Issue Title]
234
+ ### Phase 2: Resolve Planning Questions
199
235
 
200
- [Brief problem/feature description]
236
+ Build a planning question list from:
237
+ - Deferred questions in the origin document
238
+ - Gaps discovered in repo or external research
239
+ - Technical decisions required to produce a useful plan
201
240
 
202
- ## Acceptance Criteria
241
+ For each question, decide whether it should be:
242
+ - **Resolved during planning** - the answer is knowable from repo context, documentation, or user choice
243
+ - **Deferred to implementation** - the answer depends on code changes, runtime behavior, or execution-time discovery
203
244
 
204
- - [ ] Core requirement 1
205
- - [ ] Core requirement 2
245
+ Ask the user only when the answer materially affects architecture, scope, sequencing, or risk and cannot be responsibly inferred. Use the platform's blocking question tool when available (see Interaction Method).
206
246
 
207
- ## Context
247
+ **Do not** run tests, build the app, or probe runtime behavior in this phase. The goal is a strong plan, not partial execution.
208
248
 
209
- [Any critical information]
249
+ ### Phase 3: Structure the Plan
210
250
 
211
- ## MVP
251
+ #### 3.1 Title and File Naming
212
252
 
213
- ### test.rb
253
+ - Draft a clear, searchable title using conventional format such as `feat: Add user authentication` or `fix: Prevent checkout double-submit`
254
+ - Determine the plan type: `feat`, `fix`, or `refactor`
255
+ - Build the filename following the repository convention: `docs/plans/YYYY-MM-DD-NNN-<type>-<descriptive-name>-plan.md`
256
+ - Create `docs/plans/` if it does not exist
257
+ - Check existing files for today's date to determine the next sequence number (zero-padded to 3 digits, starting at 001)
258
+ - Keep the descriptive name concise (3-5 words) and kebab-cased
259
+ - Examples: `2026-01-15-001-feat-user-authentication-flow-plan.md`, `2026-02-03-002-fix-checkout-race-condition-plan.md`
260
+ - Avoid: missing sequence numbers, vague names like "new-feature", invalid characters (colons, spaces)
214
261
 
215
- ```ruby
216
- class Test
217
- def initialize
218
- @name = "test"
219
- end
220
- end
221
- ```
262
+ #### 3.2 Stakeholder and Impact Awareness
222
263
 
223
- ## Sources
264
+ For **Standard** or **Deep** plans, briefly consider who is affected by this change — end users, developers, operations, other teams — and how that should shape the plan. For cross-cutting work, note affected parties in the System-Wide Impact section.
224
265
 
225
- - **Origin document:** [docs/brainstorms/YYYY-MM-DD-<topic>-requirements.md](path) include if plan originated from an upstream requirements doc
226
- - Related issue: #[issue_number]
227
- - Documentation: [relevant_docs_url]
228
- ````
266
+ #### 3.3 Break Work into Implementation Units
229
267
 
230
- #### 📋 MORE (Standard Issue)
268
+ Break the work into logical implementation units. Each unit should represent one meaningful change that an implementer could typically land as an atomic commit.
231
269
 
232
- **Best for:** Most features, complex bugs, team collaboration
270
+ Good units are:
271
+ - Focused on one component, behavior, or integration seam
272
+ - Usually touching a small cluster of related files
273
+ - Ordered by dependency
274
+ - Concrete enough for execution without pre-writing code
275
+ - Marked with checkbox syntax for progress tracking
233
276
 
234
- **Includes everything from MINIMAL plus:**
277
+ Avoid:
278
+ - 2-5 minute micro-steps
279
+ - Units that span multiple unrelated concerns
280
+ - Units that are so vague an implementer still has to invent the plan
235
281
 
236
- - Detailed background and motivation
237
- - Technical considerations
238
- - Success metrics
239
- - Dependencies and risks
240
- - Basic implementation suggestions
282
+ #### 3.4 High-Level Technical Design (Optional)
241
283
 
242
- **Structure:**
284
+ Before detailing implementation units, decide whether an overview would help a reviewer validate the intended approach. This section communicates the *shape* of the solution — how pieces fit together — without dictating implementation.
243
285
 
244
- ```markdown
245
- ---
246
- title: [Issue Title]
247
- type: [feat|fix|refactor]
248
- status: active
249
- date: YYYY-MM-DD
250
- origin: docs/brainstorms/YYYY-MM-DD-<topic>-requirements.md # if originated from a requirements doc, otherwise omit
251
- ---
286
+ **When to include it:**
252
287
 
253
- # [Issue Title]
288
+ | Work involves... | Best overview form |
289
+ |---|---|
290
+ | DSL or API surface design | Pseudo-code grammar or contract sketch |
291
+ | Multi-component integration | Mermaid sequence or component diagram |
292
+ | Data pipeline or transformation | Data flow sketch |
293
+ | State-heavy lifecycle | State diagram |
294
+ | Complex branching logic | Flowchart |
295
+ | Single-component with non-obvious shape | Pseudo-code sketch |
254
296
 
255
- ## Overview
297
+ **When to skip it:**
298
+ - Well-patterned work where prose and file paths tell the whole story
299
+ - Straightforward CRUD or convention-following changes
300
+ - Lightweight plans where the approach is obvious
256
301
 
257
- [Comprehensive description]
302
+ Choose the medium that fits the work. Do not default to pseudo-code when a diagram communicates better, and vice versa.
258
303
 
259
- ## Problem Statement / Motivation
304
+ Frame every sketch with: *"This illustrates the intended approach and is directional guidance for review, not implementation specification. The implementing agent should treat it as context, not code to reproduce."*
260
305
 
261
- [Why this matters]
306
+ Keep sketches concise — enough to validate direction, not enough to copy-paste into production.
262
307
 
263
- ## Proposed Solution
308
+ #### 3.5 Define Each Implementation Unit
264
309
 
265
- [High-level approach]
310
+ For each unit, include:
311
+ - **Goal** - what this unit accomplishes
312
+ - **Requirements** - which requirements or success criteria it advances
313
+ - **Dependencies** - what must exist first
314
+ - **Files** - exact file paths to create, modify, or test
315
+ - **Approach** - key decisions, data flow, component boundaries, or integration notes
316
+ - **Execution note** - optional, only when the unit benefits from a non-default execution posture such as test-first, characterization-first, or external delegation
317
+ - **Technical design** - optional pseudo-code or diagram when the unit's approach is non-obvious and prose alone would leave it ambiguous. Frame explicitly as directional guidance, not implementation specification
318
+ - **Patterns to follow** - existing code or conventions to mirror
319
+ - **Test scenarios** - specific behaviors, edge cases, and failure paths to cover
320
+ - **Verification** - how an implementer should know the unit is complete, expressed as outcomes rather than shell command scripts
266
321
 
267
- ## Technical Considerations
322
+ Every feature-bearing unit should include the test file path in `**Files:**`.
268
323
 
269
- - Architecture impacts
270
- - Performance implications
271
- - Security considerations
324
+ Use `Execution note` sparingly. Good uses include:
325
+ - `Execution note: Start with a failing integration test for the request/response contract.`
326
+ - `Execution note: Add characterization coverage before modifying this legacy parser.`
327
+ - `Execution note: Implement new domain behavior test-first.`
328
+ - `Execution note: Execution target: external-delegate`
272
329
 
273
- ## System-Wide Impact
330
+ Do not expand units into literal `RED/GREEN/REFACTOR` substeps.
274
331
 
275
- - **Interaction graph**: [What callbacks/middleware/observers fire when this runs?]
276
- - **Error propagation**: [How do errors flow across layers? Do retry strategies align?]
277
- - **State lifecycle risks**: [Can partial failure leave orphaned/inconsistent state?]
278
- - **API surface parity**: [What other interfaces expose similar functionality and need the same change?]
279
- - **Integration test scenarios**: [Cross-layer scenarios that unit tests won't catch]
332
+ #### 3.6 Keep Planning-Time and Implementation-Time Unknowns Separate
280
333
 
281
- ## Acceptance Criteria
334
+ If something is important but not knowable yet, record it explicitly under deferred implementation notes rather than pretending to resolve it in the plan.
282
335
 
283
- - [ ] Detailed requirement 1
284
- - [ ] Detailed requirement 2
285
- - [ ] Testing requirements
336
+ Examples:
337
+ - Exact method or helper names
338
+ - Final SQL or query details after touching real code
339
+ - Runtime behavior that depends on seeing actual test failures
340
+ - Refactors that may become unnecessary once implementation starts
286
341
 
287
- ## Success Metrics
342
+ ### Phase 4: Write the Plan
288
343
 
289
- [How we measure success]
344
+ Use one planning philosophy across all depths. Change the amount of detail, not the boundary between planning and execution.
290
345
 
291
- ## Dependencies & Risks
346
+ #### 4.1 Plan Depth Guidance
292
347
 
293
- [What could block or complicate this]
348
+ **Lightweight**
349
+ - Keep the plan compact
350
+ - Usually 2-4 implementation units
351
+ - Omit optional sections that add little value
294
352
 
295
- ## Sources & References
353
+ **Standard**
354
+ - Use the full core template, omitting optional sections (including High-Level Technical Design) that add no value for this particular work
355
+ - Usually 3-6 implementation units
356
+ - Include risks, deferred questions, and system-wide impact when relevant
296
357
 
297
- - **Origin document:** [docs/brainstorms/YYYY-MM-DD-<topic>-requirements.md](path) — include if plan originated from an upstream requirements doc
298
- - Similar implementations: [file_path:line_number]
299
- - Best practices: [documentation_url]
300
- - Related PRs: #[pr_number]
301
- ```
358
+ **Deep**
359
+ - Use the full core template plus optional analysis sections where warranted
360
+ - Usually 4-8 implementation units
361
+ - Group units into phases when that improves clarity
362
+ - Include alternatives considered, documentation impacts, and deeper risk treatment when warranted
302
363
 
303
- #### 📚 A LOT (Comprehensive Issue)
364
+ #### 4.1b Optional Deep Plan Extensions
304
365
 
305
- **Best for:** Major features, architectural changes, complex integrations
366
+ For sufficiently large, risky, or cross-cutting work, add the sections that genuinely help:
367
+ - **Alternative Approaches Considered**
368
+ - **Success Metrics**
369
+ - **Dependencies / Prerequisites**
370
+ - **Risk Analysis & Mitigation**
371
+ - **Phased Delivery**
372
+ - **Documentation Plan**
373
+ - **Operational / Rollout Notes**
374
+ - **Future Considerations** only when they materially affect current design
306
375
 
307
- **Includes everything from MORE plus:**
376
+ Do not add these as boilerplate. Include them only when they improve execution quality or stakeholder alignment.
308
377
 
309
- - Detailed implementation plan with phases
310
- - Alternative approaches considered
311
- - Extensive technical specifications
312
- - Resource requirements and timeline
313
- - Future considerations and extensibility
314
- - Risk mitigation strategies
315
- - Documentation requirements
378
+ #### 4.2 Core Plan Template
316
379
 
317
- **Structure:**
380
+ Omit clearly inapplicable optional sections, especially for Lightweight plans.
318
381
 
319
382
  ```markdown
320
383
  ---
321
- title: [Issue Title]
384
+ title: [Plan Title]
322
385
  type: [feat|fix|refactor]
323
386
  status: active
324
387
  date: YYYY-MM-DD
325
- origin: docs/brainstorms/YYYY-MM-DD-<topic>-requirements.md # if originated from a requirements doc, otherwise omit
388
+ origin: docs/brainstorms/YYYY-MM-DD-<topic>-requirements.md # include when planning from a requirements doc
389
+ deepened: YYYY-MM-DD # optional, set later by deepen-plan when the plan is substantively strengthened
326
390
  ---
327
391
 
328
- # [Issue Title]
392
+ # [Plan Title]
329
393
 
330
394
  ## Overview
331
395
 
332
- [Executive summary]
333
-
334
- ## Problem Statement
396
+ [What is changing and why]
335
397
 
336
- [Detailed problem analysis]
398
+ ## Problem Frame
337
399
 
338
- ## Proposed Solution
400
+ [Summarize the user/business problem and context. Reference the origin doc when present.]
339
401
 
340
- [Comprehensive solution design]
402
+ ## Requirements Trace
341
403
 
342
- ## Technical Approach
404
+ - R1. [Requirement or success criterion this plan must satisfy]
405
+ - R2. [Requirement or success criterion this plan must satisfy]
343
406
 
344
- ### Architecture
407
+ ## Scope Boundaries
345
408
 
346
- [Detailed technical design]
409
+ - [Explicit non-goal or exclusion]
347
410
 
348
- ### Implementation Phases
411
+ ## Context & Research
349
412
 
350
- #### Phase 1: [Foundation]
413
+ ### Relevant Code and Patterns
351
414
 
352
- - Tasks and deliverables
353
- - Success criteria
354
- - Estimated effort
415
+ - [Existing file, class, component, or pattern to follow]
355
416
 
356
- #### Phase 2: [Core Implementation]
357
-
358
- - Tasks and deliverables
359
- - Success criteria
360
- - Estimated effort
417
+ ### Institutional Learnings
361
418
 
362
- #### Phase 3: [Polish & Optimization]
419
+ - [Relevant `docs/solutions/` insight]
363
420
 
364
- - Tasks and deliverables
365
- - Success criteria
366
- - Estimated effort
367
-
368
- ## Alternative Approaches Considered
369
-
370
- [Other solutions evaluated and why rejected]
371
-
372
- ## System-Wide Impact
421
+ ### External References
373
422
 
374
- ### Interaction Graph
423
+ - [Relevant external docs or best-practice source, if used]
375
424
 
376
- [Map the chain reaction: what callbacks, middleware, observers, and event handlers fire when this code runs? Trace at least two levels deep. Document: "Action X triggers Y, which calls Z, which persists W."]
425
+ ## Key Technical Decisions
377
426
 
378
- ### Error & Failure Propagation
427
+ - [Decision]: [Rationale]
379
428
 
380
- [Trace errors from lowest layer up. List specific error classes and where they're handled. Identify retry conflicts, unhandled error types, and silent failure swallowing.]
429
+ ## Open Questions
381
430
 
382
- ### State Lifecycle Risks
431
+ ### Resolved During Planning
383
432
 
384
- [Walk through each step that persists state. Can partial failure orphan rows, duplicate records, or leave caches stale? Document cleanup mechanisms or their absence.]
433
+ - [Question]: [Resolution]
385
434
 
386
- ### API Surface Parity
435
+ ### Deferred to Implementation
387
436
 
388
- [List all interfaces (classes, DSLs, endpoints) that expose equivalent functionality. Note which need updating and which share the code path.]
437
+ - [Question or unknown]: [Why it is intentionally deferred]
389
438
 
390
- ### Integration Test Scenarios
439
+ <!-- Optional: Include this section only when the work involves DSL design, multi-component
440
+ integration, complex data flow, state-heavy lifecycle, or other cases where prose alone
441
+ would leave the approach shape ambiguous. Omit it entirely for well-patterned or
442
+ straightforward work. -->
443
+ ## High-Level Technical Design
391
444
 
392
- [3-5 cross-layer test scenarios that unit tests with mocks would never catch. Include expected behavior for each.]
445
+ > *This illustrates the intended approach and is directional guidance for review, not implementation specification. The implementing agent should treat it as context, not code to reproduce.*
393
446
 
394
- ## Acceptance Criteria
447
+ [Pseudo-code grammar, mermaid diagram, data flow sketch, or state diagram — choose the medium that best communicates the solution shape for this work.]
395
448
 
396
- ### Functional Requirements
449
+ ## Implementation Units
397
450
 
398
- - [ ] Detailed functional criteria
451
+ - [ ] **Unit 1: [Name]**
399
452
 
400
- ### Non-Functional Requirements
453
+ **Goal:** [What this unit accomplishes]
401
454
 
402
- - [ ] Performance targets
403
- - [ ] Security requirements
404
- - [ ] Accessibility standards
455
+ **Requirements:** [R1, R2]
405
456
 
406
- ### Quality Gates
457
+ **Dependencies:** [None / Unit 1 / external prerequisite]
407
458
 
408
- - [ ] Test coverage requirements
409
- - [ ] Documentation completeness
410
- - [ ] Code review approval
459
+ **Files:**
460
+ - Create: `path/to/new_file`
461
+ - Modify: `path/to/existing_file`
462
+ - Test: `path/to/test_file`
411
463
 
412
- ## Success Metrics
464
+ **Approach:**
465
+ - [Key design or sequencing decision]
413
466
 
414
- [Detailed KPIs and measurement methods]
467
+ **Execution note:** [Optional test-first, characterization-first, external-delegate, or other execution posture signal]
415
468
 
416
- ## Dependencies & Prerequisites
469
+ **Technical design:** *(optional -- pseudo-code or diagram when the unit's approach is non-obvious. Directional guidance, not implementation specification.)*
417
470
 
418
- [Detailed dependency analysis]
471
+ **Patterns to follow:**
472
+ - [Existing file, class, or pattern]
419
473
 
420
- ## Risk Analysis & Mitigation
474
+ **Test scenarios:**
475
+ - [Specific scenario with expected behavior]
476
+ - [Edge case or failure path]
421
477
 
422
- [Comprehensive risk assessment]
478
+ **Verification:**
479
+ - [Outcome that should hold when this unit is complete]
423
480
 
424
- ## Resource Requirements
481
+ ## System-Wide Impact
425
482
 
426
- [Team, time, infrastructure needs]
483
+ - **Interaction graph:** [What callbacks, middleware, observers, or entry points may be affected]
484
+ - **Error propagation:** [How failures should travel across layers]
485
+ - **State lifecycle risks:** [Partial-write, cache, duplicate, or cleanup concerns]
486
+ - **API surface parity:** [Other interfaces that may require the same change]
487
+ - **Integration coverage:** [Cross-layer scenarios unit tests alone will not prove]
427
488
 
428
- ## Future Considerations
489
+ ## Risks & Dependencies
429
490
 
430
- [Extensibility and long-term vision]
491
+ - [Meaningful risk, dependency, or sequencing concern]
431
492
 
432
- ## Documentation Plan
493
+ ## Documentation / Operational Notes
433
494
 
434
- [What docs need updating]
495
+ - [Docs, rollout, monitoring, or support impacts when relevant]
435
496
 
436
497
  ## Sources & References
437
498
 
438
- ### Origin
439
-
440
- - **Origin document:** [docs/brainstorms/YYYY-MM-DD-<topic>-requirements.md](path) — include if plan originated from an upstream requirements doc. Key decisions carried forward: [list 2-3 major decisions from the origin]
441
-
442
- ### Internal References
443
-
444
- - Architecture decisions: [file_path:line_number]
445
- - Similar features: [file_path:line_number]
446
- - Configuration: [file_path:line_number]
447
-
448
- ### External References
449
-
450
- - Framework documentation: [url]
451
- - Best practices guide: [url]
452
- - Industry standards: [url]
453
-
454
- ### Related Work
455
-
456
- - Previous PRs: #[pr_numbers]
457
- - Related issues: #[issue_numbers]
458
- - Design documents: [links]
499
+ - **Origin document:** [docs/brainstorms/YYYY-MM-DD-<topic>-requirements.md](path)
500
+ - Related code: [path or symbol]
501
+ - Related PRs/issues: #[number]
502
+ - External docs: [url]
459
503
  ```
460
504
 
461
- ### 5. Issue Creation & Formatting
462
-
463
- <thinking>
464
- Apply best practices for clarity and actionability, making the issue easy to scan and understand
465
- </thinking>
505
+ For larger `Deep` plans, extend the core template only when useful with sections such as:
466
506
 
467
- **Content Formatting:**
507
+ ```markdown
508
+ ## Alternative Approaches Considered
468
509
 
469
- - [ ] Use clear, descriptive headings with proper hierarchy (##, ###)
470
- - [ ] Include code examples in triple backticks with language syntax highlighting
471
- - [ ] Add screenshots/mockups if UI-related (drag & drop or use image hosting)
472
- - [ ] Use task lists (- [ ]) for trackable items that can be checked off
473
- - [ ] Add collapsible sections for lengthy logs or optional details using `<details>` tags
474
- - [ ] Apply appropriate emoji for visual scanning (🐛 bug, ✨ feature, 📚 docs, ♻️ refactor)
510
+ - [Approach]: [Why rejected or not chosen]
475
511
 
476
- **Cross-Referencing:**
512
+ ## Success Metrics
477
513
 
478
- - [ ] Link to related issues/PRs using #number format
479
- - [ ] Reference specific commits with SHA hashes when relevant
480
- - [ ] Link to code using GitHub's permalink feature (press 'y' for permanent link)
481
- - [ ] Mention relevant team members with @username if needed
482
- - [ ] Add links to external resources with descriptive text
514
+ - [How we will know this solved the intended problem]
483
515
 
484
- **Code & Examples:**
516
+ ## Dependencies / Prerequisites
485
517
 
486
- ````markdown
487
- # Good example with syntax highlighting and line references
518
+ - [Technical, organizational, or rollout dependency]
488
519
 
520
+ ## Risk Analysis & Mitigation
489
521
 
490
- ```ruby
491
- # app/services/user_service.rb:42
492
- def process_user(user)
522
+ - [Risk]: [Mitigation]
493
523
 
494
- # Implementation here
524
+ ## Phased Delivery
495
525
 
496
- end
497
- ```
526
+ ### Phase 1
527
+ - [What lands first and why]
498
528
 
499
- # Collapsible error logs
529
+ ### Phase 2
530
+ - [What follows and why]
500
531
 
501
- <details>
502
- <summary>Full error stacktrace</summary>
532
+ ## Documentation Plan
503
533
 
504
- `Error details here...`
534
+ - [Docs or runbooks to update]
505
535
 
506
- </details>
507
- ````
536
+ ## Operational / Rollout Notes
508
537
 
509
- **AI-Era Considerations:**
538
+ - [Monitoring, migration, feature flag, or rollout considerations]
539
+ ```
510
540
 
511
- - [ ] Account for accelerated development with AI pair programming
512
- - [ ] Include prompts or instructions that worked well during research
513
- - [ ] Note which AI tools were used for initial exploration (Claude, Copilot, etc.)
514
- - [ ] Emphasize comprehensive testing given rapid implementation
515
- - [ ] Document any AI-generated code that needs human review
541
+ #### 4.3 Planning Rules
516
542
 
517
- ### 6. Final Review & Submission
543
+ - Prefer path plus class/component/pattern references over brittle line numbers
544
+ - Keep implementation units checkable with `- [ ]` syntax for progress tracking
545
+ - Do not include implementation code — no imports, exact method signatures, or framework-specific syntax
546
+ - Pseudo-code sketches and DSL grammars are allowed in the High-Level Technical Design section and per-unit technical design fields when they communicate design direction. Frame them explicitly as directional guidance, not implementation specification
547
+ - Mermaid diagrams are encouraged when they clarify relationships or flows that prose alone would make hard to follow — ERDs for data model changes, sequence diagrams for multi-service interactions, state diagrams for lifecycle transitions, flowcharts for complex branching logic
548
+ - Do not include git commands, commit messages, or exact test command recipes
549
+ - Do not expand implementation units into micro-step `RED/GREEN/REFACTOR` instructions
550
+ - Do not pretend an execution-time question is settled just to make the plan look complete
518
551
 
519
- **Origin document cross-check (if plan originated from a requirements doc):**
552
+ ### Phase 5: Final Review, Write File, and Handoff
520
553
 
521
- Before finalizing, re-read the origin document and verify:
522
- - [ ] Every key decision from the origin document is reflected in the plan
523
- - [ ] The chosen approach matches what was decided in the origin document
524
- - [ ] Constraints and requirements from the origin document are captured in acceptance criteria
525
- - [ ] Open questions from the origin document are either resolved or flagged
526
- - [ ] The `origin:` frontmatter field points to the correct source file
527
- - [ ] The Sources section includes the origin document with a summary of carried-forward decisions
554
+ #### 5.1 Review Before Writing
528
555
 
529
- **Pre-submission Checklist:**
556
+ Before finalizing, check:
557
+ - The plan does not invent product behavior that should have been defined in `ce:brainstorm`
558
+ - If there was no origin document, the bounded planning bootstrap established enough product clarity to plan responsibly
559
+ - Every major decision is grounded in the origin document or research
560
+ - Each implementation unit is concrete, dependency-ordered, and implementation-ready
561
+ - If test-first or characterization-first posture was explicit or strongly implied, the relevant units carry it forward with a lightweight `Execution note`
562
+ - Test scenarios are specific without becoming test code
563
+ - Deferred items are explicit and not hidden as fake certainty
564
+ - If a High-Level Technical Design section is included, it uses the right medium for the work, carries the non-prescriptive framing, and does not contain implementation code (no imports, exact signatures, or framework-specific syntax)
565
+ - Per-unit technical design fields, if present, are concise and directional rather than copy-paste-ready
530
566
 
531
- - [ ] Title is searchable and descriptive
532
- - [ ] Labels accurately categorize the issue
533
- - [ ] All template sections are complete
534
- - [ ] Links and references are working
535
- - [ ] Acceptance criteria are measurable
536
- - [ ] Add names of files in pseudo code examples and todo lists
537
- - [ ] Add an ERD mermaid diagram if applicable for new model changes
567
+ If the plan originated from a requirements document, re-read that document and verify:
568
+ - The chosen approach still matches the product intent
569
+ - Scope boundaries and success criteria are preserved
570
+ - Blocking questions were either resolved, explicitly assumed, or sent back to `ce:brainstorm`
571
+ - Every section of the origin document is addressed in the plan — scan each section to confirm nothing was silently dropped
538
572
 
539
- ## Write Plan File
573
+ #### 5.2 Write Plan File
540
574
 
541
575
  **REQUIRED: Write the plan file to disk before presenting any options.**
542
576
 
543
- ```bash
544
- mkdir -p docs/plans/
545
- # Determine daily sequence number
546
- today=$(date +%Y-%m-%d)
547
- last_seq=$(ls docs/plans/${today}-*-plan.md 2>/dev/null | grep -oP "${today}-\K\d{3}" | sort -n | tail -1)
548
- next_seq=$(printf "%03d" $(( ${last_seq:-0} + 1 )))
549
- ```
550
-
551
- Use the write tool to save the complete plan to `docs/plans/YYYY-MM-DD-NNN-<type>-<descriptive-name>-plan.md` (where NNN is `$next_seq` from the bash command above). This step is mandatory and cannot be skipped — even when running as part of LFG/SLFG or other automated pipelines.
552
-
553
- Confirm: "Plan written to docs/plans/[filename]"
577
+ Use the write tool to save the complete plan to:
554
578
 
555
- **Pipeline mode:** If invoked from an automated workflow (LFG, SLFG, or any `disable-model-invocation` context), skip all question calls. Make decisions automatically and proceed to writing the plan without interactive prompts.
556
-
557
- ## Output Format
579
+ ```text
580
+ docs/plans/YYYY-MM-DD-NNN-<type>-<descriptive-name>-plan.md
581
+ ```
558
582
 
559
- **Filename:** Use the date, daily sequence number, and kebab-case filename from Step 2 Title & Categorization.
583
+ Confirm:
560
584
 
561
- ```
562
- docs/plans/YYYY-MM-DD-NNN-<type>-<descriptive-name>-plan.md
585
+ ```text
586
+ Plan written to docs/plans/[filename]
563
587
  ```
564
588
 
565
- Examples:
566
- - ✅ `docs/plans/2026-01-15-001-feat-user-authentication-flow-plan.md`
567
- - ✅ `docs/plans/2026-02-03-001-fix-checkout-race-condition-plan.md`
568
- - ✅ `docs/plans/2026-03-10-002-refactor-api-client-extraction-plan.md`
569
- - ❌ `docs/plans/2026-01-15-feat-thing-plan.md` (missing sequence number, not descriptive)
570
- - ❌ `docs/plans/2026-01-15-001-feat-new-feature-plan.md` (too vague - what feature?)
571
- - ❌ `docs/plans/2026-01-15-001-feat: user auth-plan.md` (invalid characters - colon and space)
572
- - ❌ `docs/plans/feat-user-auth-plan.md` (missing date prefix and sequence number)
589
+ **Pipeline mode:** If invoked from an automated workflow such as LFG, SLFG, or any `disable-model-invocation` context, skip interactive questions. Make the needed choices automatically and proceed to writing the plan.
573
590
 
574
- ## Post-Generation Options
591
+ #### 5.3 Post-Generation Options
575
592
 
576
- After writing the plan file, use the **question tool** to present these options:
593
+ After writing the plan file, present the options using the platform's blocking question tool when available (see Interaction Method). Otherwise present numbered options in chat and wait for the user's reply before proceeding.
577
594
 
578
595
  **Question:** "Plan ready at `docs/plans/YYYY-MM-DD-NNN-<type>-<name>-plan.md`. What would you like to do next?"
579
596
 
580
597
  **Options:**
581
598
  1. **Open plan in editor** - Open the plan file for review
582
- 2. **Run `/deepen-plan`** - Enhance each section with parallel research agents (best practices, performance, UI)
583
- 3. **Review and refine** - Improve the document through structured self-review
584
- 4. **Share to Proof** - Upload to Proof for collaborative review and sharing
585
- 5. **Start `/ce:work`** - Begin implementing this plan locally
586
- 6. **Start `/ce:work` on remote** - Begin implementing in OpenCode on the web (use `&` to run in background)
587
- 7. **Create Issue** - Create issue in project tracker (GitHub/Linear)
599
+ 2. **Run `/deepen-plan`** - Stress-test weak sections with targeted research when the plan needs more confidence
600
+ 3. **Run `document-review` skill** - Improve the plan through structured document review
601
+ 4. **Share to Proof** - Upload the plan for collaborative review and sharing
602
+ 5. **Start `/ce:work`** - Begin implementing this plan in the current environment
603
+ 6. **Start `/ce:work` in another session** - Begin implementing in a separate agent session when the current platform supports it
604
+ 7. **Create Issue** - Create an issue in the configured tracker
588
605
 
589
606
  Based on selection:
590
- - **Open plan in editor** → Run `open docs/plans/<plan_filename>.md` to open the file in the user's default editor
591
- - **`/deepen-plan`** → Call the /deepen-plan command with the plan file path to enhance with research
592
- - **Review and refine** → Load `document-review` skill.
593
- - **Share to Proof** → Upload the plan to Proof:
607
+ - **Open plan in editor** → Open `docs/plans/<plan_filename>.md` using the current platform's file-open or editor mechanism (e.g., `open` on macOS, `xdg-open` on Linux, or the IDE's file-open API)
608
+ - **`/deepen-plan`** → Call `/deepen-plan` with the plan path
609
+ - **`document-review` skill** → Load the `document-review` skill with the plan path
610
+ - **Share to Proof** → Upload the plan:
594
611
  ```bash
595
612
  CONTENT=$(cat docs/plans/<plan_filename>.md)
596
613
  TITLE="Plan: <plan title from frontmatter>"
@@ -599,45 +616,38 @@ Based on selection:
599
616
  -d "$(jq -n --arg title "$TITLE" --arg markdown "$CONTENT" --arg by "ai:compound" '{title: $title, markdown: $markdown, by: $by}')")
600
617
  PROOF_URL=$(echo "$RESPONSE" | jq -r '.tokenUrl')
601
618
  ```
602
- Display: `View & collaborate in Proof: <PROOF_URL>` — skip silently if curl fails. Then return to options.
603
- - **`/ce:work`** → Call the /ce:work command with the plan file path
604
- - **`/ce:work` on remote** → Run `/ce:work docs/plans/<plan_filename>.md &` to start work in background for OpenCode web
605
- - **Create Issue** → See "Issue Creation" section below
606
- - **Other** (automatically provided) → Accept free text for rework or specific changes
607
-
608
- **Note:** If running `/ce:plan` with ultrathink enabled, automatically run `/deepen-plan` after plan creation for maximum depth and grounding.
619
+ Display `View & collaborate in Proof: <PROOF_URL>` if successful, then return to the options
620
+ - **`/ce:work`** → Call `/ce:work` with the plan path
621
+ - **`/ce:work` in another session** → If the current platform supports launching a separate agent session, start `/ce:work` with the plan path there. Otherwise, explain the limitation briefly and offer to run `/ce:work` in the current session instead.
622
+ - **Create Issue** → Follow the Issue Creation section below
623
+ - **Other** → Accept free text for revisions and loop back to options
609
624
 
610
- Loop back to options after Simplify or Other changes until user selects `/ce:work` or another action.
625
+ If running with ultrathink enabled, or the platform's reasoning/effort level is set to max or extra-high, automatically run `/deepen-plan` only when the plan is `Standard` or `Deep`, high-risk, or still shows meaningful confidence gaps in decisions, sequencing, system-wide impact, risks, or verification.
611
626
 
612
627
  ## Issue Creation
613
628
 
614
- When user selects "Create Issue", detect their project tracker from AGENTS.md:
615
-
616
- 1. **Check for tracker preference** in user's AGENTS.md (global or project):
617
- - Look for `project_tracker: github` or `project_tracker: linear`
618
- - Or look for mentions of "GitHub Issues" or "Linear" in their workflow section
619
-
620
- 2. **If GitHub:**
629
+ When the user selects "Create Issue", detect their project tracker from `AGENTS.md` or, if needed for compatibility, `AGENTS.md`:
621
630
 
622
- Use the title and type from Step 2 (already in context - no need to re-read the file):
631
+ 1. Look for `project_tracker: github` or `project_tracker: linear`
632
+ 2. If GitHub:
623
633
 
624
634
  ```bash
625
635
  gh issue create --title "<type>: <title>" --body-file <plan_path>
626
636
  ```
627
637
 
628
- 3. **If Linear:**
638
+ 3. If Linear:
629
639
 
630
640
  ```bash
631
641
  linear issue create --title "<title>" --description "$(cat <plan_path>)"
632
642
  ```
633
643
 
634
- 4. **If no tracker configured:**
635
- Ask user: "Which project tracker do you use? (GitHub/Linear/Other)"
636
- - Suggest adding `project_tracker: github` or `project_tracker: linear` to their AGENTS.md
644
+ 4. If no tracker is configured:
645
+ - Ask which tracker they use using the platform's blocking question tool when available (see Interaction Method)
646
+ - Suggest adding the tracker to `AGENTS.md` for future runs
637
647
 
638
- 5. **After creation:**
639
- - Display the issue URL
640
- - Ask if they want to proceed to `/ce:work`
648
+ After issue creation:
649
+ - Display the issue URL
650
+ - Ask whether to proceed to `/ce:work`
641
651
 
642
- NEVER CODE! Just research and write the plan.
652
+ NEVER CODE! Research, decide, and write the plan.
643
653