opencodekit 0.0.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.
- package/README.md +258 -0
- package/dist/index.js +3391 -0
- package/dist/template/.opencode/.env.example +193 -0
- package/dist/template/.opencode/AGENTS.md +214 -0
- package/dist/template/.opencode/README.md +269 -0
- package/dist/template/.opencode/agent/build.md +75 -0
- package/dist/template/.opencode/agent/explore.md +66 -0
- package/dist/template/.opencode/agent/planner.md +83 -0
- package/dist/template/.opencode/agent/review.md +90 -0
- package/dist/template/.opencode/agent/rush.md +85 -0
- package/dist/template/.opencode/agent/scout.md +93 -0
- package/dist/template/.opencode/command/analyze-project.md +39 -0
- package/dist/template/.opencode/command/brainstorm.md +11 -0
- package/dist/template/.opencode/command/commit.md +11 -0
- package/dist/template/.opencode/command/create.md +118 -0
- package/dist/template/.opencode/command/design.md +15 -0
- package/dist/template/.opencode/command/finish.md +233 -0
- package/dist/template/.opencode/command/fix-ci.md +20 -0
- package/dist/template/.opencode/command/fix-types.md +10 -0
- package/dist/template/.opencode/command/fix-ui.md +22 -0
- package/dist/template/.opencode/command/fix.md +22 -0
- package/dist/template/.opencode/command/handoff.md +146 -0
- package/dist/template/.opencode/command/implement.md +167 -0
- package/dist/template/.opencode/command/import-plan.md +188 -0
- package/dist/template/.opencode/command/integration-test.md +36 -0
- package/dist/template/.opencode/command/issue.md +41 -0
- package/dist/template/.opencode/command/plan.md +158 -0
- package/dist/template/.opencode/command/pr.md +36 -0
- package/dist/template/.opencode/command/quick-build.md +13 -0
- package/dist/template/.opencode/command/research-and-implement.md +21 -0
- package/dist/template/.opencode/command/research-ui.md +32 -0
- package/dist/template/.opencode/command/research.md +153 -0
- package/dist/template/.opencode/command/resume.md +127 -0
- package/dist/template/.opencode/command/review-codebase.md +13 -0
- package/dist/template/.opencode/command/skill-create.md +29 -0
- package/dist/template/.opencode/command/skill-optimize.md +28 -0
- package/dist/template/.opencode/command/status.md +109 -0
- package/dist/template/.opencode/command/ui-review.md +28 -0
- package/dist/template/.opencode/dcp.jsonc +34 -0
- package/dist/template/.opencode/memory/README.md +128 -0
- package/dist/template/.opencode/memory/_templates/handoff.md +33 -0
- package/dist/template/.opencode/memory/_templates/research.md +29 -0
- package/dist/template/.opencode/memory/_templates/task-prd.md +43 -0
- package/dist/template/.opencode/memory/_templates/task-review.md +73 -0
- package/dist/template/.opencode/memory/_templates/task-spec.md +71 -0
- package/dist/template/.opencode/memory/design-guidelines.md +281 -0
- package/dist/template/.opencode/memory/handoffs/README.md +83 -0
- package/dist/template/.opencode/opencode.json +469 -0
- package/dist/template/.opencode/package.json +23 -0
- package/dist/template/.opencode/pickle-thinker.jsonc +11 -0
- package/dist/template/.opencode/plugin/README.md +162 -0
- package/dist/template/.opencode/plugin/notification.ts +88 -0
- package/dist/template/.opencode/plugin/sessions.ts +434 -0
- package/dist/template/.opencode/plugin/superpowers.ts +332 -0
- package/dist/template/.opencode/plugin/tsconfig.json +15 -0
- package/dist/template/.opencode/superpowers/.claude/settings.local.json +141 -0
- package/dist/template/.opencode/superpowers/.claude-plugin/marketplace.json +20 -0
- package/dist/template/.opencode/superpowers/.claude-plugin/plugin.json +13 -0
- package/dist/template/.opencode/superpowers/.codex/INSTALL.md +35 -0
- package/dist/template/.opencode/superpowers/.codex/superpowers-bootstrap.md +33 -0
- package/dist/template/.opencode/superpowers/.codex/superpowers-codex +267 -0
- package/dist/template/.opencode/superpowers/.github/FUNDING.yml +3 -0
- package/dist/template/.opencode/superpowers/.opencode/INSTALL.md +135 -0
- package/dist/template/.opencode/superpowers/.opencode/plugin/superpowers.js +215 -0
- package/dist/template/.opencode/superpowers/LICENSE +21 -0
- package/dist/template/.opencode/superpowers/README.md +165 -0
- package/dist/template/.opencode/superpowers/RELEASE-NOTES.md +493 -0
- package/dist/template/.opencode/superpowers/agents/code-reviewer.md +48 -0
- package/dist/template/.opencode/superpowers/commands/brainstorm.md +5 -0
- package/dist/template/.opencode/superpowers/commands/execute-plan.md +5 -0
- package/dist/template/.opencode/superpowers/commands/write-plan.md +5 -0
- package/dist/template/.opencode/superpowers/docs/README.codex.md +153 -0
- package/dist/template/.opencode/superpowers/docs/README.opencode.md +234 -0
- package/dist/template/.opencode/superpowers/docs/plans/2025-11-22-opencode-support-design.md +294 -0
- package/dist/template/.opencode/superpowers/docs/plans/2025-11-22-opencode-support-implementation.md +1095 -0
- package/dist/template/.opencode/superpowers/hooks/hooks.json +15 -0
- package/dist/template/.opencode/superpowers/hooks/session-start.sh +34 -0
- package/dist/template/.opencode/superpowers/lib/skills-core.js +208 -0
- package/dist/template/.opencode/superpowers/skills/brainstorming/SKILL.md +54 -0
- package/dist/template/.opencode/superpowers/skills/condition-based-waiting/SKILL.md +120 -0
- package/dist/template/.opencode/superpowers/skills/condition-based-waiting/example.ts +158 -0
- package/dist/template/.opencode/superpowers/skills/defense-in-depth/SKILL.md +127 -0
- package/dist/template/.opencode/superpowers/skills/dispatching-parallel-agents/SKILL.md +180 -0
- package/dist/template/.opencode/superpowers/skills/executing-plans/SKILL.md +76 -0
- package/dist/template/.opencode/superpowers/skills/finishing-a-development-branch/SKILL.md +200 -0
- package/dist/template/.opencode/superpowers/skills/frontend-aesthetics/SKILL.md +137 -0
- package/dist/template/.opencode/superpowers/skills/gemini-large-context/SKILL.md +205 -0
- package/dist/template/.opencode/superpowers/skills/receiving-code-review/SKILL.md +209 -0
- package/dist/template/.opencode/superpowers/skills/requesting-code-review/SKILL.md +105 -0
- package/dist/template/.opencode/superpowers/skills/requesting-code-review/code-reviewer.md +146 -0
- package/dist/template/.opencode/superpowers/skills/root-cause-tracing/SKILL.md +174 -0
- package/dist/template/.opencode/superpowers/skills/root-cause-tracing/find-polluter.sh +63 -0
- package/dist/template/.opencode/superpowers/skills/sharing-skills/SKILL.md +194 -0
- package/dist/template/.opencode/superpowers/skills/subagent-driven-development/SKILL.md +189 -0
- package/dist/template/.opencode/superpowers/skills/systematic-debugging/CREATION-LOG.md +119 -0
- package/dist/template/.opencode/superpowers/skills/systematic-debugging/SKILL.md +295 -0
- package/dist/template/.opencode/superpowers/skills/systematic-debugging/test-academic.md +14 -0
- package/dist/template/.opencode/superpowers/skills/systematic-debugging/test-pressure-1.md +58 -0
- package/dist/template/.opencode/superpowers/skills/systematic-debugging/test-pressure-2.md +68 -0
- package/dist/template/.opencode/superpowers/skills/systematic-debugging/test-pressure-3.md +69 -0
- package/dist/template/.opencode/superpowers/skills/test-driven-development/SKILL.md +364 -0
- package/dist/template/.opencode/superpowers/skills/testing-anti-patterns/SKILL.md +302 -0
- package/dist/template/.opencode/superpowers/skills/testing-skills-with-subagents/SKILL.md +387 -0
- package/dist/template/.opencode/superpowers/skills/testing-skills-with-subagents/examples/CLAUDE_MD_TESTING.md +189 -0
- package/dist/template/.opencode/superpowers/skills/ui-ux-research/SKILL.md +191 -0
- package/dist/template/.opencode/superpowers/skills/using-git-worktrees/SKILL.md +213 -0
- package/dist/template/.opencode/superpowers/skills/using-superpowers/SKILL.md +101 -0
- package/dist/template/.opencode/superpowers/skills/verification-before-completion/SKILL.md +139 -0
- package/dist/template/.opencode/superpowers/skills/writing-plans/SKILL.md +116 -0
- package/dist/template/.opencode/superpowers/skills/writing-skills/SKILL.md +622 -0
- package/dist/template/.opencode/superpowers/skills/writing-skills/anthropic-best-practices.md +1150 -0
- package/dist/template/.opencode/superpowers/skills/writing-skills/graphviz-conventions.dot +172 -0
- package/dist/template/.opencode/superpowers/skills/writing-skills/persuasion-principles.md +187 -0
- package/dist/template/.opencode/superpowers/tests/opencode/run-tests.sh +165 -0
- package/dist/template/.opencode/superpowers/tests/opencode/setup.sh +73 -0
- package/dist/template/.opencode/superpowers/tests/opencode/test-plugin-loading.sh +81 -0
- package/dist/template/.opencode/superpowers/tests/opencode/test-priority.sh +198 -0
- package/dist/template/.opencode/superpowers/tests/opencode/test-skills-core.sh +440 -0
- package/dist/template/.opencode/superpowers/tests/opencode/test-tools.sh +104 -0
- package/dist/template/.opencode/tool/memory-read.ts +66 -0
- package/dist/template/.opencode/tool/memory-update.ts +61 -0
- package/dist/template/.opencode/tsconfig.json +21 -0
- package/package.json +52 -0
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Finish a bead - hard gates, commit, close
|
|
3
|
+
argument-hint: "<bead-id>"
|
|
4
|
+
agent: build
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Finish
|
|
8
|
+
|
|
9
|
+
## Phase 1: Load Bead
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
bd show $ARGUMENTS --json
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Verify status is `in-progress` or `open`.
|
|
16
|
+
|
|
17
|
+
## Phase 2: Detect Project Type
|
|
18
|
+
|
|
19
|
+
Check which project files exist to determine verification commands:
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
ls package.json Cargo.toml pyproject.toml setup.py Makefile go.mod 2>/dev/null || true
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
**Node.js/TypeScript** (`package.json` exists):
|
|
26
|
+
|
|
27
|
+
- Build: `npm run build` or `bun run build`
|
|
28
|
+
- Test: `npm test` or `bun test`
|
|
29
|
+
- Lint: `npm run lint` or `bun run lint`
|
|
30
|
+
- Type check: `npm run type-check` or `bun run type-check`
|
|
31
|
+
|
|
32
|
+
**Rust** (`Cargo.toml` exists):
|
|
33
|
+
|
|
34
|
+
- Build: `cargo build`
|
|
35
|
+
- Test: `cargo test`
|
|
36
|
+
- Lint: `cargo clippy -- -D warnings`
|
|
37
|
+
|
|
38
|
+
**Python** (`pyproject.toml` or `setup.py` exists):
|
|
39
|
+
|
|
40
|
+
- Test: `pytest`
|
|
41
|
+
- Lint: `ruff check .` or `flake8`
|
|
42
|
+
- Type check: `mypy .`
|
|
43
|
+
|
|
44
|
+
**Go** (`go.mod` exists):
|
|
45
|
+
|
|
46
|
+
- Build: `go build ./...`
|
|
47
|
+
- Test: `go test ./...`
|
|
48
|
+
- Lint: `golangci-lint run`
|
|
49
|
+
|
|
50
|
+
**Make-based** (`Makefile` exists, no other markers):
|
|
51
|
+
|
|
52
|
+
- Build: `make build`
|
|
53
|
+
- Test: `make test`
|
|
54
|
+
- Lint: `make lint`
|
|
55
|
+
|
|
56
|
+
**No recognized files:** Skip automated gates, proceed to Phase 4.
|
|
57
|
+
|
|
58
|
+
Check if each command actually exists before running (e.g., verify script exists in `package.json`).
|
|
59
|
+
|
|
60
|
+
## Phase 3: Hard Gates (MUST ALL PASS)
|
|
61
|
+
|
|
62
|
+
Run detected verification commands. Skip any that don't exist for the project.
|
|
63
|
+
|
|
64
|
+
Report:
|
|
65
|
+
|
|
66
|
+
```
|
|
67
|
+
Finish Gates: <bead-id>
|
|
68
|
+
━━━━━━━━━━━━━━━━━━━━━━
|
|
69
|
+
Project: [detected type]
|
|
70
|
+
|
|
71
|
+
Build: [✓/✗/skipped]
|
|
72
|
+
Tests: [✓/✗/skipped]
|
|
73
|
+
Lint: [✓/✗/skipped]
|
|
74
|
+
Type check: [✓/✗/skipped]
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
**If ANY gate fails: STOP.**
|
|
78
|
+
|
|
79
|
+
```
|
|
80
|
+
Cannot finish: [gate name] failed.
|
|
81
|
+
|
|
82
|
+
Fix errors and run /finish again.
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
Do not proceed. Do not offer workarounds.
|
|
86
|
+
|
|
87
|
+
## Phase 4: Verify Success Criteria
|
|
88
|
+
|
|
89
|
+
Read spec:
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
cat .beads/artifacts/<bead-id>/spec.md
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
Check each success criterion:
|
|
96
|
+
|
|
97
|
+
```
|
|
98
|
+
Success Criteria:
|
|
99
|
+
- [x] [Criterion 1] - verified by [how]
|
|
100
|
+
- [x] [Criterion 2] - verified by [how]
|
|
101
|
+
- [ ] [Criterion 3] - NOT MET: [reason]
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
**If any criterion not met: STOP.**
|
|
105
|
+
|
|
106
|
+
```
|
|
107
|
+
Cannot finish: Success criteria not met.
|
|
108
|
+
|
|
109
|
+
Missing:
|
|
110
|
+
- [Criterion] - [what's needed]
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
## Phase 5: Create Review
|
|
114
|
+
|
|
115
|
+
Write `.beads/artifacts/<bead-id>/review.md`:
|
|
116
|
+
|
|
117
|
+
```markdown
|
|
118
|
+
# Review: [Title]
|
|
119
|
+
|
|
120
|
+
**Bead:** <bead-id>
|
|
121
|
+
**Completed:** <date>
|
|
122
|
+
|
|
123
|
+
## Changes Made
|
|
124
|
+
|
|
125
|
+
| File | Change |
|
|
126
|
+
| ------------ | ------------- |
|
|
127
|
+
| `src/foo.ts` | [description] |
|
|
128
|
+
| `src/bar.ts` | [description] |
|
|
129
|
+
|
|
130
|
+
## What Worked
|
|
131
|
+
|
|
132
|
+
- [Thing that went well]
|
|
133
|
+
|
|
134
|
+
## What Was Skipped
|
|
135
|
+
|
|
136
|
+
- [Thing intentionally not done and why]
|
|
137
|
+
|
|
138
|
+
## Inconsistencies Found
|
|
139
|
+
|
|
140
|
+
- [Any issues discovered but not fixed]
|
|
141
|
+
|
|
142
|
+
## Test Coverage
|
|
143
|
+
|
|
144
|
+
- [New tests added]
|
|
145
|
+
- [Existing tests modified]
|
|
146
|
+
|
|
147
|
+
## Success Criteria
|
|
148
|
+
|
|
149
|
+
- [x] [Criterion 1]
|
|
150
|
+
- [x] [Criterion 2]
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
## Phase 6: Final Commit
|
|
154
|
+
|
|
155
|
+
```bash
|
|
156
|
+
git add -A
|
|
157
|
+
git status
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
Commit with bead reference:
|
|
161
|
+
|
|
162
|
+
```bash
|
|
163
|
+
git commit -m "<bead-id>: [summary of changes]
|
|
164
|
+
|
|
165
|
+
- [bullet 1]
|
|
166
|
+
- [bullet 2]
|
|
167
|
+
|
|
168
|
+
Closes: <bead-id>"
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
## Phase 7: Close Bead
|
|
172
|
+
|
|
173
|
+
```bash
|
|
174
|
+
bd close $ARGUMENTS --reason "Implemented: [1-liner summary]"
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
## Phase 8: Database Health Check
|
|
178
|
+
|
|
179
|
+
Check issue count:
|
|
180
|
+
|
|
181
|
+
```bash
|
|
182
|
+
bd list --status all 2>/dev/null | wc -l
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
**If >200 issues:** Warn about performance.
|
|
186
|
+
|
|
187
|
+
**If >500 issues:** Strongly recommend cleanup.
|
|
188
|
+
|
|
189
|
+
## Output
|
|
190
|
+
|
|
191
|
+
```
|
|
192
|
+
Bead Closed: <bead-id>
|
|
193
|
+
━━━━━━━━━━━━━━━━━━━━━
|
|
194
|
+
|
|
195
|
+
Gates: All passed ✓
|
|
196
|
+
Criteria: All met ✓
|
|
197
|
+
Commit: [commit hash]
|
|
198
|
+
|
|
199
|
+
Artifacts:
|
|
200
|
+
- .beads/artifacts/<bead-id>/spec.md
|
|
201
|
+
- .beads/artifacts/<bead-id>/research.md
|
|
202
|
+
- .beads/artifacts/<bead-id>/plan.md
|
|
203
|
+
- .beads/artifacts/<bead-id>/review.md
|
|
204
|
+
|
|
205
|
+
Branch: <bead-id>
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
**If issue count >200:**
|
|
209
|
+
|
|
210
|
+
```
|
|
211
|
+
⚠️ Database has [count] issues. Consider running:
|
|
212
|
+
bd cleanup --older-than 7d && bd sync
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
**Session recommendation:**
|
|
216
|
+
|
|
217
|
+
```
|
|
218
|
+
━━━━━━━━━━━━━━━━━━━━━
|
|
219
|
+
Task complete. For best performance:
|
|
220
|
+
→ Start a fresh agent session for next task
|
|
221
|
+
→ Previous work available via read_session("last")
|
|
222
|
+
|
|
223
|
+
Next: Create PR or merge to main
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
**If work was interrupted or partially complete:**
|
|
227
|
+
|
|
228
|
+
```
|
|
229
|
+
⚠️ Work incomplete? Create handoff:
|
|
230
|
+
/handoff <bead-id> "Resume: [what's left]"
|
|
231
|
+
|
|
232
|
+
Next session: /resume <bead-id>
|
|
233
|
+
```
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Analyze Github Actions logs and fix issues
|
|
3
|
+
argument-hint: "[github-actions-url]"
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
## Github Actions URL
|
|
7
|
+
|
|
8
|
+
<url>$ARGUMENTS</url>
|
|
9
|
+
|
|
10
|
+
## Workflow
|
|
11
|
+
|
|
12
|
+
- Use `build` agent to read the GitHub Actions logs, analyze and find the root causes of the issues.
|
|
13
|
+
- For complex CI/CD problems (≥3 phases), delegate to `planner` agent to create a detailed implementation plan.
|
|
14
|
+
- Use `build` agent to implement the fixes step by step.
|
|
15
|
+
- Use `review` agent to run tests, ensure quality and security, then report back.
|
|
16
|
+
- If there are issues or failed tests, `build` agent will fix them and repeat the process until all tests pass.
|
|
17
|
+
|
|
18
|
+
## Notes
|
|
19
|
+
|
|
20
|
+
- If `gh` command is not available, instruct the user to install and authorize GitHub CLI first.
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Analyze and fix UI issues
|
|
3
|
+
argument-hint: "[issue]"
|
|
4
|
+
agent: build
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Fix UI: $ARGUMENTS
|
|
8
|
+
|
|
9
|
+
use_skill("frontend-aesthetics")
|
|
10
|
+
|
|
11
|
+
1. **Analyze:**
|
|
12
|
+
- If screenshots/videos provided, describe issue in detail
|
|
13
|
+
- For large UI analysis, use Gemini CLI: `gemini` then `@[image] Analyze issue`
|
|
14
|
+
2. **Research:** Check design guidelines, component patterns
|
|
15
|
+
- Apply `frontend-aesthetics` criteria (typography, color, motion, backgrounds)
|
|
16
|
+
3. **Fix:** Implement step by step
|
|
17
|
+
- Avoid generic AI aesthetics (Inter font, purple gradients, flat backgrounds)
|
|
18
|
+
- Use distinctive typography, cohesive themes, meaningful motion
|
|
19
|
+
4. **Verify:** Screenshot/test the fix
|
|
20
|
+
5. **Review:** Run tests, ensure quality
|
|
21
|
+
|
|
22
|
+
If bead exists, update `.beads/artifacts/<bead-id>/review.md` and run `/finish`.
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Debug and fix issues
|
|
3
|
+
argument-hint: "[issue]"
|
|
4
|
+
agent: build
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Fix: $ARGUMENTS
|
|
8
|
+
|
|
9
|
+
**Simple (1-3 lines, obvious cause):** Fix directly, commit.
|
|
10
|
+
|
|
11
|
+
**Complex (unclear cause, multiple files):**
|
|
12
|
+
|
|
13
|
+
use_skill("systematic-debugging")
|
|
14
|
+
|
|
15
|
+
Follow four phases:
|
|
16
|
+
|
|
17
|
+
1. Root cause investigation (NO fixes yet)
|
|
18
|
+
2. Pattern analysis
|
|
19
|
+
3. Hypothesis testing
|
|
20
|
+
4. Implementation with TDD
|
|
21
|
+
|
|
22
|
+
If bead exists, work within `.beads/artifacts/<bead-id>/spec.md` constraints.
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Create handoff for next session - save state with repo provenance
|
|
3
|
+
argument-hint: "<bead-id> [instructions]"
|
|
4
|
+
agent: build
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Handoff
|
|
8
|
+
|
|
9
|
+
## Phase 1: Gather State
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
# Bead info
|
|
13
|
+
bd show $ARGUMENTS --json
|
|
14
|
+
|
|
15
|
+
# Git state
|
|
16
|
+
git remote get-url origin 2>/dev/null
|
|
17
|
+
git branch --show-current
|
|
18
|
+
git rev-parse HEAD
|
|
19
|
+
git status --porcelain
|
|
20
|
+
|
|
21
|
+
# Uncommitted changes
|
|
22
|
+
git diff --stat
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Phase 2: Commit WIP (if needed)
|
|
26
|
+
|
|
27
|
+
If uncommitted changes exist:
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
git add -A
|
|
31
|
+
git commit -m "WIP: <bead-id> - [current step]"
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## Phase 3: Create Handoff
|
|
35
|
+
|
|
36
|
+
Write `.beads/artifacts/<bead-id>/handoffs/<timestamp>.md`:
|
|
37
|
+
|
|
38
|
+
```markdown
|
|
39
|
+
# Handoff: <bead-id>
|
|
40
|
+
|
|
41
|
+
**Created:** <ISO timestamp>
|
|
42
|
+
**Agent:** build
|
|
43
|
+
|
|
44
|
+
## Provenance
|
|
45
|
+
|
|
46
|
+
| Key | Value |
|
|
47
|
+
| ------ | ---------------- |
|
|
48
|
+
| Repo | [git remote URL] |
|
|
49
|
+
| Branch | [branch name] |
|
|
50
|
+
| Commit | [commit hash] |
|
|
51
|
+
| Clean | [yes/no] |
|
|
52
|
+
|
|
53
|
+
## Session Context
|
|
54
|
+
|
|
55
|
+
**Current Session:** [session ID from OpenCode]
|
|
56
|
+
**Token Usage:** [if available]
|
|
57
|
+
|
|
58
|
+
Next session can load context with:
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
read_session("last", project="current")
|
|
62
|
+
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
## Bead State
|
|
66
|
+
|
|
67
|
+
| Key | Value |
|
|
68
|
+
| -------- | ---------- |
|
|
69
|
+
| ID | <bead-id> |
|
|
70
|
+
| Title | [title] |
|
|
71
|
+
| Status | [status] |
|
|
72
|
+
| Priority | [priority] |
|
|
73
|
+
|
|
74
|
+
## Progress
|
|
75
|
+
|
|
76
|
+
### Completed
|
|
77
|
+
|
|
78
|
+
- [x] [Step/task completed]
|
|
79
|
+
- [x] [Step/task completed]
|
|
80
|
+
|
|
81
|
+
### In Progress
|
|
82
|
+
|
|
83
|
+
- [ ] [Current step] - [where stopped]
|
|
84
|
+
|
|
85
|
+
### Remaining
|
|
86
|
+
|
|
87
|
+
- [ ] [Step not started]
|
|
88
|
+
- [ ] [Step not started]
|
|
89
|
+
|
|
90
|
+
## Context
|
|
91
|
+
|
|
92
|
+
### Key Files
|
|
93
|
+
|
|
94
|
+
- `src/foo.ts:42` - [why relevant]
|
|
95
|
+
- `src/bar.ts` - [why relevant]
|
|
96
|
+
|
|
97
|
+
### Decisions Made
|
|
98
|
+
|
|
99
|
+
- [Decision 1] - [reason]
|
|
100
|
+
- [Decision 2] - [reason]
|
|
101
|
+
|
|
102
|
+
### Blockers/Issues
|
|
103
|
+
|
|
104
|
+
- [Issue 1] - [status]
|
|
105
|
+
|
|
106
|
+
## Resume Instructions
|
|
107
|
+
|
|
108
|
+
[Specific instructions for next session]
|
|
109
|
+
|
|
110
|
+
1. [First thing to do]
|
|
111
|
+
2. [Second thing to do]
|
|
112
|
+
|
|
113
|
+
**Recommended:** Start next session with `/resume <bead-id>` to auto-load this handoff + previous session context.
|
|
114
|
+
|
|
115
|
+
## Artifacts
|
|
116
|
+
|
|
117
|
+
- spec.md: [exists/missing]
|
|
118
|
+
- research.md: [exists/missing]
|
|
119
|
+
- plan.md: [exists/missing]
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
## Phase 4: Update Bead
|
|
123
|
+
|
|
124
|
+
```bash
|
|
125
|
+
bd edit <bead-id> --note "Handoff created. Resume with /resume <bead-id>"
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
## Output
|
|
129
|
+
|
|
130
|
+
```
|
|
131
|
+
Handoff Created: <bead-id>
|
|
132
|
+
━━━━━━━━━━━━━━━━━━━━━━━━
|
|
133
|
+
|
|
134
|
+
Commit: [hash]
|
|
135
|
+
Branch: [branch]
|
|
136
|
+
|
|
137
|
+
Saved: .beads/artifacts/<bead-id>/handoffs/<timestamp>.md
|
|
138
|
+
|
|
139
|
+
Resume: /resume <bead-id>
|
|
140
|
+
|
|
141
|
+
Next session will auto-load:
|
|
142
|
+
- This handoff
|
|
143
|
+
- Previous session context (read_session)
|
|
144
|
+
- Git state
|
|
145
|
+
- Bead artifacts
|
|
146
|
+
```
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Implement a bead - setup workspace, execute changes, verify
|
|
3
|
+
argument-hint: "<bead-id>"
|
|
4
|
+
agent: build
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Implement
|
|
8
|
+
|
|
9
|
+
## Phase 1: Setup Workspace
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
bd show $ARGUMENTS --json
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Check git state:
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
git status --porcelain
|
|
19
|
+
git branch --show-current
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
If uncommitted changes exist, ask: "Stash, commit, or continue?"
|
|
23
|
+
|
|
24
|
+
Create branch if not on bead branch:
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
git checkout -b <bead-id>
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Phase 2: Load Context
|
|
31
|
+
|
|
32
|
+
**Check for previous session work:**
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
list_sessions(project="current", limit=3)
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
If recent session exists:
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
read_session("last", project="current")
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Review what was already attempted/completed.
|
|
45
|
+
|
|
46
|
+
Check what artifacts exist:
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
ls .beads/artifacts/<bead-id>/ 2>/dev/null || echo "No artifacts yet"
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
**If `plan.md` exists:** Follow the plan step-by-step (Phase 4).
|
|
53
|
+
|
|
54
|
+
**If `research.md` exists but no plan:** Ask user "Create plan first? Or implement directly?"
|
|
55
|
+
|
|
56
|
+
**If only `spec.md` exists (Quick Mode):** Read spec and implement directly based on requirements. No plan needed for simple tasks.
|
|
57
|
+
|
|
58
|
+
**If no artifacts:** Read bead description and implement based on that.
|
|
59
|
+
|
|
60
|
+
Check for handoffs:
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
ls .beads/artifacts/<bead-id>/handoffs/ 2>/dev/null
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
If handoff exists, load latest and continue from checkpoint.
|
|
67
|
+
|
|
68
|
+
## Phase 3: Detect Project Type
|
|
69
|
+
|
|
70
|
+
Check which project files exist:
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
ls package.json Cargo.toml pyproject.toml setup.py Makefile go.mod 2>/dev/null || true
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
**Node.js/TypeScript** (`package.json`): `npm test`, `npm run lint`, `npm run type-check`
|
|
77
|
+
|
|
78
|
+
**Rust** (`Cargo.toml`): `cargo test`, `cargo clippy -- -D warnings`
|
|
79
|
+
|
|
80
|
+
**Python** (`pyproject.toml` or `setup.py`): `pytest`, `ruff check .`, `mypy .`
|
|
81
|
+
|
|
82
|
+
**Go** (`go.mod`): `go test ./...`, `golangci-lint run`
|
|
83
|
+
|
|
84
|
+
**Make-based** (`Makefile`): `make test`, `make lint`
|
|
85
|
+
|
|
86
|
+
**No recognized files:** Skip automated verification.
|
|
87
|
+
|
|
88
|
+
Report:
|
|
89
|
+
|
|
90
|
+
```
|
|
91
|
+
Implementing: <bead-id>
|
|
92
|
+
━━━━━━━━━━━━━━━━━━━━━━
|
|
93
|
+
Project: [detected type]
|
|
94
|
+
Mode: [Quick/Planned]
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
## Phase 4: Implementation
|
|
98
|
+
|
|
99
|
+
### With Plan (Planned Mode)
|
|
100
|
+
|
|
101
|
+
For each unchecked step in plan.md:
|
|
102
|
+
|
|
103
|
+
1. Make changes to listed files
|
|
104
|
+
2. Run verification (test/lint/type-check)
|
|
105
|
+
3. Mark step complete: `- [x]`
|
|
106
|
+
4. Commit if significant
|
|
107
|
+
|
|
108
|
+
### Without Plan (Quick Mode)
|
|
109
|
+
|
|
110
|
+
1. Read spec requirements
|
|
111
|
+
2. Identify files to change
|
|
112
|
+
3. Make minimal, focused changes
|
|
113
|
+
4. Run verification after each logical change
|
|
114
|
+
5. Keep changes atomic and reviewable
|
|
115
|
+
|
|
116
|
+
**Gate rules:**
|
|
117
|
+
|
|
118
|
+
- Type check fails → Fix before proceeding
|
|
119
|
+
- Tests fail → Fix before proceeding
|
|
120
|
+
- Lint fails → Fix if auto-fixable, else note
|
|
121
|
+
|
|
122
|
+
## Phase 5: Progress Report
|
|
123
|
+
|
|
124
|
+
After each change:
|
|
125
|
+
|
|
126
|
+
```
|
|
127
|
+
Progress: <bead-id>
|
|
128
|
+
━━━━━━━━━━━━━━━━━━
|
|
129
|
+
|
|
130
|
+
Changes:
|
|
131
|
+
- src/foo.ts:15 - [what changed]
|
|
132
|
+
|
|
133
|
+
Verification: Test ✓ | Lint ✓ | Types ✓
|
|
134
|
+
|
|
135
|
+
Continue? (yes/pause/stop)
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
If "pause" or "stop": Run `/handoff <bead-id>`.
|
|
139
|
+
|
|
140
|
+
## Phase 6: Complete
|
|
141
|
+
|
|
142
|
+
When done:
|
|
143
|
+
|
|
144
|
+
```
|
|
145
|
+
Implementation Complete: <bead-id>
|
|
146
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
147
|
+
|
|
148
|
+
Final verification running...
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
Run full verification suite.
|
|
152
|
+
|
|
153
|
+
If all pass:
|
|
154
|
+
|
|
155
|
+
```
|
|
156
|
+
All gates passed ✓
|
|
157
|
+
|
|
158
|
+
Next: /finish <bead-id>
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
If any fail:
|
|
162
|
+
|
|
163
|
+
```
|
|
164
|
+
Gate failed: [which one]
|
|
165
|
+
|
|
166
|
+
Fix issues before running /finish.
|
|
167
|
+
```
|