spec-kitty-cli 0.12.1__py3-none-any.whl

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 (242) hide show
  1. spec_kitty_cli-0.12.1.dist-info/METADATA +1767 -0
  2. spec_kitty_cli-0.12.1.dist-info/RECORD +242 -0
  3. spec_kitty_cli-0.12.1.dist-info/WHEEL +4 -0
  4. spec_kitty_cli-0.12.1.dist-info/entry_points.txt +2 -0
  5. spec_kitty_cli-0.12.1.dist-info/licenses/LICENSE +21 -0
  6. specify_cli/__init__.py +171 -0
  7. specify_cli/acceptance.py +627 -0
  8. specify_cli/agent_utils/README.md +157 -0
  9. specify_cli/agent_utils/__init__.py +9 -0
  10. specify_cli/agent_utils/status.py +356 -0
  11. specify_cli/cli/__init__.py +6 -0
  12. specify_cli/cli/commands/__init__.py +46 -0
  13. specify_cli/cli/commands/accept.py +189 -0
  14. specify_cli/cli/commands/agent/__init__.py +22 -0
  15. specify_cli/cli/commands/agent/config.py +382 -0
  16. specify_cli/cli/commands/agent/context.py +191 -0
  17. specify_cli/cli/commands/agent/feature.py +1057 -0
  18. specify_cli/cli/commands/agent/release.py +11 -0
  19. specify_cli/cli/commands/agent/tasks.py +1253 -0
  20. specify_cli/cli/commands/agent/workflow.py +801 -0
  21. specify_cli/cli/commands/context.py +246 -0
  22. specify_cli/cli/commands/dashboard.py +85 -0
  23. specify_cli/cli/commands/implement.py +973 -0
  24. specify_cli/cli/commands/init.py +827 -0
  25. specify_cli/cli/commands/init_help.py +62 -0
  26. specify_cli/cli/commands/merge.py +755 -0
  27. specify_cli/cli/commands/mission.py +240 -0
  28. specify_cli/cli/commands/ops.py +265 -0
  29. specify_cli/cli/commands/orchestrate.py +640 -0
  30. specify_cli/cli/commands/repair.py +175 -0
  31. specify_cli/cli/commands/research.py +165 -0
  32. specify_cli/cli/commands/sync.py +364 -0
  33. specify_cli/cli/commands/upgrade.py +249 -0
  34. specify_cli/cli/commands/validate_encoding.py +186 -0
  35. specify_cli/cli/commands/validate_tasks.py +186 -0
  36. specify_cli/cli/commands/verify.py +310 -0
  37. specify_cli/cli/helpers.py +123 -0
  38. specify_cli/cli/step_tracker.py +91 -0
  39. specify_cli/cli/ui.py +192 -0
  40. specify_cli/core/__init__.py +53 -0
  41. specify_cli/core/agent_context.py +311 -0
  42. specify_cli/core/config.py +96 -0
  43. specify_cli/core/context_validation.py +362 -0
  44. specify_cli/core/dependency_graph.py +351 -0
  45. specify_cli/core/git_ops.py +129 -0
  46. specify_cli/core/multi_parent_merge.py +323 -0
  47. specify_cli/core/paths.py +260 -0
  48. specify_cli/core/project_resolver.py +110 -0
  49. specify_cli/core/stale_detection.py +263 -0
  50. specify_cli/core/tool_checker.py +79 -0
  51. specify_cli/core/utils.py +43 -0
  52. specify_cli/core/vcs/__init__.py +114 -0
  53. specify_cli/core/vcs/detection.py +341 -0
  54. specify_cli/core/vcs/exceptions.py +85 -0
  55. specify_cli/core/vcs/git.py +1304 -0
  56. specify_cli/core/vcs/jujutsu.py +1208 -0
  57. specify_cli/core/vcs/protocol.py +285 -0
  58. specify_cli/core/vcs/types.py +249 -0
  59. specify_cli/core/version_checker.py +261 -0
  60. specify_cli/core/worktree.py +506 -0
  61. specify_cli/dashboard/__init__.py +28 -0
  62. specify_cli/dashboard/diagnostics.py +204 -0
  63. specify_cli/dashboard/handlers/__init__.py +17 -0
  64. specify_cli/dashboard/handlers/api.py +143 -0
  65. specify_cli/dashboard/handlers/base.py +65 -0
  66. specify_cli/dashboard/handlers/features.py +390 -0
  67. specify_cli/dashboard/handlers/router.py +81 -0
  68. specify_cli/dashboard/handlers/static.py +50 -0
  69. specify_cli/dashboard/lifecycle.py +541 -0
  70. specify_cli/dashboard/scanner.py +437 -0
  71. specify_cli/dashboard/server.py +123 -0
  72. specify_cli/dashboard/static/dashboard/dashboard.css +722 -0
  73. specify_cli/dashboard/static/dashboard/dashboard.js +1424 -0
  74. specify_cli/dashboard/static/spec-kitty.png +0 -0
  75. specify_cli/dashboard/templates/__init__.py +36 -0
  76. specify_cli/dashboard/templates/index.html +258 -0
  77. specify_cli/doc_generators.py +621 -0
  78. specify_cli/doc_state.py +408 -0
  79. specify_cli/frontmatter.py +384 -0
  80. specify_cli/gap_analysis.py +915 -0
  81. specify_cli/gitignore_manager.py +300 -0
  82. specify_cli/guards.py +145 -0
  83. specify_cli/legacy_detector.py +83 -0
  84. specify_cli/manifest.py +286 -0
  85. specify_cli/merge/__init__.py +63 -0
  86. specify_cli/merge/executor.py +653 -0
  87. specify_cli/merge/forecast.py +215 -0
  88. specify_cli/merge/ordering.py +126 -0
  89. specify_cli/merge/preflight.py +230 -0
  90. specify_cli/merge/state.py +185 -0
  91. specify_cli/merge/status_resolver.py +354 -0
  92. specify_cli/mission.py +654 -0
  93. specify_cli/missions/documentation/command-templates/implement.md +309 -0
  94. specify_cli/missions/documentation/command-templates/plan.md +275 -0
  95. specify_cli/missions/documentation/command-templates/review.md +344 -0
  96. specify_cli/missions/documentation/command-templates/specify.md +206 -0
  97. specify_cli/missions/documentation/command-templates/tasks.md +189 -0
  98. specify_cli/missions/documentation/mission.yaml +113 -0
  99. specify_cli/missions/documentation/templates/divio/explanation-template.md +192 -0
  100. specify_cli/missions/documentation/templates/divio/howto-template.md +168 -0
  101. specify_cli/missions/documentation/templates/divio/reference-template.md +179 -0
  102. specify_cli/missions/documentation/templates/divio/tutorial-template.md +146 -0
  103. specify_cli/missions/documentation/templates/generators/jsdoc.json.template +18 -0
  104. specify_cli/missions/documentation/templates/generators/sphinx-conf.py.template +36 -0
  105. specify_cli/missions/documentation/templates/plan-template.md +269 -0
  106. specify_cli/missions/documentation/templates/release-template.md +222 -0
  107. specify_cli/missions/documentation/templates/spec-template.md +172 -0
  108. specify_cli/missions/documentation/templates/task-prompt-template.md +140 -0
  109. specify_cli/missions/documentation/templates/tasks-template.md +159 -0
  110. specify_cli/missions/research/command-templates/merge.md +388 -0
  111. specify_cli/missions/research/command-templates/plan.md +125 -0
  112. specify_cli/missions/research/command-templates/review.md +144 -0
  113. specify_cli/missions/research/command-templates/tasks.md +225 -0
  114. specify_cli/missions/research/mission.yaml +115 -0
  115. specify_cli/missions/research/templates/data-model-template.md +33 -0
  116. specify_cli/missions/research/templates/plan-template.md +161 -0
  117. specify_cli/missions/research/templates/research/evidence-log.csv +18 -0
  118. specify_cli/missions/research/templates/research/source-register.csv +18 -0
  119. specify_cli/missions/research/templates/research-template.md +35 -0
  120. specify_cli/missions/research/templates/spec-template.md +64 -0
  121. specify_cli/missions/research/templates/task-prompt-template.md +148 -0
  122. specify_cli/missions/research/templates/tasks-template.md +114 -0
  123. specify_cli/missions/software-dev/command-templates/accept.md +75 -0
  124. specify_cli/missions/software-dev/command-templates/analyze.md +183 -0
  125. specify_cli/missions/software-dev/command-templates/checklist.md +286 -0
  126. specify_cli/missions/software-dev/command-templates/clarify.md +157 -0
  127. specify_cli/missions/software-dev/command-templates/constitution.md +432 -0
  128. specify_cli/missions/software-dev/command-templates/dashboard.md +101 -0
  129. specify_cli/missions/software-dev/command-templates/implement.md +41 -0
  130. specify_cli/missions/software-dev/command-templates/merge.md +383 -0
  131. specify_cli/missions/software-dev/command-templates/plan.md +171 -0
  132. specify_cli/missions/software-dev/command-templates/review.md +32 -0
  133. specify_cli/missions/software-dev/command-templates/specify.md +321 -0
  134. specify_cli/missions/software-dev/command-templates/tasks.md +566 -0
  135. specify_cli/missions/software-dev/mission.yaml +100 -0
  136. specify_cli/missions/software-dev/templates/plan-template.md +132 -0
  137. specify_cli/missions/software-dev/templates/spec-template.md +116 -0
  138. specify_cli/missions/software-dev/templates/task-prompt-template.md +140 -0
  139. specify_cli/missions/software-dev/templates/tasks-template.md +159 -0
  140. specify_cli/orchestrator/__init__.py +75 -0
  141. specify_cli/orchestrator/agent_config.py +224 -0
  142. specify_cli/orchestrator/agents/__init__.py +170 -0
  143. specify_cli/orchestrator/agents/augment.py +112 -0
  144. specify_cli/orchestrator/agents/base.py +243 -0
  145. specify_cli/orchestrator/agents/claude.py +112 -0
  146. specify_cli/orchestrator/agents/codex.py +106 -0
  147. specify_cli/orchestrator/agents/copilot.py +137 -0
  148. specify_cli/orchestrator/agents/cursor.py +139 -0
  149. specify_cli/orchestrator/agents/gemini.py +115 -0
  150. specify_cli/orchestrator/agents/kilocode.py +94 -0
  151. specify_cli/orchestrator/agents/opencode.py +132 -0
  152. specify_cli/orchestrator/agents/qwen.py +96 -0
  153. specify_cli/orchestrator/config.py +455 -0
  154. specify_cli/orchestrator/executor.py +642 -0
  155. specify_cli/orchestrator/integration.py +1230 -0
  156. specify_cli/orchestrator/monitor.py +898 -0
  157. specify_cli/orchestrator/scheduler.py +832 -0
  158. specify_cli/orchestrator/state.py +508 -0
  159. specify_cli/orchestrator/testing/__init__.py +122 -0
  160. specify_cli/orchestrator/testing/availability.py +346 -0
  161. specify_cli/orchestrator/testing/fixtures.py +684 -0
  162. specify_cli/orchestrator/testing/paths.py +218 -0
  163. specify_cli/plan_validation.py +107 -0
  164. specify_cli/scripts/debug-dashboard-scan.py +61 -0
  165. specify_cli/scripts/tasks/acceptance_support.py +695 -0
  166. specify_cli/scripts/tasks/task_helpers.py +506 -0
  167. specify_cli/scripts/tasks/tasks_cli.py +848 -0
  168. specify_cli/scripts/validate_encoding.py +180 -0
  169. specify_cli/task_metadata_validation.py +274 -0
  170. specify_cli/tasks_support.py +447 -0
  171. specify_cli/template/__init__.py +47 -0
  172. specify_cli/template/asset_generator.py +206 -0
  173. specify_cli/template/github_client.py +334 -0
  174. specify_cli/template/manager.py +193 -0
  175. specify_cli/template/renderer.py +99 -0
  176. specify_cli/templates/AGENTS.md +190 -0
  177. specify_cli/templates/POWERSHELL_SYNTAX.md +229 -0
  178. specify_cli/templates/agent-file-template.md +35 -0
  179. specify_cli/templates/checklist-template.md +42 -0
  180. specify_cli/templates/claudeignore-template +58 -0
  181. specify_cli/templates/command-templates/accept.md +141 -0
  182. specify_cli/templates/command-templates/analyze.md +253 -0
  183. specify_cli/templates/command-templates/checklist.md +352 -0
  184. specify_cli/templates/command-templates/clarify.md +224 -0
  185. specify_cli/templates/command-templates/constitution.md +432 -0
  186. specify_cli/templates/command-templates/dashboard.md +175 -0
  187. specify_cli/templates/command-templates/implement.md +190 -0
  188. specify_cli/templates/command-templates/merge.md +374 -0
  189. specify_cli/templates/command-templates/plan.md +171 -0
  190. specify_cli/templates/command-templates/research.md +88 -0
  191. specify_cli/templates/command-templates/review.md +510 -0
  192. specify_cli/templates/command-templates/specify.md +321 -0
  193. specify_cli/templates/command-templates/status.md +92 -0
  194. specify_cli/templates/command-templates/tasks.md +199 -0
  195. specify_cli/templates/git-hooks/pre-commit +22 -0
  196. specify_cli/templates/git-hooks/pre-commit-agent-check +37 -0
  197. specify_cli/templates/git-hooks/pre-commit-encoding-check +142 -0
  198. specify_cli/templates/plan-template.md +108 -0
  199. specify_cli/templates/spec-template.md +118 -0
  200. specify_cli/templates/task-prompt-template.md +165 -0
  201. specify_cli/templates/tasks-template.md +161 -0
  202. specify_cli/templates/vscode-settings.json +13 -0
  203. specify_cli/text_sanitization.py +225 -0
  204. specify_cli/upgrade/__init__.py +18 -0
  205. specify_cli/upgrade/detector.py +239 -0
  206. specify_cli/upgrade/metadata.py +182 -0
  207. specify_cli/upgrade/migrations/__init__.py +65 -0
  208. specify_cli/upgrade/migrations/base.py +80 -0
  209. specify_cli/upgrade/migrations/m_0_10_0_python_only.py +359 -0
  210. specify_cli/upgrade/migrations/m_0_10_12_constitution_cleanup.py +99 -0
  211. specify_cli/upgrade/migrations/m_0_10_14_update_implement_slash_command.py +176 -0
  212. specify_cli/upgrade/migrations/m_0_10_1_populate_slash_commands.py +174 -0
  213. specify_cli/upgrade/migrations/m_0_10_2_update_slash_commands.py +172 -0
  214. specify_cli/upgrade/migrations/m_0_10_6_workflow_simplification.py +174 -0
  215. specify_cli/upgrade/migrations/m_0_10_8_fix_memory_structure.py +252 -0
  216. specify_cli/upgrade/migrations/m_0_10_9_repair_templates.py +168 -0
  217. specify_cli/upgrade/migrations/m_0_11_0_workspace_per_wp.py +182 -0
  218. specify_cli/upgrade/migrations/m_0_11_1_improved_workflow_templates.py +173 -0
  219. specify_cli/upgrade/migrations/m_0_11_1_update_implement_slash_command.py +160 -0
  220. specify_cli/upgrade/migrations/m_0_11_2_improved_workflow_templates.py +173 -0
  221. specify_cli/upgrade/migrations/m_0_11_3_workflow_agent_flag.py +114 -0
  222. specify_cli/upgrade/migrations/m_0_12_0_documentation_mission.py +155 -0
  223. specify_cli/upgrade/migrations/m_0_12_1_remove_kitty_specs_from_gitignore.py +183 -0
  224. specify_cli/upgrade/migrations/m_0_2_0_specify_to_kittify.py +80 -0
  225. specify_cli/upgrade/migrations/m_0_4_8_gitignore_agents.py +118 -0
  226. specify_cli/upgrade/migrations/m_0_5_0_encoding_hooks.py +141 -0
  227. specify_cli/upgrade/migrations/m_0_6_5_commands_rename.py +169 -0
  228. specify_cli/upgrade/migrations/m_0_6_7_ensure_missions.py +228 -0
  229. specify_cli/upgrade/migrations/m_0_7_2_worktree_commands_dedup.py +89 -0
  230. specify_cli/upgrade/migrations/m_0_7_3_update_scripts.py +114 -0
  231. specify_cli/upgrade/migrations/m_0_8_0_remove_active_mission.py +82 -0
  232. specify_cli/upgrade/migrations/m_0_8_0_worktree_agents_symlink.py +148 -0
  233. specify_cli/upgrade/migrations/m_0_9_0_frontmatter_only_lanes.py +346 -0
  234. specify_cli/upgrade/migrations/m_0_9_1_complete_lane_migration.py +656 -0
  235. specify_cli/upgrade/migrations/m_0_9_2_research_mission_templates.py +221 -0
  236. specify_cli/upgrade/registry.py +121 -0
  237. specify_cli/upgrade/runner.py +284 -0
  238. specify_cli/validators/__init__.py +14 -0
  239. specify_cli/validators/paths.py +154 -0
  240. specify_cli/validators/research.py +428 -0
  241. specify_cli/verify_enhanced.py +270 -0
  242. specify_cli/workspace_context.py +224 -0
