planflow-ai 1.3.0 → 1.3.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.
Files changed (44) hide show
  1. package/.claude/commands/brainstorm.md +2 -2
  2. package/.claude/commands/discovery-plan.md +11 -0
  3. package/.claude/commands/execute-plan.md +26 -2
  4. package/.claude/commands/flow.md +5 -0
  5. package/.claude/commands/heartbeat.md +1 -1
  6. package/.claude/commands/learn.md +4 -6
  7. package/.claude/commands/{brain.md → note.md} +12 -12
  8. package/.claude/commands/review-code.md +61 -1
  9. package/.claude/commands/review-pr.md +61 -1
  10. package/.claude/commands/setup.md +11 -1
  11. package/.claude/resources/core/_index.md +102 -2
  12. package/.claude/resources/core/compaction-guide.md +111 -0
  13. package/.claude/resources/core/discovery-sub-agents.md +266 -0
  14. package/.claude/resources/core/phase-isolation.md +222 -0
  15. package/.claude/resources/core/resource-capture.md +1 -1
  16. package/.claude/resources/core/review-adaptive-depth.md +217 -0
  17. package/.claude/resources/core/review-multi-agent.md +289 -0
  18. package/.claude/resources/core/review-severity-ranking.md +149 -0
  19. package/.claude/resources/core/review-verification.md +158 -0
  20. package/.claude/resources/core/session-scratchpad.md +105 -0
  21. package/.claude/resources/patterns/review-code-templates.md +315 -2
  22. package/.claude/resources/skills/_index.md +108 -42
  23. package/.claude/resources/skills/brain-skill.md +3 -3
  24. package/.claude/resources/skills/discovery-skill.md +50 -6
  25. package/.claude/resources/skills/execute-plan-skill.md +14 -6
  26. package/.claude/resources/skills/review-code-skill.md +73 -0
  27. package/.claude/resources/skills/review-pr-skill.md +58 -0
  28. package/README.md +38 -3
  29. package/dist/cli/commands/heartbeat.js.map +1 -1
  30. package/dist/cli/daemon/heartbeat-daemon.js +31 -1
  31. package/dist/cli/daemon/heartbeat-daemon.js.map +1 -1
  32. package/dist/cli/daemon/heartbeat-parser.d.ts.map +1 -1
  33. package/dist/cli/daemon/heartbeat-parser.js +6 -0
  34. package/dist/cli/daemon/heartbeat-parser.js.map +1 -1
  35. package/dist/cli/handlers/claude.js +20 -12
  36. package/dist/cli/handlers/claude.js.map +1 -1
  37. package/dist/cli/types.d.ts +1 -0
  38. package/dist/cli/types.d.ts.map +1 -1
  39. package/package.json +1 -1
  40. package/rules/skills/brain-skill.mdc +4 -4
  41. package/skills/plan-flow/SKILL.md +1 -1
  42. package/skills/plan-flow/brain/SKILL.md +1 -1
  43. package/templates/shared/AGENTS.md.template +1 -1
  44. package/templates/shared/CLAUDE.md.template +11 -1
@@ -15,6 +15,18 @@ Skills implement the workflow logic for commands. Each skill orchestrates a spec
15
15
  > **Note**: The execute-plan skill supports **Model Routing** — automatic model selection per phase based on complexity scores (0-3 → haiku, 4-5 → sonnet, 6-10 → opus). Controlled by `model_routing` in `flow/.flowconfig`. See `.claude/resources/core/model-routing.md` for full rules.
16
16
  >
17
17
  > **Note**: The discovery skill also includes **Design Awareness**. During discovery, the LLM asks whether the feature involves UI work and captures structured design tokens (colors, typography, spacing) into a `## Design Context` section. During execution, these tokens are auto-injected into UI phase prompts. See `.claude/resources/core/design-awareness.md` for full rules.
18
+ >
19
+ > **Note**: The review-code and review-pr skills include a **Verification Pass**. After initial analysis, each finding is re-examined against surrounding code context and classified as Confirmed, Likely, or Dismissed. False positives are filtered before output. See `.claude/resources/core/review-verification.md` for full rules.
20
+ >
21
+ > **Note**: The review-code and review-pr skills include **Multi-Agent Parallel Review** for Deep mode (500+ lines). Four specialized subagents (security, logic, performance, patterns) run in parallel, and the coordinator deduplicates, verifies, and ranks the merged results. See `.claude/resources/core/review-multi-agent.md` for full rules.
22
+ >
23
+ > **Note**: The review-code and review-pr skills include **Severity Re-Ranking**. After verification, findings are re-ranked by severity → confidence → fix complexity, related findings across files are grouped, and an executive summary is added when ≥ 5 findings. See `.claude/resources/core/review-severity-ranking.md` for full rules.
24
+ >
25
+ > **Note**: The review-code and review-pr skills include **Adaptive Depth**. Review depth scales automatically based on changeset size: < 50 lines → Lightweight (quick-scan), 50–500 → Standard (no change), 500+ → Deep (multi-pass with executive summary). See `.claude/resources/core/review-adaptive-depth.md` for full rules.
26
+ >
27
+ > **Note**: All long-running skills (execute-plan, review-code, discovery) support **Context Compaction**. When compacting mid-skill, load `.claude/resources/core/compaction-guide.md` for preserve/discard rules and the compact summary template. See `COR-CG-1` through `COR-CG-4`.
28
+ >
29
+ > **Note**: The discovery skill uses **Discovery Sub-Agents** for parallel codebase exploration. Three haiku sub-agents (similar features, API/data patterns, schema/types) run in parallel after reading referenced docs, returning condensed JSON findings merged into a Codebase Analysis section. See `.claude/resources/core/discovery-sub-agents.md` for full rules.
18
30
 
19
31
  ---
20
32
 
@@ -85,44 +97,68 @@ Skills implement the workflow logic for commands. Each skill orchestrates a spec
85
97
 
86
98
  | Code | Description | Source | Lines |
