planflow-ai 1.1.2 → 1.1.4
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/.claude/commands/brain.md +0 -3
- package/.claude/commands/create-contract.md +22 -68
- package/.claude/commands/create-plan.md +22 -106
- package/.claude/commands/discovery-plan.md +26 -152
- package/.claude/commands/execute-plan.md +3 -63
- package/.claude/commands/flow.md +43 -56
- package/.claude/commands/learn.md +0 -3
- package/.claude/commands/review-code.md +0 -65
- package/.claude/commands/review-pr.md +0 -50
- package/.claude/commands/setup.md +0 -5
- package/.claude/commands/write-tests.md +0 -7
- package/.claude/resources/core/_index.md +0 -37
- package/.claude/resources/core/autopilot-mode.md +44 -240
- package/.claude/resources/core/brain-capture.md +4 -92
- package/.claude/resources/core/complexity-scoring.md +1 -30
- package/.claude/resources/core/project-ledger.md +0 -57
- package/.claude/resources/languages/_index.md +13 -61
- package/.claude/resources/languages/python-patterns.md +0 -243
- package/.claude/resources/languages/typescript-patterns.md +0 -213
- package/.claude/resources/patterns/_index.md +0 -70
- package/.claude/resources/patterns/brain-patterns.md +0 -3
- package/.claude/resources/patterns/discovery-patterns.md +2 -58
- package/.claude/resources/patterns/discovery-templates.md +0 -12
- package/.claude/resources/patterns/plans-patterns.md +3 -22
- package/.claude/resources/patterns/plans-templates.md +9 -102
- package/.claude/resources/patterns/review-code-templates.md +4 -21
- package/.claude/resources/patterns/review-pr-patterns.md +0 -21
- package/.claude/resources/skills/brain-skill.md +18 -11
- package/.claude/resources/skills/create-contract-skill.md +30 -13
- package/.claude/resources/skills/create-plan-skill.md +33 -123
- package/.claude/resources/skills/discovery-skill.md +34 -158
- package/.claude/resources/skills/execute-plan-skill.md +18 -394
- package/.claude/resources/skills/learn-skill.md +17 -11
- package/.claude/resources/skills/review-code-skill.md +39 -125
- package/.claude/resources/skills/review-pr-skill.md +92 -80
- package/.claude/resources/skills/setup-skill.md +0 -93
- package/.claude/resources/skills/write-tests-skill.md +0 -22
- package/README.md +21 -113
- package/dist/cli/commands/init.d.ts.map +1 -1
- package/dist/cli/commands/init.js +3 -12
- package/dist/cli/commands/init.js.map +1 -1
- package/dist/cli/handlers/claude.d.ts +1 -1
- package/dist/cli/handlers/claude.d.ts.map +1 -1
- package/dist/cli/handlers/claude.js +2 -45
- package/dist/cli/handlers/claude.js.map +1 -1
- package/dist/cli/handlers/codex.d.ts.map +1 -1
- package/dist/cli/handlers/codex.js +0 -11
- package/dist/cli/handlers/codex.js.map +1 -1
- package/dist/cli/handlers/cursor.d.ts +1 -1
- package/dist/cli/handlers/cursor.d.ts.map +1 -1
- package/dist/cli/handlers/cursor.js +2 -28
- package/dist/cli/handlers/cursor.js.map +1 -1
- package/dist/cli/handlers/shared.d.ts +1 -2
- package/dist/cli/handlers/shared.d.ts.map +1 -1
- package/dist/cli/handlers/shared.js +9 -140
- package/dist/cli/handlers/shared.js.map +1 -1
- package/dist/cli/index.js +0 -72
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/types.d.ts +0 -1
- package/dist/cli/types.d.ts.map +1 -1
- package/dist/cli/utils/files.d.ts.map +1 -1
- package/dist/cli/utils/files.js +1 -6
- package/dist/cli/utils/files.js.map +1 -1
- package/dist/cli/utils/prompts.d.ts +9 -0
- package/dist/cli/utils/prompts.d.ts.map +1 -1
- package/dist/cli/utils/prompts.js +23 -0
- package/dist/cli/utils/prompts.js.map +1 -1
- package/package.json +1 -2
- package/rules/core/_index.mdc +0 -30
- package/rules/core/autopilot-mode.mdc +89 -253
- package/rules/core/brain-capture.mdc +3 -14
- package/rules/patterns/_index.mdc +0 -70
- package/rules/patterns/brain-patterns.mdc +0 -2
- package/rules/patterns/discovery-patterns.mdc +6 -152
- package/rules/patterns/plans-patterns.mdc +9 -28
- package/rules/patterns/plans-templates.mdc +0 -57
- package/rules/skills/brain-skill.mdc +0 -8
- package/rules/skills/create-contract-skill.mdc +30 -12
- package/rules/skills/create-plan-skill.mdc +30 -112
- package/rules/skills/discovery-skill.mdc +34 -153
- package/rules/skills/execute-plan-skill.mdc +3 -254
- package/rules/skills/learn-skill.mdc +0 -8
- package/rules/skills/review-code-skill.mdc +39 -122
- package/rules/skills/review-pr-skill.mdc +93 -79
- package/rules/skills/setup-skill.mdc +0 -81
- package/rules/skills/write-tests-skill.mdc +0 -8
- package/templates/shared/CLAUDE.md.template +0 -1
- package/.claude/resources/core/agent-profiles.md +0 -107
- package/.claude/resources/core/audit-trail.md +0 -180
- package/.claude/resources/core/orchestration-workflows.md +0 -178
- package/.claude/resources/core/tech-detection.md +0 -82
- package/.claude/resources/languages/go-patterns.md +0 -337
- package/.claude/resources/languages/rust-patterns.md +0 -363
- package/.claude/resources/patterns/autopilot-progress-patterns.md +0 -124
- package/.claude/resources/patterns/handoff-patterns.md +0 -160
- package/.claude/resources/patterns/parallel-review-patterns.md +0 -164
- package/.claude/resources/patterns/security-scan-patterns.md +0 -137
- package/rules/core/agent-profiles.mdc +0 -111
- package/rules/core/audit-trail.mdc +0 -114
- package/rules/core/orchestration-workflows.mdc +0 -139
- package/rules/patterns/autopilot-progress-patterns.mdc +0 -124
- package/rules/patterns/handoff-patterns.mdc +0 -164
- package/rules/patterns/parallel-review-patterns.mdc +0 -168
- package/rules/patterns/security-scan-patterns.mdc +0 -141
- package/scripts/hooks/pre-compact.cjs +0 -85
- package/scripts/hooks/session-end.cjs +0 -284
- package/scripts/hooks/session-start.cjs +0 -145
- package/templates/shared/hooks.json.example +0 -7
- package/templates/shared/session-hooks-instructions.md +0 -29
|
@@ -55,18 +55,12 @@ RELATED COMMANDS:
|
|
|
55
55
|
|
|
56
56
|
---
|
|
57
57
|
|
|
58
|
-
> **MODE: Research**
|
|
59
|
-
> Explore before concluding. Read 3x more than you write. Prefer Read/Grep/Glob/WebSearch tools.
|
|
60
|
-
> Ask clarifying questions when uncertain. Don't jump to implementation.
|
|
61
|
-
|
|
62
|
-
> **AGENT_PROFILE: read-only**
|
|
63
|
-
> See `.claude/resources/core/agent-profiles.md` for tool access rules.
|
|
64
|
-
|
|
65
58
|
## Critical Rules
|
|
66
59
|
|
|
67
60
|
| Rule | Description |
|
|
68
61
|
| ------------------------ | -------------------------------------------------------- |
|
|
69
62
|
| **No Auto-Chaining** | NEVER auto-invoke /discovery-plan - user must invoke it |
|
|
63
|
+
| **File Only** | Save the `.md` file and report its path. Do NOT show full content in chat. |
|
|
70
64
|
| **Complete and Stop** | After presenting results, STOP and wait for user |
|
|
71
65
|
|
|
72
66
|
---
|
|
@@ -122,27 +116,30 @@ See: `.claude/resources/skills/create-contract-skill.md`
|
|
|
122
116
|
|
|
123
117
|
---
|
|
124
118
|
|
|
125
|
-
### Step 4:
|
|
119
|
+
### Step 4: Save File and Stop
|
|
126
120
|
|
|
127
|
-
After the skill completes
|
|
121
|
+
After the skill completes:
|
|
128
122
|
|
|
129
|
-
|
|
130
|
-
|
|
123
|
+
1. **Save the contract document** to `flow/contracts/<service_name>_contract.md`
|
|
124
|
+
2. **Report only the file path** — do NOT display the full contract content in chat
|
|
125
|
+
3. **STOP** — do NOT auto-invoke `/discovery-plan`
|
|
131
126
|
|
|
132
|
-
**
|
|
127
|
+
**Output to the user** (this is the ONLY thing to show):
|
|
133
128
|
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
- Authentication: [method]
|
|
137
|
-
- Error handling documented
|
|
129
|
+
```markdown
|
|
130
|
+
Contract created.
|
|
138
131
|
|
|
139
|
-
**
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
3. When ready, invoke `/discovery-plan @flow/contracts/<service_name>_contract.md`
|
|
132
|
+
**Created**: `flow/contracts/<service_name>_contract.md`
|
|
133
|
+
|
|
134
|
+
Next: review the file, then run `/discovery-plan` when ready.
|
|
143
135
|
```
|
|
144
136
|
|
|
145
|
-
**CRITICAL**:
|
|
137
|
+
⚠️ **CRITICAL**: After saving the file, the command is DONE. Do NOT:
|
|
138
|
+
- Show the full contract content in chat
|
|
139
|
+
- Auto-invoke `/discovery-plan`
|
|
140
|
+
- Offer to start discovery or planning
|
|
141
|
+
|
|
142
|
+
The user will read the `.md` file themselves and decide when to proceed.
|
|
146
143
|
|
|
147
144
|
---
|
|
148
145
|
|
|
@@ -175,9 +172,10 @@ Contract Created!
|
|
|
175
172
|
|
|
|
176
173
|
v
|
|
177
174
|
+------------------------------------------+
|
|
178
|
-
| Step 4:
|
|
179
|
-
| -
|
|
180
|
-
| -
|
|
175
|
+
| Step 4: Save File and Stop |
|
|
176
|
+
| - Save .md file to flow/contracts/ |
|
|
177
|
+
| - Report file path only |
|
|
178
|
+
| - STOP (no discovery, no plan) |
|
|
181
179
|
+------------------------------------------+
|
|
182
180
|
```
|
|
183
181
|
|
|
@@ -248,47 +246,3 @@ When executing this command:
|
|
|
248
246
|
| `interactive-questions-tool.md` | Interactive Questions UI workflow |
|
|
249
247
|
| `/discovery-plan` command | Create discovery from contract |
|
|
250
248
|
| `/create-plan` command | Create plan from discovery |
|
|
251
|
-
|
|
252
|
-
---
|
|
253
|
-
|
|
254
|
-
## Compaction Suggestion
|
|
255
|
-
|
|
256
|
-
After contract creation completes, suggest context cleanup if the contract was complex (> 5 endpoints):
|
|
257
|
-
|
|
258
|
-
> Contract created. Consider running `/compact` to free context before the next task.
|
|
259
|
-
|
|
260
|
-
Skip if autopilot is ON.
|
|
261
|
-
|
|
262
|
-
---
|
|
263
|
-
|
|
264
|
-
## Brain Capture
|
|
265
|
-
|
|
266
|
-
After contract creation completes, append a brain-capture block. See `.claude/resources/core/brain-capture.md` for processing rules.
|
|
267
|
-
|
|
268
|
-
**Capture the following**:
|
|
269
|
-
|
|
270
|
-
```
|
|
271
|
-
<!-- brain-capture
|
|
272
|
-
skill: create-contract
|
|
273
|
-
feature: [service name]
|
|
274
|
-
status: completed
|
|
275
|
-
data:
|
|
276
|
-
service_name: [API/service name]
|
|
277
|
-
endpoints_documented: [count]
|
|
278
|
-
auth_type: [detected auth type]
|
|
279
|
-
contract_doc: [path to contract document]
|
|
280
|
-
-->
|
|
281
|
-
```
|
|
282
|
-
|
|
283
|
-
Update `flow/brain/features/[service-name].md` with contract context and update `flow/brain/index.md`.
|
|
284
|
-
|
|
285
|
-
---
|
|
286
|
-
|
|
287
|
-
## Resource Capture
|
|
288
|
-
|
|
289
|
-
During this skill's execution, watch for valuable reference materials worth preserving. See `.claude/resources/core/resource-capture.md` for capture rules, file format, and naming conventions.
|
|
290
|
-
|
|
291
|
-
At natural break points, if you encounter information that could be useful for future development (API specs, architecture notes, config references, domain knowledge, etc.), ask the user: "I found something that could be useful for future reference: _{brief description}_. Should I save it to `flow/resources/`?"
|
|
292
|
-
|
|
293
|
-
Only save if the user approves. Do not re-ask if declined.
|
|
294
|
-
|
|
@@ -64,19 +64,13 @@ RELATED COMMANDS:
|
|
|
64
64
|
> - **If YES**: Autopilot is ON. After creating the plan and getting user approval, **auto-proceed** to `/execute-plan` with the plan output. Do NOT wait for manual invocation.
|
|
65
65
|
> - **If NO**: Follow the standard rules below (stop and wait for user).
|
|
66
66
|
|
|
67
|
-
> **MODE: Research**
|
|
68
|
-
> Explore before concluding. Read 3x more than you write. Prefer Read/Grep/Glob/WebSearch tools.
|
|
69
|
-
> Ask clarifying questions when uncertain. Don't jump to implementation.
|
|
70
|
-
|
|
71
|
-
> **AGENT_PROFILE: read-only**
|
|
72
|
-
> See `.claude/resources/core/agent-profiles.md` for tool access rules.
|
|
73
|
-
|
|
74
67
|
## Critical Rules
|
|
75
68
|
|
|
76
69
|
| Rule | Description |
|
|
77
70
|
| ------------------------ | -------------------------------------------------------- |
|
|
78
71
|
| **Discovery Required** | NEVER create a plan without a discovery document. If none exists, run `/discovery-plan` first. No exceptions. |
|
|
79
72
|
| **No Auto-Chaining** | NEVER auto-invoke /execute-plan - user must invoke it (unless autopilot ON) |
|
|
73
|
+
| **File Only** | Save the `.md` file and report its path. Do NOT show full content in chat. |
|
|
80
74
|
| **Complete and Stop** | After presenting results, STOP and wait for user (unless autopilot ON) |
|
|
81
75
|
|
|
82
76
|
---
|
|
@@ -141,50 +135,31 @@ See: `.claude/resources/skills/create-plan-skill.md`
|
|
|
141
135
|
|
|
142
136
|
---
|
|
143
137
|
|
|
144
|
-
### Step 5:
|
|
138
|
+
### Step 5: Save File and Stop
|
|
145
139
|
|
|
146
|
-
After the skill completes
|
|
140
|
+
After the skill completes:
|
|
147
141
|
|
|
148
|
-
|
|
149
|
-
|
|
142
|
+
1. **Save the plan document** to `flow/plans/plan_<feature>_v<version>.md`
|
|
143
|
+
2. **Report only the file path** — do NOT display the full plan content in chat
|
|
144
|
+
3. **STOP** — do NOT execute the plan, do NOT offer to build
|
|
150
145
|
|
|
151
|
-
**
|
|
146
|
+
**Output to the user** (this is the ONLY thing to show):
|
|
152
147
|
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
- Total complexity: XX/XX
|
|
156
|
-
- Highest complexity: Phase X at Y/10
|
|
157
|
-
```
|
|
148
|
+
```markdown
|
|
149
|
+
Plan created.
|
|
158
150
|
|
|
159
|
-
**
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
2. **If autopilot is ON**: Do NOT show "Next Steps" or "invoke manually". Instead, use `AskUserQuestion` to ask for plan approval, then **immediately auto-proceed** to `/execute-plan` with the plan file. Do NOT stop. Do NOT wait for the user to manually invoke `/execute-plan`.
|
|
163
|
-
|
|
164
|
-
```typescript
|
|
165
|
-
// When autopilot is ON, ask for approval then auto-proceed:
|
|
166
|
-
AskUserQuestion({
|
|
167
|
-
questions: [{
|
|
168
|
-
question: "Plan is ready. Approve to proceed with execution?",
|
|
169
|
-
header: "Plan",
|
|
170
|
-
options: [
|
|
171
|
-
{ label: "Approve and execute", description: "Start executing the plan now" },
|
|
172
|
-
{ label: "Refine first", description: "Let me suggest changes to the plan before executing" }
|
|
173
|
-
],
|
|
174
|
-
multiSelect: false
|
|
175
|
-
}]
|
|
176
|
-
})
|
|
177
|
-
// If approved → immediately invoke /execute-plan (do NOT stop)
|
|
151
|
+
**Created**: `flow/plans/plan_<feature>_v<version>.md`
|
|
152
|
+
|
|
153
|
+
Next: review the file, then run `/execute-plan` when ready.
|
|
178
154
|
```
|
|
179
155
|
|
|
180
|
-
|
|
156
|
+
⚠️ **CRITICAL**: After saving the file, the command is DONE. Do NOT:
|
|
157
|
+
- Show the full plan content in chat
|
|
158
|
+
- Auto-invoke `/execute-plan`
|
|
159
|
+
- Offer to start building or implementing
|
|
160
|
+
- Show implementation steps or code
|
|
181
161
|
|
|
182
|
-
|
|
183
|
-
**Next Steps**:
|
|
184
|
-
1. Review the plan above
|
|
185
|
-
2. Request any refinements
|
|
186
|
-
3. When ready, invoke `/execute-plan @flow/plans/plan_<feature>_v<version>.md`
|
|
187
|
-
```
|
|
162
|
+
The user will read the `.md` file themselves and decide when to proceed.
|
|
188
163
|
|
|
189
164
|
---
|
|
190
165
|
|
|
@@ -224,9 +199,10 @@ AskUserQuestion({
|
|
|
224
199
|
|
|
|
225
200
|
v
|
|
226
201
|
+------------------------------------------+
|
|
227
|
-
| Step 5:
|
|
228
|
-
| -
|
|
229
|
-
| -
|
|
202
|
+
| Step 5: Save File and Stop |
|
|
203
|
+
| - Save .md file to flow/plans/ |
|
|
204
|
+
| - Report file path only |
|
|
205
|
+
| - STOP (no execute, no build) |
|
|
230
206
|
+------------------------------------------+
|
|
231
207
|
```
|
|
232
208
|
|
|
@@ -299,63 +275,3 @@ When executing this command:
|
|
|
299
275
|
| `complexity-scoring.md` | Complexity scoring system |
|
|
300
276
|
| `/discovery-plan` command | Run discovery first |
|
|
301
277
|
| `/execute-plan` command | Execute the created plan |
|
|
302
|
-
|
|
303
|
-
---
|
|
304
|
-
|
|
305
|
-
## Compaction Suggestion
|
|
306
|
-
|
|
307
|
-
After plan creation completes, suggest context cleanup:
|
|
308
|
-
|
|
309
|
-
> Plan created. Consider running `/compact` before execution to maximize available context for the implementation phases.
|
|
310
|
-
|
|
311
|
-
Only suggest if the plan has > 3 phases. Skip if autopilot is ON.
|
|
312
|
-
|
|
313
|
-
---
|
|
314
|
-
|
|
315
|
-
## Brain Capture
|
|
316
|
-
|
|
317
|
-
After plan creation completes successfully, append a brain-capture block. See `.claude/resources/core/brain-capture.md` for processing rules.
|
|
318
|
-
|
|
319
|
-
**Capture the following**:
|
|
320
|
-
|
|
321
|
-
```
|
|
322
|
-
<!-- brain-capture
|
|
323
|
-
skill: create-plan
|
|
324
|
-
feature: [feature name]
|
|
325
|
-
status: completed
|
|
326
|
-
data:
|
|
327
|
-
phase_count: [number of phases]
|
|
328
|
-
total_complexity: [sum of complexity scores]
|
|
329
|
-
highest_phase: [phase name with highest score]
|
|
330
|
-
discovery_link: [[discovery-feature-name]]
|
|
331
|
-
plan_doc: [path to plan document]
|
|
332
|
-
-->
|
|
333
|
-
```
|
|
334
|
-
|
|
335
|
-
Update `flow/brain/features/[feature-name].md` with plan details and link to discovery entry.
|
|
336
|
-
|
|
337
|
-
---
|
|
338
|
-
|
|
339
|
-
## Resource Capture
|
|
340
|
-
|
|
341
|
-
During this skill's execution, watch for valuable reference materials worth preserving. See `.claude/resources/core/resource-capture.md` for capture rules, file format, and naming conventions.
|
|
342
|
-
|
|
343
|
-
At natural break points, if you encounter information that could be useful for future development (API specs, architecture notes, config references, domain knowledge, etc.), ask the user: "I found something that could be useful for future reference: _{brief description}_. Should I save it to `flow/resources/`?"
|
|
344
|
-
|
|
345
|
-
Only save if the user approves. Do not re-ask if declined.
|
|
346
|
-
|
|
347
|
-
---
|
|
348
|
-
|
|
349
|
-
## Handoff
|
|
350
|
-
|
|
351
|
-
### Consumption
|
|
352
|
-
|
|
353
|
-
Before creating the plan, check for `flow/handoffs/handoff_<feature>_discovery_to_plan.md` (or `handoff_<feature>_review_to_plan.md` for bugfix workflow). If it exists, read it silently and use its focus guidance to inform plan structure. If it doesn't exist, proceed normally (backward compatible).
|
|
354
|
-
|
|
355
|
-
### Production
|
|
356
|
-
|
|
357
|
-
After the plan is created, produce a handoff for the execution step.
|
|
358
|
-
|
|
359
|
-
**Output**: `flow/handoffs/handoff_<feature>_plan_to_execute.md`
|
|
360
|
-
|
|
361
|
-
Include: feature name, workflow type, phase count, total complexity, highest complexity phase, plan and discovery paths, and focus guidance for execution.
|
|
@@ -18,13 +18,6 @@ This command creates a discovery document for gathering and clarifying requireme
|
|
|
18
18
|
> - **If YES**: Autopilot is ON. After completing discovery and user Q&A, **auto-proceed** to `/create-plan` with the discovery output. Do NOT ask "Would you like to proceed?" - just continue.
|
|
19
19
|
> - **If NO**: Follow the standard rules below (stop and wait for user).
|
|
20
20
|
|
|
21
|
-
> **MODE: Research**
|
|
22
|
-
> Explore before concluding. Read 3x more than you write. Prefer Read/Grep/Glob/WebSearch tools.
|
|
23
|
-
> Ask clarifying questions when uncertain. Don't jump to implementation.
|
|
24
|
-
|
|
25
|
-
> **AGENT_PROFILE: read-only**
|
|
26
|
-
> See `.claude/resources/core/agent-profiles.md` for tool access rules.
|
|
27
|
-
|
|
28
21
|
> ⚠️ **IMPORTANT - DISCOVERY ONLY**
|
|
29
22
|
>
|
|
30
23
|
> This command ONLY creates a discovery document. It does NOT:
|
|
@@ -73,9 +66,8 @@ WORKFLOW:
|
|
|
73
66
|
4. Documents requirements (FR, NFR, Constraints)
|
|
74
67
|
5. Proposes high-level approach (no code)
|
|
75
68
|
6. Creates discovery document for review
|
|
76
|
-
7. Asks user if they want to proceed
|
|
77
|
-
8.
|
|
78
|
-
9. Waits for user confirmation before proceeding
|
|
69
|
+
7. Asks user if they want to proceed to /create-plan
|
|
70
|
+
8. Waits for user confirmation before proceeding
|
|
79
71
|
|
|
80
72
|
RECOMMENDED MODEL:
|
|
81
73
|
Claude Opus 4.6 or Sonnet 4.5 for best results
|
|
@@ -94,7 +86,7 @@ These rules are mandatory. For detailed patterns and guidelines, see `.claude/re
|
|
|
94
86
|
| Rule | Description |
|
|
95
87
|
| ------------------------ | -------------------------------------------------------- |
|
|
96
88
|
| **No Code** | NEVER write, edit, or generate code during discovery |
|
|
97
|
-
| **Only Markdown Output** | The ONLY deliverable is the discovery markdown file
|
|
89
|
+
| **Only Markdown Output** | The ONLY deliverable is the discovery markdown file. Do NOT display it in chat. |
|
|
98
90
|
| **Ask Questions** | When in doubt, ask - don't assume |
|
|
99
91
|
| **Read First** | Read all referenced documents before asking questions |
|
|
100
92
|
| **High-Level Only** | Technical considerations are conceptual, not code |
|
|
@@ -103,6 +95,7 @@ These rules are mandatory. For detailed patterns and guidelines, see `.claude/re
|
|
|
103
95
|
| **No Auto-Execution** | Do NOT auto-invoke commands without user confirmation (unless autopilot ON) |
|
|
104
96
|
| **NO PLANNING** | Do NOT create implementation plans during discovery |
|
|
105
97
|
| **NO EXECUTION** | Do NOT execute any implementation steps |
|
|
98
|
+
| **File Only** | Save the `.md` file and report its path. Do NOT show full content in chat. |
|
|
106
99
|
|
|
107
100
|
---
|
|
108
101
|
|
|
@@ -129,24 +122,6 @@ To start the discovery process, I need to understand:
|
|
|
129
122
|
|
|
130
123
|
---
|
|
131
124
|
|
|
132
|
-
### Step 1.5: Search for Existing Solutions
|
|
133
|
-
|
|
134
|
-
**Before recommending implementation**, check if the problem is already solved:
|
|
135
|
-
|
|
136
|
-
1. **Project code**: Use Grep/Glob to search for existing implementations, similar patterns, or utilities that already address part of the requirement
|
|
137
|
-
2. **Package registries**: Use WebSearch to check npm (for JS/TS projects) or PyPI (for Python projects) for established libraries
|
|
138
|
-
- Search: `"{problem description} npm package"` or `"{problem description} python library"`
|
|
139
|
-
- Evaluate: maintenance status (last publish date), weekly downloads, compatibility with project stack
|
|
140
|
-
3. **Document findings** in an "Existing Solutions Analysis" section in the discovery document
|
|
141
|
-
|
|
142
|
-
**Decision criteria**:
|
|
143
|
-
- If an existing library covers **>80%** of the need → recommend using it instead of building from scratch
|
|
144
|
-
- If **<80%** → note what it covers and what custom work remains
|
|
145
|
-
|
|
146
|
-
**Graceful degradation**: If WebSearch is unavailable, skip registry search and note "Package registry search skipped — WebSearch unavailable" in the discovery document. Always perform the project code search.
|
|
147
|
-
|
|
148
|
-
---
|
|
149
|
-
|
|
150
125
|
### Step 2: Extract Feature Name
|
|
151
126
|
|
|
152
127
|
From the user input, extract or derive a feature name for the discovery document.
|
|
@@ -180,81 +155,37 @@ The skill will:
|
|
|
180
155
|
6. Identify technical considerations
|
|
181
156
|
7. Propose high-level approach
|
|
182
157
|
8. Document risks and unknowns
|
|
183
|
-
9. Generate discovery document
|
|
184
|
-
10. Support iterative refinement (max 3 rounds) if user requests it
|
|
185
|
-
11. Ask user if they want to proceed to /create-plan
|
|
186
|
-
12. Wait for user confirmation before proceeding
|
|
158
|
+
9. Generate discovery document and save to `flow/discovery/`
|
|
187
159
|
|
|
188
160
|
See: `.claude/resources/skills/discovery-skill.md`
|
|
189
161
|
|
|
190
162
|
---
|
|
191
163
|
|
|
192
|
-
### Step 5:
|
|
164
|
+
### Step 5: Save File and Stop
|
|
193
165
|
|
|
194
|
-
After the skill completes
|
|
166
|
+
After the skill completes:
|
|
195
167
|
|
|
196
|
-
|
|
197
|
-
|
|
168
|
+
1. **Save the discovery document** to `flow/discovery/discovery_<feature>_v<version>.md`
|
|
169
|
+
2. **Report only the file path** — do NOT display the full document content in chat
|
|
170
|
+
3. **STOP** — do NOT create a plan, do NOT offer to build, do NOT show implementation steps
|
|
198
171
|
|
|
199
|
-
**
|
|
200
|
-
- X functional requirements gathered
|
|
201
|
-
- X non-functional requirements identified
|
|
202
|
-
- X risks documented
|
|
203
|
-
- X questions resolved
|
|
172
|
+
**Output to the user** (this is the ONLY thing to show):
|
|
204
173
|
|
|
205
|
-
|
|
174
|
+
```markdown
|
|
175
|
+
Discovery complete.
|
|
206
176
|
|
|
207
|
-
**
|
|
208
|
-
1. Review the discovery document above
|
|
209
|
-
2. Request any refinements or additions (if needed)
|
|
210
|
-
3. Proceed to planning when ready
|
|
211
|
-
```
|
|
177
|
+
**Created**: `flow/discovery/discovery_<feature>_v1.md`
|
|
212
178
|
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
```typescript
|
|
216
|
-
AskUserQuestion({
|
|
217
|
-
questions: [{
|
|
218
|
-
question: "Would you like me to proceed with creating the implementation plan?",
|
|
219
|
-
header: "Next step",
|
|
220
|
-
options: [
|
|
221
|
-
{ label: "Yes, create plan", description: "I'll invoke /create-plan with the discovery document" },
|
|
222
|
-
{ label: "No, review first", description: "You can review the discovery and invoke /create-plan when ready" },
|
|
223
|
-
{ label: "Refine discovery", description: "Iteratively refine the discovery document (max 3 rounds)" }
|
|
224
|
-
],
|
|
225
|
-
multiSelect: false
|
|
226
|
-
}]
|
|
227
|
-
})
|
|
179
|
+
Next: review the file, then run `/create-plan` when ready.
|
|
228
180
|
```
|
|
229
181
|
|
|
230
|
-
⚠️ **
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
1. **Accept feedback**: Ask user what areas need adjustment (requirements, approach, scope, risks)
|
|
239
|
-
2. **Follow-up questions**: Ask 1-3 targeted questions about the refinement areas only
|
|
240
|
-
3. **Update document**: Modify the discovery document in-place, add/update Refinement History section
|
|
241
|
-
4. **Re-present**: Show the updated document and offer the same 3 options again
|
|
242
|
-
5. **Round tracking**: Track refinement round count (max 3). After 3 rounds, only offer "Yes, create plan" and "No, review first" — the "Refine discovery" option is removed
|
|
243
|
-
|
|
244
|
-
```typescript
|
|
245
|
-
// After 3 refinement rounds, remove the refine option:
|
|
246
|
-
AskUserQuestion({
|
|
247
|
-
questions: [{
|
|
248
|
-
question: "Discovery refined 3 times (maximum). Would you like to proceed?",
|
|
249
|
-
header: "Next step",
|
|
250
|
-
options: [
|
|
251
|
-
{ label: "Yes, create plan", description: "I'll invoke /create-plan with the discovery document" },
|
|
252
|
-
{ label: "No, stop here", description: "You can review and invoke /create-plan manually when ready" }
|
|
253
|
-
],
|
|
254
|
-
multiSelect: false
|
|
255
|
-
}]
|
|
256
|
-
})
|
|
257
|
-
```
|
|
182
|
+
⚠️ **CRITICAL**: After saving the file, the command is DONE. Do NOT:
|
|
183
|
+
- Show the full discovery document content in chat
|
|
184
|
+
- Create or suggest an implementation plan
|
|
185
|
+
- Offer to build or execute anything
|
|
186
|
+
- Auto-invoke `/create-plan`
|
|
187
|
+
|
|
188
|
+
The user will read the `.md` file themselves and decide when to proceed.
|
|
258
189
|
|
|
259
190
|
---
|
|
260
191
|
|
|
@@ -288,10 +219,10 @@ AskUserQuestion({
|
|
|
288
219
|
|
|
|
289
220
|
v
|
|
290
221
|
+------------------------------------------+
|
|
291
|
-
| Step 5:
|
|
292
|
-
| -
|
|
293
|
-
| -
|
|
294
|
-
| -
|
|
222
|
+
| Step 5: Save File and Stop |
|
|
223
|
+
| - Save .md file to flow/discovery/ |
|
|
224
|
+
| - Report file path only |
|
|
225
|
+
| - STOP (no plan, no build) |
|
|
295
226
|
+------------------------------------------+
|
|
296
227
|
```
|
|
297
228
|
|
|
@@ -374,60 +305,3 @@ Read: resources/tools/interactive-questions-tool.md (lines from TLS-IQ-3)
|
|
|
374
305
|
| `discovery-templates.md` | Document templates |
|
|
375
306
|
| `interactive-questions-tool.md` | Interactive Questions UI workflow |
|
|
376
307
|
| `/create-plan` command | Creates plan from discovery document |
|
|
377
|
-
|
|
378
|
-
---
|
|
379
|
-
|
|
380
|
-
## Compaction Suggestion
|
|
381
|
-
|
|
382
|
-
After discovery completes, suggest context cleanup:
|
|
383
|
-
|
|
384
|
-
> Discovery complete. Consider running `/compact` before creating a plan to free context for the planning phase.
|
|
385
|
-
|
|
386
|
-
Only suggest if the discovery was substantial (> 5 requirements gathered). Skip if autopilot is ON (context will be managed automatically).
|
|
387
|
-
|
|
388
|
-
---
|
|
389
|
-
|
|
390
|
-
## Brain Capture
|
|
391
|
-
|
|
392
|
-
After discovery completes successfully, append a brain-capture block. See `.claude/resources/core/brain-capture.md` for processing rules.
|
|
393
|
-
|
|
394
|
-
**Capture the following**:
|
|
395
|
-
|
|
396
|
-
```
|
|
397
|
-
<!-- brain-capture
|
|
398
|
-
skill: discovery
|
|
399
|
-
feature: [feature name from discovery]
|
|
400
|
-
status: completed
|
|
401
|
-
data:
|
|
402
|
-
user_prompt: [original user request]
|
|
403
|
-
questions_asked: [count]
|
|
404
|
-
questions_answered: [count]
|
|
405
|
-
requirements_fr: [count of functional requirements]
|
|
406
|
-
requirements_nfr: [count of non-functional requirements]
|
|
407
|
-
discovery_doc: [path to discovery document]
|
|
408
|
-
-->
|
|
409
|
-
```
|
|
410
|
-
|
|
411
|
-
Write/update `flow/brain/features/[feature-name].md` with discovery context and update `flow/brain/index.md`.
|
|
412
|
-
|
|
413
|
-
---
|
|
414
|
-
|
|
415
|
-
## Resource Capture
|
|
416
|
-
|
|
417
|
-
During this skill's execution, watch for valuable reference materials worth preserving. See `.claude/resources/core/resource-capture.md` for capture rules, file format, and naming conventions.
|
|
418
|
-
|
|
419
|
-
At natural break points, if you encounter information that could be useful for future development (API specs, architecture notes, config references, domain knowledge, etc.), ask the user: "I found something that could be useful for future reference: _{brief description}_. Should I save it to `flow/resources/`?"
|
|
420
|
-
|
|
421
|
-
Only save if the user approves. Do not re-ask if declined.
|
|
422
|
-
|
|
423
|
-
---
|
|
424
|
-
|
|
425
|
-
## Handoff Production
|
|
426
|
-
|
|
427
|
-
After discovery completes, produce a handoff document for the next step. See `.claude/resources/patterns/handoff-patterns.md` [PTN-HND-1] for the template.
|
|
428
|
-
|
|
429
|
-
**Output**: `flow/handoffs/handoff_<feature>_discovery_to_plan.md`
|
|
430
|
-
|
|
431
|
-
Include: feature name, workflow type, requirements summary (FR/NFR/C counts), key decisions from Q&A, top risks, discovery doc path, and focus guidance for planning.
|
|
432
|
-
|
|
433
|
-
Create the `flow/handoffs/` directory if it doesn't exist.
|
|
@@ -49,7 +49,7 @@ WORKFLOW:
|
|
|
49
49
|
- Presents phase details for approval
|
|
50
50
|
- Implements after approval
|
|
51
51
|
- Updates progress in plan file
|
|
52
|
-
4. Runs
|
|
52
|
+
4. Runs npm run build && npm run test (ONLY at the end)
|
|
53
53
|
5. Auto-archives plan and discovery to flow/archive/
|
|
54
54
|
|
|
55
55
|
EXECUTION STRATEGIES:
|
|
@@ -79,13 +79,6 @@ RELATED COMMANDS:
|
|
|
79
79
|
> - **If YES**: Autopilot is ON. After completing execution (build + test pass), **auto-proceed** to `/review-code`. Do NOT stop and wait.
|
|
80
80
|
> - **If NO**: Follow the standard rules below (stop and wait for user).
|
|
81
81
|
|
|
82
|
-
> **MODE: Dev**
|
|
83
|
-
> Code first, test after. Prefer Edit/Write/Bash tools. Run build/test after changes.
|
|
84
|
-
> Move efficiently. Verify with tests, not exploration.
|
|
85
|
-
|
|
86
|
-
> **AGENT_PROFILE: full-access**
|
|
87
|
-
> See `.claude/resources/core/agent-profiles.md` for tool access rules.
|
|
88
|
-
|
|
89
82
|
## Critical Rules
|
|
90
83
|
|
|
91
84
|
| Rule | Description |
|
|
@@ -141,21 +134,9 @@ Please run this command and let me know when it's complete.
|
|
|
141
134
|
|
|
142
135
|
## CRITICAL RULE: Build Verification ONLY at the End
|
|
143
136
|
|
|
144
|
-
**DO NOT run
|
|
145
|
-
|
|
146
|
-
**Build and test commands MUST ONLY be executed at the very end, after ALL phases (including Tests) are complete.** Use `.claude/resources/core/tech-detection.md` to determine the correct commands for the project's language.
|
|
147
|
-
|
|
148
|
-
**Structured Verification Format**: When running final verification, output:
|
|
149
|
-
|
|
150
|
-
```
|
|
151
|
-
VERIFICATION: [PASS/FAIL]
|
|
152
|
-
Build: [OK/FAIL - details]
|
|
153
|
-
Types: [OK/X errors]
|
|
154
|
-
Tests: [X/Y passed]
|
|
155
|
-
Ready for PR: [YES/NO]
|
|
156
|
-
```
|
|
137
|
+
**DO NOT run `npm run build` after each phase or group.**
|
|
157
138
|
|
|
158
|
-
|
|
139
|
+
**`npm run build` and `npm run test` MUST ONLY be executed at the very end, after ALL phases (including Tests) are complete.**
|
|
159
140
|
|
|
160
141
|
---
|
|
161
142
|
|
|
@@ -324,7 +305,6 @@ When executing this command:
|
|
|
324
305
|
| `resources/core/_index.md` | Index of core rules with reference codes |
|
|
325
306
|
| `resources/tools/_index.md` | Index of tools with reference codes |
|
|
326
307
|
| `execute-plan-skill.md` | Skill that executes the plan |
|
|
327
|
-
| `core/tech-detection.md` | Language-adaptive build/test commands |
|
|
328
308
|
| `plans-patterns.md` | Rules and patterns for plans |
|
|
329
309
|
| `complexity-scoring.md` | Complexity scoring system |
|
|
330
310
|
| `plan-mode-tool.md` | Plan mode switching instructions |
|
|
@@ -333,31 +313,6 @@ When executing this command:
|
|
|
333
313
|
|
|
334
314
|
---
|
|
335
315
|
|
|
336
|
-
## Cleanup Pass (De-Sloppify)
|
|
337
|
-
|
|
338
|
-
After ALL phases complete and build/tests pass, run an automatic cleanup pass to remove development artifacts. This runs before code review (in autopilot) or before archive.
|
|
339
|
-
|
|
340
|
-
### Target Patterns (ONLY remove these)
|
|
341
|
-
|
|
342
|
-
1. **Debug statements**: `console.log`, `console.debug`, `console.warn` used for debugging (not intentional application logging)
|
|
343
|
-
2. **Commented-out code**: Code blocks that are commented out (not documentation comments or TODO/FIXME markers)
|
|
344
|
-
3. **Language-behavior tests**: Test assertions that verify language or framework behavior rather than business logic (e.g., testing that `typeof` returns expected values, testing that `Array.map` works)
|
|
345
|
-
4. **Redundant type checks**: Runtime type checks that duplicate compile-time TypeScript guarantees (e.g., `if (typeof x === 'string')` when `x` is already typed as `string`)
|
|
346
|
-
5. **Unused imports**: Import statements added during development that are no longer referenced
|
|
347
|
-
|
|
348
|
-
### Safety Protocol
|
|
349
|
-
|
|
350
|
-
1. Make all cleanup changes
|
|
351
|
-
2. Run the full test suite (using the detected test command)
|
|
352
|
-
3. **If ANY test fails** → revert ALL cleanup changes and report: "Cleanup reverted — {N} test(s) failed after removing {description}"
|
|
353
|
-
4. **If all tests pass** → report: "Cleanup: removed {X} debug statements, {Y} commented blocks, {Z} redundant tests. All tests passing."
|
|
354
|
-
|
|
355
|
-
### Skip Option
|
|
356
|
-
|
|
357
|
-
The cleanup pass runs by default but can be skipped. If the user requests skipping, proceed directly to archive/review.
|
|
358
|
-
|
|
359
|
-
---
|
|
360
|
-
|
|
361
316
|
## Brain Capture
|
|
362
317
|
|
|
363
318
|
After each phase completes (and after full execution), append brain-capture blocks. See `.claude/resources/core/brain-capture.md` for processing rules.
|
|
@@ -404,18 +359,3 @@ At natural break points, if you encounter information that could be useful for f
|
|
|
404
359
|
|
|
405
360
|
Only save if the user approves. Do not re-ask if declined.
|
|
406
361
|
|
|
407
|
-
---
|
|
408
|
-
|
|
409
|
-
## Handoff
|
|
410
|
-
|
|
411
|
-
### Consumption
|
|
412
|
-
|
|
413
|
-
Before starting execution, check for `flow/handoffs/handoff_<feature>_plan_to_execute.md`. If it exists, read it silently and use its focus guidance to prioritize execution. If it doesn't exist, proceed normally (backward compatible).
|
|
414
|
-
|
|
415
|
-
### Production
|
|
416
|
-
|
|
417
|
-
After ALL phases complete and build/test verification passes, produce a handoff for the review step.
|
|
418
|
-
|
|
419
|
-
**Output**: `flow/handoffs/handoff_<feature>_execute_to_review.md`
|
|
420
|
-
|
|
421
|
-
Include: feature name, workflow type, phases completed, build/test status, plan path, and **Plan Alignment Data** — list of planned files (from plan tasks) vs actually modified files (from `git diff --name-only`), noting scope drift and missing changes.
|