@gannonh/kata 0.1.4 → 0.2.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/README.md +55 -28
- package/agents/kata-debugger.md +20 -1
- package/agents/kata-entity-generator.md +237 -0
- package/agents/kata-executor.md +31 -0
- package/agents/kata-phase-researcher.md +13 -4
- package/agents/kata-planner.md +19 -0
- package/agents/kata-project-researcher.md +5 -5
- package/agents/kata-research-synthesizer.md +9 -0
- package/bin/install.js +100 -38
- package/commands/kata/add-phase.md +8 -195
- package/commands/kata/add-todo.md +8 -170
- package/commands/kata/audit-milestone.md +10 -248
- package/commands/kata/check-todo.md +20 -0
- package/commands/kata/complete-milestone.md +8 -124
- package/commands/kata/debug.md +9 -138
- package/commands/kata/discuss-phase.md +13 -73
- package/commands/kata/execute-phase.md +9 -293
- package/commands/kata/help.md +13 -376
- package/commands/kata/insert-phase.md +8 -215
- package/commands/kata/list-phase-assumptions.md +10 -40
- package/commands/kata/map-codebase.md +10 -61
- package/commands/kata/pause-work.md +9 -112
- package/commands/kata/plan-milestone-gaps.md +9 -273
- package/commands/kata/plan-phase.md +9 -464
- package/commands/kata/progress.md +10 -346
- package/commands/kata/quick.md +20 -0
- package/commands/kata/remove-phase.md +8 -326
- package/commands/kata/research-phase.md +10 -170
- package/commands/kata/resume-work.md +10 -30
- package/commands/kata/set-profile.md +20 -0
- package/commands/kata/settings.md +20 -0
- package/commands/kata/start-milestone.md +20 -0
- package/commands/kata/start-new-milestone.md +20 -0
- package/commands/kata/start-project.md +20 -0
- package/commands/kata/update-kata.md +20 -0
- package/commands/kata/update.md +13 -219
- package/commands/kata/verify-work.md +10 -209
- package/commands/kata/whats-new.md +13 -117
- package/kata/references/checkpoints.md +318 -28
- package/kata/references/model-profiles.md +73 -0
- package/kata/references/planning-config.md +94 -0
- package/kata/references/ui-brand.md +2 -2
- package/kata/references/verification-patterns.md +17 -0
- package/kata/templates/codebase/architecture.md +2 -2
- package/kata/templates/codebase/structure.md +4 -4
- package/kata/templates/config.json +9 -0
- package/kata/templates/entity.md +173 -0
- package/kata/templates/phase-prompt.md +18 -27
- package/kata/workflows/complete-milestone.md +11 -0
- package/kata/workflows/diagnose-issues.md +12 -1
- package/kata/workflows/discovery-phase.md +5 -9
- package/kata/workflows/discuss-phase.md +11 -0
- package/kata/workflows/execute-phase.md +68 -9
- package/kata/workflows/execute-plan.md +47 -4
- package/kata/workflows/map-codebase.md +35 -2
- package/kata/workflows/resume-project.md +4 -0
- package/kata/workflows/verify-phase.md +2 -3
- package/kata/workflows/verify-work.md +36 -3
- package/package.json +12 -5
- package/skills/kata-adding-phases/SKILL.md +209 -0
- package/skills/kata-adding-todos/SKILL.md +195 -0
- package/skills/kata-auditing-milestones/SKILL.md +279 -0
- package/{commands/kata/check-todos.md → skills/kata-checking-todos/SKILL.md} +16 -5
- package/skills/kata-completing-milestones/SKILL.md +137 -0
- package/skills/kata-configuring-settings/SKILL.md +139 -0
- package/skills/kata-debugging/SKILL.md +170 -0
- package/skills/kata-discussing-phases/SKILL.md +85 -0
- package/skills/kata-executing-phases/SKILL.md +335 -0
- package/skills/kata-executing-quick-tasks/SKILL.md +306 -0
- package/skills/kata-inserting-phases/SKILL.md +229 -0
- package/skills/kata-listing-phase-assumptions/SKILL.md +51 -0
- package/skills/kata-mapping-codebases/SKILL.md +70 -0
- package/skills/kata-pausing-work/SKILL.md +137 -0
- package/skills/kata-planning-milestone-gaps/SKILL.md +295 -0
- package/skills/kata-planning-phases/SKILL.md +521 -0
- package/skills/kata-providing-help/SKILL.md +495 -0
- package/skills/kata-removing-phases/SKILL.md +350 -0
- package/skills/kata-researching-phases/SKILL.md +202 -0
- package/skills/kata-resuming-work/SKILL.md +41 -0
- package/skills/kata-setting-profiles/SKILL.md +109 -0
- package/skills/kata-showing-whats-new/SKILL.md +131 -0
- package/skills/kata-starting-milestones/SKILL.md +721 -0
- package/{commands/kata/new-milestone.md → skills/kata-starting-new-milestones/SKILL.md} +256 -272
- package/{commands/kata/new-project.md → skills/kata-starting-projects/SKILL.md} +138 -29
- package/skills/kata-tracking-progress/SKILL.md +365 -0
- package/skills/kata-updating/SKILL.md +179 -0
- package/skills/kata-updating-kata/SKILL.md +179 -0
- package/skills/kata-verifying-work/SKILL.md +217 -0
- /package/hooks/{statusline.js → kata-statusline.js} +0 -0
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"mode": "interactive",
|
|
3
3
|
"depth": "standard",
|
|
4
|
+
"workflow": {
|
|
5
|
+
"research": true,
|
|
6
|
+
"plan_check": true,
|
|
7
|
+
"verifier": true
|
|
8
|
+
},
|
|
9
|
+
"planning": {
|
|
10
|
+
"commit_docs": true,
|
|
11
|
+
"search_gitignored": false
|
|
12
|
+
},
|
|
4
13
|
"parallelization": {
|
|
5
14
|
"enabled": true,
|
|
6
15
|
"plan_level": true,
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
# Entity Template
|
|
2
|
+
|
|
3
|
+
Template for `.planning/codebase/{entity-slug}.md` - file-level intelligence documentation.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## File Template
|
|
8
|
+
|
|
9
|
+
```markdown
|
|
10
|
+
---
|
|
11
|
+
path: {path}
|
|
12
|
+
type: {type}
|
|
13
|
+
updated: {updated}
|
|
14
|
+
status: {status}
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
# {filename}
|
|
18
|
+
|
|
19
|
+
## Purpose
|
|
20
|
+
|
|
21
|
+
{purpose}
|
|
22
|
+
|
|
23
|
+
## Exports
|
|
24
|
+
|
|
25
|
+
{exports}
|
|
26
|
+
|
|
27
|
+
## Dependencies
|
|
28
|
+
|
|
29
|
+
{dependencies}
|
|
30
|
+
|
|
31
|
+
## Used By
|
|
32
|
+
|
|
33
|
+
{used_by}
|
|
34
|
+
|
|
35
|
+
## Notes
|
|
36
|
+
|
|
37
|
+
{notes}
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
---
|
|
41
|
+
|
|
42
|
+
## Field Reference
|
|
43
|
+
|
|
44
|
+
### Frontmatter
|
|
45
|
+
|
|
46
|
+
| Field | Values | Description |
|
|
47
|
+
|-------|--------|-------------|
|
|
48
|
+
| `path` | Absolute path | Full path to the file |
|
|
49
|
+
| `type` | module, component, util, config, test, api, hook | Primary classification |
|
|
50
|
+
| `updated` | YYYY-MM-DD | Last time this entity was updated |
|
|
51
|
+
| `status` | active, deprecated, stub | Current state |
|
|
52
|
+
|
|
53
|
+
### Sections
|
|
54
|
+
|
|
55
|
+
**Purpose** (required)
|
|
56
|
+
1-3 sentences covering:
|
|
57
|
+
- What this file does
|
|
58
|
+
- Why it exists
|
|
59
|
+
- Who/what uses it (high-level)
|
|
60
|
+
|
|
61
|
+
**Exports** (required for modules with exports)
|
|
62
|
+
List each export with signature and description:
|
|
63
|
+
```markdown
|
|
64
|
+
- `functionName(arg: Type): ReturnType` - What it does
|
|
65
|
+
- `ClassName` - What it represents
|
|
66
|
+
- `CONSTANT_NAME` - What value it holds
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
For files without exports (config, tests), write "None" or describe what the file defines.
|
|
70
|
+
|
|
71
|
+
**Dependencies** (required)
|
|
72
|
+
Internal dependencies use wiki-links (slugified paths):
|
|
73
|
+
```markdown
|
|
74
|
+
- [[src-lib-db]] - Database client
|
|
75
|
+
- [[src-types-user]] - User type definitions
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
External dependencies use plain text:
|
|
79
|
+
```markdown
|
|
80
|
+
- react - Component framework
|
|
81
|
+
- jose - JWT handling
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
**Used By** (grows over time)
|
|
85
|
+
Files that import this one, using wiki-links:
|
|
86
|
+
```markdown
|
|
87
|
+
- [[src-app-api-auth-route]]
|
|
88
|
+
- [[src-components-dashboard]]
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
Initially may be empty or incomplete. Updated as Claude encounters imports.
|
|
92
|
+
|
|
93
|
+
**Notes** (optional)
|
|
94
|
+
Patterns, gotchas, or context:
|
|
95
|
+
```markdown
|
|
96
|
+
- Uses singleton pattern for connection pooling
|
|
97
|
+
- WARNING: Must call `init()` before any other method
|
|
98
|
+
- Related: See [[src-lib-cache]] for caching layer
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
---
|
|
102
|
+
|
|
103
|
+
## Slug Convention
|
|
104
|
+
|
|
105
|
+
Entity slugs are derived from file paths:
|
|
106
|
+
- `src/lib/db.ts` becomes `src-lib-db`
|
|
107
|
+
- `src/app/api/auth/route.ts` becomes `src-app-api-auth-route`
|
|
108
|
+
|
|
109
|
+
Rule: Replace `/` and `.` with `-`, drop file extension.
|
|
110
|
+
|
|
111
|
+
---
|
|
112
|
+
|
|
113
|
+
## Example
|
|
114
|
+
|
|
115
|
+
```markdown
|
|
116
|
+
---
|
|
117
|
+
path: /project/src/lib/auth.ts
|
|
118
|
+
type: util
|
|
119
|
+
updated: 2025-01-15
|
|
120
|
+
status: active
|
|
121
|
+
---
|
|
122
|
+
|
|
123
|
+
# auth.ts
|
|
124
|
+
|
|
125
|
+
## Purpose
|
|
126
|
+
|
|
127
|
+
JWT token management using jose library. Handles token creation, verification, and refresh rotation. Used by all protected API routes via middleware.
|
|
128
|
+
|
|
129
|
+
## Exports
|
|
130
|
+
|
|
131
|
+
- `createAccessToken(userId: string): Promise<string>` - Creates 15-min access token
|
|
132
|
+
- `createRefreshToken(userId: string): Promise<string>` - Creates 7-day refresh token
|
|
133
|
+
- `verifyToken(token: string): Promise<TokenPayload>` - Validates and decodes token
|
|
134
|
+
- `rotateRefresh(oldToken: string): Promise<TokenPair>` - Issues new token pair
|
|
135
|
+
|
|
136
|
+
## Dependencies
|
|
137
|
+
|
|
138
|
+
- [[src-lib-db]] - Stores refresh tokens for revocation
|
|
139
|
+
- [[src-types-auth]] - TokenPayload, TokenPair types
|
|
140
|
+
- jose - JWT signing and verification
|
|
141
|
+
- bcrypt - Password hashing
|
|
142
|
+
|
|
143
|
+
## Used By
|
|
144
|
+
|
|
145
|
+
- [[src-middleware]]
|
|
146
|
+
- [[src-app-api-auth-login-route]]
|
|
147
|
+
- [[src-app-api-auth-logout-route]]
|
|
148
|
+
- [[src-app-api-auth-refresh-route]]
|
|
149
|
+
|
|
150
|
+
## Notes
|
|
151
|
+
|
|
152
|
+
- Access tokens are stateless; refresh tokens stored in DB for revocation
|
|
153
|
+
- Uses RS256 algorithm with keys from environment
|
|
154
|
+
- WARNING: Never log token values, even in debug mode
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
---
|
|
158
|
+
|
|
159
|
+
## Guidelines
|
|
160
|
+
|
|
161
|
+
**When to create/update:**
|
|
162
|
+
- After modifying a file during plan execution
|
|
163
|
+
- When encountering a file that lacks documentation
|
|
164
|
+
- When relationships change (new imports, exports)
|
|
165
|
+
|
|
166
|
+
**Minimal viable entity:**
|
|
167
|
+
At minimum, an entity needs frontmatter + Purpose. Other sections can be "TBD" if unknown.
|
|
168
|
+
|
|
169
|
+
**Accuracy over completeness:**
|
|
170
|
+
Better to have partial accurate info than complete guesses. Mark unknowns explicitly.
|
|
171
|
+
|
|
172
|
+
**Link discovery:**
|
|
173
|
+
The hook that processes entities extracts all `[[wiki-links]]` to build the relationship graph. Ensure links use correct slug format.
|
|
@@ -75,33 +75,23 @@ Output: [What artifacts will be created]
|
|
|
75
75
|
<done>[Acceptance criteria]</done>
|
|
76
76
|
</task>
|
|
77
77
|
|
|
78
|
+
<!-- For checkpoint task examples and patterns, see @~/.claude/kata/references/checkpoints.md -->
|
|
79
|
+
<!-- Key rule: Claude starts dev server BEFORE human-verify checkpoints. User only visits URLs. -->
|
|
80
|
+
|
|
78
81
|
<task type="checkpoint:decision" gate="blocking">
|
|
79
82
|
<decision>[What needs deciding]</decision>
|
|
80
83
|
<context>[Why this decision matters]</context>
|
|
81
84
|
<options>
|
|
82
|
-
<option id="option-a">
|
|
83
|
-
|
|
84
|
-
<pros>[Benefits and advantages]</pros>
|
|
85
|
-
<cons>[Tradeoffs and limitations]</cons>
|
|
86
|
-
</option>
|
|
87
|
-
<option id="option-b">
|
|
88
|
-
<name>[Option name]</name>
|
|
89
|
-
<pros>[Benefits and advantages]</pros>
|
|
90
|
-
<cons>[Tradeoffs and limitations]</cons>
|
|
91
|
-
</option>
|
|
85
|
+
<option id="option-a"><name>[Name]</name><pros>[Benefits]</pros><cons>[Tradeoffs]</cons></option>
|
|
86
|
+
<option id="option-b"><name>[Name]</name><pros>[Benefits]</pros><cons>[Tradeoffs]</cons></option>
|
|
92
87
|
</options>
|
|
93
|
-
<resume-signal>
|
|
88
|
+
<resume-signal>Select: option-a or option-b</resume-signal>
|
|
94
89
|
</task>
|
|
95
90
|
|
|
96
91
|
<task type="checkpoint:human-verify" gate="blocking">
|
|
97
|
-
<what-built>[What Claude
|
|
98
|
-
<how-to-verify>
|
|
99
|
-
|
|
100
|
-
2. Visit: [URL to check]
|
|
101
|
-
3. Test: [Specific interactions]
|
|
102
|
-
4. Confirm: [Expected behaviors]
|
|
103
|
-
</how-to-verify>
|
|
104
|
-
<resume-signal>Type "approved" to continue, or describe issues to fix</resume-signal>
|
|
92
|
+
<what-built>[What Claude built] - server running at [URL]</what-built>
|
|
93
|
+
<how-to-verify>Visit [URL] and verify: [visual checks only, NO CLI commands]</how-to-verify>
|
|
94
|
+
<resume-signal>Type "approved" or describe issues</resume-signal>
|
|
105
95
|
</task>
|
|
106
96
|
|
|
107
97
|
</tasks>
|
|
@@ -403,15 +393,16 @@ Output: Working dashboard component.
|
|
|
403
393
|
<done>Dashboard renders without errors</done>
|
|
404
394
|
</task>
|
|
405
395
|
|
|
396
|
+
<!-- Checkpoint pattern: Claude starts server, user visits URL. See checkpoints.md for full patterns. -->
|
|
397
|
+
<task type="auto">
|
|
398
|
+
<name>Start dev server</name>
|
|
399
|
+
<action>Run `npm run dev` in background, wait for ready</action>
|
|
400
|
+
<verify>curl localhost:3000 returns 200</verify>
|
|
401
|
+
</task>
|
|
402
|
+
|
|
406
403
|
<task type="checkpoint:human-verify" gate="blocking">
|
|
407
|
-
<what-built>
|
|
408
|
-
<how-to-verify>
|
|
409
|
-
1. Run: npm run dev
|
|
410
|
-
2. Visit: http://localhost:3000/dashboard
|
|
411
|
-
3. Desktop: Verify two-column grid
|
|
412
|
-
4. Mobile: Verify stacked layout
|
|
413
|
-
5. Check: No layout shift, no scroll issues
|
|
414
|
-
</how-to-verify>
|
|
404
|
+
<what-built>Dashboard - server at http://localhost:3000</what-built>
|
|
405
|
+
<how-to-verify>Visit localhost:3000/dashboard. Check: desktop grid, mobile stack, no scroll issues.</how-to-verify>
|
|
415
406
|
<resume-signal>Type "approved" or describe issues</resume-signal>
|
|
416
407
|
</task>
|
|
417
408
|
</tasks>
|
|
@@ -620,6 +620,17 @@ git push origin v[X.Y]
|
|
|
620
620
|
|
|
621
621
|
Commit milestone completion including archive files and deletions.
|
|
622
622
|
|
|
623
|
+
**Check planning config:**
|
|
624
|
+
|
|
625
|
+
```bash
|
|
626
|
+
COMMIT_PLANNING_DOCS=$(cat .planning/config.json 2>/dev/null | grep -o '"commit_docs"[[:space:]]*:[[:space:]]*[^,}]*' | grep -o 'true\|false' || echo "true")
|
|
627
|
+
git check-ignore -q .planning 2>/dev/null && COMMIT_PLANNING_DOCS=false
|
|
628
|
+
```
|
|
629
|
+
|
|
630
|
+
**If `COMMIT_PLANNING_DOCS=false`:** Skip git operations
|
|
631
|
+
|
|
632
|
+
**If `COMMIT_PLANNING_DOCS=true` (default):**
|
|
633
|
+
|
|
623
634
|
```bash
|
|
624
635
|
# Stage archive files (new)
|
|
625
636
|
git add .planning/milestones/v[X.Y]-ROADMAP.md
|
|
@@ -156,6 +156,17 @@ For each gap in the Gaps section, add artifacts and missing fields:
|
|
|
156
156
|
|
|
157
157
|
Update status in frontmatter to "diagnosed".
|
|
158
158
|
|
|
159
|
+
**Check planning config:**
|
|
160
|
+
|
|
161
|
+
```bash
|
|
162
|
+
COMMIT_PLANNING_DOCS=$(cat .planning/config.json 2>/dev/null | grep -o '"commit_docs"[[:space:]]*:[[:space:]]*[^,}]*' | grep -o 'true\|false' || echo "true")
|
|
163
|
+
git check-ignore -q .planning 2>/dev/null && COMMIT_PLANNING_DOCS=false
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
**If `COMMIT_PLANNING_DOCS=false`:** Skip git operations
|
|
167
|
+
|
|
168
|
+
**If `COMMIT_PLANNING_DOCS=true` (default):**
|
|
169
|
+
|
|
159
170
|
Commit the updated UAT.md:
|
|
160
171
|
```bash
|
|
161
172
|
git add ".planning/phases/XX-name/{phase}-UAT.md"
|
|
@@ -169,7 +180,7 @@ git commit -m "docs({phase}): add root causes from diagnosis"
|
|
|
169
180
|
Display:
|
|
170
181
|
```
|
|
171
182
|
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
172
|
-
|
|
183
|
+
Kata ► DIAGNOSIS COMPLETE
|
|
173
184
|
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
174
185
|
|
|
175
186
|
| Gap (Truth) | Root Cause | Files |
|
|
@@ -107,16 +107,14 @@ For: Choosing between options, new external integration.
|
|
|
107
107
|
|
|
108
108
|
5. **Cross-verify:** Any WebSearch finding → confirm with Context7/official docs.
|
|
109
109
|
|
|
110
|
-
6. **
|
|
111
|
-
|
|
112
|
-
7. **Create DISCOVERY.md** using ~/.claude/kata/templates/discovery.md structure:
|
|
110
|
+
6. **Create DISCOVERY.md** using ~/.claude/kata/templates/discovery.md structure:
|
|
113
111
|
|
|
114
112
|
- Summary with recommendation
|
|
115
113
|
- Key findings per option
|
|
116
114
|
- Code examples from Context7
|
|
117
115
|
- Confidence level (should be MEDIUM-HIGH for Level 2)
|
|
118
116
|
|
|
119
|
-
|
|
117
|
+
7. Return to plan-phase.md.
|
|
120
118
|
|
|
121
119
|
**Output:** `.planning/phases/XX-name/DISCOVERY.md`
|
|
122
120
|
</step>
|
|
@@ -160,18 +158,16 @@ For: Architectural decisions, novel problems, high-risk choices.
|
|
|
160
158
|
- Mark what's verified vs assumed
|
|
161
159
|
- Flag contradictions
|
|
162
160
|
|
|
163
|
-
6. **
|
|
164
|
-
|
|
165
|
-
7. **Create comprehensive DISCOVERY.md:**
|
|
161
|
+
6. **Create comprehensive DISCOVERY.md:**
|
|
166
162
|
|
|
167
163
|
- Full structure from ~/.claude/kata/templates/discovery.md
|
|
168
164
|
- Quality report with source attribution
|
|
169
165
|
- Confidence by finding
|
|
170
166
|
- If LOW confidence on any critical finding → add validation checkpoints
|
|
171
167
|
|
|
172
|
-
|
|
168
|
+
7. **Confidence gate:** If overall confidence is LOW, present options before proceeding.
|
|
173
169
|
|
|
174
|
-
|
|
170
|
+
8. Return to plan-phase.md.
|
|
175
171
|
|
|
176
172
|
**Output:** `.planning/phases/XX-name/DISCOVERY.md` (comprehensive)
|
|
177
173
|
</step>
|
|
@@ -393,6 +393,17 @@ Created: .planning/phases/${PADDED_PHASE}-${SLUG}/${PADDED_PHASE}-CONTEXT.md
|
|
|
393
393
|
<step name="git_commit">
|
|
394
394
|
Commit phase context:
|
|
395
395
|
|
|
396
|
+
**Check planning config:**
|
|
397
|
+
|
|
398
|
+
```bash
|
|
399
|
+
COMMIT_PLANNING_DOCS=$(cat .planning/config.json 2>/dev/null | grep -o '"commit_docs"[[:space:]]*:[[:space:]]*[^,}]*' | grep -o 'true\|false' || echo "true")
|
|
400
|
+
git check-ignore -q .planning 2>/dev/null && COMMIT_PLANNING_DOCS=false
|
|
401
|
+
```
|
|
402
|
+
|
|
403
|
+
**If `COMMIT_PLANNING_DOCS=false`:** Skip git operations
|
|
404
|
+
|
|
405
|
+
**If `COMMIT_PLANNING_DOCS=true` (default):**
|
|
406
|
+
|
|
396
407
|
```bash
|
|
397
408
|
git add "${PHASE_DIR}/${PADDED_PHASE}-CONTEXT.md"
|
|
398
409
|
git commit -m "$(cat <<'EOF'
|
|
@@ -8,11 +8,32 @@ The orchestrator's job is coordination, not execution. Each subagent loads the f
|
|
|
8
8
|
|
|
9
9
|
<required_reading>
|
|
10
10
|
Read STATE.md before any operation to load project context.
|
|
11
|
+
Read config.json for planning behavior settings.
|
|
11
12
|
</required_reading>
|
|
12
13
|
|
|
13
14
|
<process>
|
|
14
15
|
|
|
15
|
-
<step name="
|
|
16
|
+
<step name="resolve_model_profile" priority="first">
|
|
17
|
+
Read model profile for agent spawning:
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
MODEL_PROFILE=$(cat .planning/config.json 2>/dev/null | grep -o '"model_profile"[[:space:]]*:[[:space:]]*"[^"]*"' | grep -o '"[^"]*"$' | tr -d '"' || echo "balanced")
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
Default to "balanced" if not set.
|
|
24
|
+
|
|
25
|
+
**Model lookup table:**
|
|
26
|
+
|
|
27
|
+
| Agent | quality | balanced | budget |
|
|
28
|
+
|-------|---------|----------|--------|
|
|
29
|
+
| kata-executor | opus | sonnet | sonnet |
|
|
30
|
+
| kata-verifier | sonnet | sonnet | haiku |
|
|
31
|
+
| general-purpose | — | — | — |
|
|
32
|
+
|
|
33
|
+
Store resolved models for use in Task calls below.
|
|
34
|
+
</step>
|
|
35
|
+
|
|
36
|
+
<step name="load_project_state">
|
|
16
37
|
Before any operation, read project state:
|
|
17
38
|
|
|
18
39
|
```bash
|
|
@@ -33,6 +54,17 @@ Options:
|
|
|
33
54
|
```
|
|
34
55
|
|
|
35
56
|
**If .planning/ doesn't exist:** Error - project not initialized.
|
|
57
|
+
|
|
58
|
+
**Load planning config:**
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
# Check if planning docs should be committed (default: true)
|
|
62
|
+
COMMIT_PLANNING_DOCS=$(cat .planning/config.json 2>/dev/null | grep -o '"commit_docs"[[:space:]]*:[[:space:]]*[^,}]*' | grep -o 'true\|false' || echo "true")
|
|
63
|
+
# Auto-detect gitignored (overrides config)
|
|
64
|
+
git check-ignore -q .planning 2>/dev/null && COMMIT_PLANNING_DOCS=false
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
Store `COMMIT_PLANNING_DOCS` for use in git operations.
|
|
36
68
|
</step>
|
|
37
69
|
|
|
38
70
|
<step name="validate_phase">
|
|
@@ -158,9 +190,18 @@ Execute each wave in sequence. Autonomous plans within a wave run in parallel.
|
|
|
158
190
|
- Bad: "Executing terrain generation plan"
|
|
159
191
|
- Good: "Procedural terrain generator using Perlin noise — creates height maps, biome zones, and collision meshes. Required before vehicle physics can interact with ground."
|
|
160
192
|
|
|
161
|
-
2. **
|
|
193
|
+
2. **Read files and spawn all autonomous agents in wave simultaneously:**
|
|
194
|
+
|
|
195
|
+
Before spawning, read file contents. The `@` syntax does not work across Task() boundaries - content must be inlined.
|
|
196
|
+
|
|
197
|
+
```bash
|
|
198
|
+
# Read each plan in the wave
|
|
199
|
+
PLAN_CONTENT=$(cat "{plan_path}")
|
|
200
|
+
STATE_CONTENT=$(cat .planning/STATE.md)
|
|
201
|
+
CONFIG_CONTENT=$(cat .planning/config.json 2>/dev/null)
|
|
202
|
+
```
|
|
162
203
|
|
|
163
|
-
Use Task tool with multiple parallel calls. Each agent gets prompt
|
|
204
|
+
Use Task tool with multiple parallel calls. Each agent gets prompt with inlined content:
|
|
164
205
|
|
|
165
206
|
```
|
|
166
207
|
<objective>
|
|
@@ -177,9 +218,14 @@ Execute each wave in sequence. Autonomous plans within a wave run in parallel.
|
|
|
177
218
|
</execution_context>
|
|
178
219
|
|
|
179
220
|
<context>
|
|
180
|
-
Plan:
|
|
181
|
-
|
|
182
|
-
|
|
221
|
+
Plan:
|
|
222
|
+
{plan_content}
|
|
223
|
+
|
|
224
|
+
Project state:
|
|
225
|
+
{state_content}
|
|
226
|
+
|
|
227
|
+
Config (if exists):
|
|
228
|
+
{config_content}
|
|
183
229
|
</context>
|
|
184
230
|
|
|
185
231
|
<success_criteria>
|
|
@@ -248,7 +294,7 @@ Plans with `autonomous: false` require user interaction.
|
|
|
248
294
|
|
|
249
295
|
1. **Spawn agent for checkpoint plan:**
|
|
250
296
|
```
|
|
251
|
-
Task(prompt="{subagent-task-prompt}", subagent_type="
|
|
297
|
+
Task(prompt="{subagent-task-prompt}", subagent_type="kata-executor", model="{executor_model}")
|
|
252
298
|
```
|
|
253
299
|
|
|
254
300
|
2. **Agent runs until checkpoint:**
|
|
@@ -287,7 +333,8 @@ Plans with `autonomous: false` require user interaction.
|
|
|
287
333
|
```
|
|
288
334
|
Task(
|
|
289
335
|
prompt=filled_continuation_template,
|
|
290
|
-
subagent_type="
|
|
336
|
+
subagent_type="kata-executor",
|
|
337
|
+
model="{executor_model}"
|
|
291
338
|
)
|
|
292
339
|
```
|
|
293
340
|
|
|
@@ -363,7 +410,8 @@ Phase goal: {goal from ROADMAP.md}
|
|
|
363
410
|
|
|
364
411
|
Check must_haves against actual codebase. Create VERIFICATION.md.
|
|
365
412
|
Verify what actually exists in the code.",
|
|
366
|
-
subagent_type="kata-verifier"
|
|
413
|
+
subagent_type="kata-verifier",
|
|
414
|
+
model="{verifier_model}"
|
|
367
415
|
)
|
|
368
416
|
```
|
|
369
417
|
|
|
@@ -456,6 +504,17 @@ Update ROADMAP.md to reflect phase completion:
|
|
|
456
504
|
# Update status
|
|
457
505
|
```
|
|
458
506
|
|
|
507
|
+
**Check planning config:**
|
|
508
|
+
|
|
509
|
+
If `COMMIT_PLANNING_DOCS=false` (set in load_project_state):
|
|
510
|
+
- Skip all git operations for .planning/ files
|
|
511
|
+
- Planning docs exist locally but are gitignored
|
|
512
|
+
- Log: "Skipping planning docs commit (commit_docs: false)"
|
|
513
|
+
- Proceed to offer_next step
|
|
514
|
+
|
|
515
|
+
If `COMMIT_PLANNING_DOCS=true` (default):
|
|
516
|
+
- Continue with git operations below
|
|
517
|
+
|
|
459
518
|
Commit phase completion (roadmap, state, verification):
|
|
460
519
|
```bash
|
|
461
520
|
git add .planning/ROADMAP.md .planning/STATE.md .planning/phases/{phase_dir}/*-VERIFICATION.md
|
|
@@ -4,11 +4,32 @@ Execute a phase prompt (PLAN.md) and create the outcome summary (SUMMARY.md).
|
|
|
4
4
|
|
|
5
5
|
<required_reading>
|
|
6
6
|
Read STATE.md before any operation to load project context.
|
|
7
|
+
Read config.json for planning behavior settings.
|
|
8
|
+
|
|
9
|
+
@~/.claude/kata/references/git-integration.md
|
|
7
10
|
</required_reading>
|
|
8
11
|
|
|
9
12
|
<process>
|
|
10
13
|
|
|
11
|
-
<step name="
|
|
14
|
+
<step name="resolve_model_profile" priority="first">
|
|
15
|
+
Read model profile for agent spawning:
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
MODEL_PROFILE=$(cat .planning/config.json 2>/dev/null | grep -o '"model_profile"[[:space:]]*:[[:space:]]*"[^"]*"' | grep -o '"[^"]*"$' | tr -d '"' || echo "balanced")
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
Default to "balanced" if not set.
|
|
22
|
+
|
|
23
|
+
**Model lookup table:**
|
|
24
|
+
|
|
25
|
+
| Agent | quality | balanced | budget |
|
|
26
|
+
|-------|---------|----------|--------|
|
|
27
|
+
| kata-executor | opus | sonnet | sonnet |
|
|
28
|
+
|
|
29
|
+
Store resolved model for use in Task calls below.
|
|
30
|
+
</step>
|
|
31
|
+
|
|
32
|
+
<step name="load_project_state">
|
|
12
33
|
Before any operation, read project state:
|
|
13
34
|
|
|
14
35
|
```bash
|
|
@@ -34,6 +55,17 @@ Options:
|
|
|
34
55
|
**If .planning/ doesn't exist:** Error - project not initialized.
|
|
35
56
|
|
|
36
57
|
This ensures every execution has full project context.
|
|
58
|
+
|
|
59
|
+
**Load planning config:**
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
# Check if planning docs should be committed (default: true)
|
|
63
|
+
COMMIT_PLANNING_DOCS=$(cat .planning/config.json 2>/dev/null | grep -o '"commit_docs"[[:space:]]*:[[:space:]]*[^,}]*' | grep -o 'true\|false' || echo "true")
|
|
64
|
+
# Auto-detect gitignored (overrides config)
|
|
65
|
+
git check-ignore -q .planning 2>/dev/null && COMMIT_PLANNING_DOCS=false
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
Store `COMMIT_PLANNING_DOCS` for use in git operations.
|
|
37
69
|
</step>
|
|
38
70
|
|
|
39
71
|
<step name="identify_plan">
|
|
@@ -205,7 +237,7 @@ No segmentation benefit - execute entirely in main
|
|
|
205
237
|
```
|
|
206
238
|
1. Run init_agent_tracking step first (see step below)
|
|
207
239
|
|
|
208
|
-
2. Use Task tool with subagent_type="kata-executor":
|
|
240
|
+
2. Use Task tool with subagent_type="kata-executor" and model="{executor_model}":
|
|
209
241
|
|
|
210
242
|
Prompt: "Execute plan at .planning/phases/{phase}-{plan}-PLAN.md
|
|
211
243
|
|
|
@@ -357,7 +389,7 @@ For Pattern A (fully autonomous) and Pattern C (decision-dependent), skip this s
|
|
|
357
389
|
|
|
358
390
|
B. If routing = Subagent:
|
|
359
391
|
```
|
|
360
|
-
Spawn Task tool with subagent_type="kata-executor":
|
|
392
|
+
Spawn Task tool with subagent_type="kata-executor" and model="{executor_model}":
|
|
361
393
|
|
|
362
394
|
Prompt: "Execute tasks [task numbers/names] from plan at [plan path].
|
|
363
395
|
|
|
@@ -1511,6 +1543,17 @@ Commit execution metadata (SUMMARY + STATE + ROADMAP):
|
|
|
1511
1543
|
**Note:** All task code has already been committed during execution (one commit per task).
|
|
1512
1544
|
PLAN.md was already committed during plan-phase. This final commit captures execution results only.
|
|
1513
1545
|
|
|
1546
|
+
**Check planning config:**
|
|
1547
|
+
|
|
1548
|
+
If `COMMIT_PLANNING_DOCS=false` (set in load_project_state):
|
|
1549
|
+
- Skip all git operations for .planning/ files
|
|
1550
|
+
- Planning docs exist locally but are gitignored
|
|
1551
|
+
- Log: "Skipping planning docs commit (commit_docs: false)"
|
|
1552
|
+
- Proceed to next step
|
|
1553
|
+
|
|
1554
|
+
If `COMMIT_PLANNING_DOCS=true` (default):
|
|
1555
|
+
- Continue with git operations below
|
|
1556
|
+
|
|
1514
1557
|
**1. Stage execution artifacts:**
|
|
1515
1558
|
|
|
1516
1559
|
```bash
|
|
@@ -1574,7 +1617,7 @@ lmn012o feat(08-02): create user registration endpoint
|
|
|
1574
1617
|
|
|
1575
1618
|
Each task has its own commit, followed by one metadata commit documenting plan completion.
|
|
1576
1619
|
|
|
1577
|
-
|
|
1620
|
+
See `git-integration.md` (loaded via required_reading) for commit message conventions.
|
|
1578
1621
|
</step>
|
|
1579
1622
|
|
|
1580
1623
|
<step name="update_codebase_map">
|
|
@@ -22,7 +22,25 @@ Documents are reference material for Claude when planning/executing. Always incl
|
|
|
22
22
|
|
|
23
23
|
<process>
|
|
24
24
|
|
|
25
|
-
<step name="
|
|
25
|
+
<step name="resolve_model_profile" priority="first">
|
|
26
|
+
Read model profile for agent spawning:
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
MODEL_PROFILE=$(cat .planning/config.json 2>/dev/null | grep -o '"model_profile"[[:space:]]*:[[:space:]]*"[^"]*"' | grep -o '"[^"]*"$' | tr -d '"' || echo "balanced")
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Default to "balanced" if not set.
|
|
33
|
+
|
|
34
|
+
**Model lookup table:**
|
|
35
|
+
|
|
36
|
+
| Agent | quality | balanced | budget |
|
|
37
|
+
|-------|---------|----------|--------|
|
|
38
|
+
| kata-codebase-mapper | sonnet | haiku | haiku |
|
|
39
|
+
|
|
40
|
+
Store resolved model for use in Task calls below.
|
|
41
|
+
</step>
|
|
42
|
+
|
|
43
|
+
<step name="check_existing">
|
|
26
44
|
Check if .planning/codebase/ already exists:
|
|
27
45
|
|
|
28
46
|
```bash
|
|
@@ -73,7 +91,7 @@ Continue to spawn_agents.
|
|
|
73
91
|
<step name="spawn_agents">
|
|
74
92
|
Spawn 4 parallel kata-codebase-mapper agents.
|
|
75
93
|
|
|
76
|
-
Use Task tool with `subagent_type="kata-codebase-mapper"` and `run_in_background=true` for parallel execution.
|
|
94
|
+
Use Task tool with `subagent_type="kata-codebase-mapper"`, `model="{mapper_model}"`, and `run_in_background=true` for parallel execution.
|
|
77
95
|
|
|
78
96
|
**CRITICAL:** Use the dedicated `kata-codebase-mapper` agent, NOT `Explore`. The mapper agent writes documents directly.
|
|
79
97
|
|
|
@@ -82,6 +100,7 @@ Use Task tool with `subagent_type="kata-codebase-mapper"` and `run_in_background
|
|
|
82
100
|
Task tool parameters:
|
|
83
101
|
```
|
|
84
102
|
subagent_type: "kata-codebase-mapper"
|
|
103
|
+
model: "{mapper_model}"
|
|
85
104
|
run_in_background: true
|
|
86
105
|
description: "Map codebase tech stack"
|
|
87
106
|
```
|
|
@@ -104,6 +123,7 @@ Explore thoroughly. Write documents directly using templates. Return confirmatio
|
|
|
104
123
|
Task tool parameters:
|
|
105
124
|
```
|
|
106
125
|
subagent_type: "kata-codebase-mapper"
|
|
126
|
+
model: "{mapper_model}"
|
|
107
127
|
run_in_background: true
|
|
108
128
|
description: "Map codebase architecture"
|
|
109
129
|
```
|
|
@@ -126,6 +146,7 @@ Explore thoroughly. Write documents directly using templates. Return confirmatio
|
|
|
126
146
|
Task tool parameters:
|
|
127
147
|
```
|
|
128
148
|
subagent_type: "kata-codebase-mapper"
|
|
149
|
+
model: "{mapper_model}"
|
|
129
150
|
run_in_background: true
|
|
130
151
|
description: "Map codebase conventions"
|
|
131
152
|
```
|
|
@@ -148,6 +169,7 @@ Explore thoroughly. Write documents directly using templates. Return confirmatio
|
|
|
148
169
|
Task tool parameters:
|
|
149
170
|
```
|
|
150
171
|
subagent_type: "kata-codebase-mapper"
|
|
172
|
+
model: "{mapper_model}"
|
|
151
173
|
run_in_background: true
|
|
152
174
|
description: "Map codebase concerns"
|
|
153
175
|
```
|
|
@@ -211,6 +233,17 @@ Continue to commit_codebase_map.
|
|
|
211
233
|
<step name="commit_codebase_map">
|
|
212
234
|
Commit the codebase map:
|
|
213
235
|
|
|
236
|
+
**Check planning config:**
|
|
237
|
+
|
|
238
|
+
```bash
|
|
239
|
+
COMMIT_PLANNING_DOCS=$(cat .planning/config.json 2>/dev/null | grep -o '"commit_docs"[[:space:]]*:[[:space:]]*[^,}]*' | grep -o 'true\|false' || echo "true")
|
|
240
|
+
git check-ignore -q .planning 2>/dev/null && COMMIT_PLANNING_DOCS=false
|
|
241
|
+
```
|
|
242
|
+
|
|
243
|
+
**If `COMMIT_PLANNING_DOCS=false`:** Skip git operations
|
|
244
|
+
|
|
245
|
+
**If `COMMIT_PLANNING_DOCS=true` (default):**
|
|
246
|
+
|
|
214
247
|
```bash
|
|
215
248
|
git add .planning/codebase/*.md
|
|
216
249
|
git commit -m "$(cat <<'EOF'
|