planflow-ai 1.2.0 → 1.3.2
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/brainstorm.md +228 -0
- package/.claude/commands/discovery-plan.md +25 -1
- package/.claude/commands/execute-plan.md +35 -0
- package/.claude/commands/flow.md +36 -3
- package/.claude/commands/heartbeat.md +1 -1
- package/.claude/commands/learn.md +1 -1
- package/.claude/commands/{brain.md → note.md} +12 -12
- package/.claude/commands/review-code.md +63 -0
- package/.claude/commands/review-pr.md +53 -0
- package/.claude/resources/core/_index.md +85 -2
- package/.claude/resources/core/design-awareness.md +400 -0
- package/.claude/resources/core/model-routing.md +116 -0
- package/.claude/resources/core/pattern-capture.md +227 -0
- package/.claude/resources/core/resource-capture.md +1 -1
- package/.claude/resources/core/review-adaptive-depth.md +217 -0
- package/.claude/resources/core/review-multi-agent.md +289 -0
- package/.claude/resources/core/review-severity-ranking.md +149 -0
- package/.claude/resources/core/review-verification.md +158 -0
- package/.claude/resources/patterns/_index.md +11 -1
- package/.claude/resources/patterns/brainstorm-templates.md +132 -0
- package/.claude/resources/patterns/discovery-templates.md +44 -0
- package/.claude/resources/patterns/review-code-templates.md +315 -2
- package/.claude/resources/skills/_index.md +37 -2
- package/.claude/resources/skills/brain-skill.md +3 -3
- package/.claude/resources/skills/brainstorm-skill.md +284 -0
- package/.claude/resources/skills/discovery-skill.md +38 -4
- package/.claude/resources/skills/execute-plan-skill.md +66 -4
- package/.claude/resources/skills/flow-cost.md +153 -0
- package/.claude/resources/skills/review-code-skill.md +89 -1
- package/.claude/resources/skills/review-pr-skill.md +58 -0
- package/.claude/rules/core/allowed-patterns.md +6 -0
- package/.claude/rules/core/forbidden-patterns.md +6 -0
- package/README.md +38 -3
- package/dist/cli/daemon/heartbeat-daemon.js +7 -2
- package/dist/cli/daemon/heartbeat-daemon.js.map +1 -1
- package/dist/cli/handlers/claude.d.ts.map +1 -1
- package/dist/cli/handlers/claude.js +138 -2
- package/dist/cli/handlers/claude.js.map +1 -1
- package/dist/cli/handlers/shared.d.ts.map +1 -1
- package/dist/cli/handlers/shared.js +2 -1
- package/dist/cli/handlers/shared.js.map +1 -1
- package/dist/cli/index.js +0 -0
- package/package.json +1 -1
- package/rules/skills/brain-skill.mdc +4 -4
- package/skills/plan-flow/SKILL.md +1 -1
- package/skills/plan-flow/brain/SKILL.md +1 -1
- package/templates/shared/AGENTS.md.template +1 -1
- package/templates/shared/CLAUDE.md.template +28 -11
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Free-form conversational exploration of an idea. The LLM collaborates one-question-at-a-time to crystallize vague ideas before discovery. Optionally generates an MD file for /discovery-plan.
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Brainstorm
|
|
6
|
+
|
|
7
|
+
## Command Description
|
|
8
|
+
|
|
9
|
+
This command starts a free-form brainstorm session where the LLM collaborates conversationally to explore an idea. Unlike `/discovery-plan` (structured, project-aware), brainstorm is pure ideation — exploring the what and why through rapid back-and-forth dialogue.
|
|
10
|
+
|
|
11
|
+
**Output**: Conversational exploration, plus an optional markdown file at `flow/brainstorms/brainstorm_{topic}_v{version}.md`
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
## Help
|
|
17
|
+
|
|
18
|
+
**If the user invokes this command with `-help`, display only this section and stop:**
|
|
19
|
+
|
|
20
|
+
```
|
|
21
|
+
/brainstorm - Collaborative Idea Exploration
|
|
22
|
+
|
|
23
|
+
DESCRIPTION:
|
|
24
|
+
Free-form brainstorm session where the LLM acts as a collaborative
|
|
25
|
+
thinking partner. Explores ideas through one-question-at-a-time dialogue
|
|
26
|
+
before formalizing into discovery.
|
|
27
|
+
|
|
28
|
+
USAGE:
|
|
29
|
+
/brainstorm <idea>
|
|
30
|
+
/brainstorm -help
|
|
31
|
+
|
|
32
|
+
ARGUMENTS:
|
|
33
|
+
idea Free-text description of the idea to explore
|
|
34
|
+
|
|
35
|
+
EXAMPLES:
|
|
36
|
+
/brainstorm I want to add a plugin system to plan-flow
|
|
37
|
+
/brainstorm "Real-time notifications triggered by user actions"
|
|
38
|
+
/brainstorm We need a better way to handle error recovery in the API
|
|
39
|
+
|
|
40
|
+
OUTPUT:
|
|
41
|
+
- Conversational exploration of the idea
|
|
42
|
+
- Optional: flow/brainstorms/brainstorm_{topic}_v{version}.md
|
|
43
|
+
- Optional: tasklist entry (only if requested)
|
|
44
|
+
|
|
45
|
+
WORKFLOW:
|
|
46
|
+
1. You share your idea
|
|
47
|
+
2. LLM presents batched questions with options (3-4 per round, with recommended choices)
|
|
48
|
+
3. You pick options or type custom answers, LLM reacts with insights
|
|
49
|
+
4. You say "done" / "wrap up" / "summarize" when ready
|
|
50
|
+
5. LLM presents structured summary
|
|
51
|
+
6. Optionally generates MD file for /discovery-plan
|
|
52
|
+
7. Optionally adds to tasklist
|
|
53
|
+
|
|
54
|
+
WHAT IT IS:
|
|
55
|
+
- A thinking partner — challenges, suggests, connects, presents structured options
|
|
56
|
+
- Pure ideation — explores the what and why
|
|
57
|
+
- Lightweight — no brain, no memory, no auto-tasklist
|
|
58
|
+
|
|
59
|
+
WHAT IT IS NOT:
|
|
60
|
+
- Not /discovery-plan — no codebase scanning, no requirements docs
|
|
61
|
+
- Not /note — no knowledge capture, no wiki-links
|
|
62
|
+
- Not a plan — no phases, no complexity scores
|
|
63
|
+
|
|
64
|
+
RECOMMENDED MODEL:
|
|
65
|
+
Claude Opus 4.6 or Sonnet 4.5 for best results
|
|
66
|
+
|
|
67
|
+
RELATED COMMANDS:
|
|
68
|
+
/discovery-plan Ground the brainstorm idea into the project
|
|
69
|
+
/create-plan Create plan from discovery document
|
|
70
|
+
/note Capture knowledge (different purpose)
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
---
|
|
74
|
+
|
|
75
|
+
## Critical Rules
|
|
76
|
+
|
|
77
|
+
| Rule | Description |
|
|
78
|
+
|------|-------------|
|
|
79
|
+
| **Structured Exploration** | Questions in batches of 3-4 with options via `AskUserQuestion`. Commentary between batches. |
|
|
80
|
+
| **No Code** | NEVER write, edit, or generate source code |
|
|
81
|
+
| **No Brain** | Do NOT write to `flow/brain/` or update brain index |
|
|
82
|
+
| **No Memory** | Do NOT write to `flow/memory.md` |
|
|
83
|
+
| **No Auto-Tasklist** | Only update tasklist if user explicitly requests |
|
|
84
|
+
| **Codebase on Request** | Only read codebase files when user explicitly asks |
|
|
85
|
+
| **User Ends It** | Never auto-end the brainstorm. User controls when it's done. |
|
|
86
|
+
| **Complete and Stop** | After completion, STOP and wait for user |
|
|
87
|
+
|
|
88
|
+
---
|
|
89
|
+
|
|
90
|
+
## Instructions
|
|
91
|
+
|
|
92
|
+
### Step 1: Validate Inputs
|
|
93
|
+
|
|
94
|
+
| Input | Required | Description |
|
|
95
|
+
|-------|----------|-------------|
|
|
96
|
+
| `idea` | Yes | Free-text description of the idea to explore |
|
|
97
|
+
|
|
98
|
+
If no idea is provided, ask:
|
|
99
|
+
|
|
100
|
+
```markdown
|
|
101
|
+
What idea would you like to explore? Just describe it in your own words —
|
|
102
|
+
it can be as vague or specific as you want.
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
---
|
|
106
|
+
|
|
107
|
+
### Step 2: Check for Existing Brainstorms
|
|
108
|
+
|
|
109
|
+
Check `flow/brainstorms/` for existing brainstorm documents on a similar topic:
|
|
110
|
+
|
|
111
|
+
1. If found, mention it: "There's an existing brainstorm on {topic} (v{N}). Want to build on that or start fresh?"
|
|
112
|
+
2. If starting fresh, increment version number
|
|
113
|
+
3. If building on existing, read it first for context
|
|
114
|
+
|
|
115
|
+
---
|
|
116
|
+
|
|
117
|
+
### Step 3: Invoke Brainstorm Skill
|
|
118
|
+
|
|
119
|
+
The skill will:
|
|
120
|
+
|
|
121
|
+
1. Parse the idea and open the conversation
|
|
122
|
+
2. Run the conversational loop (one question per turn)
|
|
123
|
+
3. Detect when the user wants to end
|
|
124
|
+
4. Present a structured summary
|
|
125
|
+
5. Offer to generate an MD file
|
|
126
|
+
6. Offer to add a tasklist entry
|
|
127
|
+
|
|
128
|
+
See: `.claude/resources/skills/brainstorm-skill.md`
|
|
129
|
+
|
|
130
|
+
---
|
|
131
|
+
|
|
132
|
+
### Step 4: Handle Completion
|
|
133
|
+
|
|
134
|
+
After the skill completes:
|
|
135
|
+
|
|
136
|
+
- If MD file was generated: report the file path
|
|
137
|
+
- If no MD file: just acknowledge completion
|
|
138
|
+
- Do NOT auto-chain to `/discovery-plan`
|
|
139
|
+
|
|
140
|
+
---
|
|
141
|
+
|
|
142
|
+
## Flow Diagram
|
|
143
|
+
|
|
144
|
+
```
|
|
145
|
+
+------------------------------------------+
|
|
146
|
+
| /brainstorm COMMAND |
|
|
147
|
+
+------------------------------------------+
|
|
148
|
+
|
|
|
149
|
+
v
|
|
150
|
+
+------------------------------------------+
|
|
151
|
+
| Step 1: Validate Inputs |
|
|
152
|
+
| - Check for idea text |
|
|
153
|
+
| - Ask if not provided |
|
|
154
|
+
+------------------------------------------+
|
|
155
|
+
|
|
|
156
|
+
v
|
|
157
|
+
+------------------------------------------+
|
|
158
|
+
| Step 2: Check Existing Brainstorms |
|
|
159
|
+
| - Look in flow/brainstorms/ |
|
|
160
|
+
| - Offer to build on or start fresh |
|
|
161
|
+
+------------------------------------------+
|
|
162
|
+
|
|
|
163
|
+
v
|
|
164
|
+
+------------------------------------------+
|
|
165
|
+
| Step 3: Invoke Brainstorm Skill |
|
|
166
|
+
| - Conversational loop |
|
|
167
|
+
| - One question per turn |
|
|
168
|
+
| - Silent thread tracking |
|
|
169
|
+
| - See brainstorm-skill.md |
|
|
170
|
+
+------------------------------------------+
|
|
171
|
+
|
|
|
172
|
+
v
|
|
173
|
+
+------------------------------------------+
|
|
174
|
+
| Step 4: Handle Completion |
|
|
175
|
+
| - Summary presented |
|
|
176
|
+
| - Optional MD file generated |
|
|
177
|
+
| - Optional tasklist entry |
|
|
178
|
+
| - STOP (no auto-chain) |
|
|
179
|
+
+------------------------------------------+
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
---
|
|
183
|
+
|
|
184
|
+
## Context Optimization
|
|
185
|
+
|
|
186
|
+
### Recommended Loading Order
|
|
187
|
+
|
|
188
|
+
1. **Always load first**: This command file (`commands/brainstorm.md`)
|
|
189
|
+
2. **Expand on-demand**: Load skill file when entering conversational loop
|
|
190
|
+
|
|
191
|
+
### Reference Codes for Brainstorm
|
|
192
|
+
|
|
193
|
+
| Code | Description | When to Expand |
|
|
194
|
+
|------|-------------|----------------|
|
|
195
|
+
| SKL-BS-1 | Brainstorm skill restrictions and inputs | Understanding allowed actions |
|
|
196
|
+
| SKL-BS-2 | Conversational loop and tracking | During the brainstorm |
|
|
197
|
+
| SKL-BS-3 | End detection, summary, and output | When wrapping up |
|
|
198
|
+
|
|
199
|
+
---
|
|
200
|
+
|
|
201
|
+
## Related Resources
|
|
202
|
+
|
|
203
|
+
| Resource | Purpose |
|
|
204
|
+
|----------|---------|
|
|
205
|
+
| `resources/skills/_index.md` | Index of skills with reference codes |
|
|
206
|
+
| `brainstorm-skill.md` | Skill that runs the brainstorm |
|
|
207
|
+
| `brainstorm-templates.md` | Output file template |
|
|
208
|
+
| `/discovery-plan` command | Next step after brainstorm |
|
|
209
|
+
|
|
210
|
+
---
|
|
211
|
+
|
|
212
|
+
## Resource Capture
|
|
213
|
+
|
|
214
|
+
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.
|
|
215
|
+
|
|
216
|
+
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/`?"
|
|
217
|
+
|
|
218
|
+
Only save if the user approves. Do not re-ask if declined.
|
|
219
|
+
|
|
220
|
+
---
|
|
221
|
+
|
|
222
|
+
## Pattern Capture
|
|
223
|
+
|
|
224
|
+
During the brainstorm, silently watch for conventions, anti-patterns, and patterns that emerge from the discussion. Append captured patterns to `flow/resources/pending-patterns.md` without interrupting the conversation.
|
|
225
|
+
|
|
226
|
+
After the brainstorm completes, present any buffered patterns for user approval. Approved patterns are written to `.claude/rules/core/allowed-patterns.md` or `.claude/rules/core/forbidden-patterns.md`.
|
|
227
|
+
|
|
228
|
+
See `.claude/resources/core/pattern-capture.md` for buffer format, capture triggers, conflict detection, and the full review protocol.
|
|
@@ -55,6 +55,7 @@ EXAMPLES:
|
|
|
55
55
|
/discovery-plan @flow/contracts/api_contract.md
|
|
56
56
|
/discovery-plan "User authentication with OAuth2"
|
|
57
57
|
/discovery-plan @docs/feature-spec.md "Focus on the payment flow"
|
|
58
|
+
/discovery-plan @flow/brainstorms/brainstorm_plugin-system_v1.md
|
|
58
59
|
|
|
59
60
|
OUTPUT:
|
|
60
61
|
Creates: flow/discovery/discovery_<feature_name>_v<version>.md
|
|
@@ -145,9 +146,14 @@ Check `flow/discovery/` for existing discovery documents for this feature:
|
|
|
145
146
|
|
|
146
147
|
### Step 4: Invoke Discovery Skill
|
|
147
148
|
|
|
149
|
+
**Brainstorm files as input**: If the reference document is a brainstorm file (`flow/brainstorms/brainstorm_*.md`), the skill should:
|
|
150
|
+
- Treat "Resolved During Brainstorm" decisions as settled — do NOT re-ask
|
|
151
|
+
- Use "Still Open (Discovery Should Investigate)" as starting investigation points
|
|
152
|
+
- Respect "Rejected (Do Not Revisit)" — do NOT re-propose these alternatives
|
|
153
|
+
|
|
148
154
|
The skill will:
|
|
149
155
|
|
|
150
|
-
1. Read all referenced documents
|
|
156
|
+
1. Read all referenced documents (including brainstorm files)
|
|
151
157
|
2. Find all related code references in the codebase
|
|
152
158
|
3. Ask clarifying questions via Interactive Questions Tool
|
|
153
159
|
4. Track question status
|
|
@@ -380,3 +386,21 @@ During this skill's execution, watch for valuable reference materials worth pres
|
|
|
380
386
|
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/`?"
|
|
381
387
|
|
|
382
388
|
Only save if the user approves. Do not re-ask if declined.
|
|
389
|
+
|
|
390
|
+
---
|
|
391
|
+
|
|
392
|
+
## Design Awareness
|
|
393
|
+
|
|
394
|
+
During discovery, always ask whether the feature involves UI work. If confirmed, follow the design question flow to capture structured design tokens (colors, typography, spacing, component patterns) into a `## Design Context` section in the discovery document.
|
|
395
|
+
|
|
396
|
+
See `.claude/resources/core/design-awareness.md` for the full question flow, personality options, token extraction rules, and Design Context template.
|
|
397
|
+
|
|
398
|
+
---
|
|
399
|
+
|
|
400
|
+
## Pattern Capture
|
|
401
|
+
|
|
402
|
+
During discovery, silently watch for conventions found in existing code, anti-patterns in referenced documents, and patterns identified during technical analysis. Append captured patterns to `flow/resources/pending-patterns.md` without interrupting work.
|
|
403
|
+
|
|
404
|
+
After generating the discovery document, present any buffered patterns for user approval. Approved patterns are written to `.claude/rules/core/allowed-patterns.md` or `.claude/rules/core/forbidden-patterns.md`.
|
|
405
|
+
|
|
406
|
+
See `.claude/resources/core/pattern-capture.md` for buffer format, capture triggers, conflict detection, and the full review protocol.
|
|
@@ -85,6 +85,7 @@ RELATED COMMANDS:
|
|
|
85
85
|
| ------------------------ | -------------------------------------------------------- |
|
|
86
86
|
| **Build ONLY at End** | Do NOT run build after each phase - only at the very end |
|
|
87
87
|
| **No Direct DB/ORM** | NEVER run ORM or database commands directly |
|
|
88
|
+
| **Compact at Boundaries**| After each phase, if context is heavy, run `/compact` with execution state (see Step 5b in skill) |
|
|
88
89
|
| **Complete and Stop** | After execution, STOP and wait for user (unless autopilot ON) |
|
|
89
90
|
|
|
90
91
|
---
|
|
@@ -430,3 +431,37 @@ At natural break points, if you encounter information that could be useful for f
|
|
|
430
431
|
|
|
431
432
|
Only save if the user approves. Do not re-ask if declined.
|
|
432
433
|
|
|
434
|
+
---
|
|
435
|
+
|
|
436
|
+
## Pattern Capture
|
|
437
|
+
|
|
438
|
+
During execution, silently watch for recurring conventions, anti-patterns, workarounds, and user corrections. Append captured patterns to `flow/resources/pending-patterns.md` without interrupting work.
|
|
439
|
+
|
|
440
|
+
After all phases complete (before brain-capture), present any buffered patterns for user approval. Approved patterns are written to `.claude/rules/core/allowed-patterns.md` or `.claude/rules/core/forbidden-patterns.md`.
|
|
441
|
+
|
|
442
|
+
See `.claude/resources/core/pattern-capture.md` for buffer format, capture triggers, conflict detection, and the full review protocol.
|
|
443
|
+
|
|
444
|
+
---
|
|
445
|
+
|
|
446
|
+
## Design Awareness
|
|
447
|
+
|
|
448
|
+
During execution, when a phase involves UI work and the discovery document contains a `## Design Context` section, auto-inject the design tokens into the phase implementation prompt. This ensures UI phases follow the established design system.
|
|
449
|
+
|
|
450
|
+
See `.claude/resources/core/design-awareness.md` for UI phase detection heuristics and injection rules.
|
|
451
|
+
|
|
452
|
+
---
|
|
453
|
+
|
|
454
|
+
## Model Routing
|
|
455
|
+
|
|
456
|
+
When `model_routing: true` in `flow/.flowconfig` (default), each phase is automatically routed to the most cost-effective model based on its complexity score:
|
|
457
|
+
|
|
458
|
+
| Complexity | Tier | Claude Code Model |
|
|
459
|
+
|-----------|------|-------------------|
|
|
460
|
+
| 0-3 | Fast | haiku |
|
|
461
|
+
| 4-5 | Standard | sonnet |
|
|
462
|
+
| 6-10 | Powerful | opus |
|
|
463
|
+
|
|
464
|
+
Routing happens at Step 4 of the execution skill — the phase implementation is spawned as an Agent subagent with the appropriate `model` parameter. Planning/approval steps always use the session model.
|
|
465
|
+
|
|
466
|
+
Disable with `/flow model_routing=false`. See `.claude/resources/core/model-routing.md` for full tier table, platform mappings, and aggregation rules.
|
|
467
|
+
|
package/.claude/commands/flow.md
CHANGED
|
@@ -29,6 +29,7 @@ DESCRIPTION:
|
|
|
29
29
|
USAGE:
|
|
30
30
|
/flow <key>=<value> [key=value ...] Set one or more settings
|
|
31
31
|
/flow <prompt> Enable autopilot and start flow with prompt
|
|
32
|
+
/flow cost [--today|--week|--month] Show token usage and cost report
|
|
32
33
|
/flow -status Show all current settings
|
|
33
34
|
/flow -reset Reset all settings to defaults
|
|
34
35
|
/flow -help Show this help
|
|
@@ -38,6 +39,16 @@ SETTINGS:
|
|
|
38
39
|
commit=true|false Auto-commit after each completed phase (default: false)
|
|
39
40
|
push=true|false Auto-push after all phases + build/test pass (default: false)
|
|
40
41
|
branch=<name> Target branch for git operations (default: current branch)
|
|
42
|
+
model_routing=true|false Auto-select model per phase based on complexity (default: true)
|
|
43
|
+
|
|
44
|
+
COST REPORTING:
|
|
45
|
+
/flow cost Last 7 days summary (default)
|
|
46
|
+
/flow cost --today Today's usage only
|
|
47
|
+
/flow cost --week Last 7 days
|
|
48
|
+
/flow cost --month Last 30 days
|
|
49
|
+
/flow cost --project <name> Filter by project name
|
|
50
|
+
/flow cost --session <id> Show single session detail
|
|
51
|
+
/flow cost --detail Include model breakdown
|
|
41
52
|
|
|
42
53
|
EXAMPLES:
|
|
43
54
|
/flow autopilot=true # Enable autopilot
|
|
@@ -45,6 +56,9 @@ EXAMPLES:
|
|
|
45
56
|
/flow autopilot=true commit=true # Enable both
|
|
46
57
|
/flow branch=development # Set target branch
|
|
47
58
|
/flow commit=false push=false # Disable git control
|
|
59
|
+
/flow model_routing=false # Disable model routing (use session model for all phases)
|
|
60
|
+
/flow cost # Show cost report (last 7 days)
|
|
61
|
+
/flow cost --today --detail # Today's costs with model breakdown
|
|
48
62
|
/flow -status # Show current config
|
|
49
63
|
/flow -reset # Reset everything
|
|
50
64
|
|
|
@@ -82,9 +96,10 @@ CONFIG FILE:
|
|
|
82
96
|
|
|
83
97
|
Parse the user input to determine what action to take:
|
|
84
98
|
|
|
85
|
-
1. **
|
|
86
|
-
2. **
|
|
87
|
-
3. **
|
|
99
|
+
1. **Check for `cost` subcommand**: If input starts with `cost`, route to cost reporting (see Step 6)
|
|
100
|
+
2. **Scan for `key=value` pairs**: Extract all `key=value` tokens from the input
|
|
101
|
+
3. **Check for flags**: `-status`, `-reset`, `-help`
|
|
102
|
+
4. **Remaining text**: Anything left after extracting keys and flags is a prompt
|
|
88
103
|
|
|
89
104
|
**Valid keys**:
|
|
90
105
|
|
|
@@ -94,6 +109,7 @@ Parse the user input to determine what action to take:
|
|
|
94
109
|
| `commit` | `true`, `false` | `false` | Auto-commit after each phase |
|
|
95
110
|
| `push` | `true`, `false` | `false` | Auto-push after completion |
|
|
96
111
|
| `branch` | any string | current branch | Target branch for git ops |
|
|
112
|
+
| `model_routing` | `true`, `false` | `true` | Auto-select model per phase based on complexity |
|
|
97
113
|
|
|
98
114
|
---
|
|
99
115
|
|
|
@@ -184,6 +200,23 @@ This is a **feature request with autopilot**:
|
|
|
184
200
|
|
|
185
201
|
---
|
|
186
202
|
|
|
203
|
+
### Step 6: Cost Reporting (`/flow cost`)
|
|
204
|
+
|
|
205
|
+
If the input starts with `cost`, route to the cost reporting flow:
|
|
206
|
+
|
|
207
|
+
1. **Load the skill**: Read `.claude/resources/skills/flow-cost.md` for full implementation details
|
|
208
|
+
2. **Parse cost flags**: `--today`, `--week`, `--month`, `--project <name>`, `--session <id>`, `--detail`
|
|
209
|
+
3. **Read metrics file**: `~/.claude/metrics/costs.jsonl`
|
|
210
|
+
4. **Filter and aggregate**: Apply time/project/session filters, group by project
|
|
211
|
+
5. **Display summary table**: Format tokens (K/M), costs ($X.XX), present as markdown table
|
|
212
|
+
6. **STOP**: After showing the report, wait for user input
|
|
213
|
+
|
|
214
|
+
**Default behavior** (no flags): Show last 7 days summary grouped by project.
|
|
215
|
+
|
|
216
|
+
See `.claude/resources/skills/flow-cost.md` for detailed formatting rules and examples.
|
|
217
|
+
|
|
218
|
+
---
|
|
219
|
+
|
|
187
220
|
## Critical Rules
|
|
188
221
|
|
|
189
222
|
| Rule | Description |
|
|
@@ -81,7 +81,7 @@ TEACHING MODE (/learn about <topic>):
|
|
|
81
81
|
Index: ~/plan-flow/brain/learns/_index.md (LRN-* codes)
|
|
82
82
|
|
|
83
83
|
RELATED COMMANDS:
|
|
84
|
-
/
|
|
84
|
+
/note Capture meeting notes, ideas, brainstorms
|
|
85
85
|
/setup Generate project pattern files
|
|
86
86
|
/review-code Review local uncommitted changes
|
|
87
87
|
```
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
---
|
|
2
|
-
description: Manual
|
|
2
|
+
description: Manual note entry - capture meeting notes, ideas, brainstorms, and insights into the project brain
|
|
3
3
|
---
|
|
4
4
|
|
|
5
|
-
#
|
|
5
|
+
# Note: Manual Knowledge Capture
|
|
6
6
|
|
|
7
7
|
## Command Description
|
|
8
8
|
|
|
@@ -18,25 +18,25 @@ This command allows manual brain entries for capturing meeting notes, brainstorm
|
|
|
18
18
|
**If the user invokes this command with `-help`, display only this section and stop:**
|
|
19
19
|
|
|
20
20
|
```
|
|
21
|
-
/
|
|
21
|
+
/note - Manual Brain Entry
|
|
22
22
|
|
|
23
23
|
DESCRIPTION:
|
|
24
24
|
Capture meeting notes, brainstorms, ideas, and insights into the
|
|
25
25
|
project brain. Creates Obsidian-compatible markdown with [[wiki-links]].
|
|
26
26
|
|
|
27
27
|
USAGE:
|
|
28
|
-
/
|
|
29
|
-
/
|
|
30
|
-
/
|
|
28
|
+
/note <free text> Free-text mode (default)
|
|
29
|
+
/note -guided Guided mode with structured questions
|
|
30
|
+
/note -help Show this help
|
|
31
31
|
|
|
32
32
|
ARGUMENTS:
|
|
33
33
|
free text Unstructured text to parse and categorize
|
|
34
34
|
-guided Triggers structured question mode
|
|
35
35
|
|
|
36
36
|
EXAMPLES:
|
|
37
|
-
/
|
|
38
|
-
/
|
|
39
|
-
/
|
|
37
|
+
/note Had a call with the team about auth flow. Decision: use JWT with refresh tokens.
|
|
38
|
+
/note Discovered that the API rate limits at 100 req/min. Need to add throttling.
|
|
39
|
+
/note -guided
|
|
40
40
|
|
|
41
41
|
OUTPUT:
|
|
42
42
|
- Writes to appropriate flow/brain/ subdirectory
|
|
@@ -90,7 +90,7 @@ If no content and no `-guided` flag, ask:
|
|
|
90
90
|
```markdown
|
|
91
91
|
What would you like to capture? You can:
|
|
92
92
|
1. Type free text and I'll categorize it automatically
|
|
93
|
-
2. Use `/
|
|
93
|
+
2. Use `/note -guided` for structured prompts
|
|
94
94
|
```
|
|
95
95
|
|
|
96
96
|
---
|
|
@@ -175,7 +175,7 @@ Brain entry captured!
|
|
|
175
175
|
|
|
176
176
|
```
|
|
177
177
|
+------------------------------------------+
|
|
178
|
-
| /
|
|
178
|
+
| /note COMMAND |
|
|
179
179
|
+------------------------------------------+
|
|
180
180
|
|
|
|
181
181
|
v
|
|
@@ -214,7 +214,7 @@ Brain entry captured!
|
|
|
214
214
|
|
|
215
215
|
### Recommended Loading Order
|
|
216
216
|
|
|
217
|
-
1. **Always load first**: This command file (`commands/
|
|
217
|
+
1. **Always load first**: This command file (`commands/note.md`)
|
|
218
218
|
2. **Load indexes**: Load `_index.md` files for relevant folders
|
|
219
219
|
3. **Expand on-demand**: Use reference codes to load specific sections when needed
|
|
220
220
|
|
|
@@ -46,6 +46,11 @@ WORKFLOW:
|
|
|
46
46
|
4. Compares against existing patterns
|
|
47
47
|
5. Generates review document with findings
|
|
48
48
|
|
|
49
|
+
ADAPTIVE DEPTH:
|
|
50
|
+
< 50 lines Lightweight (security, logic bugs, breaking changes only)
|
|
51
|
+
50-500 lines Standard (full review)
|
|
52
|
+
500+ lines Deep (multi-pass, severity-grouped, executive summary)
|
|
53
|
+
|
|
49
54
|
REVIEW CATEGORIES:
|
|
50
55
|
- Pattern compliance
|
|
51
56
|
- Code quality issues
|
|
@@ -149,6 +154,13 @@ This command uses hierarchical context loading to reduce context consumption. In
|
|
|
149
154
|
| PTN-REV-1 | Review document structure | Creating review output |
|
|
150
155
|
| COR-AP-1 | Allowed patterns overview | Checking pattern compliance |
|
|
151
156
|
| COR-FP-1 | Forbidden patterns overview | Identifying anti-patterns |
|
|
157
|
+
| COR-MA-1 | Multi-agent subagent definitions | Deep mode parallel review setup |
|
|
158
|
+
| COR-MA-2 | Coordinator dedup and merge | Deep mode result processing |
|
|
159
|
+
| COR-SR-1 | Severity re-ranking algorithm | Ordering findings by impact |
|
|
160
|
+
| COR-SR-2 | Finding grouping rules | Grouping related findings |
|
|
161
|
+
| COR-AD-1 | Adaptive depth size detection | Determining review mode |
|
|
162
|
+
| COR-AD-2 | Lightweight review mode | Changeset < 50 lines |
|
|
163
|
+
| COR-AD-3 | Deep review mode | Changeset 500+ lines |
|
|
152
164
|
|
|
153
165
|
### Expansion Instructions
|
|
154
166
|
|
|
@@ -238,3 +250,54 @@ During this skill's execution, watch for valuable reference materials worth pres
|
|
|
238
250
|
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/`?"
|
|
239
251
|
|
|
240
252
|
Only save if the user approves. Do not re-ask if declined.
|
|
253
|
+
|
|
254
|
+
---
|
|
255
|
+
|
|
256
|
+
## Multi-Agent Parallel Review
|
|
257
|
+
|
|
258
|
+
For Deep mode reviews (500+ lines), the review is split into 4 specialized subagents running in parallel:
|
|
259
|
+
|
|
260
|
+
| Agent | Focus | Model |
|
|
261
|
+
|-------|-------|-------|
|
|
262
|
+
| Security | Vulnerabilities, secrets, injection, auth bypass | sonnet |
|
|
263
|
+
| Logic & Bugs | Edge cases, null handling, race conditions, wrong logic | sonnet |
|
|
264
|
+
| Performance | N+1 queries, memory leaks, blocking I/O, re-renders | sonnet |
|
|
265
|
+
| Pattern Compliance | Forbidden/allowed patterns, naming, consistency | haiku |
|
|
266
|
+
|
|
267
|
+
The coordinator merges results, deduplicates overlapping findings, then runs verification and re-ranking.
|
|
268
|
+
|
|
269
|
+
See `.claude/resources/core/review-multi-agent.md` for full rules.
|
|
270
|
+
|
|
271
|
+
---
|
|
272
|
+
|
|
273
|
+
## Adaptive Depth
|
|
274
|
+
|
|
275
|
+
Review depth scales automatically based on changeset size:
|
|
276
|
+
|
|
277
|
+
| Lines Changed | Mode | Behavior |
|
|
278
|
+
|--------------|------|----------|
|
|
279
|
+
| < 50 | **Lightweight** | Quick-scan for security, logic bugs, breaking changes only. Skips pattern loading, similar implementations, verification pass. |
|
|
280
|
+
| 50–500 | **Standard** | Full review (current behavior, no changes). |
|
|
281
|
+
| 500+ | **Deep** | Multi-pass review with file categorization, severity-grouped output, executive summary, and mandatory verification pass. |
|
|
282
|
+
|
|
283
|
+
Thresholds are hardcoded. The detected mode is displayed before the review starts.
|
|
284
|
+
|
|
285
|
+
See `.claude/resources/core/review-adaptive-depth.md` for full rules and `.claude/resources/patterns/review-code-templates.md` for lightweight and deep templates.
|
|
286
|
+
|
|
287
|
+
---
|
|
288
|
+
|
|
289
|
+
## Verification Pass
|
|
290
|
+
|
|
291
|
+
After initial analysis, all findings undergo a second-pass verification. Each finding is re-examined against 15 lines of surrounding context and classified as Confirmed, Likely, or Dismissed. False positives are filtered before output. A Verification Summary shows filter stats.
|
|
292
|
+
|
|
293
|
+
See `.claude/resources/core/review-verification.md` for classification criteria, category-specific questions, and output format.
|
|
294
|
+
|
|
295
|
+
---
|
|
296
|
+
|
|
297
|
+
## Pattern Capture
|
|
298
|
+
|
|
299
|
+
During code review, silently watch for anti-patterns found in changed code, good patterns that should be documented, and pattern conflicts between new and existing code. Append captured patterns to `flow/resources/pending-patterns.md` without interrupting work.
|
|
300
|
+
|
|
301
|
+
After analysis, present any buffered patterns for user approval. Approved patterns are written to `.claude/rules/core/allowed-patterns.md` or `.claude/rules/core/forbidden-patterns.md`.
|
|
302
|
+
|
|
303
|
+
See `.claude/resources/core/pattern-capture.md` for buffer format, capture triggers, conflict detection, and the full review protocol.
|
|
@@ -49,6 +49,11 @@ WORKFLOW:
|
|
|
49
49
|
5. Analyzes code changes
|
|
50
50
|
6. Generates review document
|
|
51
51
|
|
|
52
|
+
ADAPTIVE DEPTH:
|
|
53
|
+
< 50 lines Lightweight (security, logic bugs, breaking changes only)
|
|
54
|
+
50-500 lines Standard (full review)
|
|
55
|
+
500+ lines Deep (multi-pass, severity-grouped, executive summary)
|
|
56
|
+
|
|
52
57
|
REVIEW INCLUDES:
|
|
53
58
|
- Summary of changes
|
|
54
59
|
- Pattern compliance check
|
|
@@ -146,6 +151,13 @@ This command uses hierarchical context loading to reduce context consumption. In
|
|
|
146
151
|
| PTN-PR-1 | PR review patterns | Creating review output |
|
|
147
152
|
| COR-AP-1 | Allowed patterns overview | Checking pattern compliance |
|
|
148
153
|
| COR-FP-1 | Forbidden patterns overview | Identifying anti-patterns |
|
|
154
|
+
| COR-MA-1 | Multi-agent subagent definitions | Deep mode parallel review setup |
|
|
155
|
+
| COR-MA-2 | Coordinator dedup and merge | Deep mode result processing |
|
|
156
|
+
| COR-SR-1 | Severity re-ranking algorithm | Ordering findings by impact |
|
|
157
|
+
| COR-SR-2 | Finding grouping rules | Grouping related findings |
|
|
158
|
+
| COR-AD-1 | Adaptive depth size detection | Determining review mode |
|
|
159
|
+
| COR-AD-2 | Lightweight review mode | Changeset < 50 lines |
|
|
160
|
+
| COR-AD-3 | Deep review mode | Changeset 500+ lines |
|
|
149
161
|
|
|
150
162
|
### Expansion Instructions
|
|
151
163
|
|
|
@@ -238,3 +250,44 @@ During this skill's execution, watch for valuable reference materials worth pres
|
|
|
238
250
|
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/`?"
|
|
239
251
|
|
|
240
252
|
Only save if the user approves. Do not re-ask if declined.
|
|
253
|
+
|
|
254
|
+
---
|
|
255
|
+
|
|
256
|
+
## Multi-Agent Parallel Review
|
|
257
|
+
|
|
258
|
+
For Deep mode reviews (500+ lines), the review is split into 4 specialized subagents running in parallel:
|
|
259
|
+
|
|
260
|
+
| Agent | Focus | Model |
|
|
261
|
+
|-------|-------|-------|
|
|
262
|
+
| Security | Vulnerabilities, secrets, injection, auth bypass | sonnet |
|
|
263
|
+
| Logic & Bugs | Edge cases, null handling, race conditions, wrong logic | sonnet |
|
|
264
|
+
| Performance | N+1 queries, memory leaks, blocking I/O, re-renders | sonnet |
|
|
265
|
+
| Pattern Compliance | Forbidden/allowed patterns, naming, consistency | haiku |
|
|
266
|
+
|
|
267
|
+
The coordinator merges results, deduplicates overlapping findings, then runs verification and re-ranking.
|
|
268
|
+
|
|
269
|
+
See `.claude/resources/core/review-multi-agent.md` for full rules.
|
|
270
|
+
|
|
271
|
+
---
|
|
272
|
+
|
|
273
|
+
## Adaptive Depth
|
|
274
|
+
|
|
275
|
+
Review depth scales automatically based on changeset size:
|
|
276
|
+
|
|
277
|
+
| Lines Changed | Mode | Behavior |
|
|
278
|
+
|--------------|------|----------|
|
|
279
|
+
| < 50 | **Lightweight** | Quick-scan for security, logic bugs, breaking changes only. Skips pattern loading, full analysis, verification pass. |
|
|
280
|
+
| 50–500 | **Standard** | Full review (current behavior, no changes). |
|
|
281
|
+
| 500+ | **Deep** | Multi-pass review with file categorization, severity-grouped output, executive summary, and mandatory verification pass. |
|
|
282
|
+
|
|
283
|
+
Thresholds are hardcoded. The detected mode is displayed before the review starts.
|
|
284
|
+
|
|
285
|
+
See `.claude/resources/core/review-adaptive-depth.md` for full rules.
|
|
286
|
+
|
|
287
|
+
---
|
|
288
|
+
|
|
289
|
+
## Verification Pass
|
|
290
|
+
|
|
291
|
+
After initial analysis, all findings undergo a second-pass verification. Each finding is re-examined against 15 lines of surrounding context and classified as Confirmed, Likely, or Dismissed. False positives are filtered before output. A Verification Summary shows filter stats.
|
|
292
|
+
|
|
293
|
+
See `.claude/resources/core/review-verification.md` for classification criteria, category-specific questions, and output format.
|