@kata-sh/cli 0.1.0 → 0.1.1

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 (199) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +156 -0
  3. package/dist/app-paths.d.ts +4 -0
  4. package/dist/app-paths.js +6 -0
  5. package/dist/cli.d.ts +1 -0
  6. package/dist/cli.js +56 -0
  7. package/dist/loader.d.ts +2 -0
  8. package/dist/loader.js +95 -0
  9. package/dist/resource-loader.d.ts +18 -0
  10. package/dist/resource-loader.js +50 -0
  11. package/dist/wizard.d.ts +15 -0
  12. package/dist/wizard.js +159 -0
  13. package/package.json +50 -21
  14. package/pkg/dist/modes/interactive/theme/dark.json +85 -0
  15. package/pkg/dist/modes/interactive/theme/light.json +84 -0
  16. package/pkg/dist/modes/interactive/theme/theme-schema.json +335 -0
  17. package/pkg/dist/modes/interactive/theme/theme.d.ts +78 -0
  18. package/pkg/dist/modes/interactive/theme/theme.d.ts.map +1 -0
  19. package/pkg/dist/modes/interactive/theme/theme.js +949 -0
  20. package/pkg/dist/modes/interactive/theme/theme.js.map +1 -0
  21. package/pkg/package.json +8 -0
  22. package/scripts/postinstall.js +45 -0
  23. package/src/resources/AGENTS.md +108 -0
  24. package/src/resources/KATA-WORKFLOW.md +661 -0
  25. package/src/resources/agents/researcher.md +29 -0
  26. package/src/resources/agents/scout.md +56 -0
  27. package/src/resources/agents/worker.md +31 -0
  28. package/src/resources/extensions/ask-user-questions.ts +200 -0
  29. package/src/resources/extensions/bg-shell/index.ts +2758 -0
  30. package/src/resources/extensions/browser-tools/BROWSER-TOOLS-V2-PROPOSAL.md +1277 -0
  31. package/src/resources/extensions/browser-tools/core.js +1057 -0
  32. package/src/resources/extensions/browser-tools/index.ts +4916 -0
  33. package/src/resources/extensions/browser-tools/package.json +20 -0
  34. package/src/resources/extensions/context7/index.ts +428 -0
  35. package/src/resources/extensions/context7/package.json +11 -0
  36. package/src/resources/extensions/get-secrets-from-user.ts +352 -0
  37. package/src/resources/extensions/github/formatters.ts +207 -0
  38. package/src/resources/extensions/github/gh-api.ts +537 -0
  39. package/src/resources/extensions/github/index.ts +778 -0
  40. package/src/resources/extensions/kata/activity-log.ts +88 -0
  41. package/src/resources/extensions/kata/auto.ts +2786 -0
  42. package/src/resources/extensions/kata/commands.ts +355 -0
  43. package/src/resources/extensions/kata/crash-recovery.ts +85 -0
  44. package/src/resources/extensions/kata/dashboard-overlay.ts +516 -0
  45. package/src/resources/extensions/kata/docs/preferences-reference.md +103 -0
  46. package/src/resources/extensions/kata/doctor.ts +683 -0
  47. package/src/resources/extensions/kata/files.ts +730 -0
  48. package/src/resources/extensions/kata/gitignore.ts +165 -0
  49. package/src/resources/extensions/kata/guided-flow.ts +976 -0
  50. package/src/resources/extensions/kata/index.ts +556 -0
  51. package/src/resources/extensions/kata/metrics.ts +397 -0
  52. package/src/resources/extensions/kata/observability-validator.ts +408 -0
  53. package/src/resources/extensions/kata/package.json +11 -0
  54. package/src/resources/extensions/kata/paths.ts +346 -0
  55. package/src/resources/extensions/kata/preferences.ts +695 -0
  56. package/src/resources/extensions/kata/prompt-loader.ts +50 -0
  57. package/src/resources/extensions/kata/prompts/complete-milestone.md +25 -0
  58. package/src/resources/extensions/kata/prompts/complete-slice.md +27 -0
  59. package/src/resources/extensions/kata/prompts/discuss.md +151 -0
  60. package/src/resources/extensions/kata/prompts/doctor-heal.md +29 -0
  61. package/src/resources/extensions/kata/prompts/execute-task.md +64 -0
  62. package/src/resources/extensions/kata/prompts/guided-complete-slice.md +1 -0
  63. package/src/resources/extensions/kata/prompts/guided-discuss-milestone.md +3 -0
  64. package/src/resources/extensions/kata/prompts/guided-discuss-slice.md +59 -0
  65. package/src/resources/extensions/kata/prompts/guided-execute-task.md +1 -0
  66. package/src/resources/extensions/kata/prompts/guided-plan-milestone.md +23 -0
  67. package/src/resources/extensions/kata/prompts/guided-plan-slice.md +1 -0
  68. package/src/resources/extensions/kata/prompts/guided-research-slice.md +11 -0
  69. package/src/resources/extensions/kata/prompts/guided-resume-task.md +1 -0
  70. package/src/resources/extensions/kata/prompts/plan-milestone.md +47 -0
  71. package/src/resources/extensions/kata/prompts/plan-slice.md +63 -0
  72. package/src/resources/extensions/kata/prompts/queue.md +85 -0
  73. package/src/resources/extensions/kata/prompts/reassess-roadmap.md +48 -0
  74. package/src/resources/extensions/kata/prompts/replan-slice.md +39 -0
  75. package/src/resources/extensions/kata/prompts/research-milestone.md +37 -0
  76. package/src/resources/extensions/kata/prompts/research-slice.md +28 -0
  77. package/src/resources/extensions/kata/prompts/run-uat.md +109 -0
  78. package/src/resources/extensions/kata/prompts/system.md +341 -0
  79. package/src/resources/extensions/kata/session-forensics.ts +550 -0
  80. package/src/resources/extensions/kata/skill-discovery.ts +137 -0
  81. package/src/resources/extensions/kata/state.ts +509 -0
  82. package/src/resources/extensions/kata/templates/context.md +76 -0
  83. package/src/resources/extensions/kata/templates/decisions.md +8 -0
  84. package/src/resources/extensions/kata/templates/milestone-summary.md +73 -0
  85. package/src/resources/extensions/kata/templates/plan.md +133 -0
  86. package/src/resources/extensions/kata/templates/preferences.md +15 -0
  87. package/src/resources/extensions/kata/templates/project.md +31 -0
  88. package/src/resources/extensions/kata/templates/reassessment.md +28 -0
  89. package/src/resources/extensions/kata/templates/requirements.md +81 -0
  90. package/src/resources/extensions/kata/templates/research.md +46 -0
  91. package/src/resources/extensions/kata/templates/roadmap.md +118 -0
  92. package/src/resources/extensions/kata/templates/slice-context.md +58 -0
  93. package/src/resources/extensions/kata/templates/slice-summary.md +99 -0
  94. package/src/resources/extensions/kata/templates/state.md +19 -0
  95. package/src/resources/extensions/kata/templates/task-plan.md +52 -0
  96. package/src/resources/extensions/kata/templates/task-summary.md +57 -0
  97. package/src/resources/extensions/kata/templates/uat.md +54 -0
  98. package/src/resources/extensions/kata/tests/activity-log-prune.test.ts +327 -0
  99. package/src/resources/extensions/kata/tests/auto-preflight.test.ts +97 -0
  100. package/src/resources/extensions/kata/tests/auto-supervisor.test.mjs +53 -0
  101. package/src/resources/extensions/kata/tests/complete-milestone.test.ts +317 -0
  102. package/src/resources/extensions/kata/tests/cost-projection.test.ts +160 -0
  103. package/src/resources/extensions/kata/tests/derive-state-deps.test.ts +477 -0
  104. package/src/resources/extensions/kata/tests/derive-state.test.ts +1013 -0
  105. package/src/resources/extensions/kata/tests/doctor.test.ts +718 -0
  106. package/src/resources/extensions/kata/tests/idle-recovery.test.ts +490 -0
  107. package/src/resources/extensions/kata/tests/metrics-io.test.ts +254 -0
  108. package/src/resources/extensions/kata/tests/metrics.test.ts +217 -0
  109. package/src/resources/extensions/kata/tests/must-have-parser.test.ts +309 -0
  110. package/src/resources/extensions/kata/tests/parsers.test.ts +1257 -0
  111. package/src/resources/extensions/kata/tests/plan-milestone.test.ts +185 -0
  112. package/src/resources/extensions/kata/tests/plan-quality-validator.test.ts +386 -0
  113. package/src/resources/extensions/kata/tests/reassess-prompt.test.ts +208 -0
  114. package/src/resources/extensions/kata/tests/replan-slice.test.ts +686 -0
  115. package/src/resources/extensions/kata/tests/requirements.test.ts +151 -0
  116. package/src/resources/extensions/kata/tests/resolve-ts-hooks.mjs +17 -0
  117. package/src/resources/extensions/kata/tests/resolve-ts.mjs +11 -0
  118. package/src/resources/extensions/kata/tests/run-uat.test.ts +383 -0
  119. package/src/resources/extensions/kata/tests/unit-runtime.test.ts +388 -0
  120. package/src/resources/extensions/kata/tests/workspace-index.test.ts +118 -0
  121. package/src/resources/extensions/kata/tests/worktree.test.ts +222 -0
  122. package/src/resources/extensions/kata/types.ts +159 -0
  123. package/src/resources/extensions/kata/unit-runtime.ts +163 -0
  124. package/src/resources/extensions/kata/workspace-index.ts +203 -0
  125. package/src/resources/extensions/kata/worktree.ts +182 -0
  126. package/src/resources/extensions/mac-tools/index.ts +852 -0
  127. package/src/resources/extensions/mac-tools/swift-cli/Package.swift +22 -0
  128. package/src/resources/extensions/mac-tools/swift-cli/Sources/main.swift +1318 -0
  129. package/src/resources/extensions/search-the-web/cache.ts +78 -0
  130. package/src/resources/extensions/search-the-web/format.ts +258 -0
  131. package/src/resources/extensions/search-the-web/http.ts +238 -0
  132. package/src/resources/extensions/search-the-web/index.ts +68 -0
  133. package/src/resources/extensions/search-the-web/tool-fetch-page.ts +519 -0
  134. package/src/resources/extensions/search-the-web/tool-llm-context.ts +404 -0
  135. package/src/resources/extensions/search-the-web/tool-search.ts +503 -0
  136. package/src/resources/extensions/search-the-web/url-utils.ts +91 -0
  137. package/src/resources/extensions/shared/confirm-ui.ts +126 -0
  138. package/src/resources/extensions/shared/interview-ui.ts +822 -0
  139. package/src/resources/extensions/shared/next-action-ui.ts +235 -0
  140. package/src/resources/extensions/shared/progress-widget.ts +282 -0
  141. package/src/resources/extensions/shared/thinking-widget.ts +107 -0
  142. package/src/resources/extensions/shared/ui.ts +400 -0
  143. package/src/resources/extensions/shared/wizard-ui.ts +551 -0
  144. package/src/resources/extensions/slash-commands/audit.ts +92 -0
  145. package/src/resources/extensions/slash-commands/create-extension.ts +375 -0
  146. package/src/resources/extensions/slash-commands/create-slash-command.ts +280 -0
  147. package/src/resources/extensions/slash-commands/index.ts +12 -0
  148. package/src/resources/extensions/slash-commands/kata-run.ts +34 -0
  149. package/src/resources/extensions/subagent/agents.ts +126 -0
  150. package/src/resources/extensions/subagent/index.ts +1293 -0
  151. package/src/resources/skills/debug-like-expert/SKILL.md +231 -0
  152. package/src/resources/skills/debug-like-expert/references/debugging-mindset.md +253 -0
  153. package/src/resources/skills/debug-like-expert/references/hypothesis-testing.md +373 -0
  154. package/src/resources/skills/debug-like-expert/references/investigation-techniques.md +337 -0
  155. package/src/resources/skills/debug-like-expert/references/verification-patterns.md +425 -0
  156. package/src/resources/skills/debug-like-expert/references/when-to-research.md +361 -0
  157. package/src/resources/skills/frontend-design/SKILL.md +45 -0
  158. package/src/resources/skills/swiftui/SKILL.md +208 -0
  159. package/src/resources/skills/swiftui/references/animations.md +921 -0
  160. package/src/resources/skills/swiftui/references/architecture.md +1561 -0
  161. package/src/resources/skills/swiftui/references/layout-system.md +1186 -0
  162. package/src/resources/skills/swiftui/references/navigation.md +1492 -0
  163. package/src/resources/skills/swiftui/references/networking-async.md +214 -0
  164. package/src/resources/skills/swiftui/references/performance.md +1706 -0
  165. package/src/resources/skills/swiftui/references/platform-integration.md +204 -0
  166. package/src/resources/skills/swiftui/references/state-management.md +1443 -0
  167. package/src/resources/skills/swiftui/references/swiftdata.md +297 -0
  168. package/src/resources/skills/swiftui/references/testing-debugging.md +247 -0
  169. package/src/resources/skills/swiftui/references/uikit-appkit-interop.md +218 -0
  170. package/src/resources/skills/swiftui/workflows/add-feature.md +191 -0
  171. package/src/resources/skills/swiftui/workflows/build-new-app.md +311 -0
  172. package/src/resources/skills/swiftui/workflows/debug-swiftui.md +192 -0
  173. package/src/resources/skills/swiftui/workflows/optimize-performance.md +197 -0
  174. package/src/resources/skills/swiftui/workflows/ship-app.md +203 -0
  175. package/src/resources/skills/swiftui/workflows/write-tests.md +235 -0
  176. package/dist/commands/task.d.ts +0 -9
  177. package/dist/commands/task.d.ts.map +0 -1
  178. package/dist/commands/task.js +0 -129
  179. package/dist/commands/task.js.map +0 -1
  180. package/dist/commands/task.test.d.ts +0 -2
  181. package/dist/commands/task.test.d.ts.map +0 -1
  182. package/dist/commands/task.test.js +0 -169
  183. package/dist/commands/task.test.js.map +0 -1
  184. package/dist/e2e/task-e2e.test.d.ts +0 -2
  185. package/dist/e2e/task-e2e.test.d.ts.map +0 -1
  186. package/dist/e2e/task-e2e.test.js +0 -173
  187. package/dist/e2e/task-e2e.test.js.map +0 -1
  188. package/dist/index.d.ts +0 -3
  189. package/dist/index.d.ts.map +0 -1
  190. package/dist/index.js +0 -93
  191. package/dist/index.js.map +0 -1
  192. package/dist/slug.d.ts +0 -2
  193. package/dist/slug.d.ts.map +0 -1
  194. package/dist/slug.js +0 -12
  195. package/dist/slug.js.map +0 -1
  196. package/dist/slug.test.d.ts +0 -2
  197. package/dist/slug.test.d.ts.map +0 -1
  198. package/dist/slug.test.js +0 -32
  199. package/dist/slug.test.js.map +0 -1
