@kata-sh/cli 0.1.0 → 0.1.2

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,50 @@
1
+ /**
2
+ * Kata Prompt Loader
3
+ *
4
+ * Reads .md prompt templates from the prompts/ directory and substitutes
5
+ * {{variable}} placeholders with provided values.
6
+ *
7
+ * Templates live at prompts/ relative to this module's directory.
8
+ * They use {{variableName}} syntax for substitution.
9
+ */
10
+
11
+ import { readFileSync } from "node:fs";
12
+ import { join, dirname } from "node:path";
13
+ import { fileURLToPath } from "node:url";
14
+
15
+ const promptsDir = join(dirname(fileURLToPath(import.meta.url)), "prompts");
16
+
17
+ /**
18
+ * Load a prompt template and substitute variables.
19
+ *
20
+ * @param name - Template filename without .md extension (e.g. "execute-task")
21
+ * @param vars - Key-value pairs to substitute for {{key}} placeholders
22
+ */
23
+ export function loadPrompt(name: string, vars: Record<string, string> = {}): string {
24
+ const path = join(promptsDir, `${name}.md`);
25
+ let content = readFileSync(path, "utf-8");
26
+
27
+ // Check BEFORE substitution: find all {{varName}} placeholders the template
28
+ // declares and verify every one has a value in vars. Checking after substitution
29
+ // would also flag {{...}} patterns injected by inlined content (e.g. template
30
+ // files embedded in {{inlinedContext}}), producing false positives.
31
+ const declared = content.match(/\{\{[a-zA-Z][a-zA-Z0-9_]*\}\}/g);
32
+ if (declared) {
33
+ const missing = [...new Set(declared)]
34
+ .map(m => m.slice(2, -2))
35
+ .filter(key => !(key in vars));
36
+ if (missing.length > 0) {
37
+ throw new Error(
38
+ `loadPrompt("${name}"): template declares {{${missing.join("}}, {{")}}}} but no value was provided. ` +
39
+ `This usually means the extension code in memory is older than the template on disk. ` +
40
+ `Restart pi to reload the extension.`
41
+ );
42
+ }
43
+ }
44
+
45
+ for (const [key, value] of Object.entries(vars)) {
46
+ content = content.replaceAll(`{{${key}}}`, value);
47
+ }
48
+
49
+ return content.trim();
50
+ }
@@ -0,0 +1,25 @@
1
+ You are executing Kata auto-mode.
2
+
3
+ ## UNIT: Complete Milestone {{milestoneId}} ("{{milestoneTitle}}")
4
+
5
+ All relevant context has been preloaded below — the roadmap, all slice summaries, requirements, decisions, and project context are inlined. Start working immediately without re-reading these files.
6
+
7
+ {{inlinedContext}}
8
+
9
+ Then:
10
+ 1. Read the milestone-summary template at `~/.kata-cli/agent/extensions/kata/templates/milestone-summary.md`
11
+ 2. If a `Kata Skill Preferences` block is present in system context, use it to decide which skills to load and follow during completion, without relaxing required verification or artifact rules
12
+ 3. Verify each **success criterion** from the milestone definition in `{{roadmapPath}}`. For each criterion, confirm it was met with specific evidence from slice summaries, test results, or observable behavior. List any criterion that was NOT met.
13
+ 4. Verify the milestone's **definition of done** — all slices are `[x]`, all slice summaries exist, and any cross-slice integration points work correctly.
14
+ 5. Validate **requirement status transitions**. For each requirement that changed status during this milestone, confirm the transition is supported by evidence. Requirements can move between Active, Validated, Deferred, Blocked, or Out of Scope — but only with proof.
15
+ 6. Write `{{milestoneSummaryAbsPath}}` using the milestone-summary template. Fill all frontmatter fields and narrative sections. The `requirement_outcomes` field must list every requirement that changed status with `from_status`, `to_status`, and `proof`.
16
+ 7. Update `.kata/REQUIREMENTS.md` if any requirement status transitions were validated in step 5.
17
+ 8. Update `.kata/PROJECT.md` to reflect milestone completion and current project state.
18
+ 9. Commit all changes: `git add -A && git commit -m 'feat(kata): complete {{milestoneId}}'`
19
+ 10. Update `.kata/STATE.md`
20
+
21
+ **Important:** Do NOT skip the success criteria and definition of done verification (steps 3-4). The milestone summary must reflect actual verified outcomes, not assumed success. If any criterion was not met, document it clearly in the summary and do not mark the milestone as passing verification.
22
+
23
+ **You MUST write `{{milestoneSummaryAbsPath}}` AND update PROJECT.md before finishing.**
24
+
25
+ When done, say: "Milestone {{milestoneId}} complete."
@@ -0,0 +1,27 @@
1
+ You are executing Kata auto-mode.
2
+
3
+ ## UNIT: Complete Slice {{sliceId}} ("{{sliceTitle}}") — Milestone {{milestoneId}}
4
+
5
+ All relevant context has been preloaded below — the slice plan, all task summaries, and the milestone roadmap are inlined. Start working immediately without re-reading these files.
6
+
7
+ {{inlinedContext}}
8
+
9
+ Then:
10
+ 1. Read the templates:
11
+ - `~/.kata-cli/agent/extensions/kata/templates/slice-summary.md`
12
+ - `~/.kata-cli/agent/extensions/kata/templates/uat.md`
13
+ 2. If a `Kata Skill Preferences` block is present in system context, use it to decide which skills to load and follow during completion, without relaxing required verification or artifact rules
14
+ 3. Run all slice-level verification checks defined in the slice plan. All must pass before marking the slice done. If any fail, fix them first.
15
+ 4. Confirm the slice's observability/diagnostic surfaces are real and useful where relevant: status inspection works, failure state is externally visible, structured errors/logs are actionable, and hidden failures are not being mistaken for success.
16
+ 5. If `.kata/REQUIREMENTS.md` exists, update it based on what this slice actually proved. Move requirements between Active, Validated, Deferred, Blocked, or Out of Scope only when the evidence from execution supports that change. Surface any new candidate requirements discovered during execution instead of silently dropping them.
17
+ 6. Write `{{sliceSummaryAbsPath}}` (compress all task summaries). Fill the requirement-related sections explicitly.
18
+ 7. Write `{{sliceUatAbsPath}}`. Fill the new `UAT Type`, `Requirements Proved By This UAT`, and `Not Proven By This UAT` sections explicitly.
19
+ 8. Review task summaries for `key_decisions`. Ensure any significant architectural, pattern, or observability decisions are in `.kata/DECISIONS.md`. If any are missing, append them now.
20
+ 9. Mark {{sliceId}} done in `{{roadmapPath}}` (change `[ ]` to `[x]`)
21
+ 10. Commit all remaining slice changes: `git add -A && git commit -m 'feat(kata): complete {{sliceId}}'`. Do not squash-merge manually; the extension will merge the slice branch back to main after this unit succeeds.
22
+ 11. Update `.kata/PROJECT.md` if it exists — refresh current state if needed.
23
+ 12. Update `.kata/STATE.md`
24
+
25
+ **You MUST mark {{sliceId}} as `[x]` in `{{roadmapPath}}` AND write `{{sliceSummaryAbsPath}}` before finishing.**
26
+
27
+ When done, say: "Slice {{sliceId}} complete."
@@ -0,0 +1,151 @@
1
+ {{preamble}}
2
+
3
+ Say exactly: "What's the vision?" — nothing else. Wait for the user's answer.
4
+
5
+ ## Discussion Phase
6
+
7
+ After they describe it, your job is to understand the project deeply enough to define the project's capability contract before planning slices.
8
+
9
+ ## Vision Mapping
10
+
11
+ Before diving into detailed Q&A, read the user's description and classify its scale:
12
+
13
+ - **Task** — a focused piece of work (single milestone, few slices)
14
+ - **Project** — a coherent product with multiple major capabilities (multi-milestone likely)
15
+ - **Product/Platform** — a large vision with distinct phases, audiences, or systems (definitely multi-milestone)
16
+
17
+ **For Project or Product/Platform scale:** Before drilling into details, map the full landscape:
18
+ 1. Propose a milestone sequence — names, one-line intents, rough dependencies
19
+ 2. Present this to the user for confirmation or adjustment
20
+ 3. Only then begin the deep Q&A — and scope the Q&A to the full vision, not just M001
21
+
22
+ **For Task scale:** Proceed directly to the discussion flow below (single milestone).
23
+
24
+ **Anti-reduction rule:** If the user describes a big vision, plan the big vision. Do not ask "what's the minimum viable version?" or try to reduce scope unless the user explicitly asks for an MVP or minimal version. When something is complex or risky, phase it into a later milestone — do not cut it. The user's ambition is the target, and your job is to sequence it intelligently, not shrink it.
25
+
26
+ ---
27
+
28
+ **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.
29
+
30
+ **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.
31
+
32
+ - 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
33
+ - 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.
34
+ - 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
35
+
36
+ Don't go deep — just enough that your next question reflects what's actually true rather than what you assume.
37
+
38
+ **Use this to actively surface:**
39
+ - The biggest technical unknowns — what could fail, what hasn't been proven, what might invalidate the plan
40
+ - Integration surfaces — external systems, APIs, libraries, or internal modules this work touches
41
+ - What needs to be proven before committing — the things that, if they don't work, mean the plan is wrong
42
+ - Product reality requirements: primary user loop, launchability expectations, continuity expectations, and failure visibility expectations
43
+ - Items that are complex, risky, or lower priority — phase these into later milestones rather than deferring or cutting them. Only truly unwanted capabilities become anti-features.
44
+
45
+ **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.
46
+
47
+ 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.
48
+
49
+ **Self-regulate depth by scale:**
50
+ - **Task scale:** After about 5-10 questions total (2-3 rounds), or when you feel you have a solid understanding, offer to proceed.
51
+ - **Project/Product scale:** After about 15-25 questions total (5-8 rounds), or when you feel you have a solid understanding, offer to proceed.
52
+
53
+ Include a question like:
54
+ "I think I have a good picture. Ready to confirm requirements and milestone plan, or are there more things to discuss?"
55
+ with options: "Ready to confirm requirements and milestone plan (Recommended)", "I have more to discuss"
56
+
57
+ If the user wants to keep going, keep asking. If they're ready, proceed.
58
+
59
+ ## Focused Research
60
+
61
+ For a new project or any project that does not yet have `.kata/REQUIREMENTS.md`, do a focused research pass before roadmap creation.
62
+
63
+ Research is advisory, not auto-binding. Use the discussion output to identify:
64
+ - table stakes the product space usually expects
65
+ - domain-standard behaviors the user may or may not want
66
+ - likely omissions that would make the product feel incomplete
67
+ - plausible anti-features or scope traps
68
+ - differentiators worth preserving
69
+
70
+ If the research suggests requirements the user did not explicitly ask for, present them as candidate requirements to confirm, defer, or reject. Do not silently turn research into scope.
71
+
72
+ For multi-milestone visions, research should cover the full landscape, not just the first milestone. Research findings may affect milestone sequencing, not just slice ordering within M001.
73
+
74
+ ## Capability Contract
75
+
76
+ Before writing a roadmap, produce or update `.kata/REQUIREMENTS.md`.
77
+
78
+ Use it as the project's explicit capability contract.
79
+
80
+ Requirements must be organized into:
81
+ - Active
82
+ - Validated
83
+ - Deferred
84
+ - Out of Scope
85
+ - Traceability
86
+
87
+ Each requirement should include:
88
+ - stable ID (`R###`)
89
+ - title
90
+ - class
91
+ - status
92
+ - description
93
+ - why it matters
94
+ - source (`user`, `inferred`, `research`, or `execution`)
95
+ - primary owning slice
96
+ - supporting slices
97
+ - validation status
98
+ - notes
99
+
100
+ Rules:
101
+ - Keep requirements capability-oriented, not a giant feature inventory
102
+ - Every Active requirement must either be mapped to a roadmap owner, explicitly deferred, blocked with reason, or moved out of scope
103
+ - Product-facing work should capture launchability, primary user loop, continuity, and failure visibility when relevant
104
+ - Later milestones may have provisional ownership, but the first planned milestone should map requirements to concrete slices wherever possible
105
+
106
+ For multi-milestone projects, requirements should span the full vision. Requirements owned by later milestones get provisional ownership. The full requirement set captures the user's complete vision — milestones are the sequencing strategy, not the scope boundary.
107
+
108
+ If the project is new or has no `REQUIREMENTS.md`, confirm candidate requirements with the user before writing the roadmap. Keep the confirmation lightweight: confirm, defer, reject, or add.
109
+
110
+ ## Scope Assessment
111
+
112
+ Confirm the scale assessment from Vision Mapping still holds after discussion. If the scope grew or shrank significantly during Q&A, adjust the milestone count accordingly.
113
+
114
+ If Vision Mapping classified the work as Task but discussion revealed Project-scale complexity, upgrade to multi-milestone and propose the split. If Vision Mapping classified it as Project but the scope narrowed to a single coherent body of work (roughly 2-12 slices), downgrade to single-milestone.
115
+
116
+ ## Output Phase
117
+
118
+ ### Naming Convention
119
+
120
+ Directories use bare IDs. Files use ID-SUFFIX format. Titles live inside file content, not in names.
121
+ - Milestone dir: `.kata/milestones/{{milestoneId}}/`
122
+ - Milestone files: `{{milestoneId}}-CONTEXT.md`, `{{milestoneId}}-ROADMAP.md`
123
+ - Slice dirs: `S01/`, `S02/`, etc.
124
+
125
+ ### Single Milestone
126
+
127
+ Once the user is satisfied, in a single pass:
128
+ 1. `mkdir -p .kata/milestones/{{milestoneId}}/slices`
129
+ 2. Write or update `.kata/PROJECT.md` — read the template at `~/.kata-cli/agent/extensions/kata/templates/project.md` first. Describe what the project is, its current state, and list the milestone sequence.
130
+ 3. Write or update `.kata/REQUIREMENTS.md` — read the template at `~/.kata-cli/agent/extensions/kata/templates/requirements.md` first. Confirm requirement states, ownership, and traceability before roadmap creation.
131
+ 4. Write `{{contextAbsPath}}` — read the template at `~/.kata-cli/agent/extensions/kata/templates/context.md` first. Preserve key risks, unknowns, existing codebase constraints, integration points, and relevant requirements surfaced during discussion.
132
+ 5. Write `{{roadmapAbsPath}}` — read the template at `~/.kata-cli/agent/extensions/kata/templates/roadmap.md` first. Decompose into demoable vertical slices with checkboxes, risk, depends, demo sentences, proof strategy, verification classes, milestone definition of done, requirement coverage, and a boundary map. If the milestone crosses multiple runtime boundaries, include an explicit final integration slice that proves the assembled system works end-to-end in a real environment.
133
+ 6. Seed `.kata/DECISIONS.md` — read the template at `~/.kata-cli/agent/extensions/kata/templates/decisions.md` first. Append rows for any architectural or pattern decisions made during discussion.
134
+ 7. Update `.kata/STATE.md`
135
+ 8. Commit: `docs({{milestoneId}}): context, requirements, and roadmap`
136
+
137
+ After writing the files and committing, say exactly: "Milestone {{milestoneId}} ready." — nothing else. Auto-mode will start automatically.
138
+
139
+ ### Multi-Milestone
140
+
141
+ Once the user confirms the milestone split, in a single pass:
142
+ 1. `mkdir -p .kata/milestones/{{milestoneId}}/slices` for each milestone
143
+ 2. Write `.kata/PROJECT.md` — read the template at `~/.kata-cli/agent/extensions/kata/templates/project.md` first.
144
+ 3. Write `.kata/REQUIREMENTS.md` — read the template at `~/.kata-cli/agent/extensions/kata/templates/requirements.md` first. Capture Active, Deferred, Out of Scope, and any already Validated requirements. Later milestones may have provisional ownership where slice plans do not exist yet.
145
+ 4. Write a `CONTEXT.md` for **every** milestone — capture the intent, scope, risks, constraints, user-visible outcome, completion class, final integrated acceptance, and relevant requirements for each. Each future milestone's CONTEXT.md should be rich enough that a planning agent encountering it fresh — with no memory of this conversation — can understand the intent, constraints, dependencies, what this milestone unlocks, and what "done" looks like.
146
+ 5. Write a `ROADMAP.md` for **only the first milestone** — detail-planning later milestones now is waste because the codebase will change. Include requirement coverage and a milestone definition of done.
147
+ 6. Seed `.kata/DECISIONS.md`.
148
+ 7. Update `.kata/STATE.md`
149
+ 8. Commit: `docs: project plan — N milestones` (replace N with the actual milestone count)
150
+
151
+ After writing the files and committing, say exactly: "Milestone M001 ready." — nothing else. Auto-mode will start automatically.
@@ -0,0 +1,29 @@
1
+ You are executing Kata doctor heal mode.
2
+
3
+ The doctor has already scanned the repo and optionally applied deterministic fixes. You are now responsible for resolving the remaining issues using the smallest safe set of changes.
4
+
5
+ Rules:
6
+ 1. Prioritize the active milestone or the explicitly requested scope. Do not fan out across unrelated historical milestones unless the report explicitly scopes you there.
7
+ 2. Read before edit.
8
+ 3. Prefer fixing authoritative artifacts over masking warnings.
9
+ 4. For missing summaries or UAT files, generate the real artifact from existing slice/task context when possible — do not leave placeholders if you can reconstruct the real content.
10
+ 5. After each repair cluster, verify the relevant invariant directly from disk.
11
+ 6. When done, rerun `/kata doctor {{doctorCommandSuffix}}` mentally by ensuring the remaining issue set for this scope is reduced or cleared.
12
+
13
+ ## Doctor Summary
14
+
15
+ {{doctorSummary}}
16
+
17
+ ## Structured Issues
18
+
19
+ {{structuredIssues}}
20
+
21
+ ## Requested Scope
22
+
23
+ {{scopeLabel}}
24
+
25
+ Then:
26
+ - Repair the unresolved issues in scope
27
+ - Keep changes minimal and targeted
28
+ - If unresolved issues remain outside scope, leave them untouched and mention them briefly
29
+ - End with: "Kata doctor heal complete."
@@ -0,0 +1,64 @@
1
+ You are executing Kata auto-mode.
2
+
3
+ ## UNIT: Execute Task {{taskId}} ("{{taskTitle}}") — Slice {{sliceId}} ("{{sliceTitle}}"), Milestone {{milestoneId}}
4
+
5
+ Start with the inlined context below. Treat the inlined task plan as the authoritative local execution contract for this unit. Use the referenced source artifacts to verify details, resolve ambiguity, and run the required checks — do not waste time reconstructing context that is already provided here.
6
+
7
+ {{resumeSection}}
8
+
9
+ {{carryForwardSection}}
10
+
11
+ {{taskPlanInline}}
12
+
13
+ {{slicePlanExcerpt}}
14
+
15
+ ## Backing Source Artifacts
16
+ - Slice plan: `{{planPath}}`
17
+ - Task plan source: `{{taskPlanPath}}`
18
+ - Prior task summaries in this slice:
19
+ {{priorTaskLines}}
20
+
21
+ Then:
22
+ 1. If a `Kata Skill Preferences` block is present in system context, use it to decide which skills to load and follow during execution, without relaxing required verification or artifact rules
23
+ 2. Execute the steps in the inlined task plan
24
+ 3. Build the real thing. If the task plan says "create login endpoint", build an endpoint that actually authenticates against a real store, not one that returns a hardcoded success response. If the task plan says "create dashboard page", build a page that renders real data from the API, not a component with hardcoded props. Stubs and mocks are for tests, not for the shipped feature.
25
+ 4. Write or update tests as part of execution — tests are verification, not an afterthought. If the slice plan defines test files in its Verification section and this is the first task, create them (they should initially fail).
26
+ 5. When implementing non-trivial runtime behavior, add or preserve agent-usable observability:
27
+ - Prefer structured logs/events, stable error codes/types, and explicit status surfaces over ad hoc console text
28
+ - Ensure failures are externally inspectable rather than swallowed or hidden
29
+ - Persist high-value failure state when it materially improves retries, recovery, or later debugging
30
+ - Never log secrets, tokens, or sensitive raw payloads unnecessarily
31
+ 6. Verify must-haves are met by running concrete checks (tests, commands, observable behaviors)
32
+ 7. Run the slice-level verification checks defined in the slice plan's Verification section. Track which pass. On the final task of the slice, all must pass before marking done. On intermediate tasks, partial passes are expected — note which ones pass in the summary.
33
+ 8. If the task touches UI, browser flows, DOM behavior, or user-visible web state:
34
+ - exercise the real flow in the browser
35
+ - prefer `browser_batch` when the next few actions are obvious and sequential
36
+ - prefer `browser_assert` for explicit pass/fail verification of the intended outcome
37
+ - use `browser_diff` when an action's effect is ambiguous
38
+ - use console/network/dialog diagnostics when validating async, stateful, or failure-prone UI
39
+ - record verification in terms of explicit checks passed/failed, not only prose interpretation
40
+ 9. If observability or diagnostics were part of this task's scope, verify them directly — e.g. structured errors, status inspection, health endpoints, persisted failure state, browser/network diagnostics, or equivalent.
41
+ 10. **If execution is running long or verification fails:**
42
+
43
+ **Context budget:** If you've used most of your context and haven't finished all steps, stop implementing and prioritize writing the task summary with clear notes on what's done and what remains. A partial summary that enables clean resumption is more valuable than one more half-finished step with no documentation. Never sacrifice summary quality for one more implementation step.
44
+
45
+ **Debugging discipline:** If a verification check fails or implementation hits unexpected behavior:
46
+ - Form a hypothesis first. State what you think is wrong and why, then test that specific theory. Don't shotgun-fix.
47
+ - Change one variable at a time. Make one change, test, observe. Multiple simultaneous changes mean you can't attribute what worked.
48
+ - Read completely. When investigating, read entire functions and their imports, not just the line that looks relevant.
49
+ - Distinguish "I know" from "I assume." Observable facts (the error says X) are strong evidence. Assumptions (this library should work this way) need verification.
50
+ - Know when to stop. If you've tried 3+ fixes without progress, your mental model is probably wrong. Stop. List what you know for certain. List what you've ruled out. Form fresh hypotheses from there.
51
+ - Don't fix symptoms. Understand *why* something fails before changing code. A test that passes after a change you don't understand is luck, not a fix.
52
+ 11. **Blocker discovery:** If execution reveals that the remaining slice plan is fundamentally invalid — not just a bug or minor deviation, but a plan-invalidating finding like a wrong API, missing capability, or architectural mismatch — set `blocker_discovered: true` in the task summary frontmatter and describe the blocker clearly in the summary narrative. Do NOT set `blocker_discovered: true` for ordinary debugging, minor deviations, or issues that can be fixed within the current task or the remaining plan. This flag triggers an automatic replan of the slice.
53
+ 12. If you made an architectural, pattern, library, or observability decision during this task that downstream work should know about, append it to `.kata/DECISIONS.md` (read the template at `~/.kata-cli/agent/extensions/kata/templates/decisions.md` if the file doesn't exist yet). Not every task produces decisions — only append when a meaningful choice was made.
54
+ 13. Read the template at `~/.kata-cli/agent/extensions/kata/templates/task-summary.md`
55
+ 14. Write `{{taskSummaryAbsPath}}`
56
+ 15. Mark {{taskId}} done in `{{planPath}}` (change `[ ]` to `[x]`)
57
+ 16. Commit your work: `git add -A && git commit -m 'feat({{sliceId}}/{{taskId}}): <what was built>'`. If `git add` silently fails to stage files (a known git worktree stat-cache bug), use this workaround per file: `git update-index --cacheinfo 100644,$(git hash-object -w <file>),<file>` then commit. If that also fails, move on — the system will auto-commit remaining changes after your session ends.
58
+ 17. Update `.kata/STATE.md`
59
+
60
+ You are on the slice branch. All work stays here.
61
+
62
+ **You MUST mark {{taskId}} as `[x]` in `{{planPath}}` AND write `{{taskSummaryAbsPath}}` before finishing.**
63
+
64
+ When done, say: "Task {{taskId}} complete."
@@ -0,0 +1 @@
1
+ Complete slice {{sliceId}} ("{{sliceTitle}}") of milestone {{milestoneId}}. All tasks are done. Read the templates at `~/.kata-cli/agent/extensions/kata/templates/slice-summary.md` and `uat.md`. If a `Kata Skill Preferences` block is present in system context, use it to decide which skills to load and follow during completion, without relaxing required verification or artifact rules. Write `{{sliceId}}-SUMMARY.md` (compress task summaries), write `{{sliceId}}-UAT.md`, and fill the `UAT Type` plus `Not Proven By This UAT` sections explicitly so the artifact states what class of acceptance it covers and what still remains unproven. Review task summaries for `key_decisions` and ensure any significant ones are in `.kata/DECISIONS.md`. Mark the slice checkbox done in the roadmap, update STATE.md, update milestone summary, and leave the slice branch clean for the extension to squash-merge back to main automatically.
@@ -0,0 +1,3 @@
1
+ Discuss milestone {{milestoneId}} ("{{milestoneTitle}}"). Identify gray areas, ask the user about them, and write `{{milestoneId}}-CONTEXT.md` in the milestone directory with the decisions. Read the template at `~/.kata-cli/agent/extensions/kata/templates/context.md` first. If a `Kata Skill Preferences` block is present in system context, use it to decide which skills to load and follow; do not override required artifact rules.
2
+
3
+ **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. Check library docs (`resolve_library`/`get_library_docs`) when tech choices are relevant, search the web (`search-the-web` with `freshness`/`domain` filters, then `fetch_page` for full content) to verify the landscape, scout the codebase (`rg`, `find`, `scout`) to understand what already exists. Don't go deep — just enough that your next question reflects what's actually true. The goal is to ask questions the user can't answer by saying "did you check the docs?" or "look at the code."
@@ -0,0 +1,59 @@
1
+ You are interviewing the user to surface behavioural, UX, and usage grey areas for slice **{{sliceId}}: {{sliceTitle}}** of milestone **{{milestoneId}}**.
2
+
3
+ Your goal is **not** to settle tech stack, naming conventions, or architecture — that happens during research and planning. Your goal is to produce a context file that captures the human decisions: what this slice should feel like, how it should behave, what edge cases matter, where scope begins and ends, and what the user cares about that won't be obvious from the roadmap entry alone.
4
+
5
+ {{inlinedContext}}
6
+
7
+ ---
8
+
9
+ ## Interview Protocol
10
+
11
+ ### Before your first question round
12
+
13
+ Do a lightweight targeted investigation so your questions are grounded in reality:
14
+ - Scout the codebase (`rg`, `find`, or `scout` for broad unfamiliar areas) to understand what already exists that this slice touches or builds on
15
+ - Check the roadmap context above to understand what surrounds this slice — what comes before, what depends on it
16
+ - Identify the 3–5 biggest behavioural unknowns: things where the user's answer will materially change what gets built
17
+
18
+ Do **not** go deep — just enough that your questions reflect what's actually true rather than what you assume.
19
+
20
+ ### Question rounds
21
+
22
+ Ask **1–3 questions per round** using `ask_user_questions`. Keep each question focused on one of:
23
+ - **UX and user-facing behaviour** — what does the user see, click, trigger, or experience?
24
+ - **Edge cases and failure states** — what happens when things go wrong or are in unusual states?
25
+ - **Scope boundaries** — what is explicitly in vs out for this slice? What deferred to later?
26
+ - **Feel and experience** — tone, responsiveness, feedback, transitions, what "done" feels like to the user
27
+
28
+ After the user answers, investigate further if any answer opens a new unknown, then ask the next round.
29
+
30
+ ### Check-in after each round
31
+
32
+ After each round of answers, use `ask_user_questions` to ask:
33
+
34
+ > "I think I have a solid picture of this slice. Ready to wrap up and write the context file, or is there more to cover?"
35
+
36
+ Options:
37
+ - "Wrap up — write the context file" *(recommended after ~2–3 rounds)*
38
+ - "Keep going — more to discuss"
39
+
40
+ If the user wants to keep going, keep asking. Stop when they say wrap up.
41
+
42
+ ---
43
+
44
+ ## Output
45
+
46
+ Once the user is ready to wrap up:
47
+
48
+ 1. Read the slice context template at `~/.kata-cli/agent/extensions/kata/templates/slice-context.md`
49
+ 2. `mkdir -p {{sliceDirAbsPath}}`
50
+ 3. Write `{{contextAbsPath}}` — use the template structure, filling in:
51
+ - **Goal** — one sentence: what this slice delivers
52
+ - **Why this Slice** — why now, what it unblocks
53
+ - **Scope / In Scope** — what was confirmed in scope during the interview
54
+ - **Scope / Out of Scope** — what was explicitly deferred or excluded
55
+ - **Constraints** — anything the user flagged as a hard constraint
56
+ - **Integration Points** — what this slice consumes and produces
57
+ - **Open Questions** — anything still unresolved, with current thinking
58
+ 4. Commit: `git -C {{projectRoot}} add {{contextAbsPath}} && git -C {{projectRoot}} commit -m "docs({{milestoneId}}/{{sliceId}}): slice context from discuss"`
59
+ 5. Say exactly: `"{{sliceId}} context written."` — nothing else.
@@ -0,0 +1 @@
1
+ Execute the next task: {{taskId}} ("{{taskTitle}}") in slice {{sliceId}} of milestone {{milestoneId}}. Read the task plan (`{{taskId}}-PLAN.md`), load relevant summaries from prior tasks, and execute each step. Verify must-haves when done. If the task touches UI, browser flows, DOM behavior, or user-visible web state, exercise the real flow in the browser, prefer `browser_batch` for obvious sequences, prefer `browser_assert` for explicit pass/fail verification, use `browser_diff` when an action's effect is ambiguous, and use browser diagnostics when validating async or failure-prone UI. If you made an architectural, pattern, or library decision, append it to `.kata/DECISIONS.md`. Read the template at `~/.kata-cli/agent/extensions/kata/templates/task-summary.md`. Write `{{taskId}}-SUMMARY.md`, mark it done, commit, and advance. If a `Kata Skill Preferences` block is present in system context, use it to decide which skills to load and follow during execution, without relaxing required verification or artifact rules. If running long and not all steps are finished, stop implementing and prioritize writing a clean partial summary over attempting one more step — a recoverable handoff is more valuable than a half-finished step with no documentation. If verification fails, debug methodically: form a hypothesis and test that specific theory before changing anything, change one variable at a time, read entire functions not just the suspect line, distinguish observable facts from assumptions, and if 3+ fixes fail without progress stop and reassess your mental model — list what you know for certain, what you've ruled out, and form fresh hypotheses. Don't fix symptoms — understand why something fails before changing code.
@@ -0,0 +1,23 @@
1
+ Plan milestone {{milestoneId}} ("{{milestoneTitle}}"). Read `.kata/DECISIONS.md` if it exists — respect existing decisions. Read `.kata/REQUIREMENTS.md` if it exists and treat Active requirements as the capability contract. If `REQUIREMENTS.md` is missing, continue in legacy compatibility mode but explicitly note missing requirement coverage. Read the template at `~/.kata-cli/agent/extensions/kata/templates/roadmap.md`. Create `{{milestoneId}}-ROADMAP.md` in the milestone directory with slices, risk levels, dependencies, demo sentences, verification classes, milestone definition of done, requirement coverage, and a boundary map. Write success criteria as observable truths, not implementation tasks. If the milestone crosses multiple runtime boundaries, include an explicit final integration slice that proves the assembled system works end-to-end in a real environment. If planning produces structural decisions, append them to `.kata/DECISIONS.md`. If a `Kata Skill Preferences` block is present in system context, use it to decide which skills to load and follow during planning, without overriding required roadmap formatting.
2
+
3
+ ## Requirement Rules
4
+
5
+ - Every relevant Active requirement must be mapped to a slice, deferred, blocked with reason, or moved out of scope.
6
+ - Each requirement gets one primary owner and may have supporting slices.
7
+ - Surface orphaned Active requirements instead of silently ignoring them.
8
+ - Product-facing milestones should cover launchability, primary user loop, continuity, and failure visibility when relevant.
9
+
10
+ ## Planning Doctrine
11
+
12
+ - **Risk-first means proof-first.** The earliest slices should prove the hardest thing works by shipping the real feature through the uncertain path. If auth is the risk, the first slice ships a real login page with real session handling that a user can actually use — not a CLI command that returns "authenticated: true". Proof is the shipped feature working. There is no separate "proof" artifact. Do not plan spikes, proof-of-concept slices, or validation-only slices — the proof is the real feature, built through the risky path.
13
+ - **Every slice is vertical, demoable, and shippable.** Every slice ships real, user-facing functionality. "Demoable" means you could show a stakeholder and they'd see real product progress — not a developer showing a terminal command. If the only way to demonstrate the slice is through a test runner or a curl command, the slice is missing its UI/UX surface. Add it. A slice that only proves something but doesn't ship real working code is not a slice — restructure it.
14
+ - **Brownfield bias.** When planning against an existing codebase, ground slices in existing modules, conventions, and seams. Prefer extending real patterns over inventing new ones.
15
+ - **Each slice should establish something downstream slices can depend on.** Think about what stable surface this slice creates for later work — an API, a data shape, a proven integration path.
16
+ - **Avoid foundation-only slices.** If a slice doesn't produce something demoable end-to-end, it's probably a layer, not a vertical slice. Restructure it.
17
+ - **Verification-first.** When planning slices, know what "done" looks like before detailing implementation. Each slice's demo line should describe concrete, verifiable evidence — not vague "it works" claims.
18
+ - **Plan for integrated reality, not just local proof.** Distinguish contract proof from live integration proof. If the milestone involves multiple runtime boundaries, one slice must explicitly prove the assembled system through the real entrypoint or runtime path.
19
+ - **Truthful demo lines only.** If a slice is proven by fixtures or tests only, say so. Do not phrase harness-level proof as if the user can already perform the live end-to-end behavior unless that has actually been exercised.
20
+ - **Completion must imply capability.** If every slice in this roadmap were completed exactly as written, the milestone's promised outcome should actually work at the proof level claimed. Do not write slices that can all be checked off while the user-visible capability still does not exist.
21
+ - **Don't invent risks.** If the project is straightforward, skip the proof strategy and just ship value in smart order. Not everything has major unknowns.
22
+ - **Ship features, not proofs.** A completed slice should leave the product in a state where the new capability is actually usable through its real interface. A login flow slice ends with a working login page, not a middleware function. An API slice ends with endpoints that return real data from a real store, not hardcoded fixtures. A dashboard slice ends with a real dashboard rendering real data, not a component that renders mock props. If a slice can't ship the real thing yet because a dependency isn't built, it should ship with realistic stubs that are clearly marked for replacement — but the user-facing surface must be real.
23
+ - **Ambition matches the milestone.** The number and depth of slices should match the milestone's ambition. A milestone promising "core platform with auth, data model, and primary user loop" should have enough slices to actually deliver all three as working features — not two proof-of-concept slices and a note that "the rest will come in the next milestone." If the milestone's context promises an outcome, the roadmap must deliver it.
@@ -0,0 +1 @@
1
+ Plan slice {{sliceId}} ("{{sliceTitle}}") of milestone {{milestoneId}}. Read `.kata/DECISIONS.md` if it exists — respect existing decisions. Read `.kata/REQUIREMENTS.md` if it exists — identify which Active requirements the roadmap says this slice owns or supports, and ensure the plan delivers them. Read the roadmap boundary map, any existing context/research files, and dependency summaries. Read the templates at `~/.kata-cli/agent/extensions/kata/templates/plan.md` and `task-plan.md`. Decompose into tasks with must-haves. Fill the `Proof Level` and `Integration Closure` sections truthfully so the plan says what class of proof this slice really delivers and what end-to-end wiring still remains. Write `{{sliceId}}-PLAN.md` and individual `T##-PLAN.md` files in the `tasks/` subdirectory. If planning produces structural decisions, append them to `.kata/decisions.md`. If a `Kata Skill Preferences` block is present in system context, use it to decide which skills to load and follow during planning, without overriding required plan formatting. Before committing, self-audit the plan: every must-have maps to at least one task, every task has complete sections (steps, must-haves, verification, observability impact, inputs, and expected output), task ordering is consistent with no circular references, every pair of artifacts that must connect has an explicit wiring step, task scope targets 2–5 steps and 3–8 files (6–8 steps or 8–10 files — consider splitting; 10+ steps or 12+ files — must split), the plan honors locked decisions from context/research/decisions artifacts, the proof-level wording does not overclaim live integration if only fixture/contract proof is planned, every Active requirement this slice owns has at least one task with verification that proves it is met, and every task produces real user-facing progress — if the slice has a UI surface at least one task builds the real UI, if it has an API at least one task connects it to a real data source, and showing the completed result to a non-technical stakeholder would demonstrate real product progress rather than developer artifacts.
@@ -0,0 +1,11 @@
1
+ Research slice {{sliceId}} ("{{sliceTitle}}") of milestone {{milestoneId}}. Read `.kata/DECISIONS.md` if it exists — respect existing decisions, don't contradict them. Read `.kata/REQUIREMENTS.md` if it exists — identify which Active requirements this slice owns or supports and target research toward risks, unknowns, and constraints that could affect delivery of those requirements. 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. Explore the relevant code — use `rg`/`find` for targeted reads, or `scout` if the area is broad or unfamiliar. Check libraries with `resolve_library`/`get_library_docs`. Read the template at `~/.kata-cli/agent/extensions/kata/templates/research.md`. Write `{{sliceId}}-RESEARCH.md` in the slice directory with summary, don't-hand-roll, common pitfalls, and relevant code sections.
2
+
3
+ ## Strategic Questions to Answer
4
+
5
+ Research should drive planning decisions, not just collect facts. Explicitly address:
6
+
7
+ - **What should be proven first?** What's the riskiest assumption — the thing that, if wrong, invalidates downstream work?
8
+ - **What existing patterns should be reused?** What modules, conventions, or infrastructure already exist that the plan should build on rather than reinvent?
9
+ - **What boundary contracts matter?** What interfaces, data shapes, event formats, or invariants will slices need to agree on?
10
+ - **What constraints does the existing codebase impose?** What can't be changed, what's expensive to change, what patterns must be respected?
11
+ - **Are there known failure modes that should shape slice ordering?** Pitfalls that mean certain work should come before or after other work?
@@ -0,0 +1 @@
1
+ Resume interrupted work. Find the continue file (`{{sliceId}}-CONTINUE.md` or `continue.md`) in slice {{sliceId}} of milestone {{milestoneId}}, then pick up from where you left off. Delete the continue file after reading it. If a `Kata Skill Preferences` block is present in system context, use it to decide which skills to load and follow during execution, without relaxing required verification or artifact rules.
@@ -0,0 +1,47 @@
1
+ You are executing Kata auto-mode.
2
+
3
+ ## UNIT: Plan 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:
10
+ 1. Read the template at `~/.kata-cli/agent/extensions/kata/templates/roadmap.md`
11
+ 2. Read `.kata/REQUIREMENTS.md` if it exists. Treat **Active** requirements as the capability contract for planning. If it does not exist, continue in legacy compatibility mode but explicitly note that requirement coverage is operating without a contract.
12
+ 3. If a `Kata Skill Preferences` block is present in system context, use it to decide which skills to load and follow during planning, without overriding required roadmap formatting
13
+ 4. Create the roadmap: decompose into demoable vertical slices — as many as the work needs, no more
14
+ 5. Order by risk (high-risk first)
15
+ 6. Write `{{outputPath}}` with checkboxes, risk, depends, demo sentences, proof strategy, verification classes, milestone definition of done, **requirement coverage**, and a boundary map. Write success criteria as observable truths, not implementation tasks. If the milestone crosses multiple runtime boundaries, include an explicit final integration slice that proves the assembled system works end-to-end in a real environment
16
+ 7. If planning produced structural decisions (e.g. slice ordering rationale, technology choices, scope exclusions), append them to `.kata/DECISIONS.md` (read the template at `~/.kata-cli/agent/extensions/kata/templates/decisions.md` if the file doesn't exist yet)
17
+ 8. Update `.kata/STATE.md`
18
+
19
+ ## Requirement Mapping Rules
20
+
21
+ - Every Active requirement relevant to this milestone must be in one of these states by the end of planning: mapped to a slice, explicitly deferred, blocked with reason, or moved out of scope.
22
+ - Each requirement should have one accountable primary owner and may have supporting slices.
23
+ - Product-facing milestones should cover launchability, primary user loop, continuity, and failure visibility when relevant.
24
+ - A slice may support multiple requirements, but should not exist with no requirement justification unless it is clearly enabling work for a mapped requirement.
25
+ - Include a compact coverage summary in the roadmap so omissions are mechanically visible.
26
+ - If `.kata/REQUIREMENTS.md` exists and an Active requirement has no credible path, surface that clearly. Do not silently ignore orphaned Active requirements.
27
+
28
+ ## Planning Doctrine
29
+
30
+ Apply these when decomposing and ordering slices:
31
+
32
+ - **Risk-first means proof-first.** The earliest slices should prove the hardest thing works by shipping the real feature through the uncertain path. If auth is the risk, the first slice ships a real login page with real session handling that a user can actually use — not a CLI command that returns "authenticated: true". Proof is the shipped feature working. There is no separate "proof" artifact. Do not plan spikes, proof-of-concept slices, or validation-only slices — the proof is the real feature, built through the risky path.
33
+ - **Every slice is vertical, demoable, and shippable.** Every slice ships real, user-facing functionality. "Demoable" means you could show a stakeholder and they'd see real product progress — not a developer showing a terminal command. If the only way to demonstrate the slice is through a test runner or a curl command, the slice is missing its UI/UX surface. Add it. A slice that only proves something but doesn't ship real working code is not a slice — restructure it.
34
+ - **Brownfield bias.** When planning against an existing codebase, ground slices in existing modules, conventions, and seams. Prefer extending real patterns over inventing new ones.
35
+ - **Each slice should establish something downstream slices can depend on.** Think about what stable surface this slice creates for later work — an API, a data shape, a proven integration path.
36
+ - **Avoid foundation-only slices.** If a slice doesn't produce something demoable end-to-end, it's probably a layer, not a vertical slice. Restructure it.
37
+ - **Verification-first.** When planning slices, know what "done" looks like before detailing implementation. Each slice's demo line should describe concrete, verifiable evidence — not vague "it works" claims.
38
+ - **Plan for integrated reality, not just local proof.** Distinguish contract proof from live integration proof. If the milestone involves multiple runtime boundaries, one slice must explicitly prove the assembled system through the real entrypoint or runtime path.
39
+ - **Truthful demo lines only.** If a slice is proven by fixtures or tests only, say so. Do not phrase harness-level proof as if the user can already perform the live end-to-end behavior unless that has actually been exercised.
40
+ - **Completion must imply capability.** If every slice in this roadmap were completed exactly as written, the milestone's promised outcome should actually work at the proof level claimed. Do not write slices that can all be checked off while the user-visible capability still does not exist.
41
+ - **Don't invent risks.** If the project is straightforward, skip the proof strategy and just ship value in smart order. Not everything has major unknowns.
42
+ - **Ship features, not proofs.** A completed slice should leave the product in a state where the new capability is actually usable through its real interface. A login flow slice ends with a working login page, not a middleware function. An API slice ends with endpoints that return real data from a real store, not hardcoded fixtures. A dashboard slice ends with a real dashboard rendering real data, not a component that renders mock props. If a slice can't ship the real thing yet because a dependency isn't built, it should ship with realistic stubs that are clearly marked for replacement — but the user-facing surface must be real.
43
+ - **Ambition matches the milestone.** The number and depth of slices should match the milestone's ambition. A milestone promising "core platform with auth, data model, and primary user loop" should have enough slices to actually deliver all three as working features — not two proof-of-concept slices and a note that "the rest will come in the next milestone." If the milestone's context promises an outcome, the roadmap must deliver it.
44
+
45
+ **You MUST write the file `{{outputAbsPath}}` before finishing.**
46
+
47
+ When done, say: "Milestone {{milestoneId}} planned."
@@ -0,0 +1,63 @@
1
+ You are executing Kata auto-mode.
2
+
3
+ ## UNIT: Plan 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 this slice should watch out for.
12
+
13
+ {{dependencySummaries}}
14
+
15
+ Then:
16
+ 0. If `REQUIREMENTS.md` was preloaded above, identify which Active requirements the roadmap says this slice owns or supports. These are the requirements this plan must deliver — every owned requirement needs at least one task that directly advances it, and verification must prove the requirement is met.
17
+ 1. Read the templates:
18
+ - `~/.kata-cli/agent/extensions/kata/templates/plan.md`
19
+ - `~/.kata-cli/agent/extensions/kata/templates/task-plan.md`
20
+ 2. If a `Kata Skill Preferences` block is present in system context, use it to decide which skills to load and follow during planning, without overriding required plan formatting
21
+ 3. Define slice-level verification first — the objective stopping condition for this slice:
22
+ - For non-trivial slices: plan actual test files with real assertions. Name the files. The first task creates them (initially failing). Remaining tasks make them pass.
23
+ - For simple slices: executable commands or script assertions are fine.
24
+ - If the project is non-trivial and has no test framework, the first task should set one up.
25
+ - If this slice establishes a boundary contract, verification must exercise that contract.
26
+ 4. Plan observability and diagnostics explicitly:
27
+ - For non-trivial backend, integration, async, stateful, or UI slices, include an `Observability / Diagnostics` section in the slice plan.
28
+ - Define how a future agent will inspect state, detect failure, and localize the problem.
29
+ - Prefer structured logs/events, stable error codes/types, status surfaces, and persisted failure state over ad hoc debug text.
30
+ - Include at least one verification check for a diagnostic or failure-path signal when relevant.
31
+ 5. Fill the `Proof Level` and `Integration Closure` sections truthfully:
32
+ - State whether the slice proves contract, integration, operational, or final-assembly behavior.
33
+ - Say whether real runtime or human/UAT is required.
34
+ - Name the wiring introduced in this slice and what still remains before the milestone is truly usable end-to-end.
35
+ 6. Decompose the slice into tasks, each fitting one context window
36
+ 7. Every task in the slice plan should be written as an executable increment with:
37
+ - a concrete, action-oriented title
38
+ - the inline task entry fields defined in the plan.md template (Why / Files / Do / Verify / Done when)
39
+ - a matching task plan containing description, steps, must-haves, verification, observability impact, inputs, and expected output
40
+ 8. Each task needs: title, description, steps, must-haves, verification, observability impact, inputs, and expected output
41
+ 9. If verification includes test files, ensure the first task includes creating them with expected assertions (they should fail initially — that's correct)
42
+ 10. Write `{{outputPath}}`
43
+ 11. Write individual task plans in `{{sliceAbsPath}}/tasks/`: `T01-PLAN.md`, `T02-PLAN.md`, etc.
44
+ 12. **Self-audit the plan before continuing.** Walk through each check — if any fail, fix the plan files before moving on:
45
+ - **Completion semantics:** If every task were completed exactly as written, the slice goal/demo should actually be true at the claimed proof level. Do not allow a task plan that only scaffolds toward a future working state.
46
+ - **Requirement coverage:** Every must-have in the slice maps to at least one task. No must-have is orphaned.
47
+ - **Task completeness:** Every task has steps, must-haves, verification, observability impact, inputs, and expected output — none are blank or vague.
48
+ - **Dependency correctness:** Task ordering is consistent. No task references work from a later task.
49
+ - **Key links planned:** For every pair of artifacts that must connect (component → API, API → database, form → handler), there is an explicit step that wires them — not just "create X" and "create Y" in separate tasks with no connection step.
50
+ - **Scope sanity:** Target 2–5 steps and 3–8 files per task. 6–8 steps or 8–10 files is a warning — consider splitting. 10+ steps or 12+ files — must split. Each task must be completable in a single fresh context window.
51
+ - **Context compliance:** If context/research artifacts or `.kata/DECISIONS.md` exist, the plan honors locked decisions and doesn't include deferred or out-of-scope items.
52
+ - **Requirement coverage:** If `REQUIREMENTS.md` exists, every Active requirement this slice owns (per the roadmap) maps to at least one task with verification that proves the requirement is met. No owned requirement is left without a task. No task claims to satisfy a requirement that is Deferred or Out of Scope.
53
+ - **Proof honesty:** The `Proof Level` and `Integration Closure` sections match what this slice will actually prove, and they do not imply live end-to-end completion if only fixture or contract proof is planned.
54
+ - **Feature completeness:** Every task produces real, user-facing progress — not just internal scaffolding. If the slice has a UI surface, at least one task builds the real UI (not a placeholder). If the slice has an API, at least one task connects it to a real data source (not hardcoded returns). If every task were completed and you showed the result to a non-technical stakeholder, they should see real product progress, not developer artifacts.
55
+ 13. If planning produced structural decisions (e.g. verification strategy, observability strategy, technology choices, patterns to follow), append them to `.kata/DECISIONS.md`
56
+ 14. Commit: `docs({{sliceId}}): add slice plan`
57
+ 15. Update `.kata/STATE.md`
58
+
59
+ The slice directory and tasks/ subdirectory already exist. Do NOT mkdir. You are on the slice branch; all work stays here.
60
+
61
+ **You MUST write the file `{{outputAbsPath}}` before finishing.**
62
+
63
+ When done, say: "Slice {{sliceId}} planned."