zoe-agent 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (267) hide show
  1. package/CHANGELOG.md +154 -0
  2. package/LICENSE +96 -0
  3. package/README.md +568 -0
  4. package/dist/adapters/cli/agent.d.ts +59 -0
  5. package/dist/adapters/cli/agent.js +232 -0
  6. package/dist/adapters/cli/bootstrap.d.ts +25 -0
  7. package/dist/adapters/cli/bootstrap.js +204 -0
  8. package/dist/adapters/cli/commands/build-registry.d.ts +14 -0
  9. package/dist/adapters/cli/commands/build-registry.js +88 -0
  10. package/dist/adapters/cli/commands/clear.d.ts +7 -0
  11. package/dist/adapters/cli/commands/clear.js +10 -0
  12. package/dist/adapters/cli/commands/compact.d.ts +13 -0
  13. package/dist/adapters/cli/commands/compact.js +96 -0
  14. package/dist/adapters/cli/commands/exit.d.ts +7 -0
  15. package/dist/adapters/cli/commands/exit.js +9 -0
  16. package/dist/adapters/cli/commands/gateway.d.ts +7 -0
  17. package/dist/adapters/cli/commands/gateway.js +152 -0
  18. package/dist/adapters/cli/commands/help.d.ts +9 -0
  19. package/dist/adapters/cli/commands/help.js +12 -0
  20. package/dist/adapters/cli/commands/models.d.ts +10 -0
  21. package/dist/adapters/cli/commands/models.js +32 -0
  22. package/dist/adapters/cli/commands/registry.d.ts +70 -0
  23. package/dist/adapters/cli/commands/registry.js +111 -0
  24. package/dist/adapters/cli/commands/settings-utils.d.ts +38 -0
  25. package/dist/adapters/cli/commands/settings-utils.js +182 -0
  26. package/dist/adapters/cli/commands/settings.d.ts +9 -0
  27. package/dist/adapters/cli/commands/settings.js +395 -0
  28. package/dist/adapters/cli/commands/skills.d.ts +7 -0
  29. package/dist/adapters/cli/commands/skills.js +21 -0
  30. package/dist/adapters/cli/config-loader.d.ts +27 -0
  31. package/dist/adapters/cli/config-loader.js +48 -0
  32. package/dist/adapters/cli/docker-utils.d.ts +37 -0
  33. package/dist/adapters/cli/docker-utils.js +90 -0
  34. package/dist/adapters/cli/index.d.ts +2 -0
  35. package/dist/adapters/cli/index.js +88 -0
  36. package/dist/adapters/cli/repl.d.ts +22 -0
  37. package/dist/adapters/cli/repl.js +256 -0
  38. package/dist/adapters/cli/setup.d.ts +19 -0
  39. package/dist/adapters/cli/setup.js +613 -0
  40. package/dist/adapters/cli/system-prompts.d.ts +56 -0
  41. package/dist/adapters/cli/system-prompts.js +131 -0
  42. package/dist/adapters/cli/tui/app.d.ts +58 -0
  43. package/dist/adapters/cli/tui/app.js +314 -0
  44. package/dist/adapters/cli/tui/components/assistant-message.d.ts +5 -0
  45. package/dist/adapters/cli/tui/components/assistant-message.js +9 -0
  46. package/dist/adapters/cli/tui/components/autocomplete.d.ts +19 -0
  47. package/dist/adapters/cli/tui/components/autocomplete.js +75 -0
  48. package/dist/adapters/cli/tui/components/command-palette.d.ts +15 -0
  49. package/dist/adapters/cli/tui/components/command-palette.js +50 -0
  50. package/dist/adapters/cli/tui/components/diff-viewer.d.ts +5 -0
  51. package/dist/adapters/cli/tui/components/diff-viewer.js +109 -0
  52. package/dist/adapters/cli/tui/components/error-message.d.ts +5 -0
  53. package/dist/adapters/cli/tui/components/error-message.js +8 -0
  54. package/dist/adapters/cli/tui/components/footer.d.ts +20 -0
  55. package/dist/adapters/cli/tui/components/footer.js +19 -0
  56. package/dist/adapters/cli/tui/components/goal-status.d.ts +12 -0
  57. package/dist/adapters/cli/tui/components/goal-status.js +22 -0
  58. package/dist/adapters/cli/tui/components/info-message.d.ts +5 -0
  59. package/dist/adapters/cli/tui/components/info-message.js +8 -0
  60. package/dist/adapters/cli/tui/components/logo-banner.d.ts +7 -0
  61. package/dist/adapters/cli/tui/components/logo-banner.js +33 -0
  62. package/dist/adapters/cli/tui/components/markdown.d.ts +9 -0
  63. package/dist/adapters/cli/tui/components/markdown.js +92 -0
  64. package/dist/adapters/cli/tui/components/message-area.d.ts +19 -0
  65. package/dist/adapters/cli/tui/components/message-area.js +55 -0
  66. package/dist/adapters/cli/tui/components/permission-prompt.d.ts +13 -0
  67. package/dist/adapters/cli/tui/components/permission-prompt.js +32 -0
  68. package/dist/adapters/cli/tui/components/prompt-area.d.ts +22 -0
  69. package/dist/adapters/cli/tui/components/prompt-area.js +68 -0
  70. package/dist/adapters/cli/tui/components/text-input.d.ts +27 -0
  71. package/dist/adapters/cli/tui/components/text-input.js +142 -0
  72. package/dist/adapters/cli/tui/components/tool-call-block.d.ts +11 -0
  73. package/dist/adapters/cli/tui/components/tool-call-block.js +68 -0
  74. package/dist/adapters/cli/tui/components/user-message.d.ts +5 -0
  75. package/dist/adapters/cli/tui/components/user-message.js +8 -0
  76. package/dist/adapters/cli/tui/diff/file-write-meta.d.ts +11 -0
  77. package/dist/adapters/cli/tui/diff/file-write-meta.js +11 -0
  78. package/dist/adapters/cli/tui/diff/line-diff.d.ts +17 -0
  79. package/dist/adapters/cli/tui/diff/line-diff.js +44 -0
  80. package/dist/adapters/cli/tui/feed-serializer.d.ts +29 -0
  81. package/dist/adapters/cli/tui/feed-serializer.js +70 -0
  82. package/dist/adapters/cli/tui/file-index.d.ts +8 -0
  83. package/dist/adapters/cli/tui/file-index.js +41 -0
  84. package/dist/adapters/cli/tui/hooks/use-agent.d.ts +54 -0
  85. package/dist/adapters/cli/tui/hooks/use-agent.js +177 -0
  86. package/dist/adapters/cli/tui/hooks/use-feed.d.ts +16 -0
  87. package/dist/adapters/cli/tui/hooks/use-feed.js +25 -0
  88. package/dist/adapters/cli/tui/hooks/use-file-watcher.d.ts +10 -0
  89. package/dist/adapters/cli/tui/hooks/use-file-watcher.js +43 -0
  90. package/dist/adapters/cli/tui/hooks/use-keybindings.d.ts +16 -0
  91. package/dist/adapters/cli/tui/hooks/use-keybindings.js +25 -0
  92. package/dist/adapters/cli/tui/hooks/use-theme.d.ts +8 -0
  93. package/dist/adapters/cli/tui/hooks/use-theme.js +12 -0
  94. package/dist/adapters/cli/tui/index.d.ts +19 -0
  95. package/dist/adapters/cli/tui/index.js +206 -0
  96. package/dist/adapters/cli/tui/ink-reset.d.ts +29 -0
  97. package/dist/adapters/cli/tui/ink-reset.js +57 -0
  98. package/dist/adapters/cli/tui/layout.d.ts +15 -0
  99. package/dist/adapters/cli/tui/layout.js +15 -0
  100. package/dist/adapters/cli/tui/logo/gradient.d.ts +11 -0
  101. package/dist/adapters/cli/tui/logo/gradient.js +31 -0
  102. package/dist/adapters/cli/tui/overlays/help-dialog.d.ts +4 -0
  103. package/dist/adapters/cli/tui/overlays/help-dialog.js +26 -0
  104. package/dist/adapters/cli/tui/overlays/model-selector.d.ts +14 -0
  105. package/dist/adapters/cli/tui/overlays/model-selector.js +43 -0
  106. package/dist/adapters/cli/tui/overlays/session-selector.d.ts +35 -0
  107. package/dist/adapters/cli/tui/overlays/session-selector.js +162 -0
  108. package/dist/adapters/cli/tui/overlays/settings-overlay.d.ts +24 -0
  109. package/dist/adapters/cli/tui/overlays/settings-overlay.js +126 -0
  110. package/dist/adapters/cli/tui/session-export.d.ts +21 -0
  111. package/dist/adapters/cli/tui/session-export.js +63 -0
  112. package/dist/adapters/cli/tui/theme.d.ts +23 -0
  113. package/dist/adapters/cli/tui/theme.js +22 -0
  114. package/dist/adapters/cli/tui/types.d.ts +52 -0
  115. package/dist/adapters/cli/tui/types.js +12 -0
  116. package/dist/adapters/sdk/agent.d.ts +20 -0
  117. package/dist/adapters/sdk/agent.js +356 -0
  118. package/dist/adapters/sdk/http.d.ts +43 -0
  119. package/dist/adapters/sdk/http.js +61 -0
  120. package/dist/adapters/sdk/index.d.ts +58 -0
  121. package/dist/adapters/sdk/index.js +209 -0
  122. package/dist/adapters/sdk/settings.d.ts +18 -0
  123. package/dist/adapters/sdk/settings.js +57 -0
  124. package/dist/adapters/sdk/tools.d.ts +7 -0
  125. package/dist/adapters/sdk/tools.js +13 -0
  126. package/dist/adapters/server/auth.d.ts +53 -0
  127. package/dist/adapters/server/auth.js +168 -0
  128. package/dist/adapters/server/index.d.ts +40 -0
  129. package/dist/adapters/server/index.js +255 -0
  130. package/dist/adapters/server/rest-gateway.d.ts +13 -0
  131. package/dist/adapters/server/rest-gateway.js +218 -0
  132. package/dist/adapters/server/rest.d.ts +37 -0
  133. package/dist/adapters/server/rest.js +341 -0
  134. package/dist/adapters/server/server-core.d.ts +55 -0
  135. package/dist/adapters/server/server-core.js +121 -0
  136. package/dist/adapters/server/session-store.d.ts +81 -0
  137. package/dist/adapters/server/session-store.js +272 -0
  138. package/dist/adapters/server/settings-handlers.d.ts +24 -0
  139. package/dist/adapters/server/settings-handlers.js +360 -0
  140. package/dist/adapters/server/standalone.d.ts +19 -0
  141. package/dist/adapters/server/standalone.js +113 -0
  142. package/dist/adapters/server/websocket.d.ts +26 -0
  143. package/dist/adapters/server/websocket.js +68 -0
  144. package/dist/adapters/server/ws-handlers.d.ts +32 -0
  145. package/dist/adapters/server/ws-handlers.js +523 -0
  146. package/dist/adapters/server/ws-types.d.ts +304 -0
  147. package/dist/adapters/server/ws-types.js +7 -0
  148. package/dist/core/agent-loop.d.ts +68 -0
  149. package/dist/core/agent-loop.js +423 -0
  150. package/dist/core/config.d.ts +115 -0
  151. package/dist/core/config.js +189 -0
  152. package/dist/core/errors.d.ts +58 -0
  153. package/dist/core/errors.js +88 -0
  154. package/dist/core/hooks.d.ts +35 -0
  155. package/dist/core/hooks.js +49 -0
  156. package/dist/core/index.d.ts +23 -0
  157. package/dist/core/index.js +29 -0
  158. package/dist/core/message-convert.d.ts +41 -0
  159. package/dist/core/message-convert.js +94 -0
  160. package/dist/core/middleware/auth.d.ts +24 -0
  161. package/dist/core/middleware/auth.js +28 -0
  162. package/dist/core/middleware/logging.d.ts +23 -0
  163. package/dist/core/middleware/logging.js +28 -0
  164. package/dist/core/middleware/rate-limit.d.ts +27 -0
  165. package/dist/core/middleware/rate-limit.js +38 -0
  166. package/dist/core/middleware/semantic-tools.d.ts +10 -0
  167. package/dist/core/middleware/semantic-tools.js +43 -0
  168. package/dist/core/middleware.d.ts +48 -0
  169. package/dist/core/middleware.js +38 -0
  170. package/dist/core/permission.d.ts +25 -0
  171. package/dist/core/permission.js +50 -0
  172. package/dist/core/provider-config.d.ts +129 -0
  173. package/dist/core/provider-config.js +273 -0
  174. package/dist/core/provider-env.d.ts +39 -0
  175. package/dist/core/provider-env.js +142 -0
  176. package/dist/core/provider-resolver.d.ts +12 -0
  177. package/dist/core/provider-resolver.js +12 -0
  178. package/dist/core/session-store.d.ts +75 -0
  179. package/dist/core/session-store.js +245 -0
  180. package/dist/core/settings-manager.d.ts +57 -0
  181. package/dist/core/settings-manager.js +359 -0
  182. package/dist/core/settings-schema.d.ts +38 -0
  183. package/dist/core/settings-schema.js +171 -0
  184. package/dist/core/skill-catalog.d.ts +6 -0
  185. package/dist/core/skill-catalog.js +17 -0
  186. package/dist/core/skill-invoker.d.ts +127 -0
  187. package/dist/core/skill-invoker.js +182 -0
  188. package/dist/core/stream-accumulator.d.ts +21 -0
  189. package/dist/core/stream-accumulator.js +51 -0
  190. package/dist/core/stream-manager.d.ts +58 -0
  191. package/dist/core/stream-manager.js +212 -0
  192. package/dist/core/tool-executor.d.ts +84 -0
  193. package/dist/core/tool-executor.js +256 -0
  194. package/dist/core/types.d.ts +259 -0
  195. package/dist/core/types.js +11 -0
  196. package/dist/gateway/gateway.d.ts +52 -0
  197. package/dist/gateway/gateway.js +537 -0
  198. package/dist/gateway/index.d.ts +21 -0
  199. package/dist/gateway/index.js +31 -0
  200. package/dist/gateway/openapi-importer.d.ts +15 -0
  201. package/dist/gateway/openapi-importer.js +66 -0
  202. package/dist/gateway/semantic-scorer.d.ts +7 -0
  203. package/dist/gateway/semantic-scorer.js +24 -0
  204. package/dist/gateway/settings-adapter.d.ts +49 -0
  205. package/dist/gateway/settings-adapter.js +137 -0
  206. package/dist/gateway/tool-factory.d.ts +9 -0
  207. package/dist/gateway/tool-factory.js +414 -0
  208. package/dist/gateway/types.d.ts +68 -0
  209. package/dist/gateway/types.js +7 -0
  210. package/dist/models-catalog.js +46 -0
  211. package/dist/providers/anthropic.d.ts +22 -0
  212. package/dist/providers/anthropic.js +148 -0
  213. package/dist/providers/factory.d.ts +10 -0
  214. package/dist/providers/factory.js +25 -0
  215. package/dist/providers/openai.d.ts +15 -0
  216. package/dist/providers/openai.js +71 -0
  217. package/dist/providers/types.d.ts +48 -0
  218. package/dist/providers/types.js +1 -0
  219. package/dist/skills/args.d.ts +37 -0
  220. package/dist/skills/args.js +99 -0
  221. package/dist/skills/index.d.ts +11 -0
  222. package/dist/skills/index.js +23 -0
  223. package/dist/skills/loader.d.ts +3 -0
  224. package/dist/skills/loader.js +59 -0
  225. package/dist/skills/parser.d.ts +7 -0
  226. package/dist/skills/parser.js +152 -0
  227. package/dist/skills/registry.d.ts +13 -0
  228. package/dist/skills/registry.js +74 -0
  229. package/dist/skills/resolver.d.ts +19 -0
  230. package/dist/skills/resolver.js +116 -0
  231. package/dist/skills/types.d.ts +74 -0
  232. package/dist/skills/types.js +50 -0
  233. package/dist/tools/browser.d.ts +2 -0
  234. package/dist/tools/browser.js +68 -0
  235. package/dist/tools/core.d.ts +20 -0
  236. package/dist/tools/core.js +244 -0
  237. package/dist/tools/email.d.ts +2 -0
  238. package/dist/tools/email.js +61 -0
  239. package/dist/tools/image.d.ts +2 -0
  240. package/dist/tools/image.js +257 -0
  241. package/dist/tools/index.d.ts +2 -0
  242. package/dist/tools/index.js +88 -0
  243. package/dist/tools/interface.d.ts +22 -0
  244. package/dist/tools/interface.js +1 -0
  245. package/dist/tools/notify.d.ts +2 -0
  246. package/dist/tools/notify.js +100 -0
  247. package/dist/tools/prompt-optimizer.d.ts +2 -0
  248. package/dist/tools/prompt-optimizer.js +65 -0
  249. package/dist/tools/screenshot.d.ts +2 -0
  250. package/dist/tools/screenshot.js +184 -0
  251. package/dist/tools/search.d.ts +2 -0
  252. package/dist/tools/search.js +78 -0
  253. package/dist/tools/todos.d.ts +10 -0
  254. package/dist/tools/todos.js +50 -0
  255. package/package.json +119 -0
  256. package/skills/docker-ops/SKILL.md +329 -0
  257. package/skills/k8s-deploy/SKILL.md +397 -0
  258. package/skills/log-analyzer/SKILL.md +331 -0
  259. package/skills/speckit-analyze/SKILL.md +260 -0
  260. package/skills/speckit-checklist/SKILL.md +374 -0
  261. package/skills/speckit-clarify/SKILL.md +286 -0
  262. package/skills/speckit-constitution/SKILL.md +157 -0
  263. package/skills/speckit-implement/SKILL.md +224 -0
  264. package/skills/speckit-plan/SKILL.md +171 -0
  265. package/skills/speckit-specify/SKILL.md +346 -0
  266. package/skills/speckit-tasks/SKILL.md +215 -0
  267. package/skills/speckit-taskstoissues/SKILL.md +107 -0