@@ -0,0 +1,85 @@
1
+ {{preamble}}
2
+
3
+ Say exactly: "What do you want to add?" — nothing else. Wait for the user's answer.
4
+
5
+ ## Discussion Phase
6
+
7
+ After they describe it, your job is to understand the new work deeply enough to create context files that a future planning session can use.
8
+
9
+ **If the user provides a file path or pastes a large document** (spec, design doc, product plan, chat export), read it fully before asking questions. Use it as the starting point — don't ask them to re-explain what's already in the document. Your questions should fill gaps and resolve ambiguities the document doesn't cover.
10
+
11
+ **Investigate between question rounds to make your questions smarter.** Before each round of questions, do enough lightweight research that your questions are grounded in reality — not guesses about what exists or what's possible.
12
+
13
+ - Check library docs (`resolve_library` / `get_library_docs`) when the user mentions tech you need current facts about — capabilities, constraints, API shapes, version-specific behavior
14
+ - Do web searches (`search-the-web`) to verify the landscape — what solutions exist, what's changed recently, what's the current best practice. Use `freshness` for recency-sensitive queries, `domain` to target specific sites. Use `fetch_page` to read the full content of promising URLs when snippets aren't enough.
15
+ - Scout the codebase (`ls`, `find`, `rg`, or `scout` for broad unfamiliar areas) to understand what already exists, what patterns are established, what constraints current code imposes
16
+
17
+ Don't go deep — just enough that your next question reflects what's actually true rather than what you assume.
18
+
19
+ **Use this to actively surface:**
20
+ - The biggest technical unknowns — what could fail, what hasn't been proven, what might invalidate the plan
21
+ - Integration surfaces — external systems, APIs, libraries, or internal modules this work touches
22
+ - What needs to be proven before committing — the things that, if they don't work, mean the plan is wrong
23
+ - How the new work relates to existing milestones — overlap, dependencies, prerequisites
24
+ - If `.kata/REQUIREMENTS.md` exists: which unmet Active or Deferred requirements this queued work advances
25
+
26
+ **Then use ask_user_questions** to dig into gray areas — architecture choices, scope boundaries, tech preferences, what's in vs out. 1-3 questions per round.
27
+
28
+ If a `Kata Skill Preferences` block is present in system context, use it to decide which skills to load and follow during discuss/planning work, but do not let it override the required discuss flow or artifact requirements.
29
+
30
+ **Self-regulate:** After about 10-15 questions total (3-5 rounds), or when you feel you have a solid understanding, include a question like:
31
+ "I think I have a good picture. Ready to queue this, or are there more things to discuss?"
32
+ with options: "Ready to queue (Recommended)", "I have more to discuss"
33
+
34
+ If the user wants to keep going, keep asking. If they're ready, proceed.
35
+
36
+ ## Existing Milestone Awareness
37
+
38
+ {{existingMilestonesContext}}
39
+
40
+ Before writing anything, assess the new work against what already exists:
41
+
42
+ 1. **Dedup check** — Is this already covered (fully or partially) by an existing milestone? If so, tell the user and explain what's already planned. Don't create duplicate milestones.
43
+ 2. **Extension check** — Should this be added to an existing *pending* (not yet started) milestone rather than creating a new one? If the scope naturally belongs with existing pending work, propose extending that milestone's context instead.
44
+ 3. **Dependency check** — Does the new work depend on something that's currently in progress or planned? Note the dependency so context files capture it.
45
+ 4. **Requirement check** — If `.kata/REQUIREMENTS.md` exists, identify whether this queued work advances unmet Active requirements, promotes Deferred work, or introduces entirely new scope that should also update the requirement contract.
46
+
47
+ If the new work is already fully covered, say so and stop — don't create anything.
48
+
49
+ ## Scope Assessment
50
+
51
+ Before writing artifacts, assess whether this is **single-milestone** or **multi-milestone** scope.
52
+
53
+ **Single milestone** if the work is one coherent body of deliverables that fits in roughly 2-12 slices.
54
+
55
+ **Multi-milestone** if:
56
+ - The work has natural phase boundaries
57
+ - Different parts could ship independently on different timelines
58
+ - The full scope is too large for one milestone to stay focused
59
+ - The document/spec describes what is clearly multiple major efforts
60
+
61
+ If multi-milestone: propose the split to the user before writing artifacts.
62
+
63
+ ## Sequencing
64
+
65
+ Determine where the new milestones should go in the overall sequence. Consider dependencies, prerequisites, and independence.
66
+
67
+ ## Output Phase
68
+
69
+ Once the user is satisfied, in a single pass for **each** new milestone (starting from {{nextId}}):
70
+
71
+ 1. `mkdir -p .kata/milestones/<ID>/slices`
72
+ 2. Write `.kata/milestones/<ID>/<ID>-CONTEXT.md` — read the template at `~/.kata/agent/extensions/kata/templates/context.md` first. Capture intent, scope, risks, constraints, integration points, and relevant requirements. Mark the status as "Queued — pending auto-mode execution."
73
+
74
+ Then, after all milestone directories and context files are written:
75
+
76
+ 3. Update `.kata/PROJECT.md` — add the new milestones to the Milestone Sequence. Keep existing entries exactly as they are. Only add new lines.
77
+ 4. If `.kata/REQUIREMENTS.md` exists and the queued work introduces new in-scope capabilities or promotes Deferred items, update it.
78
+ 5. If discussion produced decisions relevant to existing work, append to `.kata/DECISIONS.md`.
79
+ 6. Append to `.kata/QUEUE.md`.
80
+ 7. Commit: `docs: queue <milestone list>`
81
+
82
+ **Do NOT write roadmaps for queued milestones.**
83
+ **Do NOT update `.kata/STATE.md`.**
84
+
85
+ After writing the files and committing, say exactly: "Queued N milestone(s). Auto-mode will pick them up after current work completes." — nothing else.
@@ -0,0 +1,48 @@
1
+ You are executing Kata auto-mode.
2
+
3
+ ## UNIT: Reassess Roadmap — Milestone {{milestoneId}} after {{completedSliceId}}
4
+
5
+ All relevant context has been preloaded below — the current roadmap, completed slice summary, project state, and decisions are inlined. Start working immediately without re-reading these files.
6
+
7
+ {{inlinedContext}}
8
+
9
+ If a `Kata Skill Preferences` block is present in system context, use it to decide which skills to load and follow during reassessment, without relaxing required verification or artifact rules.
10
+
11
+ Then assess whether the remaining roadmap still makes sense given what was just built.
12
+
13
+ **Bias strongly toward "roadmap is fine."** Most of the time, the plan is still good. Only rewrite if you have concrete evidence that remaining slices need to change. Don't rewrite for cosmetic reasons, minor optimization, or theoretical improvements.
14
+
15
+ Ask yourself:
16
+ - Did this slice retire the risk it was supposed to? If not, does a remaining slice need to address it?
17
+ - Did new risks or unknowns emerge that should change slice ordering?
18
+ - Are the boundary contracts in the boundary map still accurate given what was actually built?
19
+ - Should any remaining slices be reordered, merged, split, or adjusted based on concrete evidence?
20
+ - Did assumptions in remaining slice descriptions turn out wrong?
21
+ - If `.kata/REQUIREMENTS.md` exists: did this slice validate, invalidate, defer, block, or newly surface requirements?
22
+ - If `.kata/REQUIREMENTS.md` exists: does the remaining roadmap still provide credible coverage for Active requirements, including launchability, primary user loop, continuity, and failure visibility where relevant?
23
+
24
+ ### Success-Criterion Coverage Check
25
+
26
+ Before deciding whether changes are needed, enumerate each success criterion from the roadmap's `## Success Criteria` section and map it to the remaining (unchecked) slice(s) that prove it. Each criterion must have at least one remaining owning slice. If any criterion has no remaining owner after the proposed changes, flag it as a **blocking issue** — do not accept changes that leave a criterion unproved.
27
+
28
+ Format each criterion as a single line:
29
+
30
+ - `Criterion text → S02, S03` (covered by at least one remaining slice)
31
+ - `Criterion text → ⚠ no remaining owner — BLOCKING` (no slice proves this criterion)
32
+
33
+ If all criteria have at least one remaining owning slice, the coverage check passes. If any criterion has no remaining owner, resolve it before finalizing the assessment — either by keeping a slice that was going to be removed, adding coverage to another slice, or explaining why the criterion is no longer relevant.
34
+
35
+ **If the roadmap is still good:**
36
+
37
+ Write `{{assessmentAbsPath}}` with a brief confirmation that roadmap coverage still holds after {{completedSliceId}}. If requirements exist, explicitly note whether requirement coverage remains sound.
38
+
39
+ **If changes are needed:**
40
+
41
+ 1. Rewrite the remaining (unchecked) slices in `{{roadmapPath}}`. Keep completed slices exactly as they are (`[x]`). Update the boundary map for changed slices. Update the proof strategy if risks changed. Update requirement coverage if ownership or scope changed.
42
+ 2. Write `{{assessmentAbsPath}}` explaining what changed and why — keep it brief and concrete.
43
+ 3. If `.kata/REQUIREMENTS.md` exists and requirement ownership or status changed, update it.
44
+ 4. Commit: `docs({{milestoneId}}): reassess roadmap after {{completedSliceId}}`
45
+
46
+ **You MUST write the file `{{assessmentAbsPath}}` before finishing.**
47
+
48
+ When done, say: "Roadmap reassessed."
@@ -0,0 +1,39 @@
1
+ You are executing Kata auto-mode.
2
+
3
+ ## UNIT: Replan Slice {{sliceId}} ("{{sliceTitle}}") — Milestone {{milestoneId}}
4
+
5
+ A completed task reported `blocker_discovered: true`, meaning the current slice plan cannot be executed as-is. Your job is to rewrite the remaining tasks in the slice plan to address the blocker while preserving all completed work.
6
+
7
+ All relevant context has been preloaded below — the roadmap, current slice plan, the blocker task summary, and decisions are inlined. Start working immediately without re-reading these files.
8
+
9
+ {{inlinedContext}}
10
+
11
+ ## Hard Constraints
12
+
13
+ - **Do NOT renumber or remove completed tasks.** All `[x]` tasks and their IDs must remain exactly as they are in the plan.
14
+ - **Do NOT change completed task descriptions, estimates, or metadata.** They are historical records.
15
+ - **Preserve completed task summaries.** Do not modify any `T0x-SUMMARY.md` files for completed tasks.
16
+ - Only modify `[ ]` (incomplete) tasks. You may rewrite, reorder, add, or remove incomplete tasks as needed to address the blocker.
17
+ - New tasks must follow the existing ID numbering sequence (e.g., if T01–T03 exist, new tasks start at T04 or continue from the highest existing ID).
18
+
19
+ ## Instructions
20
+
21
+ 1. Read the blocker task summary carefully. Understand exactly what was discovered and why it blocks the current plan.
22
+ 2. Analyze the remaining `[ ]` tasks in the slice plan. Determine which are still valid, which need modification, and which should be replaced.
23
+ 3. Write `{{replanAbsPath}}` documenting:
24
+ - What blocker was discovered and in which task
25
+ - What changed in the plan and why
26
+ - Which incomplete tasks were modified, added, or removed
27
+ - Any new risks or considerations introduced by the replan
28
+ 4. Rewrite `{{planPath}}` with the updated slice plan:
29
+ - Keep all `[x]` tasks exactly as they were (same IDs, same descriptions, same checkmarks)
30
+ - Update the `[ ]` tasks to address the blocker
31
+ - Ensure the slice Goal and Demo sections are still achievable with the new tasks, or update them if the blocker fundamentally changes what the slice can deliver
32
+ - Update the Files Likely Touched section if the replan changes which files are affected
33
+ 5. If any incomplete task had a `T0x-PLAN.md`, remove or rewrite it to match the new task description.
34
+ 6. Commit all changes: `git add -A && git commit -m 'refactor({{sliceId}}): replan after blocker in {{blockerTaskId}}'`
35
+ 7. Update `.kata/STATE.md`
36
+
37
+ **You MUST write `{{replanAbsPath}}` and the updated slice plan before finishing.**
38
+
39
+ When done, say: "Slice {{sliceId}} replanned."
@@ -0,0 +1,37 @@
1
+ You are executing Kata auto-mode.
2
+
3
+ ## UNIT: Research Milestone {{milestoneId}} ("{{milestoneTitle}}")
4
+
5
+ All relevant context has been preloaded below — start working immediately without re-reading these files.
6
+
7
+ {{inlinedContext}}
8
+
9
+ Then research the codebase and relevant technologies:
10
+ 1. If a `Kata Skill Preferences` block is present in system context, use it to decide which skills to load and follow during research, without relaxing required verification or artifact rules
11
+ 2. **Skill Discovery ({{skillDiscoveryMode}}):**{{skillDiscoveryInstructions}}
12
+ 3. Explore relevant code. For small/familiar codebases, use `rg`, `find`, and targeted reads. For large or unfamiliar codebases, use `scout` to build a broad map efficiently before diving in.
13
+ 4. Use `resolve_library` / `get_library_docs` for unfamiliar libraries
14
+ 5. Read the template at `~/.kata/agent/extensions/kata/templates/research.md`
15
+ 6. If `.kata/REQUIREMENTS.md` exists, research against it. Identify which Active requirements are table stakes, likely omissions, overbuilt risks, or domain-standard behaviors the user may or may not want.
16
+ 7. Write `{{outputPath}}` with:
17
+ - Summary (2-3 paragraphs, primary recommendation)
18
+ - Don't Hand-Roll table (problems with existing solutions)
19
+ - Common Pitfalls (what goes wrong, how to avoid)
20
+ - Relevant Code (existing files, patterns, integration points)
21
+ - Sources
22
+
23
+ ## Strategic Questions to Answer
24
+
25
+ - What should be proven first?
26
+ - What existing patterns should be reused?
27
+ - What boundary contracts matter?
28
+ - What constraints does the existing codebase impose?
29
+ - Are there known failure modes that should shape slice ordering?
30
+ - If requirements exist: what table stakes, expected behaviors, continuity expectations, launchability expectations, or failure-visibility expectations are missing, optional, or clearly out of scope?
31
+ - Which research findings should become candidate requirements versus remaining advisory only?
32
+
33
+ **Research is advisory, not auto-binding.** Surface candidate requirements clearly instead of silently expanding scope.
34
+
35
+ **You MUST write the file `{{outputAbsPath}}` before finishing.**
36
+
37
+ When done, say: "Milestone {{milestoneId}} researched."
@@ -0,0 +1,28 @@
1
+ You are executing Kata auto-mode.
2
+
3
+ ## UNIT: Research Slice {{sliceId}} ("{{sliceTitle}}") — Milestone {{milestoneId}}
4
+
5
+ All relevant context has been preloaded below — start working immediately without re-reading these files.
6
+
7
+ {{inlinedContext}}
8
+
9
+ ### Dependency Slice Summaries
10
+
11
+ Pay particular attention to **Forward Intelligence** sections — they contain hard-won knowledge about what's fragile, what assumptions changed, and what to watch out for.
12
+
13
+ {{dependencySummaries}}
14
+
15
+ Then research what this slice needs:
16
+ 0. If `REQUIREMENTS.md` was preloaded above, identify which Active requirements this slice owns or supports. Research should target these requirements — surfacing risks, unknowns, and implementation constraints that could affect whether the slice actually delivers them.
17
+ 1. If a `Kata Skill Preferences` block is present in system context, use it to decide which skills to load and follow during research, without relaxing required verification or artifact rules
18
+ 2. **Skill Discovery ({{skillDiscoveryMode}}):**{{skillDiscoveryInstructions}}
19
+ 3. Explore relevant code for this slice's scope. For targeted exploration, use `rg`, `find`, and reads. For broad or unfamiliar subsystems, use `scout` to map the relevant area first.
20
+ 4. Use `resolve_library` / `get_library_docs` for unfamiliar libraries
21
+ 5. Read the template at `~/.kata/agent/extensions/kata/templates/research.md`
22
+ 6. Write `{{outputPath}}`
23
+
24
+ The slice directory already exists at `{{slicePath}}/`. Do NOT mkdir — just write the file.
25
+
26
+ **You MUST write the file `{{outputAbsPath}}` before finishing.**
27
+
28
+ When done, say: "Slice {{sliceId}} researched."
@@ -0,0 +1,109 @@
1
+ You are executing Kata auto-mode.
2
+
3
+ ## UNIT: Run UAT — {{milestoneId}}/{{sliceId}}
4
+
5
+ All relevant context has been preloaded below. Start working immediately without re-reading these files.
6
+
7
+ {{inlinedContext}}
8
+
9
+ If a `Kata Skill Preferences` block is present in system context, use it to decide which skills to load and follow during UAT execution, without relaxing required verification or artifact rules.
10
+
11
+ ---
12
+
13
+ ## UAT Instructions
14
+
15
+ **UAT file:** `{{uatPath}}`
16
+ **UAT type:** `{{uatType}}`
17
+ **Result file to write:** `{{uatResultAbsPath}}` (relative: `{{uatResultPath}}`)
18
+
19
+ ### If UAT type is `artifact-driven`
20
+
21
+ You are the test runner. Execute every check defined in `{{uatPath}}` directly:
22
+
23
+ - Run shell commands with `bash`
24
+ - Run `grep` / `rg` checks against files
25
+ - Run `node` / script invocations
26
+ - Read files and verify their contents
27
+ - Check that expected artifacts exist and have correct structure
28
+
29
+ For each check, record:
30
+ - The check description (from the UAT file)
31
+ - The command or action taken
32
+ - The actual result observed
33
+ - PASS or FAIL verdict
34
+
35
+ After running all checks, compute the **overall verdict**:
36
+ - `PASS` — all checks passed
37
+ - `FAIL` — one or more checks failed
38
+ - `PARTIAL` — some checks passed, some failed or were skipped
39
+
40
+ Write `{{uatResultAbsPath}}` with:
41
+
42
+ ```markdown
43
+ ---
44
+ sliceId: {{sliceId}}
45
+ uatType: {{uatType}}
46
+ verdict: PASS | FAIL | PARTIAL
47
+ date: <ISO 8601 timestamp>
48
+ ---
49
+
50
+ # UAT Result — {{sliceId}}
51
+
52
+ ## Checks
53
+
54
+ | Check | Result | Notes |
55
+ |-------|--------|-------|
56
+ | <check description> | PASS / FAIL | <observed output or reason> |
57
+
58
+ ## Overall Verdict
59
+
60
+ <PASS / FAIL / PARTIAL> — <one sentence summary>
61
+
62
+ ## Notes
63
+
64
+ <any additional context, errors encountered, or follow-up items>
65
+ ```
66
+
67
+ ### If UAT type is NOT `artifact-driven` (type is `{{uatType}}`)
68
+
69
+ This UAT type requires human execution or live-runtime observation that you cannot perform mechanically. Your role is to surface it clearly for review.
70
+
71
+ Write `{{uatResultAbsPath}}` with:
72
+
73
+ ```markdown
74
+ ---
75
+ sliceId: {{sliceId}}
76
+ uatType: {{uatType}}
77
+ verdict: surfaced-for-human-review
78
+ date: <ISO 8601 timestamp>
79
+ ---
80
+
81
+ # UAT Result — {{sliceId}}
82
+
83
+ ## UAT Type
84
+
85
+ `{{uatType}}` — requires human execution or live-runtime verification.
86
+
87
+ ## Status
88
+
89
+ Surfaced for human review. Auto-mode will pause after this unit so the UAT can be performed manually.
90
+
91
+ ## UAT File
92
+
93
+ See `{{uatPath}}` for the full UAT specification and acceptance criteria.
94
+
95
+ ## Instructions for Human Reviewer
96
+
97
+ Review `{{uatPath}}`, perform the described UAT steps, then update this file with:
98
+ - The actual verdict (PASS / FAIL / PARTIAL)
99
+ - Results for each check
100
+ - Date completed
101
+
102
+ Once updated, run `/kata auto` to resume auto-mode.
103
+ ```
104
+
105
+ ---
106
+
107
+ **You MUST write `{{uatResultAbsPath}}` before finishing.**
108
+
109
+ When done, say: "UAT {{sliceId}} complete."