@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
|
@@ -13,6 +13,10 @@ Enables seamless session continuity for fully autonomous workflows.
|
|
|
13
13
|
"Where were we?" should have an immediate, complete answer.
|
|
14
14
|
</purpose>
|
|
15
15
|
|
|
16
|
+
<required_reading>
|
|
17
|
+
@~/.claude/kata/references/continuation-format.md
|
|
18
|
+
</required_reading>
|
|
19
|
+
|
|
16
20
|
<process>
|
|
17
21
|
|
|
18
22
|
<step name="detect_existing_project">
|
|
@@ -18,9 +18,8 @@ Then verify each level against the actual codebase.
|
|
|
18
18
|
</core_principle>
|
|
19
19
|
|
|
20
20
|
<required_reading>
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
- ~/.claude/kata/templates/verification-report.md (output format)
|
|
21
|
+
@~/.claude/kata/references/verification-patterns.md
|
|
22
|
+
@~/.claude/kata/templates/verification-report.md
|
|
24
23
|
</required_reading>
|
|
25
24
|
|
|
26
25
|
<process>
|
|
@@ -20,6 +20,25 @@ No Pass/Fail buttons. No severity questions. Just: "Here's what should happen. D
|
|
|
20
20
|
|
|
21
21
|
<process>
|
|
22
22
|
|
|
23
|
+
<step name="resolve_model_profile" priority="first">
|
|
24
|
+
Read model profile for agent spawning:
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
MODEL_PROFILE=$(cat .planning/config.json 2>/dev/null | grep -o '"model_profile"[[:space:]]*:[[:space:]]*"[^"]*"' | grep -o '"[^"]*"$' | tr -d '"' || echo "balanced")
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Default to "balanced" if not set.
|
|
31
|
+
|
|
32
|
+
**Model lookup table:**
|
|
33
|
+
|
|
34
|
+
| Agent | quality | balanced | budget |
|
|
35
|
+
|-------|---------|----------|--------|
|
|
36
|
+
| kata-planner | opus | opus | sonnet |
|
|
37
|
+
| kata-plan-checker | sonnet | sonnet | haiku |
|
|
38
|
+
|
|
39
|
+
Store resolved models for use in Task calls below.
|
|
40
|
+
</step>
|
|
41
|
+
|
|
23
42
|
<step name="check_active_session">
|
|
24
43
|
**First: Check for active UAT sessions**
|
|
25
44
|
|
|
@@ -285,6 +304,17 @@ Clear Current Test section:
|
|
|
285
304
|
[testing complete]
|
|
286
305
|
```
|
|
287
306
|
|
|
307
|
+
**Check planning config:**
|
|
308
|
+
|
|
309
|
+
```bash
|
|
310
|
+
COMMIT_PLANNING_DOCS=$(cat .planning/config.json 2>/dev/null | grep -o '"commit_docs"[[:space:]]*:[[:space:]]*[^,}]*' | grep -o 'true\|false' || echo "true")
|
|
311
|
+
git check-ignore -q .planning 2>/dev/null && COMMIT_PLANNING_DOCS=false
|
|
312
|
+
```
|
|
313
|
+
|
|
314
|
+
**If `COMMIT_PLANNING_DOCS=false`:** Skip git operations
|
|
315
|
+
|
|
316
|
+
**If `COMMIT_PLANNING_DOCS=true` (default):**
|
|
317
|
+
|
|
288
318
|
Commit the UAT file:
|
|
289
319
|
```bash
|
|
290
320
|
git add ".planning/phases/XX-name/{phase}-UAT.md"
|
|
@@ -345,7 +375,7 @@ Diagnosis runs automatically - no user prompt. Parallel agents investigate simul
|
|
|
345
375
|
Display:
|
|
346
376
|
```
|
|
347
377
|
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
348
|
-
|
|
378
|
+
Kata ► PLANNING FIXES
|
|
349
379
|
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
350
380
|
|
|
351
381
|
◆ Spawning planner for gap closure...
|
|
@@ -378,6 +408,7 @@ Plans must be executable prompts.
|
|
|
378
408
|
</downstream_consumer>
|
|
379
409
|
""",
|
|
380
410
|
subagent_type="kata-planner",
|
|
411
|
+
model="{planner_model}",
|
|
381
412
|
description="Plan gap fixes for Phase {phase}"
|
|
382
413
|
)
|
|
383
414
|
```
|
|
@@ -393,7 +424,7 @@ On return:
|
|
|
393
424
|
Display:
|
|
394
425
|
```
|
|
395
426
|
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
396
|
-
|
|
427
|
+
Kata ► VERIFYING FIX PLANS
|
|
397
428
|
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
398
429
|
|
|
399
430
|
◆ Spawning plan checker...
|
|
@@ -423,6 +454,7 @@ Return one of:
|
|
|
423
454
|
</expected_output>
|
|
424
455
|
""",
|
|
425
456
|
subagent_type="kata-plan-checker",
|
|
457
|
+
model="{checker_model}",
|
|
426
458
|
description="Verify Phase {phase} fix plans"
|
|
427
459
|
)
|
|
428
460
|
```
|
|
@@ -463,6 +495,7 @@ Do NOT replan from scratch unless issues are fundamental.
|
|
|
463
495
|
</instructions>
|
|
464
496
|
""",
|
|
465
497
|
subagent_type="kata-planner",
|
|
498
|
+
model="{planner_model}",
|
|
466
499
|
description="Revise Phase {phase} plans"
|
|
467
500
|
)
|
|
468
501
|
```
|
|
@@ -487,7 +520,7 @@ Wait for user response.
|
|
|
487
520
|
|
|
488
521
|
```
|
|
489
522
|
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
490
|
-
|
|
523
|
+
Kata ► FIXES READY ✓
|
|
491
524
|
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
492
525
|
|
|
493
526
|
**Phase {X}: {Name}** — {N} gap(s) diagnosed, {M} fix plan(s) created
|
package/package.json
CHANGED
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gannonh/kata",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"description": "Spec-driven development framework for Claude Code.",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"test": "node --test --test-reporter spec tests/**/*.test.js",
|
|
8
|
+
"test:skills": "node --test --test-reporter spec tests/skills/*.test.js",
|
|
9
|
+
"test:skill": "node --test --test-reporter spec"
|
|
10
|
+
},
|
|
5
11
|
"bin": {
|
|
6
12
|
"kata": "bin/install.js"
|
|
7
13
|
},
|
|
@@ -10,7 +16,8 @@
|
|
|
10
16
|
"commands",
|
|
11
17
|
"kata",
|
|
12
18
|
"agents",
|
|
13
|
-
"hooks"
|
|
19
|
+
"hooks",
|
|
20
|
+
"skills"
|
|
14
21
|
],
|
|
15
22
|
"keywords": [
|
|
16
23
|
"claude",
|
|
@@ -27,6 +34,6 @@
|
|
|
27
34
|
"url": "git+https://github.com/gannonh/kata.git"
|
|
28
35
|
},
|
|
29
36
|
"engines": {
|
|
30
|
-
"node": ">=
|
|
37
|
+
"node": ">=20.0.0"
|
|
31
38
|
}
|
|
32
|
-
}
|
|
39
|
+
}
|
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: kata-adding-phases
|
|
3
|
+
description: Use this skill to add planned work discovered during execution to the end of the current milestone in the roadmap. This skill appends sequential phases to the current milestone's phase list, automatically calculating the next phase number. Triggers include "add phase", "append phase", "new phase", and "create phase". This skill updates ROADMAP.md and STATE.md accordingly.
|
|
4
|
+
version: 0.1.0
|
|
5
|
+
user-invocable: false
|
|
6
|
+
disable-model-invocation: false
|
|
7
|
+
allowed-tools:
|
|
8
|
+
- Read
|
|
9
|
+
- Write
|
|
10
|
+
- Bash
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
<objective>
|
|
14
|
+
Add a new integer phase to the end of the current milestone in the roadmap.
|
|
15
|
+
|
|
16
|
+
This command appends sequential phases to the current milestone's phase list, automatically calculating the next phase number based on existing phases.
|
|
17
|
+
|
|
18
|
+
Purpose: Add planned work discovered during execution that belongs at the end of current milestone.
|
|
19
|
+
</objective>
|
|
20
|
+
|
|
21
|
+
<execution_context>
|
|
22
|
+
@.planning/ROADMAP.md
|
|
23
|
+
@.planning/STATE.md
|
|
24
|
+
</execution_context>
|
|
25
|
+
|
|
26
|
+
<process>
|
|
27
|
+
|
|
28
|
+
<step name="parse_arguments">
|
|
29
|
+
Parse the command arguments:
|
|
30
|
+
- All arguments become the phase description
|
|
31
|
+
- Example: `/kata:add-phase Add authentication` → description = "Add authentication"
|
|
32
|
+
- Example: `/kata:add-phase Fix critical performance issues` → description = "Fix critical performance issues"
|
|
33
|
+
|
|
34
|
+
If no arguments provided:
|
|
35
|
+
|
|
36
|
+
```
|
|
37
|
+
ERROR: Phase description required
|
|
38
|
+
Usage: /kata:add-phase <description>
|
|
39
|
+
Example: /kata:add-phase Add authentication system
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
Exit.
|
|
43
|
+
</step>
|
|
44
|
+
|
|
45
|
+
<step name="load_roadmap">
|
|
46
|
+
Load the roadmap file:
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
if [ -f .planning/ROADMAP.md ]; then
|
|
50
|
+
ROADMAP=".planning/ROADMAP.md"
|
|
51
|
+
else
|
|
52
|
+
echo "ERROR: No roadmap found (.planning/ROADMAP.md)"
|
|
53
|
+
exit 1
|
|
54
|
+
fi
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
Read roadmap content for parsing.
|
|
58
|
+
</step>
|
|
59
|
+
|
|
60
|
+
<step name="find_current_milestone">
|
|
61
|
+
Parse the roadmap to find the current milestone section:
|
|
62
|
+
|
|
63
|
+
1. Locate the "## Current Milestone:" heading
|
|
64
|
+
2. Extract milestone name and version
|
|
65
|
+
3. Identify all phases under this milestone (before next "---" separator or next milestone heading)
|
|
66
|
+
4. Parse existing phase numbers (including decimals if present)
|
|
67
|
+
|
|
68
|
+
Example structure:
|
|
69
|
+
|
|
70
|
+
```
|
|
71
|
+
## Current Milestone: v1.0 Foundation
|
|
72
|
+
|
|
73
|
+
### Phase 4: Focused Command System
|
|
74
|
+
### Phase 5: Path Routing & Validation
|
|
75
|
+
### Phase 6: Documentation & Distribution
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
</step>
|
|
79
|
+
|
|
80
|
+
<step name="calculate_next_phase">
|
|
81
|
+
Find the highest integer phase number in the current milestone:
|
|
82
|
+
|
|
83
|
+
1. Extract all phase numbers from phase headings (### Phase N:)
|
|
84
|
+
2. Filter to integer phases only (ignore decimals like 4.1, 4.2)
|
|
85
|
+
3. Find the maximum integer value
|
|
86
|
+
4. Add 1 to get the next phase number
|
|
87
|
+
|
|
88
|
+
Example: If phases are 4, 5, 5.1, 6 → next is 7
|
|
89
|
+
|
|
90
|
+
Format as two-digit: `printf "%02d" $next_phase`
|
|
91
|
+
</step>
|
|
92
|
+
|
|
93
|
+
<step name="generate_slug">
|
|
94
|
+
Convert the phase description to a kebab-case slug:
|
|
95
|
+
|
|
96
|
+
```bash
|
|
97
|
+
# Example transformation:
|
|
98
|
+
# "Add authentication" → "add-authentication"
|
|
99
|
+
# "Fix critical performance issues" → "fix-critical-performance-issues"
|
|
100
|
+
|
|
101
|
+
slug=$(echo "$description" | tr '[:upper:]' '[:lower:]' | sed 's/[^a-z0-9]/-/g' | sed 's/--*/-/g' | sed 's/^-//;s/-$//')
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
Phase directory name: `{two-digit-phase}-{slug}`
|
|
105
|
+
Example: `07-add-authentication`
|
|
106
|
+
</step>
|
|
107
|
+
|
|
108
|
+
<step name="create_phase_directory">
|
|
109
|
+
Create the phase directory structure:
|
|
110
|
+
|
|
111
|
+
```bash
|
|
112
|
+
phase_dir=".planning/phases/${phase_num}-${slug}"
|
|
113
|
+
mkdir -p "$phase_dir"
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
Confirm: "Created directory: $phase_dir"
|
|
117
|
+
</step>
|
|
118
|
+
|
|
119
|
+
<step name="update_roadmap">
|
|
120
|
+
Add the new phase entry to the roadmap:
|
|
121
|
+
|
|
122
|
+
1. Find the insertion point (after last phase in current milestone, before "---" separator)
|
|
123
|
+
2. Insert new phase heading:
|
|
124
|
+
|
|
125
|
+
```
|
|
126
|
+
### Phase {N}: {Description}
|
|
127
|
+
|
|
128
|
+
**Goal:** [To be planned]
|
|
129
|
+
**Depends on:** Phase {N-1}
|
|
130
|
+
**Plans:** 0 plans
|
|
131
|
+
|
|
132
|
+
Plans:
|
|
133
|
+
- [ ] TBD (run /kata:plan-phase {N} to break down)
|
|
134
|
+
|
|
135
|
+
**Details:**
|
|
136
|
+
[To be added during planning]
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
3. Write updated roadmap back to file
|
|
140
|
+
|
|
141
|
+
Preserve all other content exactly (formatting, spacing, other phases).
|
|
142
|
+
</step>
|
|
143
|
+
|
|
144
|
+
<step name="update_project_state">
|
|
145
|
+
Update STATE.md to reflect the new phase:
|
|
146
|
+
|
|
147
|
+
1. Read `.planning/STATE.md`
|
|
148
|
+
2. Under "## Current Position" → "**Next Phase:**" add reference to new phase
|
|
149
|
+
3. Under "## Accumulated Context" → "### Roadmap Evolution" add entry:
|
|
150
|
+
```
|
|
151
|
+
- Phase {N} added: {description}
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
If "Roadmap Evolution" section doesn't exist, create it.
|
|
155
|
+
</step>
|
|
156
|
+
|
|
157
|
+
<step name="completion">
|
|
158
|
+
Present completion summary:
|
|
159
|
+
|
|
160
|
+
```
|
|
161
|
+
Phase {N} added to current milestone:
|
|
162
|
+
- Description: {description}
|
|
163
|
+
- Directory: .planning/phases/{phase-num}-{slug}/
|
|
164
|
+
- Status: Not planned yet
|
|
165
|
+
|
|
166
|
+
Roadmap updated: {roadmap-path}
|
|
167
|
+
Project state updated: .planning/STATE.md
|
|
168
|
+
|
|
169
|
+
---
|
|
170
|
+
|
|
171
|
+
## ▶ Next Up
|
|
172
|
+
|
|
173
|
+
**Phase {N}: {description}**
|
|
174
|
+
|
|
175
|
+
`/kata:plan-phase {N}`
|
|
176
|
+
|
|
177
|
+
<sub>`/clear` first → fresh context window</sub>
|
|
178
|
+
|
|
179
|
+
---
|
|
180
|
+
|
|
181
|
+
**Also available:**
|
|
182
|
+
- `/kata:add-phase <description>` — add another phase
|
|
183
|
+
- Review roadmap
|
|
184
|
+
|
|
185
|
+
---
|
|
186
|
+
```
|
|
187
|
+
</step>
|
|
188
|
+
|
|
189
|
+
</process>
|
|
190
|
+
|
|
191
|
+
<anti_patterns>
|
|
192
|
+
|
|
193
|
+
- Don't modify phases outside current milestone
|
|
194
|
+
- Don't renumber existing phases
|
|
195
|
+
- Don't use decimal numbering (that's /kata:insert-phase)
|
|
196
|
+
- Don't create plans yet (that's /kata:plan-phase)
|
|
197
|
+
- Don't commit changes (user decides when to commit)
|
|
198
|
+
</anti_patterns>
|
|
199
|
+
|
|
200
|
+
<success_criteria>
|
|
201
|
+
Phase addition is complete when:
|
|
202
|
+
|
|
203
|
+
- [ ] Phase directory created: `.planning/phases/{NN}-{slug}/`
|
|
204
|
+
- [ ] Roadmap updated with new phase entry
|
|
205
|
+
- [ ] STATE.md updated with roadmap evolution note
|
|
206
|
+
- [ ] New phase appears at end of current milestone
|
|
207
|
+
- [ ] Next phase number calculated correctly (ignoring decimals)
|
|
208
|
+
- [ ] User informed of next steps
|
|
209
|
+
</success_criteria>
|
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: kata-adding-todos
|
|
3
|
+
description: Use this skill to capture an idea, task, or issue that surfaces during a Kata session as a structured todo for later work. This skill creates markdown todo files in the .planning/todos/pending directory with relevant metadata and content extracted from the conversation. Triggers include "add todo", "capture todo", "new todo", and "create todo".
|
|
4
|
+
version: 0.1.0
|
|
5
|
+
user-invocable: false
|
|
6
|
+
disable-model-invocation: false
|
|
7
|
+
allowed-tools:
|
|
8
|
+
- Read
|
|
9
|
+
- Write
|
|
10
|
+
- Bash
|
|
11
|
+
- Glob
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
<objective>
|
|
15
|
+
Capture an idea, task, or issue that surfaces during a Kata session as a structured todo for later work.
|
|
16
|
+
|
|
17
|
+
Enables "thought → capture → continue" flow without losing context or derailing current work.
|
|
18
|
+
</objective>
|
|
19
|
+
|
|
20
|
+
<context>
|
|
21
|
+
@.planning/STATE.md
|
|
22
|
+
</context>
|
|
23
|
+
|
|
24
|
+
<process>
|
|
25
|
+
|
|
26
|
+
<step name="ensure_directory">
|
|
27
|
+
```bash
|
|
28
|
+
mkdir -p .planning/todos/pending .planning/todos/done
|
|
29
|
+
```
|
|
30
|
+
</step>
|
|
31
|
+
|
|
32
|
+
<step name="check_existing_areas">
|
|
33
|
+
```bash
|
|
34
|
+
ls .planning/todos/pending/*.md 2>/dev/null | xargs -I {} grep "^area:" {} 2>/dev/null | cut -d' ' -f2 | sort -u
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Note existing areas for consistency in infer_area step.
|
|
38
|
+
</step>
|
|
39
|
+
|
|
40
|
+
<step name="extract_content">
|
|
41
|
+
**With arguments:** Use as the title/focus.
|
|
42
|
+
- `/kata:add-todo Add auth token refresh` → title = "Add auth token refresh"
|
|
43
|
+
|
|
44
|
+
**Without arguments:** Analyze recent conversation to extract:
|
|
45
|
+
- The specific problem, idea, or task discussed
|
|
46
|
+
- Relevant file paths mentioned
|
|
47
|
+
- Technical details (error messages, line numbers, constraints)
|
|
48
|
+
|
|
49
|
+
Formulate:
|
|
50
|
+
- `title`: 3-10 word descriptive title (action verb preferred)
|
|
51
|
+
- `problem`: What's wrong or why this is needed
|
|
52
|
+
- `solution`: Approach hints or "TBD" if just an idea
|
|
53
|
+
- `files`: Relevant paths with line numbers from conversation
|
|
54
|
+
</step>
|
|
55
|
+
|
|
56
|
+
<step name="infer_area">
|
|
57
|
+
Infer area from file paths:
|
|
58
|
+
|
|
59
|
+
| Path pattern | Area |
|
|
60
|
+
|--------------|------|
|
|
61
|
+
| `src/api/*`, `api/*` | `api` |
|
|
62
|
+
| `src/components/*`, `src/ui/*` | `ui` |
|
|
63
|
+
| `src/auth/*`, `auth/*` | `auth` |
|
|
64
|
+
| `src/db/*`, `database/*` | `database` |
|
|
65
|
+
| `tests/*`, `__tests__/*` | `testing` |
|
|
66
|
+
| `docs/*` | `docs` |
|
|
67
|
+
| `.planning/*` | `planning` |
|
|
68
|
+
| `scripts/*`, `bin/*` | `tooling` |
|
|
69
|
+
| No files or unclear | `general` |
|
|
70
|
+
|
|
71
|
+
Use existing area from step 2 if similar match exists.
|
|
72
|
+
</step>
|
|
73
|
+
|
|
74
|
+
<step name="check_duplicates">
|
|
75
|
+
```bash
|
|
76
|
+
grep -l -i "[key words from title]" .planning/todos/pending/*.md 2>/dev/null
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
If potential duplicate found:
|
|
80
|
+
1. Read the existing todo
|
|
81
|
+
2. Compare scope
|
|
82
|
+
|
|
83
|
+
If overlapping, use AskUserQuestion:
|
|
84
|
+
- header: "Duplicate?"
|
|
85
|
+
- question: "Similar todo exists: [title]. What would you like to do?"
|
|
86
|
+
- options:
|
|
87
|
+
- "Skip" — keep existing todo
|
|
88
|
+
- "Replace" — update existing with new context
|
|
89
|
+
- "Add anyway" — create as separate todo
|
|
90
|
+
</step>
|
|
91
|
+
|
|
92
|
+
<step name="create_file">
|
|
93
|
+
```bash
|
|
94
|
+
timestamp=$(date "+%Y-%m-%dT%H:%M")
|
|
95
|
+
date_prefix=$(date "+%Y-%m-%d")
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
Generate slug from title (lowercase, hyphens, no special chars).
|
|
99
|
+
|
|
100
|
+
Write to `.planning/todos/pending/${date_prefix}-${slug}.md`:
|
|
101
|
+
|
|
102
|
+
```markdown
|
|
103
|
+
---
|
|
104
|
+
created: [timestamp]
|
|
105
|
+
title: [title]
|
|
106
|
+
area: [area]
|
|
107
|
+
files:
|
|
108
|
+
- [file:lines]
|
|
109
|
+
---
|
|
110
|
+
|
|
111
|
+
## Problem
|
|
112
|
+
|
|
113
|
+
[problem description - enough context for future Claude to understand weeks later]
|
|
114
|
+
|
|
115
|
+
## Solution
|
|
116
|
+
|
|
117
|
+
[approach hints or "TBD"]
|
|
118
|
+
```
|
|
119
|
+
</step>
|
|
120
|
+
|
|
121
|
+
<step name="update_state">
|
|
122
|
+
If `.planning/STATE.md` exists:
|
|
123
|
+
|
|
124
|
+
1. Count todos: `ls .planning/todos/pending/*.md 2>/dev/null | wc -l`
|
|
125
|
+
2. Update "### Pending Todos" under "## Accumulated Context"
|
|
126
|
+
</step>
|
|
127
|
+
|
|
128
|
+
<step name="git_commit">
|
|
129
|
+
Commit the todo and any updated state:
|
|
130
|
+
|
|
131
|
+
**Check planning config:**
|
|
132
|
+
|
|
133
|
+
```bash
|
|
134
|
+
COMMIT_PLANNING_DOCS=$(cat .planning/config.json 2>/dev/null | grep -o '"commit_docs"[[:space:]]*:[[:space:]]*[^,}]*' | grep -o 'true\|false' || echo "true")
|
|
135
|
+
git check-ignore -q .planning 2>/dev/null && COMMIT_PLANNING_DOCS=false
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
**If `COMMIT_PLANNING_DOCS=false`:** Skip git operations, log "Todo saved (not committed - commit_docs: false)"
|
|
139
|
+
|
|
140
|
+
**If `COMMIT_PLANNING_DOCS=true` (default):**
|
|
141
|
+
|
|
142
|
+
```bash
|
|
143
|
+
git add .planning/todos/pending/[filename]
|
|
144
|
+
[ -f .planning/STATE.md ] && git add .planning/STATE.md
|
|
145
|
+
git commit -m "$(cat <<'EOF'
|
|
146
|
+
docs: capture todo - [title]
|
|
147
|
+
|
|
148
|
+
Area: [area]
|
|
149
|
+
EOF
|
|
150
|
+
)"
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
Confirm: "Committed: docs: capture todo - [title]"
|
|
154
|
+
</step>
|
|
155
|
+
|
|
156
|
+
<step name="confirm">
|
|
157
|
+
```
|
|
158
|
+
Todo saved: .planning/todos/pending/[filename]
|
|
159
|
+
|
|
160
|
+
[title]
|
|
161
|
+
Area: [area]
|
|
162
|
+
Files: [count] referenced
|
|
163
|
+
|
|
164
|
+
---
|
|
165
|
+
|
|
166
|
+
Would you like to:
|
|
167
|
+
|
|
168
|
+
1. Continue with current work
|
|
169
|
+
2. Add another todo
|
|
170
|
+
3. View all todos (/kata:check-todos)
|
|
171
|
+
```
|
|
172
|
+
</step>
|
|
173
|
+
|
|
174
|
+
</process>
|
|
175
|
+
|
|
176
|
+
<output>
|
|
177
|
+
- `.planning/todos/pending/[date]-[slug].md`
|
|
178
|
+
- Updated `.planning/STATE.md` (if exists)
|
|
179
|
+
</output>
|
|
180
|
+
|
|
181
|
+
<anti_patterns>
|
|
182
|
+
- Don't create todos for work in current plan (that's deviation rule territory)
|
|
183
|
+
- Don't create elaborate solution sections — captures ideas, not plans
|
|
184
|
+
- Don't block on missing information — "TBD" is fine
|
|
185
|
+
</anti_patterns>
|
|
186
|
+
|
|
187
|
+
<success_criteria>
|
|
188
|
+
- [ ] Directory structure exists
|
|
189
|
+
- [ ] Todo file created with valid frontmatter
|
|
190
|
+
- [ ] Problem section has enough context for future Claude
|
|
191
|
+
- [ ] No duplicates (checked and resolved)
|
|
192
|
+
- [ ] Area consistent with existing todos
|
|
193
|
+
- [ ] STATE.md updated if exists
|
|
194
|
+
- [ ] Todo and state committed to git
|
|
195
|
+
</success_criteria>
|