87
99
  |------|-------------|--------|-------|
88
- | SKL-EXEC-1 | Critical rules (build only at end, no DB commands) | execute-plan-skill.md | 22-95 |
89
- | SKL-EXEC-2 | Workflow steps 1-3 (parse, analyze complexity, present summary) | execute-plan-skill.md | 105-182 |
90
- | SKL-EXEC-3 | Workflow steps 4-5 (execute phases with Plan mode, update progress) | execute-plan-skill.md | 184-238 |
91
- | SKL-EXEC-4 | Workflow steps 6-7 (tests phase, completion/verification) | execute-plan-skill.md | 240-281 |
92
- | SKL-EXEC-5 | Complexity-based behavior (low, medium, high, very high) | execute-plan-skill.md | 303-332 |
93
- | SKL-EXEC-6 | Error handling (build failures, test failures, cancellation) | execute-plan-skill.md | 334-366 |
100
+ | SKL-EXEC-1 | Purpose and inputs | execute-plan-skill.md | 4-100 |
101
+ | SKL-EXEC-2 | Critical rules (build only at end, no DB commands) | execute-plan-skill.md | 18-92 |
102
+ | SKL-EXEC-3 | Step 1: Parse the plan | execute-plan-skill.md | 103-112 |
103
+ | SKL-EXEC-4 | Step 2: Analyze complexity and determine execution strategy | execute-plan-skill.md | 113-151 |
104
+ | SKL-EXEC-5 | Step 3: Present execution plan summary | execute-plan-skill.md | 152-180 |
105
+ | SKL-EXEC-6 | Step 4: Execute each phase with Plan mode | execute-plan-skill.md | 181-236 |
106
+ | SKL-EXEC-7 | Step 5: Update progress after each phase | execute-plan-skill.md | 237-249 |
107
+ | SKL-EXEC-8 | Step 5b: Phase-boundary context check (compaction) | execute-plan-skill.md | 250-275 |
108
+ | SKL-EXEC-9 | Step 6: Handle tests phase | execute-plan-skill.md | 277-302 |
109
+ | SKL-EXEC-10 | Step 7: Completion — build and test verification | execute-plan-skill.md | 303-364 |
110
+ | SKL-EXEC-11 | Complexity-based behavior (low, medium, high, very high) | execute-plan-skill.md | 365-393 |
111
+ | SKL-EXEC-12 | Error handling (build failures, test failures, cancellation) | execute-plan-skill.md | 395-427 |
94
112
 
95
113
  ### Review Code Skill (`review-code-skill.md`)
96
114
 
97
115
  | Code | Description | Source | Lines |
98
116
  |------|-------------|--------|-------|
99
- | SKL-REV-1 | Purpose and restrictions (read-only analysis) | review-code-skill.md | 8-58 |
100
- | SKL-REV-2 | Workflow steps 1-3 (identify files, load patterns, find similar) | review-code-skill.md | 72-130 |
101
- | SKL-REV-3 | Workflow steps 4-6 (analyze, pattern conflicts, generate doc) | review-code-skill.md | 131-180 |
102
- | SKL-REV-4 | Severity levels and conflict resolution | review-code-skill.md | 182-231 |
103
- | SKL-REV-5 | Finding similar implementations (search strategies) | review-code-skill.md | 233-259 |
117
+ | SKL-REV-1 | Purpose and restrictions (read-only, allowed actions) | review-code-skill.md | 4-58 |
118
+ | SKL-REV-2 | Step 1: Identify changed files | review-code-skill.md | 70-77 |
119
+ | SKL-REV-3 | Step 1b: Determine review depth (adaptive depth) | review-code-skill.md | 78-97 |
120
+ | SKL-REV-4 | Step 2: Load review patterns | review-code-skill.md | 98-107 |
121
+ | SKL-REV-5 | Step 3: Find similar implementations in codebase | review-code-skill.md | 108-146 |
122
+ | SKL-REV-6 | Step 4: Analyze code changes | review-code-skill.md | 147-158 |
123
+ | SKL-REV-7 | Step 5: Pattern conflicts + 5b verify + 5c re-rank | review-code-skill.md | 159-231 |
124
+ | SKL-REV-8 | Step 6: Generate review document | review-code-skill.md | 232-260 |
125
+ | SKL-REV-9 | Severity levels and conflict resolution | review-code-skill.md | 252-301 |
126
+ | SKL-REV-10 | Finding similar implementations (search strategies) | review-code-skill.md | 303-330 |
127
+ | SKL-REV-11 | Validation checklist | review-code-skill.md | 379-392 |
104
128
 
105
129
  ### Review PR Skill (`review-pr-skill.md`)
106
130
 
107
131
  | Code | Description | Source | Lines |
108
132
  |------|-------------|--------|-------|
109
- | SKL-PR-1 | Purpose and restrictions (GitHub/Azure DevOps commands) | review-pr-skill.md | 8-122 |
110
- | SKL-PR-2 | Workflow (authenticate, fetch, analyze, generate) | review-pr-skill.md | 132-217 |
111
- | SKL-PR-3 | Output format template with review history | review-pr-skill.md | 219-318 |
112
- | SKL-PR-4 | Severity levels and fix complexity scoring | review-pr-skill.md | 320-370 |
113
- | SKL-PR-5 | Link format for GitHub and Azure DevOps | review-pr-skill.md | 372-420 |
133
+ | SKL-PR-1 | Purpose and restrictions (read-only, GitHub/Azure DevOps) | review-pr-skill.md | 4-120 |
134
+ | SKL-PR-2 | Step 0: Authenticate for PR access | review-pr-skill.md | 132-158 |
135
+ | SKL-PR-3 | Step 1: Fetch PR information + 1b determine review depth | review-pr-skill.md | 159-184 |
136
+ | SKL-PR-4 | Step 2: Load review patterns | review-pr-skill.md | 185-194 |
137
+ | SKL-PR-5 | Step 3: Analyze code changes + 3b verify + 3c re-rank | review-pr-skill.md | 195-240 |
138
+ | SKL-PR-6 | Step 4: Generate or update review document | review-pr-skill.md | 241-320 |
139
+ | SKL-PR-7 | Output format template (findings, severity, recommendations) | review-pr-skill.md | 322-376 |
140
+ | SKL-PR-8 | Fix complexity scoring (scale, modifiers, examples) | review-pr-skill.md | 388-426 |
141
+ | SKL-PR-9 | Link format for GitHub and Azure DevOps | review-pr-skill.md | 428-477 |
142
+ | SKL-PR-10 | Example finding and quick reference commands | review-pr-skill.md | 479-552 |
114
143
 