@@ -0,0 +1,157 @@
1
+ ---
2
+ name: "speckit-constitution"
3
+ description: "Create or update the project constitution from interactive or provided principle inputs, ensuring all dependent templates stay in sync."
4
+ argument-hint: "Principles or values for the project constitution"
5
+ compatibility: "Requires spec-kit project structure with .specify/ directory"
6
+ metadata:
7
+ author: "github-spec-kit"
8
+ source: "templates/commands/constitution.md"
9
+ user-invocable: true
10
+ disable-model-invocation: false
11
+ ---
12
+
13
+
14
+ ## User Input
15
+
16
+ ```text
17
+ $ARGUMENTS
18
+ ```
19
+
20
+ You **MUST** consider the user input before proceeding (if not empty).
21
+
22
+ ## Pre-Execution Checks
23
+
24
+ **Check for extension hooks (before constitution update)**:
25
+ - Check if `.specify/extensions.yml` exists in the project root.
26
+ - If it exists, read it and look for entries under the `hooks.before_constitution` key
27
+ - If the YAML cannot be parsed or is invalid, skip hook checking silently and continue normally
28
+ - Filter out hooks where `enabled` is explicitly `false`. Treat hooks without an `enabled` field as enabled by default.
29
+ - For each remaining hook, do **not** attempt to interpret or evaluate hook `condition` expressions:
30
+ - If the hook has no `condition` field, or it is null/empty, treat the hook as executable
31
+ - If the hook defines a non-empty `condition`, skip the hook and leave condition evaluation to the HookExecutor implementation
32
+ - When constructing slash commands from hook command names, replace dots (`.`) with hyphens (`-`). For example, `speckit.git.commit` → `/speckit-git-commit`.
33
+ - For each executable hook, output the following based on its `optional` flag:
34
+ - **Optional hook** (`optional: true`):
35
+ ```
36
+ ## Extension Hooks
37
+
38
+ **Optional Pre-Hook**: {extension}
39
+ Command: `/{command}`
40
+ Description: {description}
41
+
42
+ Prompt: {prompt}
43
+ To execute: `/{command}`
44
+ ```
45
+ - **Mandatory hook** (`optional: false`):
46
+ ```
47
+ ## Extension Hooks
48
+
49
+ **Automatic Pre-Hook**: {extension}
50
+ Executing: `/{command}`
51
+ EXECUTE_COMMAND: {command}
52
+
53
+ Wait for the result of the hook command before proceeding to the Outline.
54
+ ```
55
+ - If no hooks are registered or `.specify/extensions.yml` does not exist, skip silently
56
+
57
+ ## Outline
58
+
59
+ You are updating the project constitution at `.specify/memory/constitution.md`. This file is a TEMPLATE containing placeholder tokens in square brackets (e.g. `[PROJECT_NAME]`, `[PRINCIPLE_1_NAME]`). Your job is to (a) collect/derive concrete values, (b) fill the template precisely, and (c) propagate any amendments across dependent artifacts.
60
+
61
+ **Note**: If `.specify/memory/constitution.md` does not exist yet, it should have been initialized from `.specify/templates/constitution-template.md` during project setup. If it's missing, copy the template first.
62
+
63
+ Follow this execution flow:
64
+
65
+ 1. Load the existing constitution at `.specify/memory/constitution.md`.
66
+ - Identify every placeholder token of the form `[ALL_CAPS_IDENTIFIER]`.
67
+ **IMPORTANT**: The user might require less or more principles than the ones used in the template. If a number is specified, respect that - follow the general template. You will update the doc accordingly.
68
+
69
+ 2. Collect/derive values for placeholders:
70
+ - If user input (conversation) supplies a value, use it.
71
+ - Otherwise infer from existing repo context (README, docs, prior constitution versions if embedded).
72
+ - For governance dates: `RATIFICATION_DATE` is the original adoption date (if unknown ask or mark TODO), `LAST_AMENDED_DATE` is today if changes are made, otherwise keep previous.
73
+ - `CONSTITUTION_VERSION` must increment according to semantic versioning rules:
74
+ - MAJOR: Backward incompatible governance/principle removals or redefinitions.
75
+ - MINOR: New principle/section added or materially expanded guidance.
76
+ - PATCH: Clarifications, wording, typo fixes, non-semantic refinements.
77
+ - If version bump type ambiguous, propose reasoning before finalizing.
78
+
79
+ 3. Draft the updated constitution content:
80
+ - Replace every placeholder with concrete text (no bracketed tokens left except intentionally retained template slots that the project has chosen not to define yet—explicitly justify any left).
81
+ - Preserve heading hierarchy and comments can be removed once replaced unless they still add clarifying guidance.
82
+ - Ensure each Principle section: succinct name line, paragraph (or bullet list) capturing non‑negotiable rules, explicit rationale if not obvious.
83
+ - Ensure Governance section lists amendment procedure, versioning policy, and compliance review expectations.
84
+
85
+ 4. Consistency propagation checklist (convert prior checklist into active validations):
86
+ - Read `.specify/templates/plan-template.md` and ensure any "Constitution Check" or rules align with updated principles.
87
+ - Read `.specify/templates/spec-template.md` for scope/requirements alignment—update if constitution adds/removes mandatory sections or constraints.
88
+ - Read `.specify/templates/tasks-template.md` and ensure task categorization reflects new or removed principle-driven task types (e.g., observability, versioning, testing discipline).
89
+ - Read each command file in `.specify/templates/commands/*.md` (including this one) to verify no outdated references (agent-specific names like CLAUDE only) remain when generic guidance is required.
90
+ - Read any runtime guidance docs (e.g., `README.md`, `docs/quickstart.md`, or agent-specific guidance files if present). Update references to principles changed.
91
+
92
+ 5. Produce a Sync Impact Report (prepend as an HTML comment at top of the constitution file after update):
93
+ - Version change: old → new
94
+ - List of modified principles (old title → new title if renamed)
95
+ - Added sections
96
+ - Removed sections
97
+ - Templates requiring updates (✅ updated / ⚠ pending) with file paths
98
+ - Follow-up TODOs if any placeholders intentionally deferred.
99
+
100
+ 6. Validation before final output:
101
+ - No remaining unexplained bracket tokens.
102
+ - Version line matches report.
103
+ - Dates ISO format YYYY-MM-DD.
104
+ - Principles are declarative, testable, and free of vague language ("should" → replace with MUST/SHOULD rationale where appropriate).
105
+
106
+ 7. Write the completed constitution back to `.specify/memory/constitution.md` (overwrite).
107
+
108
+ 8. Output a final summary to the user with:
109
+ - New version and bump rationale.
110
+ - Any files flagged for manual follow-up.
111
+ - Suggested commit message (e.g., `docs: amend constitution to vX.Y.Z (principle additions + governance update)`).
112
+
113
+ Formatting & Style Requirements:
114
+
115
+ - Use Markdown headings exactly as in the template (do not demote/promote levels).
116
+ - Wrap long rationale lines to keep readability (<100 chars ideally) but do not hard enforce with awkward breaks.
117
+ - Keep a single blank line between sections.
118
+ - Avoid trailing whitespace.
119
+
120
+ If the user supplies partial updates (e.g., only one principle revision), still perform validation and version decision steps.
121
+
122
+ If critical info missing (e.g., ratification date truly unknown), insert `TODO(<FIELD_NAME>): explanation` and include in the Sync Impact Report under deferred items.
123
+
124
+ Do not create a new template; always operate on the existing `.specify/memory/constitution.md` file.
125
+
126
+ ## Post-Execution Checks
127
+
128
+ **Check for extension hooks (after constitution update)**:
129
+ Check if `.specify/extensions.yml` exists in the project root.
130
+ - If it exists, read it and look for entries under the `hooks.after_constitution` key
131
+ - If the YAML cannot be parsed or is invalid, skip hook checking silently and continue normally
132
+ - Filter out hooks where `enabled` is explicitly `false`. Treat hooks without an `enabled` field as enabled by default.
133
+ - For each remaining hook, do **not** attempt to interpret or evaluate hook `condition` expressions:
134
+ - If the hook has no `condition` field, or it is null/empty, treat the hook as executable
135
+ - If the hook defines a non-empty `condition`, skip the hook and leave condition evaluation to the HookExecutor implementation
136
+ - When constructing slash commands from hook command names, replace dots (`.`) with hyphens (`-`). For example, `speckit.git.commit` → `/speckit-git-commit`.
137
+ - For each executable hook, output the following based on its `optional` flag:
138
+ - **Optional hook** (`optional: true`):
139
+ ```
140
+ ## Extension Hooks
141
+
142
+ **Optional Hook**: {extension}
143
+ Command: `/{command}`
144
+ Description: {description}
145
+
146
+ Prompt: {prompt}
147
+ To execute: `/{command}`
148
+ ```
149
+ - **Mandatory hook** (`optional: false`):
150
+ ```
151
+ ## Extension Hooks
152
+
153
+ **Automatic Hook**: {extension}
154
+ Executing: `/{command}`
155
+ EXECUTE_COMMAND: {command}
156
+ ```
157
+ - If no hooks are registered or `.specify/extensions.yml` does not exist, skip silently
@@ -0,0 +1,224 @@
1
+ ---
2
+ name: "speckit-implement"
3
+ description: "Execute the implementation plan by processing and executing all tasks defined in tasks.md"
4
+ argument-hint: "Optional implementation guidance or task filter"
5
+ compatibility: "Requires spec-kit project structure with .specify/ directory"
6
+ metadata:
7
+ author: "github-spec-kit"
8
+ source: "templates/commands/implement.md"
9
+ user-invocable: true
10
+ disable-model-invocation: false
11
+ ---
12
+
13
+
14
+ ## User Input
15
+
16
+ ```text
17
+ $ARGUMENTS
18
+ ```
19
+
20
+ You **MUST** consider the user input before proceeding (if not empty).
21
+
22
+ ## Pre-Execution Checks
23
+
24
+ **Check for extension hooks (before implementation)**:
25
+ - Check if `.specify/extensions.yml` exists in the project root.
26
+ - If it exists, read it and look for entries under the `hooks.before_implement` key
27
+ - If the YAML cannot be parsed or is invalid, skip hook checking silently and continue normally
28
+ - Filter out hooks where `enabled` is explicitly `false`. Treat hooks without an `enabled` field as enabled by default.
29
+ - For each remaining hook, do **not** attempt to interpret or evaluate hook `condition` expressions:
30
+ - If the hook has no `condition` field, or it is null/empty, treat the hook as executable
31
+ - If the hook defines a non-empty `condition`, skip the hook and leave condition evaluation to the HookExecutor implementation
32
+ - When constructing slash commands from hook command names, replace dots (`.`) with hyphens (`-`). For example, `speckit.git.commit` → `/speckit-git-commit`.
33
+ - For each executable hook, output the following based on its `optional` flag:
34
+ - **Optional hook** (`optional: true`):
35
+ ```
36
+ ## Extension Hooks
37
+
38
+ **Optional Pre-Hook**: {extension}
39
+ Command: `/{command}`
40
+ Description: {description}
41
+
42
+ Prompt: {prompt}
43
+ To execute: `/{command}`
44
+ ```
45
+ - **Mandatory hook** (`optional: false`):
46
+ ```
47
+ ## Extension Hooks
48
+
49
+ **Automatic Pre-Hook**: {extension}
50
+ Executing: `/{command}`
51
+ EXECUTE_COMMAND: {command}
52
+
53
+ Wait for the result of the hook command before proceeding to the Outline.
54
+ ```
55
+ - If no hooks are registered or `.specify/extensions.yml` does not exist, skip silently
56
+
57
+ ## Outline
58
+
59
+ 1. Run `.specify/scripts/bash/check-prerequisites.sh --json --require-tasks --include-tasks` from repo root and parse FEATURE_DIR and AVAILABLE_DOCS list. All paths must be absolute. For single quotes in args like "I'm Groot", use escape syntax: e.g 'I'\''m Groot' (or double-quote if possible: "I'm Groot").
60
+
61
+ 2. **Check checklists status** (if FEATURE_DIR/checklists/ exists):
62
+ - Scan all checklist files in the checklists/ directory
63
+ - For each checklist, count:
64
+ - Total items: All lines matching `- [ ]` or `- [X]` or `- [x]`
65
+ - Completed items: Lines matching `- [X]` or `- [x]`
66
+ - Incomplete items: Lines matching `- [ ]`
67
+ - Create a status table:
68
+
69
+ ```text
70
+ | Checklist | Total | Completed | Incomplete | Status |
71
+ |-----------|-------|-----------|------------|--------|
72
+ | ux.md | 12 | 12 | 0 | ✓ PASS |
73
+ | test.md | 8 | 5 | 3 | ✗ FAIL |
74
+ | security.md | 6 | 6 | 0 | ✓ PASS |
75
+ ```
76
+
77
+ - Calculate overall status:
78
+ - **PASS**: All checklists have 0 incomplete items
79
+ - **FAIL**: One or more checklists have incomplete items
80
+
81
+ - **If any checklist is incomplete**:
82
+ - Display the table with incomplete item counts
83
+ - **STOP** and ask: "Some checklists are incomplete. Do you want to proceed with implementation anyway? (yes/no)"
84
+ - Wait for user response before continuing
85
+ - If user says "no" or "wait" or "stop", halt execution
86
+ - If user says "yes" or "proceed" or "continue", proceed to step 3
87
+
88
+ - **If all checklists are complete**:
89
+ - Display the table showing all checklists passed
90
+ - Automatically proceed to step 3
91
+
92
+ 3. Load and analyze the implementation context:
93
+ - **REQUIRED**: Read tasks.md for the complete task list and execution plan
94
+ - **REQUIRED**: Read plan.md for tech stack, architecture, and file structure
95
+ - **IF EXISTS**: Read data-model.md for entities and relationships
96
+ - **IF EXISTS**: Read contracts/ for API specifications and test requirements
97
+ - **IF EXISTS**: Read research.md for technical decisions and constraints
98
+ - **IF EXISTS**: Read .specify/memory/constitution.md for governance constraints
99
+ - **IF EXISTS**: Read quickstart.md for integration scenarios
100
+
101
+ 4. **Project Setup Verification**:
102
+ - **REQUIRED**: Create/verify ignore files based on actual project setup:
103
+
104
+ **Detection & Creation Logic**:
105
+ - Check if the following command succeeds to determine if the repository is a git repo (create/verify .gitignore if so):
106
+
107
+ ```sh
108
+ git rev-parse --git-dir 2>/dev/null
109
+ ```
110
+
111
+ - Check if Dockerfile* exists or Docker in plan.md → create/verify .dockerignore
112
+ - Check if .eslintrc* exists → create/verify .eslintignore
113
+ - Check if eslint.config.* exists → ensure the config's `ignores` entries cover required patterns
114
+ - Check if .prettierrc* exists → create/verify .prettierignore
115
+ - Check if .npmrc or package.json exists → create/verify .npmignore (if publishing)
116
+ - Check if terraform files (*.tf) exist → create/verify .terraformignore
117
+ - Check if .helmignore needed (helm charts present) → create/verify .helmignore
118
+
119
+ **If ignore file already exists**: Verify it contains essential patterns, append missing critical patterns only
120
+ **If ignore file missing**: Create with full pattern set for detected technology
121
+
122
+ **Common Patterns by Technology** (from plan.md tech stack):
123
+ - **Node.js/JavaScript/TypeScript**: `node_modules/`, `dist/`, `build/`, `*.log`, `.env*`
124
+ - **Python**: `__pycache__/`, `*.pyc`, `.venv/`, `venv/`, `dist/`, `*.egg-info/`
125
+ - **Java**: `target/`, `*.class`, `*.jar`, `.gradle/`, `build/`
126
+ - **C#/.NET**: `bin/`, `obj/`, `*.user`, `*.suo`, `packages/`
127
+ - **Go**: `*.exe`, `*.test`, `vendor/`, `*.out`
128
+ - **Ruby**: `.bundle/`, `log/`, `tmp/`, `*.gem`, `vendor/bundle/`
129
+ - **PHP**: `vendor/`, `*.log`, `*.cache`, `*.env`
130
+ - **Rust**: `target/`, `debug/`, `release/`, `*.rs.bk`, `*.rlib`, `*.prof*`, `.idea/`, `*.log`, `.env*`
131
+ - **Kotlin**: `build/`, `out/`, `.gradle/`, `.idea/`, `*.class`, `*.jar`, `*.iml`, `*.log`, `.env*`
132
+ - **C++**: `build/`, `bin/`, `obj/`, `out/`, `*.o`, `*.so`, `*.a`, `*.exe`, `*.dll`, `.idea/`, `*.log`, `.env*`
133
+ - **C**: `build/`, `bin/`, `obj/`, `out/`, `*.o`, `*.a`, `*.so`, `*.exe`, `*.dll`, `autom4te.cache/`, `config.status`, `config.log`, `.idea/`, `*.log`, `.env*`
134
+ - **Swift**: `.build/`, `DerivedData/`, `*.swiftpm/`, `Packages/`
135
+ - **R**: `.Rproj.user/`, `.Rhistory`, `.RData`, `.Ruserdata`, `*.Rproj`, `packrat/`, `renv/`
136
+ - **Universal**: `.DS_Store`, `Thumbs.db`, `*.tmp`, `*.swp`, `.vscode/`, `.idea/`
137
+
138
+ **Tool-Specific Patterns**:
139
+ - **Docker**: `node_modules/`, `.git/`, `Dockerfile*`, `.dockerignore`, `*.log*`, `.env*`, `coverage/`
140
+ - **ESLint**: `node_modules/`, `dist/`, `build/`, `coverage/`, `*.min.js`
141
+ - **Prettier**: `node_modules/`, `dist/`, `build/`, `coverage/`, `package-lock.json`, `yarn.lock`, `pnpm-lock.yaml`
142
+ - **Terraform**: `.terraform/`, `*.tfstate*`, `*.tfvars`, `.terraform.lock.hcl`
143
+ - **Kubernetes/k8s**: `*.secret.yaml`, `secrets/`, `.kube/`, `kubeconfig*`, `*.key`, `*.crt`
144
+
145
+ 5. Parse tasks.md structure and extract:
146
+ - **Task phases**: Setup, Tests, Core, Integration, Polish
147
+ - **Task dependencies**: Sequential vs parallel execution rules
148
+ - **Task details**: ID, description, file paths, parallel markers [P]
149
+ - **Execution flow**: Order and dependency requirements
150
+
151
+ 6. Execute implementation following the task plan:
152
+ - **Phase-by-phase execution**: Complete each phase before moving to the next
153
+ - **Respect dependencies**: Run sequential tasks in order, parallel tasks [P] can run together
154
+ - **Follow TDD approach**: Execute test tasks before their corresponding implementation tasks
155
+ - **File-based coordination**: Tasks affecting the same files must run sequentially
156
+ - **Validation checkpoints**: Verify each phase completion before proceeding
157
+
158
+ 7. Implementation execution rules:
159
+ - **Setup first**: Initialize project structure, dependencies, configuration
160
+ - **Tests before code**: If you need to write tests for contracts, entities, and integration scenarios
161
+ - **Core development**: Implement models, services, CLI commands, endpoints
162
+ - **Integration work**: Database connections, middleware, logging, external services
163
+ - **Polish and validation**: Unit tests, performance optimization, documentation
164
+
165
+ 8. Progress tracking and error handling:
166
+ - Report progress after each completed task
167
+ - Halt execution if any non-parallel task fails
168
+ - For parallel tasks [P], continue with successful tasks, report failed ones
169
+ - Provide clear error messages with context for debugging
170
+ - Suggest next steps if implementation cannot proceed
171
+ - **IMPORTANT** For completed tasks, make sure to mark the task off as [X] in the tasks file.
172
+
173
+ 9. Completion validation:
174
+ - Verify all required tasks are completed
175
+ - Check that implemented features match the original specification
176
+ - Validate that tests pass and coverage meets requirements
177
+ - Confirm the implementation follows the technical plan
178
+
179
+ Note: This command assumes a complete task breakdown exists in tasks.md. If tasks are incomplete or missing, suggest running `/speckit-tasks` first to regenerate the task list.
180
+
181
+ ## Mandatory Post-Execution Hooks
182
+
183
+ **You MUST complete this section before reporting completion to the user.**
184
+
185
+ Check if `.specify/extensions.yml` exists in the project root.
186
+ - If it does not exist, or no hooks are registered under `hooks.after_implement`, skip to the Completion Report.
187
+ - If it exists, read it and look for entries under the `hooks.after_implement` key.
188
+ - If the YAML cannot be parsed or is invalid, skip hook checking silently and continue to the Completion Report.
189
+ - Filter out hooks where `enabled` is explicitly `false`. Treat hooks without an `enabled` field as enabled by default.
190
+ - For each remaining hook, do **not** attempt to interpret or evaluate hook `condition` expressions:
191
+ - If the hook has no `condition` field, or it is null/empty, treat the hook as executable
192
+ - If the hook defines a non-empty `condition`, skip the hook and leave condition evaluation to the HookExecutor implementation
193
+ - When constructing slash commands from hook command names, replace dots (`.`) with hyphens (`-`). For example, `speckit.git.commit` → `/speckit-git-commit`.
194
+ - For each executable hook, output the following based on its `optional` flag:
195
+ - **Mandatory hook** (`optional: false`) — **You MUST emit `EXECUTE_COMMAND:` for each mandatory hook**:
196
+ ```
197
+ ## Extension Hooks
198
+
199
+ **Automatic Hook**: {extension}
200
+ Executing: `/{command}`
201
+ EXECUTE_COMMAND: {command}
202
+ ```
203
+ - **Optional hook** (`optional: true`):
204
+ ```
205
+ ## Extension Hooks
206
+
207
+ **Optional Hook**: {extension}
208
+ Command: `/{command}`
209
+ Description: {description}
210
+
211
+ Prompt: {prompt}
212
+ To execute: `/{command}`
213
+ ```
214
+
215
+ ## Completion Report
216
+
217
+ Report final status with summary of completed work.
218
+
219
+ ## Done When
220
+
221
+ - [ ] All tasks in tasks.md completed and marked `[X]`
222
+ - [ ] Implementation validated against specification, plan, and test coverage
223
+ - [ ] Extension hooks dispatched or skipped according to the rules in Mandatory Post-Execution Hooks above
224
+ - [ ] Completion reported to user with summary of completed work
@@ -0,0 +1,171 @@
1
+ ---
2
+ name: "speckit-plan"
3
+ description: "Execute the implementation planning workflow using the plan template to generate design artifacts."
4
+ argument-hint: "Optional guidance for the planning phase"
5
+ compatibility: "Requires spec-kit project structure with .specify/ directory"
6
+ metadata:
7
+ author: "github-spec-kit"
8
+ source: "templates/commands/plan.md"
9
+ user-invocable: true
10
+ disable-model-invocation: false
11
+ ---
12
+
13
+
14
+ ## User Input
15
+
16
+ ```text
17
+ $ARGUMENTS
18
+ ```
19
+
20
+ You **MUST** consider the user input before proceeding (if not empty).
21
+
22
+ ## Pre-Execution Checks
23
+
24
+ **Check for extension hooks (before planning)**:
25
+ - Check if `.specify/extensions.yml` exists in the project root.
26
+ - If it exists, read it and look for entries under the `hooks.before_plan` key
27
+ - If the YAML cannot be parsed or is invalid, skip hook checking silently and continue normally
28
+ - Filter out hooks where `enabled` is explicitly `false`. Treat hooks without an `enabled` field as enabled by default.
29
+ - For each remaining hook, do **not** attempt to interpret or evaluate hook `condition` expressions:
30
+ - If the hook has no `condition` field, or it is null/empty, treat the hook as executable
31
+ - If the hook defines a non-empty `condition`, skip the hook and leave condition evaluation to the HookExecutor implementation
32
+ - When constructing slash commands from hook command names, replace dots (`.`) with hyphens (`-`). For example, `speckit.git.commit` → `/speckit-git-commit`.
33
+ - For each executable hook, output the following based on its `optional` flag:
34
+ - **Optional hook** (`optional: true`):
35
+ ```
36
+ ## Extension Hooks
37
+
38
+ **Optional Pre-Hook**: {extension}
39
+ Command: `/{command}`
40
+ Description: {description}
41
+
42
+ Prompt: {prompt}
43
+ To execute: `/{command}`
44
+ ```
45
+ - **Mandatory hook** (`optional: false`):
46
+ ```
47
+ ## Extension Hooks
48
+
49
+ **Automatic Pre-Hook**: {extension}
50
+ Executing: `/{command}`
51
+ EXECUTE_COMMAND: {command}
52
+
53
+ Wait for the result of the hook command before proceeding to the Outline.
54
+ ```
55
+ - If no hooks are registered or `.specify/extensions.yml` does not exist, skip silently
56
+
57
+ ## Outline
58
+
59
+ 1. **Setup**: Run `.specify/scripts/bash/setup-plan.sh --json` from repo root and parse JSON for FEATURE_SPEC, IMPL_PLAN, SPECS_DIR, BRANCH. For single quotes in args like "I'm Groot", use escape syntax: e.g 'I'\''m Groot' (or double-quote if possible: "I'm Groot").
60
+
61
+ 2. **Load context**: Read FEATURE_SPEC and `.specify/memory/constitution.md`. Load IMPL_PLAN template (already copied).
62
+
63
+ 3. **Execute plan workflow**: Follow the structure in IMPL_PLAN template to:
64
+ - Fill Technical Context (mark unknowns as "NEEDS CLARIFICATION")
65
+ - Fill Constitution Check section from constitution
66
+ - Evaluate gates (ERROR if violations unjustified)
67
+ - Phase 0: Generate research.md (resolve all NEEDS CLARIFICATION)
68
+ - Phase 1: Generate data-model.md, contracts/, quickstart.md
69
+ - Phase 1: Update agent context by running the agent script
70
+ - Re-evaluate Constitution Check post-design
71
+
72
+ ## Mandatory Post-Execution Hooks
73
+
74
+ **You MUST complete this section before reporting completion to the user.**
75
+
76
+ Check if `.specify/extensions.yml` exists in the project root.
77
+ - If it does not exist, or no hooks are registered under `hooks.after_plan`, skip to the Completion Report.
78
+ - If it exists, read it and look for entries under the `hooks.after_plan` key.
79
+ - If the YAML cannot be parsed or is invalid, skip hook checking silently and continue to the Completion Report.
80
+ - Filter out hooks where `enabled` is explicitly `false`. Treat hooks without an `enabled` field as enabled by default.
81
+ - For each remaining hook, do **not** attempt to interpret or evaluate hook `condition` expressions:
82
+ - If the hook has no `condition` field, or it is null/empty, treat the hook as executable
83
+ - If the hook defines a non-empty `condition`, skip the hook and leave condition evaluation to the HookExecutor implementation
84
+ - When constructing slash commands from hook command names, replace dots (`.`) with hyphens (`-`). For example, `speckit.git.commit` → `/speckit-git-commit`.
85
+ - For each executable hook, output the following based on its `optional` flag:
86
+ - **Mandatory hook** (`optional: false`) — **You MUST emit `EXECUTE_COMMAND:` for each mandatory hook**:
87
+ ```
88
+ ## Extension Hooks
89
+
90
+ **Automatic Hook**: {extension}
91
+ Executing: `/{command}`
92
+ EXECUTE_COMMAND: {command}
93
+ ```
94
+ - **Optional hook** (`optional: true`):
95
+ ```
96
+ ## Extension Hooks
97
+
98
+ **Optional Hook**: {extension}
99
+ Command: `/{command}`
100
+ Description: {description}
101
+
102
+ Prompt: {prompt}
103
+ To execute: `/{command}`
104
+ ```
105
+
106
+ ## Completion Report
107
+
108
+ Command ends after Phase 2 planning. Report branch, IMPL_PLAN path, and generated artifacts.
109
+
110
+ ## Phases
111
+
112
+ ### Phase 0: Outline & Research
113
+
114
+ 1. **Extract unknowns from Technical Context** above:
115
+ - For each NEEDS CLARIFICATION → research task
116
+ - For each dependency → best practices task
117
+ - For each integration → patterns task
118
+
119
+ 2. **Generate and dispatch research agents**:
120
+
121
+ ```text
122
+ For each unknown in Technical Context:
123
+ Task: "Research {unknown} for {feature context}"
124
+ For each technology choice:
125
+ Task: "Find best practices for {tech} in {domain}"
126
+ ```
127
+
128
+ 3. **Consolidate findings** in `research.md` using format:
129
+ - Decision: [what was chosen]
130
+ - Rationale: [why chosen]
131
+ - Alternatives considered: [what else evaluated]
132
+
133
+ **Output**: research.md with all NEEDS CLARIFICATION resolved
134
+
135
+ ### Phase 1: Design & Contracts
136
+
137
+ **Prerequisites:** `research.md` complete
138
+
139
+ 1. **Extract entities from feature spec** → `data-model.md`:
140
+ - Entity name, fields, relationships
141
+ - Validation rules from requirements
142
+ - State transitions if applicable
143
+
144
+ 2. **Define interface contracts** (if project has external interfaces) → `/contracts/`:
145
+ - Identify what interfaces the project exposes to users or other systems
146
+ - Document the contract format appropriate for the project type
147
+ - Examples: public APIs for libraries, command schemas for CLI tools, endpoints for web services, grammars for parsers, UI contracts for applications
148
+ - Skip if project is purely internal (build scripts, one-off tools, etc.)
149
+
150
+ 3. **Create quickstart validation guide** → `quickstart.md`:
151
+ - Document runnable validation scenarios that prove the feature works end-to-end
152
+ - Include prerequisites, setup commands, test/run commands, and expected outcomes
153
+ - Use links or references to contracts and data model details instead of duplicating them
154
+ - Do not include full implementation code, model/service/controller bodies, migrations, or complete test suites
155
+ - Keep this artifact as a validation/run guide; implementation details belong in `tasks.md` and the implementation phase
156
+
157
+ 4. **Agent context update**:
158
+ - Update the plan reference between the `<!-- SPECKIT START -->` and `<!-- SPECKIT END -->` markers in `CLAUDE.md` to point to the plan file created in step 1 (the IMPL_PLAN path)
159
+
160
+ **Output**: data-model.md, /contracts/*, quickstart.md, updated agent context file
161
+
162
+ ## Key rules
163
+
164
+ - Use absolute paths for filesystem operations; use project-relative paths for references in documentation and agent context files
165
+ - ERROR on gate failures or unresolved clarifications
166
+
167
+ ## Done When
168
+
169
+ - [ ] Plan workflow executed and design artifacts generated
170
+ - [ ] Extension hooks dispatched or skipped according to the rules in Mandatory Post-Execution Hooks above
171
+ - [ ] Completion reported to user with branch, plan path, and generated artifacts