planflow-ai 1.2.0 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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/review-code.md +10 -0
- package/.claude/resources/core/_index.md +37 -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/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/skills/_index.md +28 -1
- 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 +16 -1
- package/.claude/rules/core/allowed-patterns.md +6 -0
- package/.claude/rules/core/forbidden-patterns.md +6 -0
- 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 +130 -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/templates/shared/CLAUDE.md.template +27 -10
|
@@ -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 /brain — 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
|
+
/brain 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 |
|
|
@@ -238,3 +238,13 @@ During this skill's execution, watch for valuable reference materials worth pres
|
|
|
238
238
|
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
239
|
|
|
240
240
|
Only save if the user approves. Do not re-ask if declined.
|
|
241
|
+
|
|
242
|
+
---
|
|
243
|
+
|
|
244
|
+
## Pattern Capture
|
|
245
|
+
|
|
246
|
+
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.
|
|
247
|
+
|
|
248
|
+
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`.
|
|
249
|
+
|
|
250
|
+
See `.claude/resources/core/pattern-capture.md` for buffer format, capture triggers, conflict detection, and the full review protocol.
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
|
|
6
6
|
Core rules define the foundational coding standards that apply across the entire project. These include best practices to follow (allowed patterns), anti-patterns to avoid (forbidden patterns), and complexity scoring for implementation planning.
|
|
7
7
|
|
|
8
|
-
**Total Files**:
|
|
9
|
-
**Reference Codes**: COR-AP-1 through COR-
|
|
8
|
+
**Total Files**: 14 files, ~2310 lines
|
|
9
|
+
**Reference Codes**: COR-AP-1 through COR-DA-3
|
|
10
10
|
|
|
11
11
|
---
|
|
12
12
|
|
|
@@ -94,6 +94,30 @@ Core rules define the foundational coding standards that apply across the entire
|
|
|
94
94
|
| COR-LR-1 | Trigger conditions and detection logic | learn-recommendations.md | 10-62 |
|
|
95
95
|
| COR-LR-2 | Recommendation format, rules, and integration points | learn-recommendations.md | 64-170 |
|
|
96
96
|
|
|
97
|
+
### Pattern Capture (`pattern-capture.md`)
|
|
98
|
+
|
|
99
|
+
| Code | Description | Source | Lines |
|
|
100
|
+
|------|-------------|--------|-------|
|
|
101
|
+
| COR-PC-1 | Capture behavior, triggers, and buffer format | pattern-capture.md | 10-80 |
|
|
102
|
+
| COR-PC-2 | End-of-skill review protocol and user approval flow | pattern-capture.md | 82-140 |
|
|
103
|
+
| COR-PC-3 | Auto-captured entry format and conflict detection | pattern-capture.md | 142-210 |
|
|
104
|
+
|
|
105
|
+
### Model Routing (`model-routing.md`)
|
|
106
|
+
|
|
107
|
+
| Code | Description | Source | Lines |
|
|
108
|
+
|------|-------------|--------|-------|
|
|
109
|
+
| COR-MR-1 | Model tiers, platform mappings, and routing rules | model-routing.md | 10-60 |
|
|
110
|
+
| COR-MR-2 | Aggregation behavior and plan mode exception | model-routing.md | 62-85 |
|
|
111
|
+
| COR-MR-3 | Cost impact estimates and execution summary format | model-routing.md | 87-115 |
|
|
112
|
+
|
|
113
|
+
### Design Awareness (`design-awareness.md`)
|
|
114
|
+
|
|
115
|
+
| Code | Description | Source | Lines |
|
|
116
|
+
|------|-------------|--------|-------|
|
|
117
|
+
| COR-DA-1 | Design Context template and personalities | design-awareness.md | 14-180 |
|
|
118
|
+
| COR-DA-2 | Token extraction and UI detection rules | design-awareness.md | 182-260 |
|
|
119
|
+
| COR-DA-3 | Discovery question flow and execution injection | design-awareness.md | 262-350 |
|
|
120
|
+
|
|
97
121
|
---
|
|
98
122
|
|
|
99
123
|
## When to Expand
|
|
@@ -127,6 +151,15 @@ Core rules define the foundational coding standards that apply across the entire
|
|
|
127
151
|
| COR-RC-2 | Need resource file format and naming conventions |
|
|
128
152
|
| COR-LR-1 | Need learn recommendation trigger conditions |
|
|
129
153
|
| COR-LR-2 | Need learn recommendation format and integration rules |
|
|
154
|
+
| COR-PC-1 | Need pattern capture behavior and buffer format |
|
|
155
|
+
| COR-PC-2 | Need end-of-skill review protocol |
|
|
156
|
+
| COR-PC-3 | Need auto-captured entry format and conflict detection |
|
|
157
|
+
| COR-MR-1 | Need model tier definitions and platform mappings |
|
|
158
|
+
| COR-MR-2 | Need aggregation behavior for model routing |
|
|
159
|
+
| COR-MR-3 | Need cost impact estimates or execution summary format |
|
|
160
|
+
| COR-DA-1 | Need design context template or personality options |
|
|
161
|
+
| COR-DA-2 | Need token extraction or UI detection heuristics |
|
|
162
|
+
| COR-DA-3 | Need design question flow or execution injection rules |
|
|
130
163
|
|
|
131
164
|
---
|
|
132
165
|
|
|
@@ -164,6 +197,8 @@ Core rules define the foundational coding standards that apply across the entire
|
|
|
164
197
|
- `brain-capture.md` is loaded on-demand - processes brain-capture blocks and manages brain index
|
|
165
198
|
- `resource-capture.md` is loaded on-demand - watches for valuable reference materials during skill execution
|
|
166
199
|
- `learn-recommendations.md` is loaded on-demand - detects learning opportunities and recommends `/learn`
|
|
200
|
+
- `pattern-capture.md` is loaded on-demand - silently captures patterns during skill execution and presents for approval
|
|
201
|
+
- `model-routing.md` is loaded on-demand - automatic model selection per phase based on complexity scores during `/execute-plan`
|
|
167
202
|
- `project-tasklist.md` is loaded on-demand - session start tasklist behavior
|
|
168
203
|
- `project-memory.md` is loaded on-demand - artifact tracking and 7-day session loading
|
|
169
204
|
- `heartbeat.md` is loaded on-demand - scheduled task daemon configuration
|