115
144
  ### Setup Skill (`setup-skill.md`)
116
145
 
117
146
  | Code | Description | Source | Lines |
118
147
  |------|-------------|--------|-------|
119
- | SKL-SETUP-1 | Purpose and critical approach | setup-skill.md | 8-30 |
120
- | SKL-SETUP-2 | Steps 1-2 (scan project structure, dependency analysis) | setup-skill.md | 34-106 |
121
- | SKL-SETUP-3 | Step 3 (deep code analysis, sample files, extract patterns) | setup-skill.md | 108-200 |
122
- | SKL-SETUP-4 | Steps 4-5 (research best practices, check existing rules) | setup-skill.md | 202-252 |
123
- | SKL-SETUP-5 | Step 6 (confirming questions via Plan mode) | setup-skill.md | 254-334 |
124
- | SKL-SETUP-6 | Step 7 (generate framework and library pattern files) | setup-skill.md | 336-493 |
125
- | SKL-SETUP-7 | Steps 8-11 (update core, create analysis doc, create flow folder, summary) | setup-skill.md | 595-797 |
148
+ | SKL-SETUP-1 | Purpose and critical approach | setup-skill.md | 4-28 |
149
+ | SKL-SETUP-2 | Step 1: Scan project structure | setup-skill.md | 31-57 |
150
+ | SKL-SETUP-3 | Step 2: Deep dependency analysis | setup-skill.md | 58-103 |
151
+ | SKL-SETUP-4 | Step 3: Deep code analysis | setup-skill.md | 104-199 |
152
+ | SKL-SETUP-5 | Step 4: Research best practices | setup-skill.md | 200-222 |
153
+ | SKL-SETUP-6 | Step 5: Check existing rules | setup-skill.md | 223-249 |
154
+ | SKL-SETUP-7 | Step 6: Ask confirming questions (Plan mode) | setup-skill.md | 250-332 |
155
+ | SKL-SETUP-8 | Step 7: Generate pattern files (templates + examples) | setup-skill.md | 333-574 |
156
+ | SKL-SETUP-9 | Step 8: Update core pattern files | setup-skill.md | 575-605 |
157
+ | SKL-SETUP-10 | Step 9: Sync generic patterns to global brain | setup-skill.md | 606-654 |
158
+ | SKL-SETUP-11 | Step 10: Create project analysis document | setup-skill.md | 655-727 |
159
+ | SKL-SETUP-12 | Step 11: Index documentation files | setup-skill.md | 728-816 |
160
+ | SKL-SETUP-13 | Step 12: Create flow folder structure | setup-skill.md | 817-860 |
161
+ | SKL-SETUP-14 | Step 13: Present setup summary | setup-skill.md | 861-955 |
126
162
 
127
163
  ### Write Tests Skill (`write-tests-skill.md`)
128
164
 
@@ -151,26 +187,56 @@ Skills implement the workflow logic for commands. Each skill orchestrates a spec
151
187
 
152
188
  | Code | Expand When |
153
189
  |------|-------------|
154
- | SKL-EXEC-1 | Need critical rules (build timing, DB commands) |
155
- | SKL-EXEC-2 | Need complexity analysis and grouping logic |
156
- | SKL-EXEC-3 | Need phase execution workflow with Plan mode |
157
- | SKL-EXEC-5 | Need complexity-based behavior details |
190
+ | SKL-EXEC-2 | Need critical rules (build timing, DB commands) |
191
+ | SKL-EXEC-3 | Parsing plan file structure |
192
+ | SKL-EXEC-4 | Analyzing complexity and determining execution strategy |
193
+ | SKL-EXEC-5 | Presenting execution plan summary to user |
194
+ | SKL-EXEC-6 | Executing a phase with Plan mode |
195
+ | SKL-EXEC-7 | Updating progress after a phase |
196
+ | SKL-EXEC-8 | Compacting at phase boundaries |
197
+ | SKL-EXEC-9 | Handling the tests phase |
198
+ | SKL-EXEC-10 | Final build and test verification |
199
+ | SKL-EXEC-11 | Need complexity-based behavior details |
200
+ | SKL-EXEC-12 | Handling build/test failures or cancellation |
158
201
 
159
202
  ### Code Review
160
203
 
161
204
  | Code | Expand When |
162
205
  |------|-------------|
163
- | SKL-REV-2 | Need pattern loading and similar implementation search |
164
- | SKL-REV-4 | Need severity levels and conflict resolution |
165
- | SKL-PR-3 | Need PR review output template |
166
- | SKL-PR-5 | Need link format for GitHub/Azure DevOps |
206
+ | SKL-REV-2 | Identifying changed files for review |
207
+ | SKL-REV-3 | Determining review depth (adaptive) |
208
+ | SKL-REV-4 | Loading review patterns |
209
+ | SKL-REV-5 | Finding similar implementations in codebase |
210
+ | SKL-REV-6 | Analyzing code changes |
211
+ | SKL-REV-7 | Pattern conflicts, verification, and re-ranking |
212
+ | SKL-REV-8 | Generating the review document |
213
+ | SKL-REV-9 | Need severity levels and conflict resolution |
214
+ | SKL-REV-10 | Need search strategies for similar code |
215
+ | SKL-PR-2 | Authenticating for PR access |
216
+ | SKL-PR-3 | Fetching PR info and determining depth |
217
+ | SKL-PR-5 | Analyzing PR changes, verification, re-ranking |
218
+ | SKL-PR-6 | Generating PR review document |
219
+ | SKL-PR-7 | Need PR review output template |
220
+ | SKL-PR-8 | Need fix complexity scoring |
221
+ | SKL-PR-9 | Need link format for GitHub/Azure DevOps |
167
222
 
