opencodekit 0.15.21 → 0.16.0

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 (116) hide show
  1. package/dist/index.js +5 -7
  2. package/dist/template/.opencode/AGENTS.md +21 -20
  3. package/dist/template/.opencode/agent/build.md +88 -7
  4. package/dist/template/.opencode/agent/explore.md +1 -1
  5. package/dist/template/.opencode/agent/general.md +54 -4
  6. package/dist/template/.opencode/agent/looker.md +1 -1
  7. package/dist/template/.opencode/agent/painter.md +1 -1
  8. package/dist/template/.opencode/agent/plan.md +52 -0
  9. package/dist/template/.opencode/agent/review.md +1 -1
  10. package/dist/template/.opencode/agent/scout.md +3 -3
  11. package/dist/template/.opencode/agent/vision.md +1 -1
  12. package/dist/template/.opencode/command/create.md +201 -95
  13. package/dist/template/.opencode/command/design.md +5 -7
  14. package/dist/template/.opencode/command/handoff.md +7 -0
  15. package/dist/template/.opencode/command/init.md +25 -47
  16. package/dist/template/.opencode/command/plan.md +35 -16
  17. package/dist/template/.opencode/command/resume.md +7 -18
  18. package/dist/template/.opencode/command/ship.md +156 -0
  19. package/dist/template/.opencode/command/start.md +315 -28
  20. package/dist/template/.opencode/command/ui-review.md +5 -7
  21. package/dist/template/.opencode/command/verify.md +279 -0
  22. package/dist/template/.opencode/memory/_templates/README.md +57 -19
  23. package/dist/template/.opencode/memory/_templates/prd.md +29 -0
  24. package/dist/template/.opencode/memory/_templates/project/tech-stack.md +50 -0
  25. package/dist/template/.opencode/memory/_templates/proposal.md +38 -0
  26. package/dist/template/.opencode/memory/_templates/spec.md +66 -0
  27. package/dist/template/.opencode/memory/_templates/tasks.md +198 -0
  28. package/dist/template/.opencode/memory/observations/2026-02-01-decision-add-skills-vs-commands-to-global-agents-.md +15 -0
  29. package/dist/template/.opencode/memory/observations/2026-02-01-decision-build-agent-auto-loads-skills-contextual.md +31 -0
  30. package/dist/template/.opencode/memory/observations/2026-02-01-decision-fixed-agent-configuration-for-opencodeki.md +25 -0
  31. package/dist/template/.opencode/memory/observations/2026-02-01-decision-focused-agents-md-upgrade-for-opencode-k.md +14 -0
  32. package/dist/template/.opencode/memory/observations/2026-02-01-decision-implement-tier-1-permission-upgrades.md +15 -0
  33. package/dist/template/.opencode/memory/observations/2026-02-01-decision-instructions-config-explicit-paths-not-w.md +40 -0
  34. package/dist/template/.opencode/memory/observations/2026-02-01-decision-merged-context-into-memory-project-singl.md +42 -0
  35. package/dist/template/.opencode/memory/observations/2026-02-01-decision-oracle-tool-should-use-review-agent-not-.md +14 -0
  36. package/dist/template/.opencode/memory/observations/2026-02-01-decision-plan-agent-auto-loads-skills-contextuall.md +31 -0
  37. package/dist/template/.opencode/memory/observations/2026-02-01-decision-plan-phased-oracle-command-merge-into-ne.md +14 -0
  38. package/dist/template/.opencode/memory/observations/2026-02-01-decision-prd-workflow-uses-prd-and-prd-task-skill.md +23 -0
  39. package/dist/template/.opencode/memory/observations/2026-02-01-decision-prefer-review-agent-via-opencode-cli-ove.md +14 -0
  40. package/dist/template/.opencode/memory/observations/2026-02-01-decision-remove-oracle-tool-add-ship-command-with.md +14 -0
  41. package/dist/template/.opencode/memory/observations/2026-02-01-decision-remove-oracle-tool-and-add-ship-command-.md +14 -0
  42. package/dist/template/.opencode/memory/observations/2026-02-01-decision-remove-oracle-tool-and-add-ship-command.md +14 -0
  43. package/dist/template/.opencode/memory/observations/2026-02-01-decision-remove-skills-vs-commands-section-from-a.md +14 -0
  44. package/dist/template/.opencode/memory/observations/2026-02-01-decision-replace-oracle-tool-with-ship-command-fl.md +14 -0
  45. package/dist/template/.opencode/memory/observations/2026-02-01-decision-replace-oracle-with-ship-command-workflo.md +14 -0
  46. package/dist/template/.opencode/memory/observations/2026-02-01-decision-replace-proxypal-oracle-with-cli-review-.md +14 -0
  47. package/dist/template/.opencode/memory/observations/2026-02-01-decision-simplified-dist-template-only-tech-stack.md +50 -0
  48. package/dist/template/.opencode/memory/observations/2026-02-01-decision-simplified-templates-only-tech-stack-md.md +26 -0
  49. package/dist/template/.opencode/memory/observations/2026-02-01-decision-subagents-load-minimal-skills-stay-lean.md +29 -0
  50. package/dist/template/.opencode/memory/observations/2026-02-01-decision-user-approved-permission-upgrades-in-ope.md +15 -0
  51. package/dist/template/.opencode/memory/observations/2026-02-01-discovery-verify-command-already-implemented.md +28 -0
  52. package/dist/template/.opencode/memory/observations/2026-02-01-feature-openspec-phase-b-complete-template-upgra.md +43 -0
  53. package/dist/template/.opencode/memory/observations/2026-02-01-learning-build-agent-should-use-dynamic-lsp-not-f.md +14 -0
  54. package/dist/template/.opencode/memory/observations/2026-02-01-learning-kimi-k2-5-model-requires-temperature-1-0.md +22 -0
  55. package/dist/template/.opencode/memory/observations/2026-02-01-learning-opencode-context-injection-already-imple.md +27 -0
  56. package/dist/template/.opencode/memory/observations/2026-02-01-learning-opencode-context-injection-uses-instruct.md +35 -0
  57. package/dist/template/.opencode/memory/observations/2026-02-01-learning-update-build-agent-prompt-to-use-context.md +14 -0
  58. package/dist/template/.opencode/memory/observations/2026-02-01-learning-upgrade-agents-md-using-opencode-expert-.md +14 -0
  59. package/dist/template/.opencode/memory/observations/2026-02-01-learning-upgrade-agents-md-with-opencode-expert-g.md +14 -0
  60. package/dist/template/.opencode/memory/observations/2026-02-01-learning-upgrade-agents-md-with-opencode-expert-r.md +14 -0
  61. package/dist/template/.opencode/memory/observations/2026-02-01-learning-user-prefers-copilot-gpt-5-2-codex-mediu.md +14 -0
  62. package/dist/template/.opencode/memory/observations/2026-02-01-learning-user-wants-general-agent-prompt-contextu.md +15 -0
  63. package/dist/template/.opencode/memory/observations/2026-02-01-learning-user-wants-general-agent-prompt-reviewed.md +15 -0
  64. package/dist/template/.opencode/memory/project/command-rules.md +122 -0
  65. package/dist/template/.opencode/memory/project/tech-stack.md +50 -0
  66. package/dist/template/.opencode/memory/research/ccpm-analysis.md +334 -0
  67. package/dist/template/.opencode/memory/research/openspec-analysis.md +226 -0
  68. package/dist/template/.opencode/opencode.json +916 -803
  69. package/dist/template/.opencode/skill/tool-priority/SKILL.md +2 -2
  70. package/package.json +1 -1
  71. package/dist/template/.opencode/command/accessibility-check.md +0 -331
  72. package/dist/template/.opencode/command/agent-browser.md +0 -21
  73. package/dist/template/.opencode/command/analyze-mockup.md +0 -423
  74. package/dist/template/.opencode/command/analyze-project.md +0 -295
  75. package/dist/template/.opencode/command/brainstorm.md +0 -373
  76. package/dist/template/.opencode/command/cloudflare.md +0 -70
  77. package/dist/template/.opencode/command/commit.md +0 -245
  78. package/dist/template/.opencode/command/complete-next-task.md +0 -77
  79. package/dist/template/.opencode/command/design-audit.md +0 -480
  80. package/dist/template/.opencode/command/edit-image.md +0 -242
  81. package/dist/template/.opencode/command/finish.md +0 -255
  82. package/dist/template/.opencode/command/fix-ci.md +0 -109
  83. package/dist/template/.opencode/command/fix-types.md +0 -104
  84. package/dist/template/.opencode/command/fix-ui.md +0 -117
  85. package/dist/template/.opencode/command/fix.md +0 -168
  86. package/dist/template/.opencode/command/frontend-design.md +0 -21
  87. package/dist/template/.opencode/command/generate-diagram.md +0 -349
  88. package/dist/template/.opencode/command/generate-icon.md +0 -283
  89. package/dist/template/.opencode/command/generate-image.md +0 -246
  90. package/dist/template/.opencode/command/generate-pattern.md +0 -247
  91. package/dist/template/.opencode/command/generate-storyboard.md +0 -250
  92. package/dist/template/.opencode/command/implement.md +0 -609
  93. package/dist/template/.opencode/command/import-plan.md +0 -406
  94. package/dist/template/.opencode/command/index-knowledge.md +0 -25
  95. package/dist/template/.opencode/command/integration-test.md +0 -424
  96. package/dist/template/.opencode/command/issue.md +0 -102
  97. package/dist/template/.opencode/command/new-feature.md +0 -651
  98. package/dist/template/.opencode/command/opensrc.md +0 -58
  99. package/dist/template/.opencode/command/quick-build.md +0 -238
  100. package/dist/template/.opencode/command/ralph.md +0 -41
  101. package/dist/template/.opencode/command/research-and-implement.md +0 -148
  102. package/dist/template/.opencode/command/research-ui.md +0 -466
  103. package/dist/template/.opencode/command/restore-image.md +0 -424
  104. package/dist/template/.opencode/command/revert-feature.md +0 -386
  105. package/dist/template/.opencode/command/skill-create.md +0 -517
  106. package/dist/template/.opencode/command/skill-optimize.md +0 -556
  107. package/dist/template/.opencode/command/summarize.md +0 -412
  108. package/dist/template/.opencode/command/triage.md +0 -398
  109. package/dist/template/.opencode/memory/_templates/project/architecture.md +0 -60
  110. package/dist/template/.opencode/memory/_templates/project/commands.md +0 -72
  111. package/dist/template/.opencode/memory/_templates/project/conventions.md +0 -68
  112. package/dist/template/.opencode/memory/_templates/project/gotchas.md +0 -41
  113. package/dist/template/.opencode/skill/notebooklm/SKILL.md +0 -272
  114. package/dist/template/.opencode/skill/notebooklm/references/setup.md +0 -353
  115. package/dist/template/.opencode/tool/notebooklm.ts +0 -488
  116. package/dist/template/.opencode/tool/oracle.ts +0 -240
