@gannonh/kata 0.1.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.
Files changed (91) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +439 -0
  3. package/agents/kata-codebase-mapper.md +738 -0
  4. package/agents/kata-debugger.md +1184 -0
  5. package/agents/kata-executor.md +753 -0
  6. package/agents/kata-integration-checker.md +423 -0
  7. package/agents/kata-phase-researcher.md +632 -0
  8. package/agents/kata-plan-checker.md +745 -0
  9. package/agents/kata-planner.md +1367 -0
  10. package/agents/kata-project-researcher.md +865 -0
  11. package/agents/kata-research-synthesizer.md +247 -0
  12. package/agents/kata-roadmapper.md +605 -0
  13. package/agents/kata-verifier.md +778 -0
  14. package/bin/install.js +569 -0
  15. package/commands/kata/add-phase.md +207 -0
  16. package/commands/kata/add-todo.md +182 -0
  17. package/commands/kata/audit-milestone.md +258 -0
  18. package/commands/kata/check-todos.md +217 -0
  19. package/commands/kata/complete-milestone.md +136 -0
  20. package/commands/kata/debug.md +149 -0
  21. package/commands/kata/discuss-phase.md +80 -0
  22. package/commands/kata/execute-phase.md +304 -0
  23. package/commands/kata/help.md +383 -0
  24. package/commands/kata/insert-phase.md +227 -0
  25. package/commands/kata/list-phase-assumptions.md +50 -0
  26. package/commands/kata/map-codebase.md +71 -0
  27. package/commands/kata/new-milestone.md +717 -0
  28. package/commands/kata/new-project.md +896 -0
  29. package/commands/kata/pause-work.md +123 -0
  30. package/commands/kata/plan-milestone-gaps.md +284 -0
  31. package/commands/kata/plan-phase.md +475 -0
  32. package/commands/kata/progress.md +356 -0
  33. package/commands/kata/remove-phase.md +338 -0
  34. package/commands/kata/research-phase.md +180 -0
  35. package/commands/kata/resume-work.md +40 -0
  36. package/commands/kata/update.md +172 -0
  37. package/commands/kata/verify-work.md +219 -0
  38. package/commands/kata/whats-new.md +124 -0
  39. package/hooks/kata-check-update.js +51 -0
  40. package/hooks/statusline.js +84 -0
  41. package/kata/references/checkpoints.md +788 -0
  42. package/kata/references/continuation-format.md +249 -0
  43. package/kata/references/git-integration.md +254 -0
  44. package/kata/references/questioning.md +141 -0
  45. package/kata/references/tdd.md +263 -0
  46. package/kata/references/ui-brand.md +160 -0
  47. package/kata/references/verification-patterns.md +595 -0
  48. package/kata/templates/DEBUG.md +159 -0
  49. package/kata/templates/UAT.md +247 -0
  50. package/kata/templates/codebase/architecture.md +255 -0
  51. package/kata/templates/codebase/concerns.md +310 -0
  52. package/kata/templates/codebase/conventions.md +307 -0
  53. package/kata/templates/codebase/integrations.md +280 -0
  54. package/kata/templates/codebase/stack.md +186 -0
  55. package/kata/templates/codebase/structure.md +285 -0
  56. package/kata/templates/codebase/testing.md +480 -0
  57. package/kata/templates/config.json +26 -0
  58. package/kata/templates/context.md +291 -0
  59. package/kata/templates/continue-here.md +78 -0
  60. package/kata/templates/debug-subagent-prompt.md +91 -0
  61. package/kata/templates/discovery.md +146 -0
  62. package/kata/templates/milestone-archive.md +123 -0
  63. package/kata/templates/milestone.md +115 -0
  64. package/kata/templates/phase-prompt.md +576 -0
  65. package/kata/templates/planner-subagent-prompt.md +117 -0
  66. package/kata/templates/project.md +184 -0
  67. package/kata/templates/requirements.md +231 -0
  68. package/kata/templates/research-project/ARCHITECTURE.md +204 -0
  69. package/kata/templates/research-project/FEATURES.md +147 -0
  70. package/kata/templates/research-project/PITFALLS.md +200 -0
  71. package/kata/templates/research-project/STACK.md +120 -0
  72. package/kata/templates/research-project/SUMMARY.md +170 -0
  73. package/kata/templates/research.md +529 -0
  74. package/kata/templates/roadmap.md +202 -0
  75. package/kata/templates/state.md +206 -0
  76. package/kata/templates/summary.md +269 -0
  77. package/kata/templates/user-setup.md +323 -0
  78. package/kata/templates/verification-report.md +322 -0
  79. package/kata/workflows/complete-milestone.md +750 -0
  80. package/kata/workflows/diagnose-issues.md +233 -0
  81. package/kata/workflows/discovery-phase.md +293 -0
  82. package/kata/workflows/discuss-phase.md +422 -0
  83. package/kata/workflows/execute-phase.md +552 -0
  84. package/kata/workflows/execute-plan.md +1831 -0
  85. package/kata/workflows/list-phase-assumptions.md +178 -0
  86. package/kata/workflows/map-codebase.md +289 -0
  87. package/kata/workflows/resume-project.md +311 -0
  88. package/kata/workflows/transition.md +564 -0
  89. package/kata/workflows/verify-phase.md +629 -0
  90. package/kata/workflows/verify-work.md +563 -0
  91. package/package.json +32 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Lex Christopherson
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,439 @@
1
+ <div align="center">
2
+
3
+ # KATA
4
+
5
+ **A light-weight and powerful meta-prompting, context engineering and spec-driven development system for Claude Code.**
6
+
7
+ [![npm version](https://img.shields.io/npm/v/@gannonh/kata?style=for-the-badge&logo=npm&logoColor=white&color=CB3837)](https://www.npmjs.com/package/@gannonh/kata)
8
+ [![npm downloads](https://img.shields.io/npm/dm/@gannonh/kata?style=for-the-badge&logo=npm&logoColor=white&color=CB3837)](https://www.npmjs.com/package/@gannonh/kata)
9
+ [![License](https://img.shields.io/badge/license-MIT-blue?style=for-the-badge)](LICENSE)
10
+ [![GitHub stars](https://img.shields.io/github/stars/gannonh/kata?style=for-the-badge&logo=github&color=181717)](https://github.com/gannonh/kata)
11
+
12
+ <br>
13
+
14
+ ```bash
15
+ npx @gannonh/kata
16
+ ```
17
+
18
+ **Works on Mac, Windows, and Linux.**
19
+
20
+ <br>
21
+
22
+ ![Kata Install](assets/terminal.svg)
23
+
24
+ <br>
25
+
26
+ **Trusted by engineers at Amazon, Google, Shopify, and Webflow.**
27
+
28
+ </div>
29
+
30
+ ---
31
+
32
+
33
+ ## Who This Is For
34
+
35
+ People who want to describe what they want and have it built correctly — without pretending they're running a 50-person engineering org.
36
+
37
+ ---
38
+
39
+ ## Getting Started
40
+
41
+ ```bash
42
+ npx @gannonh/kata (coming soon)
43
+ ```
44
+
45
+ That's it. Verify with `/kata:help` inside your Claude Code interface.
46
+
47
+ ### Staying Updated
48
+
49
+ Kata evolves fast. Check for updates periodically:
50
+
51
+ ```
52
+ /kata:whats-new
53
+ ```
54
+
55
+ Update with:
56
+
57
+ ```bash
58
+ npx @gannonh/kata@latest
59
+ ```
60
+
61
+ <details>
62
+ <summary><strong>Non-interactive Install (Docker, CI, Scripts)</strong></summary>
63
+
64
+ ```bash
65
+ npx @gannonh/kata --global # Install to ~/.claude/
66
+ npx @gannonh/kata --local # Install to ./.claude/
67
+ ```
68
+
69
+ Use `--global` (`-g`) or `--local` (`-l`) to skip the interactive prompt.
70
+
71
+ </details>
72
+
73
+ <details>
74
+ <summary><strong>Development Installation</strong></summary>
75
+
76
+ Clone the repository and run the installer locally:
77
+
78
+ ```bash
79
+ git clone https://github.com/gannonh/kata.git
80
+ cd kata
81
+ node bin/install.js --local
82
+ ```
83
+
84
+ Installs to `./.claude/` for testing modifications before contributing.
85
+
86
+ </details>
87
+
88
+ ### Recommended: Skip Permissions Mode
89
+
90
+ Kata is designed for frictionless automation. Run Claude Code with:
91
+
92
+ ```bash
93
+ claude --dangerously-skip-permissions
94
+ ```
95
+
96
+ > [!TIP]
97
+ > This is how Kata is intended to be used — stopping to approve `date` and `git commit` 50 times defeats the purpose.
98
+
99
+ <details>
100
+ <summary><strong>Alternative: Granular Permissions</strong></summary>
101
+
102
+ If you prefer not to use that flag, add this to your project's `.claude/settings.json`:
103
+
104
+ ```json
105
+ {
106
+ "permissions": {
107
+ "allow": [
108
+ "Bash(date:*)",
109
+ "Bash(echo:*)",
110
+ "Bash(cat:*)",
111
+ "Bash(ls:*)",
112
+ "Bash(mkdir:*)",
113
+ "Bash(wc:*)",
114
+ "Bash(head:*)",
115
+ "Bash(tail:*)",
116
+ "Bash(sort:*)",
117
+ "Bash(grep:*)",
118
+ "Bash(tr:*)",
119
+ "Bash(git add:*)",
120
+ "Bash(git commit:*)",
121
+ "Bash(git status:*)",
122
+ "Bash(git log:*)",
123
+ "Bash(git diff:*)",
124
+ "Bash(git tag:*)"
125
+ ]
126
+ }
127
+ }
128
+ ```
129
+
130
+ </details>
131
+
132
+ ---
133
+
134
+ ## How It Works
135
+
136
+ > **Already have code?** Run `/kata:map-codebase` first. It spawns parallel agents to analyze your stack, architecture, conventions, and concerns. Then `/kata:new-project` knows your codebase — questions focus on what you're adding, and planning automatically loads your patterns.
137
+
138
+ ### 1. Initialize Project
139
+
140
+ ```
141
+ /kata:new-project
142
+ ```
143
+
144
+ One command, one flow. The system:
145
+
146
+ 1. **Questions** — Asks until it understands your idea completely (goals, constraints, tech preferences, edge cases)
147
+ 2. **Research** — Spawns parallel agents to investigate the domain (optional but recommended)
148
+ 3. **Requirements** — Extracts what's v1, v2, and out of scope
149
+ 4. **Roadmap** — Creates phases mapped to requirements
150
+
151
+ You approve the roadmap. Now you're ready to build.
152
+
153
+ **Creates:** `PROJECT.md`, `REQUIREMENTS.md`, `ROADMAP.md`, `STATE.md`, `.planning/research/`
154
+
155
+ ---
156
+
157
+ ### 2. Discuss Phase
158
+
159
+ ```
160
+ /kata:discuss-phase 1
161
+ ```
162
+
163
+ **This is where you shape the implementation.**
164
+
165
+ Your roadmap has a sentence or two per phase. That's not enough context to build something the way *you* imagine it. This step captures your preferences before anything gets researched or planned.
166
+
167
+ The system analyzes the phase and identifies gray areas based on what's being built:
168
+
169
+ - **Visual features** → Layout, density, interactions, empty states
170
+ - **APIs/CLIs** → Response format, flags, error handling, verbosity
171
+ - **Content systems** → Structure, tone, depth, flow
172
+ - **Organization tasks** → Grouping criteria, naming, duplicates, exceptions
173
+
174
+ For each area you select, it asks until you're satisfied. The output — `CONTEXT.md` — feeds directly into the next two steps:
175
+
176
+ 1. **Researcher reads it** — Knows what patterns to investigate ("user wants card layout" → research card component libraries)
177
+ 2. **Planner reads it** — Knows what decisions are locked ("infinite scroll decided" → plan includes scroll handling)
178
+
179
+ The deeper you go here, the more the system builds what you actually want. Skip it and you get reasonable defaults. Use it and you get *your* vision.
180
+
181
+ **Creates:** `{phase}-CONTEXT.md`
182
+
183
+ ---
184
+
185
+ ### 3. Plan Phase
186
+
187
+ ```
188
+ /kata:plan-phase 1
189
+ ```
190
+
191
+ The system:
192
+
193
+ 1. **Researches** — Investigates how to implement this phase, guided by your CONTEXT.md decisions
194
+ 2. **Plans** — Creates 2-3 atomic task plans with XML structure
195
+ 3. **Verifies** — Checks plans against requirements, loops until they pass
196
+
197
+ Each plan is small enough to execute in a fresh context window. No degradation, no "I'll be more concise now."
198
+
199
+ **Creates:** `{phase}-RESEARCH.md`, `{phase}-{N}-PLAN.md`
200
+
201
+ ---
202
+
203
+ ### 4. Execute Phase
204
+
205
+ ```
206
+ /kata:execute-phase 1
207
+ ```
208
+
209
+ The system:
210
+
211
+ 1. **Runs plans in waves** — Parallel where possible, sequential when dependent
212
+ 2. **Fresh context per plan** — 200k tokens purely for implementation, zero accumulated garbage
213
+ 3. **Commits per task** — Every task gets its own atomic commit
214
+ 4. **Verifies against goals** — Checks the codebase delivers what the phase promised
215
+
216
+ Walk away, come back to completed work with clean git history.
217
+
218
+ **Creates:** `{phase}-{N}-SUMMARY.md`, `{phase}-VERIFICATION.md`
219
+
220
+ ---
221
+
222
+ ### 5. Verify Work
223
+
224
+ ```
225
+ /kata:verify-work 1
226
+ ```
227
+
228
+ **This is where you confirm it actually works.**
229
+
230
+ Automated verification checks that code exists and tests pass. But does the feature *work* the way you expected? This is your chance to use it.
231
+
232
+ The system:
233
+
234
+ 1. **Extracts testable deliverables** — What you should be able to do now
235
+ 2. **Walks you through one at a time** — "Can you log in with email?" Yes/no, or describe what's wrong
236
+ 3. **Diagnoses failures automatically** — Spawns debug agents to find root causes
237
+ 4. **Creates verified fix plans** — Ready for immediate re-execution
238
+
239
+ If everything passes, you move on. If something's broken, you don't manually debug — you just run `/kata:execute-phase` again with the fix plans it created.
240
+
241
+ **Creates:** `{phase}-UAT.md`, fix plans if issues found
242
+
243
+ ---
244
+
245
+ ### 6. Repeat → Complete → Next Milestone
246
+
247
+ ```
248
+ /kata:discuss-phase 2
249
+ /kata:plan-phase 2
250
+ /kata:execute-phase 2
251
+ /kata:verify-work 2
252
+ ...
253
+ /kata:complete-milestone
254
+ /kata:new-milestone
255
+ ```
256
+
257
+ Loop **discuss → plan → execute → verify** until milestone complete.
258
+
259
+ Each phase gets your input (discuss), proper research (plan), clean execution (execute), and human verification (verify). Context stays fresh. Quality stays high.
260
+
261
+ When all phases are done, `/kata:complete-milestone` archives the milestone and tags the release.
262
+
263
+ Then `/kata:new-milestone` starts the next version — same flow as `new-project` but for your existing codebase. You describe what you want to build next, the system researches the domain, you scope requirements, and it creates a fresh roadmap. Each milestone is a clean cycle: define → build → ship.
264
+
265
+ ---
266
+
267
+ ## Why It Works
268
+
269
+ ### Context Engineering
270
+
271
+ Claude Code is incredibly powerful *if* you give it the context it needs. Most people don't.
272
+
273
+ Kata handles it for you:
274
+
275
+ | File | What it does |
276
+ | ----------------- | ------------------------------------------------------------- |
277
+ | `PROJECT.md` | Project vision, always loaded |
278
+ | `research/` | Ecosystem knowledge (stack, features, architecture, pitfalls) |
279
+ | `REQUIREMENTS.md` | Scoped v1/v2 requirements with phase traceability |
280
+ | `ROADMAP.md` | Where you're going, what's done |
281
+ | `STATE.md` | Decisions, blockers, position — memory across sessions |
282
+ | `PLAN.md` | Atomic task with XML structure, verification steps |
283
+ | `SUMMARY.md` | What happened, what changed, committed to history |
284
+ | `todos/` | Captured ideas and tasks for later work |
285
+
286
+ Size limits based on where Claude's quality degrades. Stay under, get consistent excellence.
287
+
288
+ ### XML Prompt Formatting
289
+
290
+ Every plan is structured XML optimized for Claude:
291
+
292
+ ```xml
293
+ <task type="auto">
294
+ <name>Create login endpoint</name>
295
+ <files>src/app/api/auth/login/route.ts</files>
296
+ <action>
297
+ Use jose for JWT (not jsonwebtoken - CommonJS issues).
298
+ Validate credentials against users table.
299
+ Return httpOnly cookie on success.
300
+ </action>
301
+ <verify>curl -X POST localhost:3000/api/auth/login returns 200 + Set-Cookie</verify>
302
+ <done>Valid credentials return cookie, invalid return 401</done>
303
+ </task>
304
+ ```
305
+
306
+ Precise instructions. No guessing. Verification built in.
307
+
308
+ ### Multi-Agent Orchestration
309
+
310
+ Every stage uses the same pattern: a thin orchestrator spawns specialized agents, collects results, and routes to the next step.
311
+
312
+ | Stage | Orchestrator does | Agents do |
313
+ | ------------ | ---------------------------------- | -------------------------------------------------------------------------- |
314
+ | Research | Coordinates, presents findings | 4 parallel researchers investigate stack, features, architecture, pitfalls |
315
+ | Planning | Validates, manages iteration | Planner creates plans, checker verifies, loop until pass |
316
+ | Execution | Groups into waves, tracks progress | Executors implement in parallel, each with fresh 200k context |
317
+ | Verification | Presents results, routes next | Verifier checks codebase against goals, debuggers diagnose failures |
318
+
319
+ The orchestrator never does heavy lifting. It spawns agents, waits, integrates results.
320
+
321
+ **The result:** You can run an entire phase — deep research, multiple plans created and verified, thousands of lines of code written across parallel executors, automated verification against goals — and your main context window stays at 30-40%. The work happens in fresh subagent contexts. Your session stays fast and responsive.
322
+
323
+ ### Atomic Git Commits
324
+
325
+ Each task gets its own commit immediately after completion:
326
+
327
+ ```bash
328
+ abc123f docs(08-02): complete user registration plan
329
+ def456g feat(08-02): add email confirmation flow
330
+ hij789k feat(08-02): implement password hashing
331
+ lmn012o feat(08-02): create registration endpoint
332
+ ```
333
+
334
+ > [!NOTE]
335
+ > **Benefits:** Git bisect finds exact failing task. Each task independently revertable. Clear history for Claude in future sessions. Better observability in AI-automated workflow.
336
+
337
+ Every commit is surgical, traceable, and meaningful.
338
+
339
+ ### Modular by Design
340
+
341
+ - Add phases to current milestone
342
+ - Insert urgent work between phases
343
+ - Complete milestones and start fresh
344
+ - Adjust plans without rebuilding everything
345
+
346
+ You're never locked in. The system adapts.
347
+
348
+ ---
349
+
350
+ ## Commands
351
+
352
+ ### Core Workflow
353
+
354
+ | Command | What it does |
355
+ | ---------------------------- | ------------------------------------------------------------------ |
356
+ | `/kata:new-project` | Full initialization: questions → research → requirements → roadmap |
357
+ | `/kata:discuss-phase [N]` | Capture implementation decisions before planning |
358
+ | `/kata:plan-phase [N]` | Research + plan + verify for a phase |
359
+ | `/kata:execute-phase <N>` | Execute all plans in parallel waves, verify when complete |
360
+ | `/kata:verify-work [N]` | Manual user acceptance testing ¹ |
361
+ | `/kata:complete-milestone` | Archive milestone, tag release |
362
+ | `/kata:new-milestone [name]` | Start next version: questions → research → requirements → roadmap |
363
+
364
+ ### Navigation
365
+
366
+ | Command | What it does |
367
+ | ---------------- | --------------------------------- |
368
+ | `/kata:progress` | Where am I? What's next? |
369
+ | `/kata:help` | Show all commands and usage guide |
370
+
371
+ ### Brownfield
372
+
373
+ | Command | What it does |
374
+ | -------------------- | -------------------------------------------- |
375
+ | `/kata:map-codebase` | Analyze existing codebase before new-project |
376
+
377
+ ### Phase Management
378
+
379
+ | Command | What it does |
380
+ | ------------------------ | --------------------------------- |
381
+ | `/kata:add-phase` | Append phase to roadmap |
382
+ | `/kata:insert-phase [N]` | Insert urgent work between phases |
383
+ | `/kata:remove-phase [N]` | Remove future phase, renumber |
384
+
385
+ ### Session
386
+
387
+ | Command | What it does |
388
+ | ------------------- | -------------------------------------- |
389
+ | `/kata:pause-work` | Create handoff when stopping mid-phase |
390
+ | `/kata:resume-work` | Restore from last session |
391
+
392
+ ### Utilities
393
+
394
+ | Command | What it does |
395
+ | ----------------------- | ------------------------------------------ |
396
+ | `/kata:add-todo [desc]` | Capture idea for later |
397
+ | `/kata:check-todos` | List pending todos |
398
+ | `/kata:debug [desc]` | Systematic debugging with persistent state |
399
+
400
+ <sup>¹ Contributed by reddit user OracleGreyBeard</sup>
401
+
402
+ ---
403
+
404
+ ## Troubleshooting
405
+
406
+ **Commands not found after install?**
407
+ - Restart Claude Code to reload slash commands
408
+ - Verify files exist in `~/.claude/commands/gsd/` (global) or `./.claude/commands/gsd/` (local)
409
+
410
+ **Commands not working as expected?**
411
+ - Run `/kata:help` to verify installation
412
+ - Re-run `npx @gannonh/kata` to reinstall
413
+
414
+ **Updating to the latest version?**
415
+ ```bash
416
+ npx @gannonh/kata@latest
417
+ ```
418
+
419
+ **Using Docker or containerized environments?**
420
+
421
+ If file reads fail with tilde paths (`~/.claude/...`), set `CLAUDE_CONFIG_DIR` before installing:
422
+ ```bash
423
+ CLAUDE_CONFIG_DIR=/home/youruser/.claude npx @gannonh/kata --global
424
+ ```
425
+ This ensures absolute paths are used instead of `~` which may not expand correctly in containers.
426
+
427
+ ---
428
+
429
+ ## License
430
+
431
+ MIT License. See [LICENSE](LICENSE) for details.
432
+
433
+ ---
434
+
435
+ <div align="center">
436
+
437
+ **Claude Code is powerful. Kata makes it reliable.**
438
+
439
+ </div>