168
223
  ### Setup and Testing
169
224
 
170
225
  | Code | Expand When |
171
226
  |------|-------------|
172
- | SKL-SETUP-2 | Need dependency detection tables |
173
- | SKL-SETUP-6 | Need pattern file generation templates |
227
+ | SKL-SETUP-2 | Scanning project structure |
228
+ | SKL-SETUP-3 | Deep dependency analysis |
229
+ | SKL-SETUP-4 | Deep code analysis |
230
+ | SKL-SETUP-5 | Researching best practices |
231
+ | SKL-SETUP-6 | Checking existing rules |
232
+ | SKL-SETUP-7 | Asking confirming questions via Plan mode |
233
+ | SKL-SETUP-8 | Generating pattern files |
234
+ | SKL-SETUP-9 | Updating core pattern files |
235
+ | SKL-SETUP-10 | Syncing to global brain |
236
+ | SKL-SETUP-11 | Creating project analysis document |
237
+ | SKL-SETUP-12 | Indexing documentation files |
238
+ | SKL-SETUP-13 | Creating flow folder structure |
239
+ | SKL-SETUP-14 | Presenting setup summary |
174
240
  | SKL-TEST-2 | Need coverage analysis workflow |
175
241
  | SKL-TEST-4 | Need test writing guidelines |
176
242
 
@@ -188,15 +254,15 @@ Skills implement the workflow logic for commands. Each skill orchestrates a spec
188
254
  | Command | Skill | Key Codes |
189
255
  |---------|-------|-----------|
190
256
  | `/brainstorm` | brainstorm-skill | SKL-BS-1 through SKL-BS-3 |
191
- | `/brain` | brain-skill | SKL-BR-1 through SKL-BR-3 |
257
+ | `/note` | brain-skill | SKL-BR-1 through SKL-BR-3 |
192
258
  | `/flow cost` | flow-cost | SKL-COST-1 through SKL-COST-4 |
193
259
  | `/learn` | learn-skill | SKL-LRN-1 through SKL-LRN-4 |
194
260
  | `/discovery-plan` | discovery-skill | SKL-DIS-1 through SKL-DIS-4 |
195
261
  | `/create-plan` | create-plan-skill | SKL-PLN-1 through SKL-PLN-4 |
196
- | `/execute-plan` | execute-plan-skill | SKL-EXEC-1 through SKL-EXEC-6 |
197
- | `/review-code` | review-code-skill | SKL-REV-1 through SKL-REV-5 |
198
- | `/review-pr` | review-pr-skill | SKL-PR-1 through SKL-PR-5 |
199
- | `/setup` | setup-skill | SKL-SETUP-1 through SKL-SETUP-7 |
262
+ | `/execute-plan` | execute-plan-skill | SKL-EXEC-1 through SKL-EXEC-12 |
263
+ | `/review-code` | review-code-skill | SKL-REV-1 through SKL-REV-11 |
264
+ | `/review-pr` | review-pr-skill | SKL-PR-1 through SKL-PR-10 |
265
+ | `/setup` | setup-skill | SKL-SETUP-1 through SKL-SETUP-14 |
200
266
  | `/write-tests` | write-tests-skill | SKL-TEST-1 through SKL-TEST-5 |
201
267
  | `/create-contract` | create-contract-skill | SKL-CON-1 through SKL-CON-4 |
202
268
 
@@ -206,10 +272,10 @@ Skills implement the workflow logic for commands. Each skill orchestrates a spec
206
272
 
207
273
  | Skill | Lines | Sections | Complexity |
208
274
  |-------|-------|----------|------------|
209
- | setup-skill | 821 | 7 | Highest - deep project analysis |
210
- | review-pr-skill | 496 | 5 | High - multi-platform support |
211
- | execute-plan-skill | 388 | 6 | High - phase execution logic |
212
- | review-code-skill | 308 | 5 | Medium - pattern matching |
275
+ | setup-skill | 955 | 14 | Highest - deep project analysis |
276
+ | review-pr-skill | 552 | 10 | High - multi-platform support |
277
+ | execute-plan-skill | 448 | 12 | High - phase execution logic |
278
+ | review-code-skill | 392 | 11 | Medium - pattern matching |
213
279
  | discovery-skill | 295 | 4 | Medium - requirements gathering |
214
280
  | brainstorm-skill | 280 | 3 | Medium - structured exploration with interactive questions |
215
281
  | write-tests-skill | 294 | 5 | Medium - iterative testing |
@@ -49,7 +49,7 @@ This skill **only writes to `flow/brain/`**. It does NOT:
49
49
 
50
50
  ### Free-Text Mode (Default)
51
51
 
52
- When user runs `/brain {free text}`:
52
+ When user runs `/note {free text}`:
53
53
 
54
54
  1. **Parse input** - Read the user's unstructured text
55
55
  2. **Extract entities** - Identify:
@@ -63,9 +63,9 @@ When user runs `/brain {free text}`:
63
63
  4. **Write** - Create/update the appropriate brain file with `[[wiki-links]]`
64
64
  5. **Update index** - Update `flow/brain/index.md` if needed (new feature, error, or decision)
65
65
 
66
- ### Guided Mode (`/brain -guided`)
66
+ ### Guided Mode (`/note -guided`)
67
67
 
68
- When user runs `/brain -guided`:
68
+ When user runs `/note -guided`:
69
69
 
70
70
  1. **Ask structured questions** using `AskUserQuestion`:
71
71
 
@@ -98,6 +98,47 @@ This skill is **strictly for gathering and documenting requirements**. The proce
98
98
 
99
99
  ---
100
100
 