@@ -1,373 +0,0 @@
1
- ---
2
- description: Brainstorm and explore ideas with structured ideation
3
- argument-hint: "<topic or bead-id> [--quick]"
4
- agent: plan
5
- subtask: true
6
- ---
7
-
8
- # Brainstorm: $ARGUMENTS
9
-
10
- ## Load Beads Skill
11
-
12
- ```typescript
13
- skill({ name: "beads" });
14
- ```
15
-
16
- ## Options
17
-
18
- - `--quick`: 15-minute time box (default: 30 minutes)
19
-
20
- ## Phase 1: Load Context
21
-
22
- **Load skill:**
23
-
24
- ```typescript
25
- skill({ name: "brainstorming" });
26
- ```
27
-
28
- **Check for bead context:**
29
-
30
- If `$ARGUMENTS` is a bead ID:
31
-
32
- !`bd show $ARGUMENTS`
33
-
34
- Load constraints from `.beads/artifacts/<bead-id>/spec.md` if it exists.
35
-
36
- **Check for prior thinking (Semantic Search):**
37
-
38
- ```typescript
39
- // Search for related ideas and past brainstorms
40
- memory -
41
- search({
42
- query: "[topic keywords]",
43
- mode: "semantic",
44
- limit: 5,
45
- });
46
-
47
- // Find related observations
48
- memory -
49
- search({
50
- query: "[topic]",
51
- mode: "semantic",
52
- type: "observation",
53
- limit: 3,
54
- });
55
- ```
56
-
57
- Review findings for:
58
-
59
- - Previous brainstorms on similar topics
60
- - Related decisions and patterns
61
- - Ideas that were considered before
62
-
63
- If memory search fails (Ollama not running), continue without it.
64
-
65
- ## Phase 2: Set Boundaries
66
-
67
- Before brainstorming, establish:
68
-
69
- ```
70
- Brainstorm Session: $ARGUMENTS
71
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
72
-
73
- Topic: [what we're exploring]
74
- Goal: [what decision/outcome we need]
75
- Constraints: [hard limits from spec or user]
76
- Time box: [15/30 minutes]
77
-
78
- Out of scope:
79
- - [what we're NOT considering]
80
- ```
81
-
82
- ## Phase 3: Diverge (Generate Ideas)
83
-
84
- **Goal:** Quantity over quality. No evaluation yet.
85
-
86
- Generate 5-10 ideas rapidly:
87
-
88
- ```
89
- Ideas:
90
- ━━━━━━
91
-
92
- 1. [Idea name]
93
- Brief: [1-2 sentences]
94
-
95
- 2. [Idea name]
96
- Brief: [1-2 sentences]
97
-
98
- 3. [Idea name]
99
- Brief: [1-2 sentences]
100
-
101
- ... continue to 5-10 ideas
102
- ```
103
-
104
- **Techniques:**
105
-
106
- - **Inversion:** What's the opposite approach?
107
- - **Analogy:** How do others solve similar problems?
108
- - **Constraint removal:** What if [constraint] didn't exist?
109
- - **Combination:** Can we merge two partial solutions?
110
- - **Extreme:** What's the simplest? Most complex?
111
-
112
- ## Phase 4: Explore Codebase
113
-
114
- Validate feasibility against existing code:
115
-
116
- ```typescript
117
- // Find related patterns
118
- grep({ pattern: "[related concept]", include: "*.ts" });
119
- ast - grep({ pattern: "[code pattern]" });
120
-
121
- // Understand existing architecture
122
- lsp_lsp_document_symbols({ filePath: "<relevant file>" });
123
- ```
124
-
125
- For each promising idea, note:
126
-
127
- - Existing code that supports it
128
- - Existing code that conflicts
129
- - New code required
130
-
131
- ## Phase 5: Converge (Evaluate Ideas)
132
-
133
- Rate each idea on 4 dimensions:
134
-
135
- | Idea | Feasibility | Impact | Effort | Risk | Score |
136
- | ---- | ----------- | ------ | ------ | ----- | ------ |
137
- | 1 | H/M/L | H/M/L | S/M/L | H/M/L | [1-10] |
138
- | 2 | H/M/L | H/M/L | S/M/L | H/M/L | [1-10] |
139
- | ... | | | | | |
140
-
141
- **Scoring guide:**
142
-
143
- - **Feasibility:** Can we actually build this? (H=easy, L=very hard)
144
- - **Impact:** How much value does this deliver? (H=high value)
145
- - **Effort:** How much work? (S=small, L=large)
146
- - **Risk:** What could go wrong? (H=high risk)
147
-
148
- **Score formula:** (Feasibility × Impact) / (Effort × Risk)
149
-
150
- ## Phase 6: Deep Dive Top 3
151
-
152
- For the top 3 scoring ideas:
153
-
154
- ### Idea [N]: [Name]
155
-
156
- **Approach:**
157
- [2-3 sentence description]
158
-
159
- **How it works:**
160
-
161
- 1. [Step 1]
162
- 2. [Step 2]
163
- 3. [Step 3]
164
-
165
- **Pros:**
166
-
167
- - [Advantage 1]
168
- - [Advantage 2]
169
-
170
- **Cons:**
171
-
172
- - [Disadvantage 1]
173
- - [Disadvantage 2]
174
-
175
- **Code sketch:**
176
-
177
- ```typescript
178
- // Quick pseudocode or structure
179
- ```
180
-
181
- **Open questions:**
182
-
183
- - [Uncertainty 1]
184
- - [Uncertainty 2]
185
-
186
- ## Phase 7: Prototype (Optional)
187
-
188
- For the most promising idea, create a quick spike:
189
-
190
- ```
191
- Prototype Goal:
192
- ━━━━━━━━━━━━━━━
193
-
194
- Question to answer: [what are we validating?]
195
- Time limit: 15 minutes
196
- Success criteria: [how we know it works]
197
- ```
198
-
199
- Create throwaway code to validate:
200
-
201
- ```bash
202
- # Create spike branch
203
- git checkout -b spike/brainstorm-$ARGUMENTS
204
- ```
205
-
206
- Build minimal proof of concept. Delete or keep based on learnings.
207
-
208
- ## Phase 8: Capture Decision
209
-
210
- Save brainstorm results:
211
-
212
- **If bead exists:**
213
-
214
- Write to `.beads/artifacts/<bead-id>/brainstorm.md`:
215
-
216
- ```markdown
217
- # Brainstorm: [Topic]
218
-
219
- **Date:** [date]
220
- **Duration:** [N] minutes
221
- **Bead:** <bead-id>
222
-
223
- ## Goal
224
-
225
- [What we were exploring]
226
-
227
- ## Ideas Considered
228
-
229
- | Idea | Feasibility | Impact | Effort | Risk | Score |
230
- | ---- | ----------- | ------ | ------ | ---- | ----- |
231
- | [1] | H | H | M | L | 8 |
232
- | [2] | M | H | S | M | 6 |
233
- | [3] | L | M | L | H | 2 |
234
-
235
- ## Recommendation
236
-
237
- **Chosen approach:** [Idea N]
238
-
239
- **Rationale:** [Why this approach]
240
-
241
- ## Next Steps
242
-
243
- - [ ] [Action 1]
244
- - [ ] [Action 2]
245
- ```
246
-
247
- **Create observation for reusable insights:**
248
-
249
- ```typescript
250
- observation({
251
- type: "discovery",
252
- title: "Brainstorm: [topic]",
253
- content: `
254
- ## Key Insight
255
- [What we learned]
256
-
257
- ## Approach Chosen
258
- [Brief description]
259
-
260
- ## Why Others Rejected
261
- [Brief notes on alternatives]
262
- `,
263
- concepts: "[topic keywords]",
264
- bead_id: "<bead-id>",
265
- });
266
- ```
267
-
268
- ## Phase 9: Create Follow-up Beads
269
-
270
- For promising ideas that need more work:
271
-
272
- ```bash
273
- bd create "[Idea name]" -t task -p 2
274
- ```
275
-
276
- ## Output
277
-
278
- ```markdown
279
- Brainstorm Complete: $ARGUMENTS
280
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━
281
-
282
- Duration: [N] minutes
283
- Ideas generated: [N]
284
- Ideas evaluated: [N]
285
-
286
- Top 3:
287
-
288
- 1. [Idea 1] - Score: [N]
289
- 2. [Idea 2] - Score: [N]
290
- 3. [Idea 3] - Score: [N]
291
-
292
- Recommendation: [Chosen approach]
293
- Confidence: [High/Medium/Low]
294
-
295
- Artifacts:
296
-
297
- - .beads/artifacts/<bead-id>/brainstorm.md (if bead)
298
- - Observation created ✓
299
-
300
- Follow-up beads: [N] created
301
- ```
302
-
303
- **Use question tool for next steps:**
304
-
305
- ```typescript
306
- question({
307
- questions: [
308
- {
309
- header: "Next Step",
310
- question: "What should we do next with $ARGUMENTS?",
311
- options: [
312
- {
313
- label: "Research approach (Recommended)",
314
- description: "Validate with /research",
315
- },
316
- { label: "Create implementation plan", description: "Plan with /plan" },
317
- {
318
- label: "Explore more",
319
- description: "Continue brainstorming other aspects",
320
- },
321
- { label: "Done for now", description: "Save findings, revisit later" },
322
- ],
323
- },
324
- ],
325
- });
326
- ```
327
-
328
- Brainstorm Complete: $ARGUMENTS
329
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
330
-
331
- Duration: [N] minutes
332
- Ideas generated: [N]
333
- Ideas evaluated: [N]
334
-
335
- Top 3:
336
-
337
- 1. [Idea 1] - Score: [N]
338
- 2. [Idea 2] - Score: [N]
339
- 3. [Idea 3] - Score: [N]
340
-
341
- Recommendation: [Chosen approach]
342
- Confidence: [High/Medium/Low]
343
-
344
- Artifacts:
345
-
346
- - .beads/artifacts/<bead-id>/brainstorm.md (if bead)
347
- - Observation created ✓
348
-
349
- Follow-up beads: [N] created
350
-
351
- ```
352
-
353
- **Next steps:**
354
-
355
- ```
356
-
357
- If ready to proceed:
358
- /research <bead-id> # Validate approach
359
- /plan <bead-id> # Create implementation plan
360
-
361
- If need more exploration:
362
- /brainstorm <new-aspect> # Continue ideation
363
-
364
- ```
365
-
366
- ## Anti-Patterns
367
-
368
- - ❌ **Evaluating during divergence** - Generate first, judge later
369
- - ❌ **Falling in love with first idea** - Explore alternatives
370
- - ❌ **Infinite brainstorming** - Time box and decide
371
- - ❌ **No decision** - Brainstorming must produce a recommendation
372
- - ❌ **No capture** - Undocumented ideas are lost ideas
373
- ```
@@ -1,70 +0,0 @@
1
- ---
2
- description: Load Cloudflare skill and get contextual guidance for your task
3
- ---
4
-
5
- Load the Cloudflare platform skill and help with any Cloudflare development task.
6
-
7
- ## Workflow
8
-
9
- ### Step 1: Check for --update-skill flag
10
-
11
- If $ARGUMENTS contains `--update-skill`:
12
-
13
- 1. Determine install location by checking which exists:
14
- - Local: `.opencode/skill/cloudflare/`
15
- - Global: `~/.config/opencode/skill/cloudflare/`
16
-
17
- 2. Run the appropriate install command:
18
- ```bash
19
- # For local installation
20
- curl -fsSL https://raw.githubusercontent.com/dmmulroy/cloudflare-skill/main/install.sh | bash
21
-
22
- # For global installation
23
- curl -fsSL https://raw.githubusercontent.com/dmmulroy/cloudflare-skill/main/install.sh | bash -s -- --global
24
- ```
25
-
26
- 3. Output success message and stop (do not continue to other steps).
27
-
28
- ### Step 2: Load cloudflare skill
29
-
30
- ```
31
- skill({ name: 'cloudflare' })
32
- ```
33
-
34
- ### Step 3: Identify task type from user request
35
-
36
- Analyze $ARGUMENTS to determine:
37
- - **Product(s) needed** (Workers, D1, R2, Durable Objects, etc.)
38
- - **Task type** (new project setup, feature implementation, debugging, config)
39
-
40
- Use decision trees in SKILL.md to select correct product.
41
-
42
- ### Step 4: Read relevant reference files
43
-
44
- Based on task type, read from `references/<product>/`:
45
-
46
- | Task | Files to Read |
47
- |------|---------------|
48
- | New project | `README.md` + `configuration.md` |
49
- | Implement feature | `README.md` + `api.md` + `patterns.md` |
50
- | Debug/troubleshoot | `gotchas.md` |
51
- | All-in-one (monolithic) | `SKILL.md` |
52
-
53
- ### Step 5: Execute task
54
-
55
- Apply Cloudflare-specific patterns and APIs from references to complete the user's request.
56
-
57
- ### Step 6: Summarize
58
-
59
- ```
60
- === Cloudflare Task Complete ===
61
-
62
- Product(s): <products used>
63
- Files referenced: <reference files consulted>
64
-
65
- <brief summary of what was done>
66
- ```
67
-
68
- <user-request>
69
- $ARGUMENTS
70
- </user-request>
@@ -1,245 +0,0 @@
1
- ---
2
- description: Commit with verification and optional bead traceability
3
- argument-hint: "[bead-id] [--amend]"
4
- agent: build
5
- ---
6
-
7
- # Commit
8
-
9
- **Load skills:**
10
-
11
- ```typescript
12
- skill({ name: "beads" }); // Session protocol
13
- skill({ name: "verification-before-completion" });
14
- ```
15
-
16
- ## Options
17
-
18
- - `--amend`: Amend the last commit (only if not pushed and you created it)
19
-
20
- ## Phase 1: Check Git State
21
-
22
- !`git status --porcelain`
23
- !`git diff --stat`
24
- !`git diff --cached --stat`
25
-
26
- Report:
27
-
28
- ```
29
- Git State:
30
- ━━━━━━━━━━
31
-
32
- Staged:
33
- - [file1] (modified)
34
- - [file2] (new)
35
-
36
- Unstaged:
37
- - [file3] (modified)
38
-
39
- Untracked:
40
- - [file4]
41
- ```
42
-
43
- If nothing staged: "No changes staged. Run `git add <files>` first."
44
-
45
- ## Phase 2: Run Verification Gates
46
-
47
- Detect project type and run gates:
48
-
49
- !`ls package.json Cargo.toml pyproject.toml go.mod Makefile 2>/dev/null`
50
-
51
- | Project | Test Command | Lint Command |
52
- | ------- | --------------- | ------------------------------------ |
53
- | Node.js | `npm test` | `npm run lint && npm run type-check` |
54
- | Rust | `cargo test` | `cargo clippy -- -D warnings` |
55
- | Python | `pytest` | `ruff check . && mypy .` |
56
- | Go | `go test ./...` | `golangci-lint run` |
57
-
58
- ```
59
- Verification:
60
- ━━━━━━━━━━━━━
61
-
62
- Tests: [✓/✗/skipped]
63
- Lint: [✓/✗/skipped]
64
- Types: [✓/✗/skipped]
65
- ```
66
-
67
- **If any gate fails:**
68
-
69
- ```
70
- Cannot commit: [gate] failed.
71
-
72
- Fix errors or use `git commit --no-verify` (not recommended).
73
- ```
74
-
75
- ## Phase 3: Analyze Changes for Message
76
-
77
- !`git diff --cached --stat`
78
- !`git diff --cached`
79
-
80
- Determine:
81
-
82
- - **Type**: What kind of change is this?
83
- - **Scope**: Which module/component changed?
84
- - **Summary**: What does this change do?
85
-
86
- ### Commit Type Guide
87
-
88
- | Type | When to Use | Example |
89
- | ---------- | --------------------------------------- | ---------------------------------- |
90
- | `feat` | New feature for user | `feat(auth): add OAuth login` |
91
- | `fix` | Bug fix | `fix(api): handle null response` |
92
- | `refactor` | Code change (no new feature or fix) | `refactor(utils): simplify parser` |
93
- | `docs` | Documentation only | `docs: update API reference` |
94
- | `test` | Adding or updating tests | `test(auth): add login tests` |
95
- | `chore` | Maintenance, deps, tooling | `chore: update dependencies` |
96
- | `style` | Formatting, whitespace (no code change) | `style: fix indentation` |
97
- | `perf` | Performance improvement | `perf(db): add query caching` |
98
- | `ci` | CI/CD changes | `ci: add deploy workflow` |
99
-
100
- ### Scope Detection
101
-
102
- Auto-detect scope from changed files:
103
-
104
- | Changed Files | Suggested Scope |
105
- | ----------------------- | --------------- |
106
- | `src/auth/*` | auth |
107
- | `src/api/*` | api |
108
- | `src/components/*` | ui |
109
- | `tests/*` | test |
110
- | `docs/*` | docs |
111
- | Multiple unrelated dirs | (omit scope) |
112
-
113
- ## Phase 4: Generate Commit Message
114
-
115
- Propose message based on analysis:
116
-
117
- ```
118
- Proposed Commit:
119
- ━━━━━━━━━━━━━━━━
120
-
121
- <type>(<scope>): <summary>
122
-
123
- [body - what and why, not how]
124
-
125
- [footer - bead reference, breaking changes]
126
- ```
127
-
128
- **Example with bead:**
129
-
130
- ```
131
- feat(auth): add token refresh mechanism
132
-
133
- Implement automatic token refresh when access token expires.
134
- Tokens are stored in secure session storage.
135
-
136
- bd-a1b2c3: OAuth implementation
137
- ```
138
-
139
- **Example with breaking change:**
140
-
141
- ```
142
- feat(api)!: change response format
143
-
144
- BREAKING CHANGE: API responses now use camelCase instead of snake_case.
145
- Migration guide: https://...
146
- ```
147
-
148
- Ask user:
149
-
150
- ```
151
- Use this message? (yes/edit/cancel)
152
- ```
153
-
154
- ## Phase 5: Execute Commit
155
-
156
- ```bash
157
- git commit -m "<message>"
158
- ```
159
-
160
- **If pre-commit hook fails:**
161
-
162
- ```
163
- Pre-commit hook failed:
164
- ━━━━━━━━━━━━━━━━━━━━━━━
165
-
166
- [hook output]
167
-
168
- Options:
169
- 1. Fix issues and retry: /commit [bead-id]
170
- 2. Skip hook (not recommended): git commit --no-verify -m "..."
171
- ```
172
-
173
- **Do NOT use --amend** unless:
174
-
175
- 1. User explicitly requested `--amend`
176
- 2. You created the HEAD commit in this session
177
- 3. Commit has NOT been pushed to remote
178
-
179
- ## Phase 6: Sync (for multi-agent)
180
-
181
- If bead ID was provided:
182
-
183
- ```bash
184
- bd sync
185
- ```
186
-
187
- ## Output
188
-
189
- ```
190
- Committed: [short-hash]
191
- ━━━━━━━━━━━━━━━━━━━━━━━
192
-
193
- Message: <type>(<scope>): <summary>
194
- Files: [N] changed
195
- Bead: <bead-id> (if provided)
196
-
197
- Verification: All gates passed ✓
198
- ```
199
-
200
- **Next steps:**
201
-
202
- ```
203
- Continue working:
204
- [make more changes]
205
- /commit [bead-id]
206
-
207
- Ready to finish:
208
- /finish <bead-id>
209
-
210
- Create PR:
211
- /pr <bead-id>
212
- ```
213
-
214
- ## Amend Workflow (--amend)
215
-
216
- **Safety checks before amend:**
217
-
218
- !`git log -1 --format='%H %s'` # What we're amending
219
- !`git status` # Check if pushed
220
-
221
- ```
222
- Amend Safety Check:
223
- ━━━━━━━━━━━━━━━━━━━
224
-
225
- HEAD commit: [hash] [message]
226
- Pushed to remote: [yes/no]
227
- Created by you: [yes/no]
228
- ```
229
-
230
- **If pushed or not created by you: STOP.**
231
-
232
- ```
233
- Cannot amend: Commit already pushed or not created by you.
234
-
235
- Use a new commit instead:
236
- git add <files>
237
- /commit [bead-id]
238
- ```
239
-
240
- **If safe to amend:**
241
-
242
- ```bash
243
- git add <files>
244
- git commit --amend -m "<updated message>"
245
- ```