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,321 @@
1
+ ---
2
+ description: Create or update the feature specification from a natural language feature description.
3
+ ---
4
+
5
+ # /spec-kitty.specify - Create Feature Specification
6
+
7
+ **Version**: 0.11.0+
8
+
9
+ ## 📍 WORKING DIRECTORY: Stay in MAIN repository
10
+
11
+ **IMPORTANT**: Specify works in the main repository. NO worktrees are created.
12
+
13
+ ```bash
14
+ # Run from project root:
15
+ cd /path/to/project/root # Your main repository
16
+
17
+ # All planning artifacts are created in main and committed:
18
+ # - kitty-specs/###-feature/spec.md → Created in main
19
+ # - Committed to main branch
20
+ # - NO worktrees created
21
+ ```
22
+
23
+ **Worktrees are created later** during `/spec-kitty.implement`, not during planning.
24
+
25
+ ## User Input
26
+
27
+ ```text
28
+ $ARGUMENTS
29
+ ```
30
+
31
+ You **MUST** consider the user input before proceeding (if not empty).
32
+
33
+ ## Discovery Gate (mandatory)
34
+
35
+ Before running any scripts or writing to disk you **must** conduct a structured discovery interview.
36
+
37
+ - **Scope proportionality (CRITICAL)**: FIRST, gauge the inherent complexity of the request:
38
+ - **Trivial/Test Features** (hello world, simple pages, proof-of-concept): Ask 1-2 questions maximum, then proceed. Examples: "a simple hello world page", "tic-tac-toe game", "basic contact form"
39
+ - **Simple Features** (small UI additions, minor enhancements): Ask 2-3 questions covering purpose and basic constraints
40
+ - **Complex Features** (new subsystems, integrations): Ask 3-5 questions covering goals, users, constraints, risks
41
+ - **Platform/Critical Features** (authentication, payments, infrastructure): Full discovery with 5+ questions
42
+
43
+ - **User signals to reduce questioning**: If the user says "just testing", "quick prototype", "skip to next phase", "stop asking questions" - recognize this as a signal to minimize discovery and proceed with reasonable defaults.
44
+
45
+ - **First response rule**:
46
+ - For TRIVIAL features (hello world, simple test): Ask ONE clarifying question, then if the answer confirms it's simple, proceed directly to spec generation
47
+ - For other features: Ask a single focused discovery question and end with `WAITING_FOR_DISCOVERY_INPUT`
48
+
49
+ - If the user provides no initial description (empty command), stay in **Interactive Interview Mode**: keep probing with one question at a time.
50
+
51
+ - **Conversational cadence**: After each user reply, decide if you have ENOUGH context for this feature's complexity level. For trivial features, 1-2 questions is sufficient. Only continue asking if truly necessary for the scope.
52
+
53
+ Discovery requirements (scale to feature complexity):
54
+
55
+ 1. Maintain a **Discovery Questions** table internally covering questions appropriate to the feature's complexity (1-2 for trivial, up to 5+ for complex). Track columns `#`, `Question`, `Why it matters`, and `Current insight`. Do **not** render this table to the user.
56
+ 2. For trivial features, reasonable defaults are acceptable. Only probe if truly ambiguous.
57
+ 3. When you have sufficient context for the feature's scope, paraphrase into an **Intent Summary** and confirm. For trivial features, this can be very brief.
58
+ 4. If user explicitly asks to skip questions or says "just testing", acknowledge and proceed with minimal discovery.
59
+
60
+ ## Mission Selection
61
+
62
+ After completing discovery and confirming the Intent Summary, determine the appropriate mission for this feature.
63
+
64
+ ### Available Missions
65
+
66
+ - **software-dev**: For building software features, APIs, CLI tools, applications
67
+ - Phases: research → design → implement → test → review
68
+ - Best for: code changes, new features, bug fixes, refactoring
69
+
70
+ - **research**: For investigations, literature reviews, technical analysis
71
+ - Phases: question → methodology → gather → analyze → synthesize → publish
72
+ - Best for: feasibility studies, market research, technology evaluation
73
+
74
+ ### Mission Inference
75
+
76
+ 1. **Analyze the feature description** to identify the primary goal:
77
+ - Building, coding, implementing, creating software → **software-dev**
78
+ - Researching, investigating, analyzing, evaluating → **research**
79
+
80
+ 2. **Check for explicit mission requests** in the user's description:
81
+ - If user mentions "research project", "investigation", "analysis" → use research
82
+ - If user mentions "build", "implement", "create feature" → use software-dev
83
+
84
+ 3. **Confirm with user** (unless explicit):
85
+ > "Based on your description, this sounds like a **[software-dev/research]** project.
86
+ > I'll use the **[mission name]** mission. Does that work for you?"
87
+
88
+ 4. **Handle user response**:
89
+ - If confirmed: proceed with selected mission
90
+ - If user wants different mission: use their choice
91
+
92
+ 5. **Handle --mission flag**: If the user provides `--mission <key>` in their command, skip inference and use the specified mission directly.
93
+
94
+ Store the final mission selection in your notes and include it in the spec output. Do not pass a `--mission` flag to feature creation.
95
+
96
+ ## Workflow (0.11.0+)
97
+
98
+ **Planning happens in main repository - NO worktree created!**
99
+
100
+ 1. Creates `kitty-specs/###-feature/spec.md` directly in main repo
101
+ 2. Automatically commits to main branch
102
+ 3. No worktree created during specify
103
+
104
+ **Worktrees created later**: Use `spec-kitty implement WP##` to create a workspace for each work package. Worktrees are created later during implement (e.g., `.worktrees/###-feature-WP##`).
105
+
106
+ ## Location
107
+
108
+ - Work in: **Main repository** (not a worktree)
109
+ - Creates: `kitty-specs/###-feature/spec.md`
110
+ - Commits to: `main` branch
111
+
112
+ ## Outline
113
+
114
+ ### 0. Generate a Friendly Feature Title
115
+
116
+ - Summarize the agreed intent into a short, descriptive title (aim for ≤7 words; avoid filler like "feature" or "thing").
117
+ - Read that title back during the Intent Summary and revise it if the user requests changes.
118
+ - Use the confirmed title to derive the kebab-case feature slug for the create-feature command.
119
+
120
+ The text the user typed after `/spec-kitty.specify` in the triggering message **is** the initial feature description. Capture it verbatim, but treat it only as a starting point for discovery—not the final truth. Your job is to interrogate the request, surface gaps, and co-create a complete specification with the user.
121
+
122
+ Given that feature description, do this:
123
+
124
+ - **Generation Mode (arguments provided)**: Use the provided text as a starting point, validate it through discovery, and fill gaps with explicit questions or clearly documented assumptions (limit `[NEEDS CLARIFICATION: …]` to at most three critical decisions the user has postponed).
125
+ - **Interactive Interview Mode (no arguments)**: Use the discovery interview to elicit all necessary context, synthesize the working feature description, and confirm it with the user before you generate any specification artifacts.
126
+
127
+ 1. **Check discovery status**:
128
+ - If this is your first message or discovery questions remain unanswered, stay in the one-question loop, capture the user's response, update your internal table, and end with `WAITING_FOR_DISCOVERY_INPUT`. Do **not** surface the table; keep it internal. Do **not** call the creation command yet.
129
+ - Only proceed once every discovery question has an explicit answer and the user has acknowledged the Intent Summary.
130
+ - Empty invocation rule: stay in interview mode until you can restate the agreed-upon feature description. Do **not** call the creation command while the description is missing or provisional.
131
+
132
+ 2. When discovery is complete and the intent summary, **title**, and **mission** are confirmed, run the feature creation command from repo root:
133
+
134
+ ```bash
135
+ spec-kitty agent feature create-feature "<slug>" --json
136
+ ```
137
+
138
+ Where `<slug>` is a kebab-case version of the friendly title (e.g., "Checkout Upsell Flow" → "checkout-upsell-flow").
139
+
140
+ The command returns JSON with:
141
+ - `result`: "success" or error message
142
+ - `feature`: Feature number and slug (e.g., "014-checkout-upsell-flow")
143
+ - `feature_dir`: Absolute path to the feature directory inside the main repo
144
+
145
+ Parse these values for use in subsequent steps. All file paths are absolute.
146
+
147
+ **IMPORTANT**: You must only ever run this command once. The JSON is provided in the terminal output - always refer to it to get the actual paths you're looking for.
148
+ 3. **Stay in the main repository**: No worktree is created during specify.
149
+
150
+ 4. Load the spec template from `.kittify/templates/spec-template.md` (or `templates/spec-template.md`) to understand required sections.
151
+
152
+ 5. Create meta.json in the feature directory with:
153
+ ```json
154
+ {
155
+ "feature_number": "<number>",
156
+ "slug": "<full-slug>",
157
+ "friendly_name": "<Friendly Title>",
158
+ "mission": "<selected-mission>",
159
+ "source_description": "$ARGUMENTS",
160
+ "created_at": "<ISO timestamp>"
161
+ }
162
+ ```
163
+
164
+ 6. Generate the specification content by following this flow:
165
+ - Use the discovery answers as your authoritative source of truth (do **not** rely on raw `$ARGUMENTS`)
166
+ - For empty invocations, treat the synthesized interview summary as the canonical feature description
167
+ - Identify: actors, actions, data, constraints, motivations, success metrics
168
+ - For any remaining ambiguity:
169
+ * Ask the user a focused follow-up question immediately and halt work until they answer
170
+ * Only use `[NEEDS CLARIFICATION: …]` when the user explicitly defers the decision
171
+ * Record any interim assumption in the Assumptions section
172
+ * Prioritize clarifications by impact: scope > outcomes > risks/security > user experience > technical details
173
+ - Fill User Scenarios & Testing section (ERROR if no clear user flow can be determined)
174
+ - Generate Functional Requirements (each requirement must be testable)
175
+ - Define Success Criteria (measurable, technology-agnostic outcomes)
176
+ - Identify Key Entities (if data involved)
177
+
178
+ 7. Write the specification to `<feature_dir>/spec.md` using the template structure, replacing placeholders with concrete details derived from the feature description while preserving section order and headings.
179
+
180
+ 8. **Specification Quality Validation**: After writing the initial spec, validate it against quality criteria:
181
+
182
+ a. **Create Spec Quality Checklist**: Generate a checklist file at `FEATURE_DIR/checklists/requirements.md` using the checklist template structure with these validation items:
183
+
184
+ ```markdown
185
+ # Specification Quality Checklist: [FEATURE NAME]
186
+
187
+ **Purpose**: Validate specification completeness and quality before proceeding to planning
188
+ **Created**: [DATE]
189
+ **Feature**: [Link to spec.md]
190
+
191
+ ## Content Quality
192
+
193
+ - [ ] No implementation details (languages, frameworks, APIs)
194
+ - [ ] Focused on user value and business needs
195
+ - [ ] Written for non-technical stakeholders
196
+ - [ ] All mandatory sections completed
197
+
198
+ ## Requirement Completeness
199
+
200
+ - [ ] No [NEEDS CLARIFICATION] markers remain
201
+ - [ ] Requirements are testable and unambiguous
202
+ - [ ] Success criteria are measurable
203
+ - [ ] Success criteria are technology-agnostic (no implementation details)
204
+ - [ ] All acceptance scenarios are defined
205
+ - [ ] Edge cases are identified
206
+ - [ ] Scope is clearly bounded
207
+ - [ ] Dependencies and assumptions identified
208
+
209
+ ## Feature Readiness
210
+
211
+ - [ ] All functional requirements have clear acceptance criteria
212
+ - [ ] User scenarios cover primary flows
213
+ - [ ] Feature meets measurable outcomes defined in Success Criteria
214
+ - [ ] No implementation details leak into specification
215
+
216
+ ## Notes
217
+
218
+ - Items marked incomplete require spec updates before `/spec-kitty.clarify` or `/spec-kitty.plan`
219
+ ```
220
+
221
+ b. **Run Validation Check**: Review the spec against each checklist item:
222
+ - For each item, determine if it passes or fails
223
+ - Document specific issues found (quote relevant spec sections)
224
+
225
+ c. **Handle Validation Results**:
226
+
227
+ - **If all items pass**: Mark checklist complete and proceed to step 6
228
+
229
+ - **If items fail (excluding [NEEDS CLARIFICATION])**:
230
+ 1. List the failing items and specific issues
231
+ 2. Update the spec to address each issue
232
+ 3. Re-run validation until all items pass (max 3 iterations)
233
+ 4. If still failing after 3 iterations, document remaining issues in checklist notes and warn user
234
+
235
+ - **If [NEEDS CLARIFICATION] markers remain**:
236
+ 1. Extract all [NEEDS CLARIFICATION: ...] markers from the spec
237
+ 2. Re-confirm with the user whether each outstanding decision truly needs to stay unresolved. Do not assume away critical gaps.
238
+ 3. For each clarification the user has explicitly deferred, present options using plain text—no tables:
239
+
240
+ ```
241
+ Question [N]: [Topic]
242
+ Context: [Quote relevant spec section]
243
+ Need: [Specific question from NEEDS CLARIFICATION marker]
244
+ Options: (A) [First answer — implications] · (B) [Second answer — implications] · (C) [Third answer — implications] · (D) Custom (describe your own answer)
245
+ Reply with a letter or a custom answer.
246
+ ```
247
+
248
+ 4. Number questions sequentially (Q1, Q2, Q3 - max 3 total)
249
+ 5. Present all questions together before waiting for responses
250
+ 6. Wait for user to respond with their choices for all questions (e.g., "Q1: A, Q2: Custom - [details], Q3: B")
251
+ 7. Update the spec by replacing each [NEEDS CLARIFICATION] marker with the user's selected or provided answer
252
+ 9. Re-run validation after all clarifications are resolved
253
+
254
+ d. **Update Checklist**: After each validation iteration, update the checklist file with current pass/fail status
255
+
256
+ 9. Report completion with feature directory, spec file path, checklist results, and readiness for the next phase (`/spec-kitty.clarify` or `/spec-kitty.plan`).
257
+
258
+ **NOTE:** The script creates and checks out the new branch and initializes the spec file before writing.
259
+
260
+ ## General Guidelines
261
+
262
+ ## Quick Guidelines
263
+
264
+ - Focus on **WHAT** users need and **WHY**.
265
+ - Avoid HOW to implement (no tech stack, APIs, code structure).
266
+ - Written for business stakeholders, not developers.
267
+ - DO NOT create any checklists that are embedded in the spec. That will be a separate command.
268
+
269
+ ### Section Requirements
270
+
271
+ - **Mandatory sections**: Must be completed for every feature
272
+ - **Optional sections**: Include only when relevant to the feature
273
+ - When a section doesn't apply, remove it entirely (don't leave as "N/A")
274
+
275
+ ### For AI Generation
276
+
277
+ When creating this spec from a user prompt:
278
+
279
+ 1. **Make informed guesses**: Use context, industry standards, and common patterns to fill gaps
280
+ 2. **Document assumptions**: Record reasonable defaults in the Assumptions section
281
+ 3. **Limit clarifications**: Maximum 3 [NEEDS CLARIFICATION] markers - use only for critical decisions that:
282
+ - Significantly impact feature scope or user experience
283
+ - Have multiple reasonable interpretations with different implications
284
+ - Lack any reasonable default
285
+ 4. **Prioritize clarifications**: scope > security/privacy > user experience > technical details
286
+ 5. **Think like a tester**: Every vague requirement should fail the "testable and unambiguous" checklist item
287
+ 6. **Common areas needing clarification** (only if no reasonable default exists):
288
+ - Feature scope and boundaries (include/exclude specific use cases)
289
+ - User types and permissions (if multiple conflicting interpretations possible)
290
+ - Security/compliance requirements (when legally/financially significant)
291
+
292
+ **Examples of reasonable defaults** (don't ask about these):
293
+
294
+ - Data retention: Industry-standard practices for the domain
295
+ - Performance targets: Standard web/mobile app expectations unless specified
296
+ - Error handling: User-friendly messages with appropriate fallbacks
297
+ - Authentication method: Standard session-based or OAuth2 for web apps
298
+ - Integration patterns: RESTful APIs unless specified otherwise
299
+
300
+ ### Success Criteria Guidelines
301
+
302
+ Success criteria must be:
303
+
304
+ 1. **Measurable**: Include specific metrics (time, percentage, count, rate)
305
+ 2. **Technology-agnostic**: No mention of frameworks, languages, databases, or tools
306
+ 3. **User-focused**: Describe outcomes from user/business perspective, not system internals
307
+ 4. **Verifiable**: Can be tested/validated without knowing implementation details
308
+
309
+ **Good examples**:
310
+
311
+ - "Users can complete checkout in under 3 minutes"
312
+ - "System supports 10,000 concurrent users"
313
+ - "95% of searches return results in under 1 second"
314
+ - "Task completion rate improves by 40%"
315
+
316
+ **Bad examples** (implementation-focused):
317
+
318
+ - "API response time is under 200ms" (too technical, use "Users see results instantly")
319
+ - "Database can handle 1000 TPS" (implementation detail, use user-facing metric)
320
+ - "React components render efficiently" (framework-specific)
321
+ - "Redis cache hit rate above 80%" (technology-specific)
@@ -0,0 +1,92 @@
1
+ ---
2
+ description: Display kanban board status showing work package progress across lanes (planned/doing/for_review/done).
3
+ ---
4
+
5
+ ## Status Board
6
+
7
+ Show the current status of all work packages in the active feature. This displays:
8
+ - Kanban board with WPs organized by lane
9
+ - Progress bar showing completion percentage
10
+ - Parallelization opportunities (which WPs can run concurrently)
11
+ - Next steps recommendations
12
+
13
+ ## When to Use
14
+
15
+ - Before starting work (see what's ready to implement)
16
+ - During implementation (track overall progress)
17
+ - After completing a WP (see what's next)
18
+ - When planning parallelization (identify independent WPs)
19
+
20
+ ## Implementation
21
+
22
+ Run the CLI command to display the status board:
23
+
24
+ ```bash
25
+ spec-kitty agent tasks status
26
+ ```
27
+
28
+ To specify a feature explicitly:
29
+
30
+ ```bash
31
+ spec-kitty agent tasks status --feature 012-documentation-mission
32
+ ```
33
+
34
+ The command displays a rich kanban board with:
35
+ - Progress bar showing completion percentage
36
+ - Work packages organized by lane (planned/doing/for_review/done)
37
+ - Summary metrics
38
+
39
+ ## Alternative: Python API
40
+
41
+ For programmatic access (e.g., in Jupyter notebooks or scripts), use the Python function:
42
+
43
+ ```python
44
+ from specify_cli.agent_utils.status import show_kanban_status
45
+
46
+ # Auto-detect feature from current directory/branch
47
+ result = show_kanban_status()
48
+
49
+ # Or specify feature explicitly:
50
+ # result = show_kanban_status("012-documentation-mission")
51
+ ```
52
+
53
+ Returns structured data:
54
+
55
+ ```python
56
+ {
57
+ 'feature_slug': '012-documentation-mission',
58
+ 'progress_percentage': 80.0,
59
+ 'done_count': 8,
60
+ 'total_wps': 10,
61
+ 'by_lane': {
62
+ 'planned': ['WP09'],
63
+ 'doing': ['WP10'],
64
+ 'for_review': [],
65
+ 'done': ['WP01', 'WP02', ...]
66
+ },
67
+ 'parallelization': {
68
+ 'ready_wps': [...],
69
+ 'can_parallelize': True/False,
70
+ 'parallel_groups': [...]
71
+ }
72
+ }
73
+
74
+ ## Output Example
75
+
76
+ ```
77
+ ╭─────────────────────────────────────────────────────────────────────╮
78
+ │ 012-documentation-mission │
79
+ │ Progress: 80% [████████░░] │
80
+ ╰─────────────────────────────────────────────────────────────────────╯
81
+
82
+ ┌─────────────┬─────────────┬─────────────┬─────────────┐
83
+ │ PLANNED │ DOING │ FOR_REVIEW │ DONE │
84
+ ├─────────────┼─────────────┼─────────────┼─────────────┤
85
+ │ WP09 │ WP10 │ │ WP01 │
86
+ │ │ │ │ WP02 │
87
+ │ │ │ │ WP03 │
88
+ │ │ │ │ ... │
89
+ └─────────────┴─────────────┴─────────────┴─────────────┘
90
+
91
+ 🔀 Parallelization: WP09 can start (no dependencies)
92
+ ```
@@ -0,0 +1,199 @@
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
+ ## 📍 WORKING DIRECTORY: Stay in MAIN repository
10
+
11
+ **IMPORTANT**: Tasks works in the main repository. NO worktrees created.
12
+
13
+ ```bash
14
+ # Run from project root (same directory as /spec-kitty.plan):
15
+ # You should already be here if you just ran /spec-kitty.plan
16
+
17
+ # Creates:
18
+ # - kitty-specs/###-feature/tasks/WP01-*.md → In main repository
19
+ # - kitty-specs/###-feature/tasks/WP02-*.md → In main repository
20
+ # - Commits ALL to main branch
21
+ # - NO worktrees created
22
+ ```
23
+
24
+ **Do NOT cd anywhere**. Stay in the main repository root.
25
+
26
+ **Worktrees created later**: After tasks are generated, use `spec-kitty implement WP##` to create workspace for each WP.
27
+
28
+ ## User Input
29
+
30
+ ```text
31
+ $ARGUMENTS
32
+ ```
33
+
34
+ You **MUST** consider the user input before proceeding (if not empty).
35
+
36
+ ## Location Check (0.11.0+)
37
+
38
+ Before proceeding, verify you are in the main repository:
39
+
40
+ **Check your current branch:**
41
+ ```bash
42
+ git branch --show-current
43
+ ```
44
+
45
+ **Expected output:** `main` (or `master`)
46
+ **If you see a feature branch:** You're in the wrong place. Return to main:
47
+ ```bash
48
+ cd $(git rev-parse --show-toplevel)
49
+ git checkout main
50
+ ```
51
+
52
+ Work packages are generated directly in `kitty-specs/###-feature/` and committed to main. Worktrees are created later when implementing each work package.
53
+
54
+ ## Outline
55
+
56
+ 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.
57
+
58
+ **CRITICAL**: The command returns JSON with `FEATURE_DIR` as an ABSOLUTE path (e.g., `/Users/robert/Code/new_specify/kitty-specs/001-feature-name`).
59
+
60
+ **YOU MUST USE THIS PATH** for ALL subsequent file operations. Example:
61
+ ```
62
+ FEATURE_DIR = "/Users/robert/Code/new_specify/kitty-specs/001-a-simple-hello"
63
+ tasks.md location: FEATURE_DIR + "/tasks.md"
64
+ prompt location: FEATURE_DIR + "/tasks/WP01-slug.md"
65
+ ```
66
+
67
+ **DO NOT CREATE** paths like:
68
+ - ❌ `tasks/WP01-slug.md` (missing FEATURE_DIR prefix)
69
+ - ❌ `/tasks/WP01-slug.md` (wrong root)
70
+ - ❌ `FEATURE_DIR/tasks/planned/WP01-slug.md` (WRONG - no subdirectories!)
71
+ - ❌ `WP01-slug.md` (wrong directory)
72
+
73
+ 2. **Load design documents** from `FEATURE_DIR` (only those present):
74
+ - **Required**: plan.md (tech architecture, stack), spec.md (user stories & priorities)
75
+ - **Optional**: data-model.md (entities), contracts/ (API schemas), research.md (decisions), quickstart.md (validation scenarios)
76
+ - Scale your effort to the feature: simple UI tweaks deserve lighter coverage, multi-system releases require deeper decomposition.
77
+
78
+ 3. **Derive fine-grained subtasks** (IDs `T001`, `T002`, ...):
79
+ - Parse plan/spec to enumerate concrete implementation steps, tests (only if explicitly requested), migrations, and operational work.
80
+ - Capture prerequisites, dependencies, and parallelizability markers (`[P]` means safe to parallelize per file/concern).
81
+ - Maintain the subtask list internally; it feeds the work-package roll-up and the prompts.
82
+
83
+ 4. **Roll subtasks into work packages** (IDs `WP01`, `WP02`, ...):
84
+ - Target 4–10 work packages. Each should be independently implementable, rooted in a single user story or cohesive subsystem.
85
+ - Ensure every subtask appears in exactly one work package.
86
+ - Name each work package with a succinct goal (e.g., “User Story 1 – Real-time chat happy path”).
87
+ - Record per-package metadata: priority, success criteria, risks, dependencies, and list of included subtasks.
88
+
89
+ 5. **Write `tasks.md`** using `.kittify/templates/tasks-template.md`:
90
+ - **Location**: Write to `FEATURE_DIR/tasks.md` (use the absolute FEATURE_DIR path from step 1)
91
+ - Populate the Work Package sections (setup, foundational, per-story, polish) with the `WPxx` entries
92
+ - Under each work package include:
93
+ - Summary (goal, priority, independent test)
94
+ - Included subtasks (checkbox list referencing `Txxx`)
95
+ - Implementation sketch (high-level sequence)
96
+ - Parallel opportunities, dependencies, and risks
97
+ - Preserve the checklist style so implementers can mark progress
98
+
99
+ 6. **Generate prompt files (one per work package)**:
100
+ - **CRITICAL PATH RULE**: All work package files MUST be created in a FLAT `FEATURE_DIR/tasks/` directory, NOT in subdirectories!
101
+ - Correct structure: `FEATURE_DIR/tasks/WPxx-slug.md` (flat, no subdirectories)
102
+ - WRONG (do not create): `FEATURE_DIR/tasks/planned/`, `FEATURE_DIR/tasks/doing/`, or ANY lane subdirectories
103
+ - WRONG (do not create): `/tasks/`, `tasks/`, or any path not under FEATURE_DIR
104
+ - Ensure `FEATURE_DIR/tasks/` exists (create as flat directory, NO subdirectories)
105
+ - For each work package:
106
+ - Derive a kebab-case slug from the title; filename: `WPxx-slug.md`
107
+ - Full path example: `FEATURE_DIR/tasks/WP01-create-html-page.md` (use ABSOLUTE path from FEATURE_DIR variable)
108
+ - Use `.kittify/templates/task-prompt-template.md` to capture:
109
+ - Frontmatter with `work_package_id`, `subtasks` array, `lane: "planned"`, `dependencies`, history entry
110
+ - Objective, context, detailed guidance per subtask
111
+ - Test strategy (only if requested)
112
+ - Definition of Done, risks, reviewer guidance
113
+ - Update `tasks.md` to reference the prompt filename
114
+ - Keep prompts exhaustive enough that a new agent can complete the work package unaided
115
+
116
+ **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`.
117
+
118
+ 7. **Finalize tasks with dependency parsing and commit**:
119
+ After generating all WP prompt files, run the finalization command to:
120
+ - Parse dependencies from tasks.md
121
+ - Update WP frontmatter with dependencies field
122
+ - Validate dependencies (check for cycles, invalid references)
123
+ - Commit all tasks to main branch
124
+
125
+ **CRITICAL**: Run this command from repo root:
126
+ ```bash
127
+ spec-kitty agent feature finalize-tasks --json
128
+ ```
129
+
130
+ This step is MANDATORY for workspace-per-WP features. Without it:
131
+ - Dependencies won't be in frontmatter
132
+ - Agents won't know which --base flag to use
133
+ - Tasks won't be committed to main
134
+
135
+ 8. **Report**: Provide a concise outcome summary:
136
+ - Path to `tasks.md`
137
+ - Work package count and per-package subtask tallies
138
+ - Parallelization highlights
139
+ - MVP scope recommendation (usually Work Package 1)
140
+ - Prompt generation stats (files written, directory structure, any skipped items with rationale)
141
+ - Finalization status (dependencies parsed, X WP files updated, committed to main)
142
+ - Next suggested command (e.g., `/spec-kitty.analyze` or `/spec-kitty.implement`)
143
+
144
+ Context for work-package planning: {ARGS}
145
+
146
+ 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.
147
+
148
+ ## Dependency Detection (0.11.0+)
149
+
150
+ **Parse dependencies from tasks.md structure**:
151
+
152
+ The LLM should analyze tasks.md for dependency relationships:
153
+ - Explicit phrases: "Depends on WP##", "Dependencies: WP##"
154
+ - Phase grouping: Phase 2 WPs typically depend on Phase 1
155
+ - Default to empty if unclear
156
+
157
+ **Generate dependencies in WP frontmatter**:
158
+
159
+ Each WP prompt file MUST include a `dependencies` field:
160
+ ```yaml
161
+ ---
162
+ work_package_id: "WP02"
163
+ title: "Build API"
164
+ lane: "planned"
165
+ dependencies: ["WP01"] # Generated from tasks.md
166
+ subtasks: ["T001", "T002"]
167
+ ---
168
+ ```
169
+
170
+ **Include the correct implementation command**:
171
+ - No dependencies: `spec-kitty implement WP01`
172
+ - With dependencies: `spec-kitty implement WP02 --base WP01`
173
+
174
+ The WP prompt must show the correct command so agents don't branch from the wrong base.
175
+
176
+ ## Task Generation Rules
177
+
178
+ **Tests remain optional**. Only include testing tasks/steps if the feature spec or user explicitly demands them.
179
+
180
+ 1. **Subtask derivation**:
181
+ - Assign IDs `Txxx` sequentially in execution order.
182
+ - Use `[P]` for parallel-safe items (different files/components).
183
+ - Include migrations, data seeding, observability, and operational chores.
184
+
185
+ 2. **Work package grouping**:
186
+ - Map subtasks to user stories or infrastructure themes.
187
+ - Keep each work package laser-focused on a single goal; avoid mixing unrelated stories.
188
+ - Do not exceed 10 work packages. Merge low-effort items into broader bundles when necessary.
189
+
190
+ 3. **Prioritisation & dependencies**:
191
+ - Sequence work packages: setup → foundational → story phases (priority order) → polish.
192
+ - Call out inter-package dependencies explicitly in both `tasks.md` and the prompts.
193
+
194
+ 4. **Prompt composition**:
195
+ - Mirror subtask order inside the prompt.
196
+ - Provide actionable implementation and test guidance per subtask—short for trivial work, exhaustive for complex flows.
197
+ - Surface risks, integration points, and acceptance gates clearly so reviewers know what to verify.
198
+
199
+ 5. **Think like a tester**: Any vague requirement should be tightened until a reviewer can objectively mark it done or not done.
@@ -0,0 +1,22 @@
1
+ #!/usr/bin/env bash
2
+ # Main pre-commit hook that orchestrates all pre-commit checks
3
+ #
4
+ # This hook runs all individual check scripts in the git-hooks directory.
5
+ # Individual checks can be bypassed with --no-verify, but this should be
6
+ # used sparingly and only when you're certain the commit is safe.
7
+
8
+ set -e
9
+
10
+ HOOKS_DIR="$(cd "$(dirname "$0")" && pwd)"
11
+
12
+ # Run encoding check if it exists
13
+ if [ -x "$HOOKS_DIR/pre-commit-encoding-check" ]; then
14
+ "$HOOKS_DIR/pre-commit-encoding-check" || exit 1
15
+ fi
16
+
17
+ # Run agent directory check if it exists
18
+ if [ -x "$HOOKS_DIR/pre-commit-agent-check" ]; then
19
+ "$HOOKS_DIR/pre-commit-agent-check" || exit 1
20
+ fi
21
+
22
+ exit 0
@@ -0,0 +1,37 @@
1
+ #!/usr/bin/env bash
2
+ # Pre-commit hook to prevent committing agent directories
3
+ #
4
+ # Agent directories (.claude/, .codex/, etc.) may contain:
5
+ # - Authentication tokens and API keys
6
+ # - User-specific credentials (auth.json)
7
+ # - Session data and conversation history
8
+ #
9
+ # These should NEVER be committed to version control.
10
+
11
+ AGENT_DIRS=(".claude" ".codex" ".gemini" ".cursor" ".qwen" ".opencode"
12
+ ".windsurf" ".kilocode" ".augment" ".roo" ".amazonq" ".github/copilot")
13
+
14
+ STAGED_AGENT_FILES=$(git diff --cached --name-only --diff-filter=ACM |
15
+ grep -E "^\.(claude|codex|gemini|cursor|qwen|opencode|windsurf|kilocode|augment|roo|amazonq)/|^\.github/copilot/" || true)
16
+
17
+ if [ -n "$STAGED_AGENT_FILES" ]; then
18
+ echo "❌ COMMIT BLOCKED: Agent directory files detected"
19
+ echo ""
20
+ echo "The following agent directory files are staged:"
21
+ echo "$STAGED_AGENT_FILES" | sed 's/^/ /'
22
+ echo ""
23
+ echo "These directories should NEVER be committed:"
24
+ for dir in "${AGENT_DIRS[@]}"; do
25
+ echo " - $dir/ (may contain auth tokens and credentials)"
26
+ done
27
+ echo ""
28
+ echo "To fix:"
29
+ echo " 1. Unstage these files: git reset HEAD <file>"
30
+ echo " 2. Ensure .gitignore includes all agent directories"
31
+ echo " 3. Run: git status to verify"
32
+ echo ""
33
+ echo "To bypass this check (NOT recommended): git commit --no-verify"
34
+ exit 1
35
+ fi
36
+
37
+ exit 0