101
+ ### Step 1b: Spawn Exploration Sub-Agents
102
+
103
+ After reading referenced documents, spawn three parallel Agent sub-agents to explore the codebase. These run in parallel and return condensed findings that inform the clarifying questions in Step 2.
104
+
105
+ **Actions**:
106
+
107
+ 1. **Prepare context summary**: Distill Step 1 findings into a brief context paragraph (feature name, key requirements, relevant technologies mentioned)
108
+ 2. **Spawn 3 sub-agents in parallel** using the Agent tool:
109
+ - **Similar Features** agent — finds existing code with related functionality
110
+ - **API/Data Patterns** agent — maps API endpoints, service patterns, data flow
111
+ - **Schema/Types** agent — explores type definitions, schemas, shared interfaces
112
+ 3. Each sub-agent uses `model: "haiku"` and `subagent_type: "Explore"`
113
+ 4. Each receives: feature name, context summary, and agent-specific exploration instructions
114
+
115
+ See `.claude/resources/core/discovery-sub-agents.md` for prompt templates, return format schema, and full agent definitions (`COR-DSA-1`).
116
+
117
+ **Spawning pattern**:
118
+ ```
119
+ Launch in parallel:
120
+ - Agent(model: "haiku", subagent_type: "Explore", prompt: similar_features_prompt)
121
+ - Agent(model: "haiku", subagent_type: "Explore", prompt: api_data_prompt)
122
+ - Agent(model: "haiku", subagent_type: "Explore", prompt: schema_types_prompt)
123
+ ```
124
+
125
+ ---
126
+
127
+ ### Step 1c: Collect and Merge Exploration Findings
128
+
129
+ After all sub-agents return, process their findings:
130
+
131
+ 1. **Parse returns**: Extract JSON from each sub-agent response
132
+ 2. **Handle failures**: If a sub-agent returns `status: "failure"` or invalid JSON, skip its findings and continue. Log the failure but do not block discovery.
133
+ 3. **Filter**: If more than 15 total findings, remove `relevance: "low"` entries
134
+ 4. **Merge patterns**: Collect all `patterns_noticed` entries, deduplicate, and append to `flow/resources/pending-patterns.md`
135
+ 5. **Build Codebase Analysis**: Format merged findings into a `## Codebase Analysis` section (see template in `COR-DSA-2`)
136
+ 6. **Inform Step 2**: Use findings to formulate better clarifying questions — reference specific existing code when asking about patterns to follow
137
+
138
+ If all sub-agents fail or return no findings, skip the Codebase Analysis section entirely. Discovery continues normally — findings are supplementary, not required.
139
+
140
+ ---
141
+
101
142
  ### Step 2: Ask Clarifying Questions
102
143
 
103
144
  Ask questions about gaps identified in documents and unclear requirements.
@@ -273,12 +314,15 @@ Create the discovery markdown file:
273
314
 
274
315
  1. Context
275
316
  2. Referenced Documents
276
- 3. Requirements Gathered (FR, NFR, Constraints)
277
- 4. Open Questions (all answered)
278
- 5. Technical Considerations
279
- 6. Proposed Approach
280
- 7. Risks and Unknowns
281
- 8. Next Steps
317
+ 3. Codebase Analysis (from Step 1c — omit if no findings)
318
+ 4. Requirements Gathered (FR, NFR, Constraints)
319
+ 5. Open Questions (all answered)
320
+ 6. Technical Considerations
321
+ 7. Proposed Approach
322
+ 8. Risks and Unknowns
323
+ 9. Next Steps
324
+
325
+ **Codebase Analysis**: Include the merged findings from Step 1c. Use the Codebase Analysis section format from `.claude/resources/core/discovery-sub-agents.md` (`COR-DSA-2`). Omit this section if all sub-agents failed or returned no findings.
282
326
 
283
327
  **Design Context**: If UI work was confirmed during questioning, append a `## Design Context` section to the discovery document using the template from `.claude/resources/core/design-awareness.md`. Populate with extracted tokens (from screenshots), personality defaults, or existing design system values.
284
328
 
@@ -193,13 +193,19 @@ Wait for user confirmation before proceeding.
193
193
  - Read the phase's complexity score
194
194
  - Look up model tier: **0-3 → Fast (haiku)**, **4-5 → Standard (sonnet)**, **6-10 → Powerful (opus)**
195
195
  - For aggregated phases, use the **highest individual phase complexity** to determine the tier
196
- - Spawn implementation as an **Agent subagent** with `model={tier}` parameter
197
- - Include in Agent prompt: plan file path, current phase details, files modified so far, allowed/forbidden patterns
198
- - If `model_routing` is `false` or key is missing, skip routing and implement directly (use session model)
196
+ - If `model_routing` is `false` or key is missing, skip routing (use session model)
199
197
  - See `.claude/resources/core/model-routing.md` for full tier table, platform mappings, and rules