@@ -0,0 +1,566 @@
1
+ ---
2
+ description: Generate grouped work packages with actionable subtasks and matching prompt files for the feature in one pass.
3
+ ---
4
+
5
+ # /spec-kitty.tasks - Generate Work Packages
6
+
7
+ **Version**: 0.11.0+
8
+
9
+ ## ⚠️ CRITICAL: THIS IS THE MOST IMPORTANT PLANNING WORK
10
+
11
+ **You are creating the blueprint for implementation**. The quality of work packages determines:
12
+ - How easily agents can implement the feature
13
+ - How parallelizable the work is
14
+ - How reviewable the code will be
15
+ - Whether the feature succeeds or fails
16
+
17
+ **QUALITY OVER SPEED**: This is NOT the time to save tokens or rush. Take your time to:
18
+ - Understand the full scope deeply
19
+ - Break work into clear, manageable pieces
20
+ - Write detailed, actionable guidance
21
+ - Think through risks and edge cases
22
+
23
+ **Token usage is EXPECTED and GOOD here**. A thorough task breakdown saves 10x the effort during implementation. Do not cut corners.
24
+
25
+ ---
26
+
27
+ ## 📍 WORKING DIRECTORY: Stay in MAIN repository
28
+
29
+ **IMPORTANT**: Tasks works in the main repository. NO worktrees created.
30
+
31
+ ```bash
32
+ # Run from project root (same directory as /spec-kitty.plan):
33
+ # You should already be here if you just ran /spec-kitty.plan
34
+
35
+ # Creates:
36
+ # - kitty-specs/###-feature/tasks/WP01-*.md → In main repository
37
+ # - kitty-specs/###-feature/tasks/WP02-*.md → In main repository
38
+ # - Commits ALL to main branch
39
+ # - NO worktrees created
40
+ ```
41
+
42
+ **Do NOT cd anywhere**. Stay in the main repository root.
43
+
44
+ **Worktrees created later**: After tasks are generated, use `spec-kitty implement WP##` to create workspace for each WP.
45
+
46
+ ## User Input
47
+
48
+ ```text
49
+ $ARGUMENTS
50
+ ```
51
+
52
+ You **MUST** consider the user input before proceeding (if not empty).
53
+
54
+ ## Location Check (0.11.0+)
55
+
56
+ Before proceeding, verify you are in the main repository:
57
+
58
+ **Check your current branch:**
59
+ ```bash
60
+ git branch --show-current
61
+ ```
62
+
63
+ **Expected output:** `main` (or `master`)
64
+ **If you see a feature branch:** You're in the wrong place. Return to main:
65
+ ```bash
66
+ cd $(git rev-parse --show-toplevel)
67
+ git checkout main
68
+ ```
69
+
70
+ Work packages are generated directly in `kitty-specs/###-feature/` and committed to main. Worktrees are created later when implementing each work package.
71
+
72
+ ## Outline
73
+
74
+ 1. **Setup**: Run `spec-kitty agent feature check-prerequisites --json --paths-only --include-tasks` from the repository root and capture `FEATURE_DIR` plus `AVAILABLE_DOCS`. All paths must be absolute.
75
+
76
+ **CRITICAL**: The command returns JSON with `FEATURE_DIR` as an ABSOLUTE path (e.g., `/Users/robert/Code/new_specify/kitty-specs/001-feature-name`).
77
+
78
+ **YOU MUST USE THIS PATH** for ALL subsequent file operations. Example:
79
+ ```
80
+ FEATURE_DIR = "/Users/robert/Code/new_specify/kitty-specs/001-a-simple-hello"
81
+ tasks.md location: FEATURE_DIR + "/tasks.md"
82
+ prompt location: FEATURE_DIR + "/tasks/WP01-slug.md"
83
+ ```
84
+
85
+ **DO NOT CREATE** paths like:
86
+ - ❌ `tasks/WP01-slug.md` (missing FEATURE_DIR prefix)
87
+ - ❌ `/tasks/WP01-slug.md` (wrong root)
88
+ - ❌ `FEATURE_DIR/tasks/planned/WP01-slug.md` (WRONG - no subdirectories!)
89
+ - ❌ `WP01-slug.md` (wrong directory)
90
+
91
+ 2. **Load design documents** from `FEATURE_DIR` (only those present):
92
+ - **Required**: plan.md (tech architecture, stack), spec.md (user stories & priorities)
93
+ - **Optional**: data-model.md (entities), contracts/ (API schemas), research.md (decisions), quickstart.md (validation scenarios)
94
+ - Scale your effort to the feature: simple UI tweaks deserve lighter coverage, multi-system releases require deeper decomposition.
95
+
96
+ 3. **Derive fine-grained subtasks** (IDs `T001`, `T002`, ...):
97
+ - Parse plan/spec to enumerate concrete implementation steps, tests (only if explicitly requested), migrations, and operational work.
98
+ - Capture prerequisites, dependencies, and parallelizability markers (`[P]` means safe to parallelize per file/concern).
99
+ - Maintain the subtask list internally; it feeds the work-package roll-up and the prompts.
100
+
101
+ 4. **Roll subtasks into work packages** (IDs `WP01`, `WP02`, ...):
102
+
103
+ **IDEAL WORK PACKAGE SIZE** (most important guideline):
104
+ - **Target: 3-7 subtasks per WP** (results in 200-500 line prompts)
105
+ - **Maximum: 10 subtasks per WP** (results in ~700 line prompts)
106
+ - **If more than 10 subtasks needed**: Create additional WPs, don't pack them in
107
+
108
+ **WHY SIZE MATTERS**:
109
+ - **Too large** (>10 subtasks, >700 lines): Agents get overwhelmed, skip details, make mistakes
110
+ - **Too small** (<3 subtasks, <150 lines): Overhead of worktree creation not worth it
111
+ - **Just right** (3-7 subtasks, 200-500 lines): Agent can hold entire context, implements thoroughly
112
+
113
+ **NUMBER OF WPs**: Let the work dictate the count
114
+ - Simple feature (5-10 subtasks total): 2-3 WPs
115
+ - Medium feature (20-40 subtasks): 5-8 WPs
116
+ - Complex feature (50+ subtasks): 10-20 WPs ← **This is OK!**
117
+ - **Better to have 20 focused WPs than 5 overwhelming WPs**
118
+
119
+ **GROUPING PRINCIPLES**:
120
+ - Each WP should be independently implementable
121
+ - Root in a single user story or cohesive subsystem
122
+ - Ensure every subtask appears in exactly one work package
123
+ - Name with succinct goal (e.g., "User Story 1 – Real-time chat happy path")
124
+ - Record metadata: priority, success criteria, risks, dependencies, included subtasks
125
+
126
+ 5. **Write `tasks.md`** using `.kittify/templates/tasks-template.md`:
127
+ - **Location**: Write to `FEATURE_DIR/tasks.md` (use the absolute FEATURE_DIR path from step 1)
128
+ - Populate the Work Package sections (setup, foundational, per-story, polish) with the `WPxx` entries
129
+ - Under each work package include:
130
+ - Summary (goal, priority, independent test)
131
+ - Included subtasks (checkbox list referencing `Txxx`)
132
+ - Implementation sketch (high-level sequence)
133
+ - Parallel opportunities, dependencies, and risks
134
+ - Preserve the checklist style so implementers can mark progress
135
+
136
+ 6. **Generate prompt files (one per work package)**:
137
+ - **CRITICAL PATH RULE**: All work package files MUST be created in a FLAT `FEATURE_DIR/tasks/` directory, NOT in subdirectories!
138
+ - Correct structure: `FEATURE_DIR/tasks/WPxx-slug.md` (flat, no subdirectories)
139
+ - WRONG (do not create): `FEATURE_DIR/tasks/planned/`, `FEATURE_DIR/tasks/doing/`, or ANY lane subdirectories
140
+ - WRONG (do not create): `/tasks/`, `tasks/`, or any path not under FEATURE_DIR
141
+ - Ensure `FEATURE_DIR/tasks/` exists (create as flat directory, NO subdirectories)
142
+ - For each work package:
143
+ - Derive a kebab-case slug from the title; filename: `WPxx-slug.md`
144
+ - Full path example: `FEATURE_DIR/tasks/WP01-create-html-page.md` (use ABSOLUTE path from FEATURE_DIR variable)
145
+ - Use `.kittify/templates/task-prompt-template.md` to capture:
146
+ - Frontmatter with `work_package_id`, `subtasks` array, `lane: "planned"`, `dependencies`, history entry
147
+ - Objective, context, detailed guidance per subtask
148
+ - Test strategy (only if requested)
149
+ - Definition of Done, risks, reviewer guidance
150
+ - Update `tasks.md` to reference the prompt filename
151
+ - **TARGET PROMPT SIZE**: 200-500 lines per WP (results from 3-7 subtasks)
152
+ - **MAXIMUM PROMPT SIZE**: 700 lines per WP (10 subtasks max)
153
+ - **If prompts are >700 lines**: Split the WP - it's too large
154
+
155
+ **IMPORTANT**: All WP files live in flat `tasks/` directory. Lane status is tracked ONLY in the `lane:` frontmatter field, NOT by directory location. Agents can change lanes by editing the `lane:` field directly or using `spec-kitty agent tasks move-task`.
156
+
157
+ 7. **Finalize tasks with dependency parsing and commit**:
158
+ After generating all WP prompt files, run the finalization command to:
159
+ - Parse dependencies from tasks.md
160
+ - Update WP frontmatter with dependencies field
161
+ - Validate dependencies (check for cycles, invalid references)
162
+ - Commit all tasks to main branch
163
+
164
+ **CRITICAL**: Run this command from repo root:
165
+ ```bash
166
+ spec-kitty agent feature finalize-tasks --json
167
+ ```
168
+
169
+ This step is MANDATORY for workspace-per-WP features. Without it:
170
+ - Dependencies won't be in frontmatter
171
+ - Agents won't know which --base flag to use
172
+ - Tasks won't be committed to main
173
+
174
+ 8. **Report**: Provide a concise outcome summary:
175
+ - Path to `tasks.md`
176
+ - Work package count and per-package subtask tallies
177
+ - **Average prompt size** (estimate lines per WP)
178
+ - **Validation**: Flag if any WP has >10 subtasks or >700 estimated lines
179
+ - Parallelization highlights
180
+ - MVP scope recommendation (usually Work Package 1)
181
+ - Prompt generation stats (files written, directory structure, any skipped items with rationale)
182
+ - Finalization status (dependencies parsed, X WP files updated, committed to main)
183
+ - Next suggested command (e.g., `/spec-kitty.analyze` or `/spec-kitty.implement`)
184
+
185
+ Context for work-package planning: {ARGS}
186
+
187
+ The combination of `tasks.md` and the bundled prompt files must enable a new engineer to pick up any work package and deliver it end-to-end without further specification spelunking.
188
+
189
+ ## Dependency Detection (0.11.0+)
190
+
191
+ **Parse dependencies from tasks.md structure**:
192
+
193
+ The LLM should analyze tasks.md for dependency relationships:
194
+ - Explicit phrases: "Depends on WP##", "Dependencies: WP##"
195
+ - Phase grouping: Phase 2 WPs typically depend on Phase 1
196
+ - Default to empty if unclear
197
+
198
+ **Generate dependencies in WP frontmatter**:
199
+
200
+ Each WP prompt file MUST include a `dependencies` field:
201
+ ```yaml
202
+ ---
203
+ work_package_id: "WP02"
204
+ title: "Build API"
205
+ lane: "planned"
206
+ dependencies: ["WP01"] # Generated from tasks.md
207
+ subtasks: ["T001", "T002"]
208
+ ---
209
+ ```
210
+
211
+ **Include the correct implementation command**:
212
+ - No dependencies: `spec-kitty implement WP01`
213
+ - With dependencies: `spec-kitty implement WP02 --base WP01`
214
+
215
+ The WP prompt must show the correct command so agents don't branch from the wrong base.
216
+
217
+ ## Work Package Sizing Guidelines (CRITICAL)
218
+
219
+ ### Ideal WP Size
220
+
221
+ **Target: 3-7 subtasks per WP**
222
+ - Results in 200-500 line prompt files
223
+ - Agent can hold entire context in working memory
224
+ - Clear scope - easy to review
225
+ - Parallelizable - multiple agents can work simultaneously
226
+
227
+ **Examples of well-sized WPs**:
228
+ - WP01: Foundation Setup (5 subtasks, ~300 lines)
229
+ - T001: Create database schema
230
+ - T002: Set up migration system
231
+ - T003: Create base models
232
+ - T004: Add validation layer
233
+ - T005: Write foundation tests
234
+
235
+ - WP02: User Authentication (6 subtasks, ~400 lines)
236
+ - T006: Implement login endpoint
237
+ - T007: Implement logout endpoint
238
+ - T008: Add session management
239
+ - T009: Add password reset flow
240
+ - T010: Write auth tests
241
+ - T011: Add rate limiting
242
+
243
+ ### Maximum WP Size
244
+
245
+ **Hard limit: 10 subtasks, ~700 lines**
246
+ - Beyond this, agents start making mistakes
247
+ - Prompts become overwhelming
248
+ - Reviews take too long
249
+ - Integration risk increases
250
+
251
+ **If you need more than 10 subtasks**: SPLIT into multiple WPs.
252
+
253
+ ### Number of WPs: No Arbitrary Limit
254
+
255
+ **DO NOT limit based on WP count. Limit based on SIZE.**
256
+
257
+ - ✅ **20 WPs of 5 subtasks each** = 100 subtasks, manageable prompts
258
+ - ❌ **5 WPs of 20 subtasks each** = 100 subtasks, overwhelming 1400-line prompts
259
+
260
+ **Feature complexity scales with subtask count, not WP count**:
261
+ - Simple feature: 10-15 subtasks → 2-4 WPs
262
+ - Medium feature: 30-50 subtasks → 6-10 WPs
263
+ - Complex feature: 80-120 subtasks → 15-20 WPs ← **Totally fine!**
264
+ - Very complex: 150+ subtasks → 25-30 WPs ← **Also fine!**
265
+
266
+ **The goal is manageable WP size, not minimizing WP count.**
267
+
268
+ ### When to Split a WP
269
+
270
+ **Split if ANY of these are true**:
271
+ - More than 10 subtasks
272
+ - Prompt would exceed 700 lines
273
+ - Multiple independent concerns mixed together
274
+ - Different phases or priorities mixed
275
+ - Agent would need to switch contexts multiple times
276
+
277
+ **How to split**:
278
+ - By phase: Foundation WP01, Implementation WP02, Testing WP03
279
+ - By component: Database WP01, API WP02, UI WP03
280
+ - By user story: Story 1 WP01, Story 2 WP02, Story 3 WP03
281
+ - By type of work: Code WP01, Tests WP02, Migration WP03, Docs WP04
282
+
283
+ ### When to Merge WPs
284
+
285
+ **Merge if ALL of these are true**:
286
+ - Each WP has <3 subtasks
287
+ - Combined would be <7 subtasks
288
+ - Both address the same concern/component
289
+ - No natural parallelization opportunity
290
+ - Implementation is highly coupled
291
+
292
+ **Don't merge just to hit a WP count target!**
293
+
294
+ ## Task Generation Rules
295
+
296
+ **Tests remain optional**. Only include testing tasks/steps if the feature spec or user explicitly demands them.
297
+
298
+ 1. **Subtask derivation**:
299
+ - Assign IDs `Txxx` sequentially in execution order.
300
+ - Use `[P]` for parallel-safe items (different files/components).
301
+ - Include migrations, data seeding, observability, and operational chores.
302
+ - **Ideal subtask granularity**: One clear action (e.g., "Create user model", "Add login endpoint")
303
+ - **Too granular**: "Add import statement", "Fix typo" (bundle these)
304
+ - **Too coarse**: "Build entire API" (split into endpoints)
305
+
306
+ 2. **Work package grouping**:
307
+ - **Focus on SIZE first, count second**
308
+ - Target 3-7 subtasks per WP (200-500 line prompts)
309
+ - Maximum 10 subtasks per WP (700 line prompts)
310
+ - Keep each work package laser-focused on a single goal
311
+ - Avoid mixing unrelated concerns
312
+ - **Let complexity dictate WP count**: 20+ WPs is fine for complex features
313
+
314
+ 3. **Prioritisation & dependencies**:
315
+ - Sequence work packages: setup → foundational → story phases (priority order) → polish.
316
+ - Call out inter-package dependencies explicitly in both `tasks.md` and the prompts.
317
+ - Front-load infrastructure/foundation WPs (enable parallelization)
318
+
319
+ 4. **Prompt composition**:
320
+ - Mirror subtask order inside the prompt.
321
+ - Provide actionable implementation and test guidance per subtask—short for trivial work, exhaustive for complex flows.
322
+ - **Aim for 30-70 lines per subtask** in the prompt (includes purpose, steps, files, validation)
323
+ - Surface risks, integration points, and acceptance gates clearly so reviewers know what to verify.
324
+ - Include examples where helpful (API request/response shapes, config file structures, test cases)
325
+
326
+ 5. **Quality checkpoints**:
327
+ - After drafting WPs, review each prompt size estimate
328
+ - If any WP >700 lines: **STOP and split it**
329
+ - If most WPs <200 lines: Consider merging related ones
330
+ - Aim for consistency: Most WPs should be similar size (within 200-line range)
331
+ - **Think like an implementer**: Can I complete this WP in one focused session? If not, it's too big.
332
+
333
+ 6. **Think like a reviewer**: Any vague requirement should be tightened until a reviewer can objectively mark it done or not done.
334
+
335
+ ## Step-by-Step Process
336
+
337
+ ### Step 1: Setup
338
+
339
+ Run `spec-kitty agent feature check-prerequisites --json --paths-only --include-tasks` and capture `FEATURE_DIR`.
340
+
341
+ ### Step 2: Load Design Documents
342
+
343
+ Read from `FEATURE_DIR`:
344
+ - spec.md (required)
345
+ - plan.md (required)
346
+ - data-model.md (optional)
347
+ - research.md (optional)
348
+ - contracts/ (optional)
349
+
350
+ ### Step 3: Derive ALL Subtasks
351
+
352
+ Create complete list of subtasks with IDs T001, T002, etc.
353
+
354
+ **Don't worry about count yet - capture EVERYTHING needed.**
355
+
356
+ ### Step 4: Group into Work Packages
357
+
358
+ **SIZING ALGORITHM**:
359
+
360
+ ```
361
+ For each cohesive unit of work:
362
+ 1. List related subtasks
363
+ 2. Count subtasks
364
+ 3. Estimate prompt lines (subtasks × 50 lines avg)
365
+
366
+ If subtasks <= 7 AND estimated lines <= 500:
367
+ ✓ Good WP size - create it
368
+
369
+ Else if subtasks > 10 OR estimated lines > 700:
370
+ ✗ Too large - split into 2+ WPs
371
+
372
+ Else if subtasks < 3 AND can merge with related WP:
373
+ → Consider merging (but don't force it)
374
+ ```
375
+
376
+ **Examples**:
377
+
378
+ **Good sizing**:
379
+ - WP01: Database Foundation (5 subtasks, ~300 lines) ✓
380
+ - WP02: User Authentication (7 subtasks, ~450 lines) ✓
381
+ - WP03: Admin Dashboard (6 subtasks, ~400 lines) ✓
382
+
383
+ **Too large - MUST SPLIT**:
384
+ - ❌ WP01: Entire Backend (25 subtasks, ~1500 lines)
385
+ - ✓ Split into: DB Layer (5), Business Logic (6), API Layer (7), Auth (7)
386
+
387
+ **Too small - CONSIDER MERGING**:
388
+ - WP01: Add config file (2 subtasks, ~100 lines)
389
+ - WP02: Add logging (2 subtasks, ~120 lines)
390
+ - ✓ Merge into: WP01: Infrastructure Setup (4 subtasks, ~220 lines)
391
+
392
+ ### Step 5: Write tasks.md
393
+
394
+ Create work package sections with:
395
+ - Summary (goal, priority, test criteria)
396
+ - Included subtasks (checkbox list)
397
+ - Implementation notes
398
+ - Parallel opportunities
399
+ - Dependencies
400
+ - **Estimated prompt size** (e.g., "~400 lines")
401
+
402
+ ### Step 6: Generate WP Prompt Files
403
+
404
+ For each WP, generate `FEATURE_DIR/tasks/WPxx-slug.md` using the template.
405
+
406
+ **CRITICAL VALIDATION**: After generating each prompt:
407
+ 1. Count lines in the prompt
408
+ 2. If >700 lines: GO BACK and split the WP
409
+ 3. If >1000 lines: **STOP - this will fail** - you MUST split it
410
+
411
+ **Self-check**:
412
+ - Subtask count: 3-7? ✓ | 8-10? ⚠️ | 11+? ❌ SPLIT
413
+ - Estimated lines: 200-500? ✓ | 500-700? ⚠️ | 700+? ❌ SPLIT
414
+ - Can implement in one session? ✓ | Multiple sessions needed? ❌ SPLIT
415
+
416
+ ### Step 7: Finalize Tasks
417
+
418
+ Run `spec-kitty agent feature finalize-tasks --json` to:
419
+ - Parse dependencies
420
+ - Update frontmatter
421
+ - Validate (cycles, invalid refs)
422
+ - Commit to main
423
+
424
+ ### Step 8: Report
425
+
426
+ Provide summary with:
427
+ - WP count and subtask tallies
428
+ - **Size distribution** (e.g., "6 WPs ranging from 250-480 lines")
429
+ - **Size validation** (e.g., "✓ All WPs within ideal range" OR "⚠️ WP05 is 820 lines - consider splitting")
430
+ - Parallelization opportunities
431
+ - MVP scope
432
+ - Next command
433
+
434
+ ## Dependency Detection (0.11.0+)
435
+
436
+ **Parse dependencies from tasks.md structure**:
437
+
438
+ The LLM should analyze tasks.md for dependency relationships:
439
+ - Explicit phrases: "Depends on WP##", "Dependencies: WP##"
440
+ - Phase grouping: Phase 2 WPs typically depend on Phase 1
441
+ - Default to empty if unclear
442
+
443
+ **Generate dependencies in WP frontmatter**:
444
+
445
+ Each WP prompt file MUST include a `dependencies` field:
446
+ ```yaml
447
+ ---
448
+ work_package_id: "WP02"
449
+ title: "Build API"
450
+ lane: "planned"
451
+ dependencies: ["WP01"] # Generated from tasks.md
452
+ subtasks: ["T001", "T002"]
453
+ ---
454
+ ```
455
+
456
+ **Include the correct implementation command**:
457
+ - No dependencies: `spec-kitty implement WP01`
458
+ - With dependencies: `spec-kitty implement WP02 --base WP01`
459
+
460
+ The WP prompt must show the correct command so agents don't branch from the wrong base.
461
+
462
+ ## ⚠️ Common Mistakes to Avoid
463
+
464
+ ### ❌ MISTAKE 1: Optimizing for WP Count
465
+
466
+ **Bad thinking**: "I'll create exactly 5-7 WPs to keep it manageable"
467
+ → Results in: 20 subtasks per WP, 1200-line prompts, overwhelmed agents
468
+
469
+ **Good thinking**: "Each WP should be 3-7 subtasks (200-500 lines). If that means 15 WPs, that's fine."
470
+ → Results in: Focused WPs, successful implementation, happy agents
471
+
472
+ ### ❌ MISTAKE 2: Token Conservation During Planning
473
+
474
+ **Bad thinking**: "I'll save tokens by writing brief prompts with minimal guidance"
475
+ → Results in: Agents confused during implementation, asking clarifying questions, doing work wrong, requiring rework
476
+
477
+ **Good thinking**: "I'll invest tokens now to write thorough prompts with examples and edge cases"
478
+ → Results in: Agents implement correctly the first time, no rework needed, net token savings
479
+
480
+ ### ❌ MISTAKE 3: Mixing Unrelated Concerns
481
+
482
+ **Bad example**: WP03: Misc Backend Work (12 subtasks)
483
+ - T010: Add user model
484
+ - T011: Configure logging
485
+ - T012: Set up email service
486
+ - T013: Add admin dashboard
487
+ - ... (8 more unrelated tasks)
488
+
489
+ **Good approach**: Split by concern
490
+ - WP03: User Management (T010-T013, 4 subtasks)
491
+ - WP04: Infrastructure Services (T014-T017, 4 subtasks)
492
+ - WP05: Admin Dashboard (T018-T021, 4 subtasks)
493
+
494
+ ### ❌ MISTAKE 4: Insufficient Prompt Detail
495
+
496
+ **Bad prompt** (~20 lines per subtask):
497
+ ```markdown
498
+ ### Subtask T001: Add user authentication
499
+
500
+ **Purpose**: Implement login
501
+
502
+ **Steps**:
503
+ 1. Create endpoint
504
+ 2. Add validation
505
+ 3. Test it
506
+ ```
507
+
508
+ **Good prompt** (~60 lines per subtask):
509
+ ```markdown
510
+ ### Subtask T001: Implement User Login Endpoint
511
+
512
+ **Purpose**: Create POST /api/auth/login endpoint that validates credentials and returns JWT token.
513
+
514
+ **Steps**:
515
+ 1. Create endpoint handler in `src/api/auth.py`:
516
+ - Route: POST /api/auth/login
517
+ - Request body: `{email: string, password: string}`
518
+ - Response: `{token: string, user: UserProfile}` on success
519
+ - Error codes: 400 (invalid input), 401 (bad credentials), 429 (rate limited)
520
+
521
+ 2. Implement credential validation:
522
+ - Hash password with bcrypt (matches registration hash)
523
+ - Compare against stored hash from database
524
+ - Use constant-time comparison to prevent timing attacks
525
+
526
+ 3. Generate JWT token on success:
527
+ - Include: user_id, email, issued_at, expires_at (24 hours)
528
+ - Sign with SECRET_KEY from environment
529
+ - Algorithm: HS256
530
+
531
+ 4. Add rate limiting:
532
+ - Max 5 attempts per IP per 15 minutes
533
+ - Return 429 with Retry-After header
534
+
535
+ **Files**:
536
+ - `src/api/auth.py` (new file, ~80 lines)
537
+ - `tests/api/test_auth.py` (new file, ~120 lines)
538
+
539
+ **Validation**:
540
+ - [ ] Valid credentials return 200 with token
541
+ - [ ] Invalid credentials return 401
542
+ - [ ] Missing fields return 400
543
+ - [ ] Rate limit enforced (test with 6 requests)
544
+ - [ ] JWT token is valid and contains correct claims
545
+ - [ ] Token expires after 24 hours
546
+
547
+ **Edge Cases**:
548
+ - Account doesn't exist: Return 401 (same as wrong password - don't leak info)
549
+ - Empty password: Return 400
550
+ - SQL injection in email field: Prevented by parameterized queries
551
+ - Concurrent login attempts: Handle with database locking
552
+ ```
553
+
554
+ ## Remember
555
+
556
+ **This is the most important planning work you'll do.**
557
+
558
+ A well-crafted set of work packages with detailed prompts makes implementation smooth and parallelizable.
559
+
560
+ A rushed job with vague, oversized WPs causes:
561
+ - Agents getting stuck
562
+ - Implementation taking 2-3x longer
563
+ - Rework and review cycles
564
+ - Feature failure
565
+
566
+ **Invest the tokens now. Be thorough. Future agents will thank you.**
@@ -0,0 +1,100 @@
1
+ name: "Software Dev Kitty"
2
+ description: "Build high-quality software with structured workflows and test-driven development"
3
+ version: "1.0.0"
4
+ domain: "software"
5
+
6
+ # Workflow customization
7
+ workflow:
8
+ phases:
9
+ - name: "research"
10
+ description: "Research technologies and best practices"
11
+ - name: "design"
12
+ description: "Define architecture and contracts"
13
+ - name: "implement"
14
+ description: "Write code following TDD"
15
+ - name: "test"
16
+ description: "Validate implementation"
17
+ - name: "review"
18
+ description: "Code review and quality checks"
19
+
20
+ # Expected artifacts
21
+ artifacts:
22
+ required:
23
+ - spec.md
24
+ - plan.md
25
+ - tasks.md
26
+ optional:
27
+ - data-model.md
28
+ - contracts/
29
+ - quickstart.md
30
+ - research.md
31
+ - checklists/
32
+
33
+ # Path conventions for this mission
34
+ paths:
35
+ workspace: "src/"
36
+ tests: "tests/"
37
+ deliverables: "contracts/"
38
+ documentation: "docs/"
39
+
40
+ # Validation rules
41
+ validation:
42
+ checks:
43
+ - git_clean
44
+ - all_tests_pass
45
+ - kanban_complete
46
+ - no_clarification_markers
47
+ custom_validators: true # Use validators.py
48
+
49
+ # MCP tools recommended for this mission
50
+ mcp_tools:
51
+ required:
52
+ - filesystem
53
+ - git
54
+ recommended:
55
+ - code-search
56
+ - test-runner
57
+ - docker
58
+ optional:
59
+ - github
60
+ - gitlab
61
+
62
+ # Agent personality/instructions
63
+ agent_context: |
64
+ You are a software development agent following TDD practices.
65
+ Your constitution enforces Library-First, CLI Interface, and Test-First principles.
66
+ You work in structured phases: research → design → implement → test → review.
67
+
68
+ Key practices:
69
+ - Tests before code (non-negotiable)
70
+ - Library-first architecture
71
+ - CLI interfaces for all features
72
+ - Integration tests over mocks
73
+ - Real dependencies over mocks in testing
74
+
75
+ # Task metadata fields
76
+ task_metadata:
77
+ required:
78
+ - task_id
79
+ - lane
80
+ - phase
81
+ - agent
82
+ optional:
83
+ - shell_pid
84
+ - assignee
85
+ - estimated_hours
86
+
87
+ # Command customization
88
+ commands:
89
+ specify:
90
+ prompt: "Define user scenarios and acceptance criteria"
91
+ plan:
92
+ prompt: "Design technical architecture and implementation plan"
93
+ tasks:
94
+ prompt: "Break into work packages with TDD workflow"
95
+ implement:
96
+ prompt: "Execute implementation following test-first methodology"
97
+ review:
98
+ prompt: "Perform code review and validate against specification"
99
+ accept:
100
+ prompt: "Validate feature completeness and quality gates"