200
- 5. **Inject design context** - Before implementing, check if the discovery doc (from plan's "Based on Discovery" field) has a `## Design Context` section. If present and the phase involves UI work (see UI Phase Detection Heuristics in `.claude/resources/core/design-awareness.md`), prepend the Design Context to the implementation prompt with: "Follow these design tokens when implementing UI elements. Use the exact color values, typography, and spacing from the Design Context." If no Design Context or phase is not UI-related, skip this step.
201
- 6. **Implement** - Execute the phase following approved approach (via subagent if model routing is active, or directly if not)
202
- 7. **Capture patterns** - While implementing, watch for recurring conventions, anti-patterns, and workarounds. Silently append to `flow/resources/pending-patterns.md`. See `.claude/resources/core/pattern-capture.md` for buffer format and capture triggers.
198
+ 5. **Inject design context** - Before implementing, check if the discovery doc (from plan's "Based on Discovery" field) has a `## Design Context` section. If present and the phase involves UI work (see UI Phase Detection Heuristics in `.claude/resources/core/design-awareness.md`), include the Design Context in the implementation prompt. If no Design Context or phase is not UI-related, skip this step.
199
+ 6. **Implement (with phase isolation)** - Check `phase_isolation` in `flow/.flowconfig` (default: `true`):
200
+ - **If `phase_isolation: true`**: Prepare an isolated context prompt and spawn as Agent subagent. See `.claude/resources/core/phase-isolation.md` for the full context template and return format schema. The prompt includes: phase spec (scope + tasks), files modified so far (paths only), pattern file paths (allowed/forbidden), design context (if UI phase), plan file path. The sub-agent returns a structured JSON summary.
201
+ - **If `phase_isolation: false`**: Execute inline in the main session (legacy behavior). Pattern capture happens inline via step 7.
202
+ - **Agent spawning** combines model routing AND isolation: use `model={tier}` parameter (from step 4) AND the focused context prompt (from isolation). If model routing is disabled, use session model with isolation. If both are disabled, execute inline.
203
+ 7. **Process sub-agent return** (isolation mode only) - Parse the JSON summary returned by the sub-agent:
204
+ - Check `status` field: `success` → continue; `failure` → present errors to user, ask retry/skip/stop; `partial` → present deviations, ask user
205
+ - Accumulate `files_created` and `files_modified` into the running file list
206
+ - Append `patterns_captured` entries to `flow/resources/pending-patterns.md`
207
+ - Log `decisions` in phase completion message
208
+ - If inline mode (no isolation), capture patterns directly per `.claude/resources/core/pattern-capture.md`
203
209
  8. **Update progress** - Mark tasks complete in plan file
204
210
  9. **Record model used** - Track which model tier was used for this phase (for the completion summary)
205
211
  10. **Continue to next phase** - NO BUILD between phases
@@ -270,6 +276,8 @@ Run `/compact` with instructions that preserve execution state:
270
276
  - After compaction, re-read the plan file and continue from the next phase
271
277
  - In autopilot mode, compact automatically without asking — this is a maintenance action, not a user decision
272
278
 
279
+ **Compaction Guide**: For detailed preserve/discard rules, see `COR-CG-2` and `COR-CG-3`. Use the summary template from `COR-CG-4` to structure your `/compact` instructions.
280
+
273
281
  ---
274
282
 
275
283
  ### Step 6: Handle Tests Phase
@@ -75,6 +75,26 @@ This skill is **strictly read-only analysis**. The review process:
75
75
  4. If `file_path` is provided, filter to only those files
76
76
  5. If `scope` is provided, filter to staged or unstaged only
77
77
 
78
+ ### Step 1b: Determine Review Depth
79
+
80
+ Determine the review mode based on changeset size. See `.claude/resources/core/review-adaptive-depth.md` for full rules.
81
+
82
+ 1. Count total lines changed (additions + deletions) from `git diff --stat`
83
+ 2. Exclude lock files, generated files, and pure whitespace changes from the count
84
+ 3. Classify into tier:
85
+ - **Small** (< 50 lines) → **Lightweight** mode
86
+ - **Medium** (50–500 lines) → **Standard** mode (no behavior change)
87
+ - **Large** (500+ lines) → **Deep** mode
88
+ 4. Display: `**Review mode**: {Lightweight|Standard|Deep} ({N} lines changed across {M} files)`
89
+
90
+ **If Lightweight**: Skip Steps 2–5 (pattern loading, similar implementations, full analysis, pattern conflicts). Perform abbreviated analysis checking ONLY security issues, obvious logic bugs, and breaking changes. Skip verification pass (Step 5b). Generate output using the lightweight template from `review-code-templates.md`.
91
+
92
+ **If Deep**: Activate multi-agent parallel review. See `.claude/resources/core/review-multi-agent.md`. Categorize files by type (Core Logic, Infrastructure, UI/Presentation, Tests), then spawn 4 specialized subagents in parallel (security, logic & bugs, performance, pattern compliance). The coordinator collects results, deduplicates overlapping findings, then proceeds to Step 5b (verification), Step 5c (re-ranking), Step 6b (pattern review), and Step 6 (output using deep template). Steps 2–5 are handled by subagents instead of the main agent.
93
+
94
+ **If Standard**: Proceed with all steps as defined below (no behavior change).
95
+
96
+ ---
97
+
78
98
  ### Step 2: Load Review Patterns
79
99
 
80
100
  1. Read `.claude/resources/patterns/review-pr-patterns.md` for general review guidelines
@@ -160,6 +180,42 @@ When a pattern conflict is found:
160
180
 
161
181
  4. **Buffer patterns for capture**: Silently append identified patterns (both good patterns and anti-patterns found during review) to `flow/resources/pending-patterns.md`. See `.claude/resources/core/pattern-capture.md` for buffer format and capture triggers.
162
182
 
183
+ ---
184
+
185
+ ### Step 5b: Verify Findings
186
+
187
+ After collecting all findings from Steps 4 and 5, run a second-pass verification to filter false positives. See `.claude/resources/core/review-verification.md` for full logic.
188
+
189
+ **For each finding**:
190
+
191
+ 1. **Re-read surrounding context** — Read 15 lines above and 15 below the flagged line
192
+ 2. **Ask 3 standard questions**:
193
+ - Is this actually a bug, or does surrounding code handle it?
194
+ - Is there a test that covers this case?
195
+ - Would a senior developer agree this is a real issue?
196
+ 3. **Ask 1 category-specific question** (security → exploit path, logic → reachability, performance → hot path, etc.)
197
+ 4. **Classify**:
198
+ - **Confirmed** — Clear issue, 2+ standard questions support it. Keep as-is.
199
+ - **Likely** — Ambiguous, 1 question supports. Tag with `[Likely]` in output.
200
+ - **Dismissed** — False positive, all questions fail. Remove from output.
201
+
202
+ **Rules**:
203
+ - When in doubt between Likely and Dismissed → choose **Likely**
204
+ - NEVER dismiss a Critical severity finding (downgrade to Likely at most)
205
+
206
+ **After verification**: Remove Dismissed findings, tag Likely findings, generate Verification Summary stats.
207
+
208
+ ### Step 5c: Re-Rank and Group Findings
209
+
210
+ After verification, re-rank all remaining findings by impact. See `.claude/resources/core/review-severity-ranking.md` for full rules.
211
+
212
+ 1. **Sort findings**: Severity (Critical → Major → Minor → Suggestion), then Confidence (Confirmed → Likely), then Fix Complexity (lower first)
213
+ 2. **Group related findings**: Scan for same issue type across files, same root cause, or causal chains. Only group when genuinely related (≥ 2 findings). Skip grouping for small reviews (1-3 findings).
214
+ 3. **Executive summary**: If total findings ≥ 5 (standard mode) or always (deep mode), prepend an executive summary with risk level and top 3 findings. Skip for lightweight mode.
215
+ 4. **Structure output by severity**: Use severity-grouped sections (Critical → Major → Minor → Suggestions) instead of per-file ordering. Omit empty severity sections.
216
+
217
+ ---
218
+
163
219
  ### Step 6b: Pattern Review
164
220
 
165
221
  After analysis but before generating the review document, run the pattern review protocol:
@@ -175,6 +231,8 @@ See `.claude/resources/core/pattern-capture.md` for the full end-of-skill review
175
231
 
176
232
  ### Step 6: Generate Review Document
177
233
 
234
+ **Important**: Only include Confirmed and Likely findings in the output. Dismissed findings are excluded. Add the Verification Summary section after the Review Summary.
235
+
178
236
  Create a markdown file in `flow/reviewed-code/` with the naming convention:
179
237
 
180
238
  ```
@@ -317,3 +375,18 @@ After running this command:
317
375
  5. **Commit changes** once review concerns are addressed
318
376
 
319
377
  > The goal is not just to review current changes, but to **improve the codebase patterns over time** by documenting good patterns and preventing anti-patterns from spreading.
378
+
379
+ ### Validation Checklist
380
+
381
+ - [ ] All changed files analyzed
382
+ - [ ] Forbidden patterns checked
383
+ - [ ] Allowed patterns verified
384
+ - [ ] Similar implementations searched
385
+ - [ ] Pattern conflicts documented
386
+ - [ ] Verification pass completed — all findings classified
387
+ - [ ] Dismissed findings removed from output
388
+ - [ ] Likely findings tagged with `[Likely]`
389
+ - [ ] Verification Summary section included
390
+ - [ ] Findings sorted by severity (Critical → Major → Minor → Suggestion)
391
+ - [ ] Related findings grouped when applicable (≥ 2 related)
392
+ - [ ] Executive summary included when ≥ 5 findings (standard) or always (deep)
@@ -162,6 +162,26 @@ After successful authentication, proceed to fetch PR information.
162
162
  2. Extract the PR title, description, and list of changed files
163
163
  3. Identify the primary language(s) used in the PR
164
164
 
165
+ ### Step 1b: Determine Review Depth
166
+
167
+ Determine the review mode based on changeset size. See `.claude/resources/core/review-adaptive-depth.md` for full rules.
168
+
169
+ 1. Count total lines changed (additions + deletions) from `gh pr diff --stat` or Azure DevOps diff API
170
+ 2. Exclude lock files, generated files, and pure whitespace changes from the count
171
+ 3. Classify into tier:
172
+ - **Small** (< 50 lines) → **Lightweight** mode
173
+ - **Medium** (50–500 lines) → **Standard** mode (no behavior change)
174
+ - **Large** (500+ lines) → **Deep** mode
175
+ 4. Display: `**Review mode**: {Lightweight|Standard|Deep} ({N} lines changed across {M} files)`
176
+
177
+ **If Lightweight**: Skip Steps 2–3 (pattern loading, full analysis). Perform abbreviated analysis checking ONLY security issues, obvious logic bugs, and breaking changes. Skip verification pass (Step 3b). Generate compact output with no Pattern Conflicts or Reference Implementations sections.
178
+
179
+ **If Deep**: Activate multi-agent parallel review. See `.claude/resources/core/review-multi-agent.md`. Categorize files by type (Core Logic, Infrastructure, UI/Presentation, Tests), then spawn 4 specialized subagents in parallel (security, logic & bugs, performance, pattern compliance). The coordinator collects results, deduplicates overlapping findings, then proceeds to Step 3b (verification), Step 3c (re-ranking), and Step 4 (output using deep template with severity grouping and executive summary). Steps 2–3 are handled by subagents instead of the main agent.
180
+
181
+ **If Standard**: Proceed with all steps as defined below (no behavior change).
182
+
183
+ ---
184
+
165
185
  ### Step 2: Load Review Patterns
166
186
 
167
187
  1. Read `.claude/resources/patterns/review-pr-patterns.md` for general review guidelines
@@ -182,8 +202,46 @@ For each file in the PR:
182
202
  4. Apply language-specific checks
183
203
  5. Identify security, performance, and maintainability concerns
184
204
 
205
+ ---
206
+
207
+ ### Step 3b: Verify Findings
208
+
209
+ After collecting all findings from Step 3, run a second-pass verification to filter false positives. See `.claude/resources/core/review-verification.md` for full logic.
210
+
211
+ **For each finding**:
212
+
213
+ 1. **Re-read surrounding context** — Read 15 lines above and 15 below the flagged line
214
+ 2. **Ask 3 standard questions**:
215
+ - Is this actually a bug, or does surrounding code handle it?
216
+ - Is there a test that covers this case?
217
+ - Would a senior developer agree this is a real issue?
218
+ 3. **Ask 1 category-specific question** (security → exploit path, logic → reachability, performance → hot path, etc.)
219
+ 4. **Classify**:
220
+ - **Confirmed** — Clear issue, 2+ standard questions support it. Keep as-is.
221
+ - **Likely** — Ambiguous, 1 question supports. Tag with `[Likely]` in output.
222
+ - **Dismissed** — False positive, all questions fail. Remove from output.
223
+
224
+ **Rules**:
225
+ - When in doubt between Likely and Dismissed → choose **Likely**
226
+ - NEVER dismiss a Critical severity finding (downgrade to Likely at most)
227
+
228
+ **After verification**: Remove Dismissed findings, tag Likely findings, generate Verification Summary stats.
229
+
230
+ ### Step 3c: Re-Rank and Group Findings
231
+
232
+ After verification, re-rank all remaining findings by impact. See `.claude/resources/core/review-severity-ranking.md` for full rules.
233
+
234
+ 1. **Sort findings**: Severity (Critical → Major → Minor → Suggestion), then Confidence (Confirmed → Likely), then Fix Complexity (lower first)
235
+ 2. **Group related findings**: Scan for same issue type across files, same root cause, or causal chains. Only group when genuinely related (≥ 2 findings). Skip grouping for small reviews (1-3 findings).
236
+ 3. **Executive summary**: If total findings ≥ 5 (standard mode) or always (deep mode), prepend an executive summary with risk level and top 3 findings. Skip for lightweight mode.
237
+ 4. **Structure output by severity**: Use severity-grouped sections (Critical → Major → Minor → Suggestions) instead of per-file ordering. Omit empty severity sections.
238
+
239
+ ---
240
+
185
241
  ### Step 4: Generate or Update Review Document
186
242
 
243
+ **Important**: Only include Confirmed and Likely findings in the output. Dismissed findings are excluded. Add the Verification Summary section after the Review Summary.
244
+
187
245
  **Check for existing review file** in `flow/reviewed-pr/` before creating a new one.
188
246
 
189
247
  #### If reviewing the same PR again:
package/README.md CHANGED
@@ -75,11 +75,11 @@ Installs for Claude Code, Cursor, OpenClaw, and Codex CLI simultaneously.
75
75
  | `/create-plan` | Create implementation plan with phases |
76
76
  | `/execute-plan` | Execute plan phases with verification |
77
77
  | `/create-contract` | Create integration contract from API docs |
78
- | `/review-code` | Review local uncommitted changes |
79
- | `/review-pr` | Review a Pull Request |
78
+ | `/review-code` | Review local uncommitted changes (adaptive depth + multi-agent) |
79
+ | `/review-pr` | Review a Pull Request (adaptive depth + multi-agent) |
80
80
  | `/write-tests` | Generate tests for coverage target |
81
81
  | `/flow` | Configure plan-flow settings (autopilot, git control, runtime options) |
82
- | `/brain` | Capture meeting notes, ideas, brainstorms |
82
+ | `/note` | Capture meeting notes, ideas, brainstorms |
83
83
  | `/learn` | Extract reusable patterns or learn a topic step-by-step |
84
84
  | `/pattern-validate` | Scan and index global brain patterns |
85
85
  | `/heartbeat` | Manage scheduled automated tasks |
@@ -209,6 +209,41 @@ Tasks with `in {N} hours/minutes` schedules run once and auto-disable after exec
209
209
 
210
210
  If a task fails because a Claude Code session is already active, the daemon retries up to 5 times at 60-second intervals instead of failing permanently.
211
211
 
212
+ ## Code Review
213
+
214
+ `/review-code` and `/review-pr` include three layers of intelligence:
215
+
216
+ ### Adaptive Depth
217
+
218
+ Review depth scales automatically based on changeset size:
219
+
220
+ | Lines Changed | Mode | Behavior |
221
+ |--------------|------|----------|
222
+ | < 50 | Lightweight | Quick-scan for security, logic bugs, and breaking changes only |
223
+ | 50–500 | Standard | Full review with pattern matching and similar implementation search |
224
+ | 500+ | Deep | Multi-pass review with file categorization, executive summary, and multi-agent analysis |
225
+
226
+ ### Verification Pass
227
+
228
+ Every finding goes through a second-pass verification that re-reads surrounding context and asks structured questions to classify findings as Confirmed, Likely, or Dismissed. False positives are filtered before output.
229
+
230
+ ### Severity Re-Ranking
231
+
232
+ Findings are sorted by impact (Critical > Major > Minor > Suggestion), related findings across files are grouped, and an executive summary is added when there are 5+ findings.
233
+
234
+ ### Multi-Agent Parallel Review
235
+
236
+ In Deep mode (500+ lines), the review is split into 4 specialized subagents running in parallel:
237
+
238
+ | Agent | Focus | Model |
239
+ |-------|-------|-------|
240
+ | Security | Vulnerabilities, secrets, injection, auth bypass | sonnet |
241
+ | Logic & Bugs | Edge cases, null handling, race conditions | sonnet |
242
+ | Performance | N+1 queries, memory leaks, blocking I/O | sonnet |
243
+ | Pattern Compliance | Forbidden/allowed patterns, naming consistency | haiku |
244
+
245
+ The coordinator merges results, deduplicates overlapping findings, then runs verification and re-ranking.
246
+
212
247
  ## Complexity Scoring
213
248
 
214
249
  Every plan phase has a complexity score (0-10):
@@ -1 +1 @@
1
- {"version":3,"file":"heartbeat.js","sourceRoot":"","sources":["../../../src/cli/commands/heartbeat.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,UAAU,EAAE,YAAY,EAAiB,UAAU,EAAE,MAAM,SAAS,CAAC;AAC9E,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,KAAK,GAAG,MAAM,oBAAoB,CAAC;AAE1C,MAAM,UAAU,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAClD,MAAM,SAAS,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;AAEtC,SAAS,UAAU,CAAC,MAAc;IAChC,OAAO,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,gBAAgB,CAAC,CAAC;AAChD,CAAC;AAED,SAAS,aAAa;IACpB,OAAO,IAAI,CAAC,SAAS,EAAE,IAAI,EAAE,QAAQ,EAAE,qBAAqB,CAAC,CAAC;AAChE,CAAC;AAED,SAAS,gBAAgB,CAAC,GAAW;IACnC,IAAI,C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