opencodekit 0.20.4 → 0.20.6
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/dist/index.js +1 -1
- package/dist/template/.opencode/AGENTS.md +71 -9
- package/dist/template/.opencode/agent/build.md +82 -32
- package/dist/template/.opencode/agent/plan.md +22 -14
- package/dist/template/.opencode/agent/review.md +18 -40
- package/dist/template/.opencode/agent/scout.md +17 -0
- package/dist/template/.opencode/command/compound.md +24 -2
- package/dist/template/.opencode/command/create.md +65 -69
- package/dist/template/.opencode/command/explore.md +170 -0
- package/dist/template/.opencode/command/health.md +124 -2
- package/dist/template/.opencode/command/iterate.md +200 -0
- package/dist/template/.opencode/command/plan.md +74 -14
- package/dist/template/.opencode/command/pr.md +4 -16
- package/dist/template/.opencode/command/research.md +7 -16
- package/dist/template/.opencode/command/resume.md +2 -11
- package/dist/template/.opencode/command/review-codebase.md +9 -15
- package/dist/template/.opencode/command/ship.md +12 -53
- package/dist/template/.opencode/memory/_templates/prd.md +16 -5
- package/dist/template/.opencode/memory/project/user.md +7 -0
- package/dist/template/.opencode/memory.db +0 -0
- package/dist/template/.opencode/memory.db-shm +0 -0
- package/dist/template/.opencode/memory.db-wal +0 -0
- package/dist/template/.opencode/opencode.json +54 -67
- package/dist/template/.opencode/package.json +1 -1
- package/dist/template/.opencode/skill/memory-grounding/SKILL.md +68 -0
- package/dist/template/.opencode/skill/reconcile/SKILL.md +183 -0
- package/dist/template/.opencode/skill/verification-before-completion/SKILL.md +75 -0
- package/dist/template/.opencode/skill/verification-gates/SKILL.md +63 -0
- package/dist/template/.opencode/skill/workspace-setup/SKILL.md +76 -0
- package/package.json +1 -1
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Refine PRD mid-implementation when scope changes, discoveries emerge, or requirements pivot
|
|
3
|
+
argument-hint: "<bead-id> [--scope expand|reduce|pivot] [--reason <text>]"
|
|
4
|
+
agent: build
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Iterate: $ARGUMENTS
|
|
8
|
+
|
|
9
|
+
Refine a bead's PRD during active implementation. Two-phase process: define what changed, then update spec artifacts and re-derive affected tasks.
|
|
10
|
+
|
|
11
|
+
> **When to use:** Mid-`/ship` when you discover scope changed, requirements shifted, or a technical discovery invalidates the original plan.
|
|
12
|
+
>
|
|
13
|
+
> **NOT for:** Pre-implementation changes (use `/create` to rewrite the PRD) or post-implementation retrospectives (use `/compound`).
|
|
14
|
+
|
|
15
|
+
## Load Skills
|
|
16
|
+
|
|
17
|
+
```typescript
|
|
18
|
+
skill({ name: "beads" });
|
|
19
|
+
skill({ name: "memory-grounding" });
|
|
20
|
+
skill({ name: "prd" });
|
|
21
|
+
skill({ name: "prd-task" });
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Parse Arguments
|
|
25
|
+
|
|
26
|
+
| Argument | Default | Description |
|
|
27
|
+
| ----------- | ------------- | ---------------------------------- |
|
|
28
|
+
| `<bead-id>` | required | The bead being iterated |
|
|
29
|
+
| `--scope` | auto-detected | Change type: expand, reduce, pivot |
|
|
30
|
+
| `--reason` | prompted | Why the change is needed |
|
|
31
|
+
|
|
32
|
+
## Before You Iterate
|
|
33
|
+
|
|
34
|
+
- **Be certain**: Only iterate if continuing with the current spec would produce wrong output
|
|
35
|
+
- **Don't over-iterate**: Minor adjustments don't need a full iterate cycle — just fix inline during `/ship`
|
|
36
|
+
- **Preserve progress**: Completed tasks stay completed unless explicitly invalidated
|
|
37
|
+
- **Document the delta**: Every change must be traceable to a reason
|
|
38
|
+
|
|
39
|
+
## Phase 1: Guards
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
br show $ARGUMENTS
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
Read `.beads/artifacts/$ARGUMENTS/` to check what artifacts exist.
|
|
46
|
+
|
|
47
|
+
Verify:
|
|
48
|
+
|
|
49
|
+
- Bead is `in_progress`
|
|
50
|
+
- `prd.md` exists
|
|
51
|
+
- Implementation is partially complete (at least 1 task done or in-progress)
|
|
52
|
+
|
|
53
|
+
If no tasks are started yet, redirect: "Use `/create --spec-only` to rewrite the PRD instead."
|
|
54
|
+
|
|
55
|
+
## Phase 2: Assess Change Type
|
|
56
|
+
|
|
57
|
+
If `--scope` was not provided, determine the change type:
|
|
58
|
+
|
|
59
|
+
| Type | Signal | Example |
|
|
60
|
+
| ---------- | ------------------------------------------------------- | ----------------------------------------- |
|
|
61
|
+
| **expand** | New requirement discovered, additional files needed | "We also need to handle edge case X" |
|
|
62
|
+
| **reduce** | Feature is over-scoped, some tasks are unnecessary | "We don't need the admin panel after all" |
|
|
63
|
+
| **pivot** | Fundamental approach changed, different solution needed | "REST won't work, switching to WebSocket" |
|
|
64
|
+
|
|
65
|
+
Ask user to confirm:
|
|
66
|
+
|
|
67
|
+
```typescript
|
|
68
|
+
question({
|
|
69
|
+
questions: [
|
|
70
|
+
{
|
|
71
|
+
header: "Change Type",
|
|
72
|
+
question: "What kind of spec change is this?",
|
|
73
|
+
options: [
|
|
74
|
+
{ label: "Expand", description: "Adding scope — new requirements or files" },
|
|
75
|
+
{ label: "Reduce", description: "Removing scope — dropping unnecessary work" },
|
|
76
|
+
{ label: "Pivot", description: "Changing approach — different solution path" },
|
|
77
|
+
],
|
|
78
|
+
},
|
|
79
|
+
],
|
|
80
|
+
});
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
## Phase 3: Define the Delta
|
|
84
|
+
|
|
85
|
+
### Step 1: Capture the change reason
|
|
86
|
+
|
|
87
|
+
If `--reason` was not provided, ask:
|
|
88
|
+
|
|
89
|
+
```typescript
|
|
90
|
+
question({
|
|
91
|
+
questions: [
|
|
92
|
+
{
|
|
93
|
+
header: "Reason",
|
|
94
|
+
question: "What triggered this change? (Be specific — this goes into the PRD changelog)",
|
|
95
|
+
options: [],
|
|
96
|
+
},
|
|
97
|
+
],
|
|
98
|
+
});
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
### Step 2: Identify affected artifacts
|
|
102
|
+
|
|
103
|
+
Read the current PRD and list:
|
|
104
|
+
|
|
105
|
+
- **Tasks completed:** (preserve these unless pivot invalidates them)
|
|
106
|
+
- **Tasks in-progress:** (may need modification)
|
|
107
|
+
- **Tasks not started:** (may need modification, removal, or replacement)
|
|
108
|
+
- **New tasks needed:** (for expand/pivot)
|
|
109
|
+
|
|
110
|
+
### Step 3: Document the delta
|
|
111
|
+
|
|
112
|
+
Write a change record to `.beads/artifacts/$ARGUMENTS/iterations.md`:
|
|
113
|
+
|
|
114
|
+
```markdown
|
|
115
|
+
## Iteration [N] — [date]
|
|
116
|
+
|
|
117
|
+
**Type:** [expand | reduce | pivot]
|
|
118
|
+
**Reason:** [user-provided reason]
|
|
119
|
+
**Triggered by:** [discovery | user request | technical constraint | external dependency]
|
|
120
|
+
|
|
121
|
+
### Impact Assessment
|
|
122
|
+
|
|
123
|
+
| Area | Before | After | Action |
|
|
124
|
+
| ----- | ----------------------- | ------------------------- | ------------------------------ |
|
|
125
|
+
| Scope | [original scope] | [new scope] | [expanded/reduced/pivoted] |
|
|
126
|
+
| Tasks | [N] total, [M] complete | [N'] total, [M] preserved | [added/removed/modified count] |
|
|
127
|
+
| Files | [original file list] | [updated file list] | [new/removed files] |
|
|
128
|
+
|
|
129
|
+
### Task Changes
|
|
130
|
+
|
|
131
|
+
- **Preserved:** [list of completed task titles — unchanged]
|
|
132
|
+
- **Modified:** [list of tasks with what changed]
|
|
133
|
+
- **Removed:** [list of tasks marked obsolete, with reason]
|
|
134
|
+
- **Added:** [list of new tasks]
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
## Phase 4: Apply Changes
|
|
138
|
+
|
|
139
|
+
### For Expand:
|
|
140
|
+
|
|
141
|
+
1. Add new sections/requirements to `prd.md`
|
|
142
|
+
2. Add new tasks at the end of the Tasks section
|
|
143
|
+
3. Mark new tasks with `depends_on` referencing completed tasks if needed
|
|
144
|
+
4. Re-run `prd-task` skill to regenerate `prd.json` with merged task state
|
|
145
|
+
|
|
146
|
+
### For Reduce:
|
|
147
|
+
|
|
148
|
+
1. Move removed scope items to "Out-of-Scope" in `prd.md` with note: `[Removed in Iteration N: reason]`
|
|
149
|
+
2. Mark affected tasks by changing their heading from `### Task Title [category]` to `### ~~Task Title~~ [OBSOLETE — Iteration N]` in `prd.md` (don't delete — preserve history). The `prd-task` skill skips headings containing `OBSOLETE` or `INVALIDATED` markers.
|
|
150
|
+
3. Re-run `prd-task` to regenerate `prd.json` (obsolete tasks excluded)
|
|
151
|
+
|
|
152
|
+
### For Pivot:
|
|
153
|
+
|
|
154
|
+
1. Archive current PRD section as `## Original Approach (Superseded)` at bottom of file
|
|
155
|
+
2. Rewrite affected sections (Proposed Solution, Requirements, Tasks)
|
|
156
|
+
3. Preserve completed tasks that are still valid
|
|
157
|
+
4. Mark invalidated completed tasks by changing their heading to `### ~~Task Title~~ [INVALIDATED — Iteration N: reason]`
|
|
158
|
+
5. Re-run `prd-task` to regenerate `prd.json`
|
|
159
|
+
|
|
160
|
+
### Update plan.md (if exists):
|
|
161
|
+
|
|
162
|
+
If `.beads/artifacts/$ARGUMENTS/plan.md` exists:
|
|
163
|
+
|
|
164
|
+
1. Add an "## Iteration [N] Changes" section to the plan
|
|
165
|
+
2. Update dependency graph if tasks changed
|
|
166
|
+
3. Re-compute waves for remaining tasks
|
|
167
|
+
|
|
168
|
+
## Phase 5: Validate
|
|
169
|
+
|
|
170
|
+
After applying changes:
|
|
171
|
+
|
|
172
|
+
- [ ] PRD has no `[NEEDS CLARIFICATION]` markers (resolve or add to Open Questions)
|
|
173
|
+
- [ ] All preserved completed tasks are still valid
|
|
174
|
+
- [ ] New/modified tasks have verification steps
|
|
175
|
+
- [ ] `iterations.md` documents the full delta
|
|
176
|
+
- [ ] `prd.json` reflects the updated task state
|
|
177
|
+
|
|
178
|
+
## Phase 6: Report
|
|
179
|
+
|
|
180
|
+
```bash
|
|
181
|
+
br comments add $ARGUMENTS "Iteration [N]: [type] — [reason summary]. Tasks: [added/removed/modified] count"
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
Output:
|
|
185
|
+
|
|
186
|
+
1. **Change type:** [expand | reduce | pivot]
|
|
187
|
+
2. **Reason:** [brief summary]
|
|
188
|
+
3. **Task changes:** [N] preserved, [M] modified, [K] removed, [J] added
|
|
189
|
+
4. **Files affected:** [updated list]
|
|
190
|
+
5. **Iteration log:** `.beads/artifacts/$ARGUMENTS/iterations.md`
|
|
191
|
+
6. **Next step:** Continue `/ship $ARGUMENTS` with updated spec
|
|
192
|
+
|
|
193
|
+
## Related Commands
|
|
194
|
+
|
|
195
|
+
| Need | Command |
|
|
196
|
+
| -------------------------- | ------------------ |
|
|
197
|
+
| Create initial spec | `/create` |
|
|
198
|
+
| Continue shipping | `/ship <id>` |
|
|
199
|
+
| Review after changes | `/review-codebase` |
|
|
200
|
+
| Post-implementation review | `/compound <id>` |
|
|
@@ -18,6 +18,7 @@ Create a detailed implementation plan with TDD steps. Optional deep-planning bet
|
|
|
18
18
|
|
|
19
19
|
```typescript
|
|
20
20
|
skill({ name: "beads" });
|
|
21
|
+
skill({ name: "memory-grounding" });
|
|
21
22
|
skill({ name: "writing-plans" }); // TDD plan format
|
|
22
23
|
```
|
|
23
24
|
|
|
@@ -44,12 +45,7 @@ Before touching the PRD or planning anything, load what the codebase already kno
|
|
|
44
45
|
|
|
45
46
|
### Step 1: Search institutional memory
|
|
46
47
|
|
|
47
|
-
|
|
48
|
-
// Search for past decisions, patterns, gotchas related to this work
|
|
49
|
-
memory_search({ query: "<bead-title or feature keywords>", limit: 5 });
|
|
50
|
-
memory_search({ query: "<key technical concept from bead>", type: "bugfix", limit: 3 });
|
|
51
|
-
memory_read({ file: "handoffs/last" }); // Check last session context
|
|
52
|
-
```
|
|
48
|
+
Follow the [memory-grounding](../skill/memory-grounding/SKILL.md) skill protocol. Focus on: bugfixes, existing plans (ask user before overwriting).
|
|
53
49
|
|
|
54
50
|
If relevant observations found: incorporate them directly into the plan. Don't re-solve solved problems.
|
|
55
51
|
|
|
@@ -132,7 +128,10 @@ question({
|
|
|
132
128
|
header: "Discovery Level",
|
|
133
129
|
question: "Suggested discovery level based on PRD complexity. Proceed?",
|
|
134
130
|
options: [
|
|
135
|
-
{
|
|
131
|
+
{
|
|
132
|
+
label: "Deep (Recommended for complex work)",
|
|
133
|
+
description: "Level 2-3: spawn scout + explore agents",
|
|
134
|
+
},
|
|
136
135
|
{ label: "Standard", description: "Level 1: quick doc lookup" },
|
|
137
136
|
{ label: "Skip research", description: "Level 0: I know the codebase" },
|
|
138
137
|
],
|
|
@@ -318,7 +317,68 @@ Wave 3: C
|
|
|
318
317
|
- **Each step is 2-5 minutes** — one action per step
|
|
319
318
|
- **Tasks map to PRD tasks**
|
|
320
319
|
|
|
321
|
-
## Phase 8:
|
|
320
|
+
## Phase 8: Constitutional Compliance Gate
|
|
321
|
+
|
|
322
|
+
Before executing, scan the plan against AGENTS.md hard constraints. This catches violations before they become implementation bugs.
|
|
323
|
+
|
|
324
|
+
### Automated Checks
|
|
325
|
+
|
|
326
|
+
Scan `plan.md` content for these patterns:
|
|
327
|
+
|
|
328
|
+
| Violation Pattern | AGENTS.md Rule | Severity |
|
|
329
|
+
| ------------------------------------------------- | ------------------------------------------- | ------------ |
|
|
330
|
+
| `git add .` or `git add -A` | Multi-Agent Safety: stage specific files | **CRITICAL** |
|
|
331
|
+
| `--force` push or `force push` | Git Safety: never force push main | **CRITICAL** |
|
|
332
|
+
| `--no-verify` | Git Safety: never bypass hooks | **CRITICAL** |
|
|
333
|
+
| `as any` or `@ts-ignore` without justification | Quality Bar: strong typing | **WARNING** |
|
|
334
|
+
| New package/dependency without approval step | Guardrails: no new deps without approval | **WARNING** |
|
|
335
|
+
| Task modifying >3 files without plan confirmation | Guardrails: no surprise edits | **WARNING** |
|
|
336
|
+
| `reset --hard` or `checkout .` or `clean -fd` | Git Restore: never without explicit request | **CRITICAL** |
|
|
337
|
+
| Secret/credential patterns | Security: never expose credentials | **CRITICAL** |
|
|
338
|
+
|
|
339
|
+
### Check Process
|
|
340
|
+
|
|
341
|
+
```bash
|
|
342
|
+
# Scan plan for violation patterns (fixed-string mode to avoid regex false positives)
|
|
343
|
+
grep -inF "git add ." .beads/artifacts/$ARGUMENTS/plan.md
|
|
344
|
+
grep -inF "git add -A" .beads/artifacts/$ARGUMENTS/plan.md
|
|
345
|
+
grep -inF -- "--no-verify" .beads/artifacts/$ARGUMENTS/plan.md
|
|
346
|
+
grep -inF "force push" .beads/artifacts/$ARGUMENTS/plan.md
|
|
347
|
+
grep -inF -- "--force" .beads/artifacts/$ARGUMENTS/plan.md
|
|
348
|
+
grep -inF "reset --hard" .beads/artifacts/$ARGUMENTS/plan.md
|
|
349
|
+
grep -inF "checkout ." .beads/artifacts/$ARGUMENTS/plan.md
|
|
350
|
+
grep -inF "clean -fd" .beads/artifacts/$ARGUMENTS/plan.md
|
|
351
|
+
```
|
|
352
|
+
|
|
353
|
+
Also check:
|
|
354
|
+
|
|
355
|
+
- Count files per task: if any task lists >3 files in its `files:` metadata, flag as WARNING
|
|
356
|
+
- Check for `as any` or `@ts-ignore` usage that lacks a documented reason
|
|
357
|
+
- Check if any task adds new dependencies (look for `npm install`, `pnpm add`, `yarn add`, `pip install`, `cargo add`)
|
|
358
|
+
|
|
359
|
+
### Violation Response
|
|
360
|
+
|
|
361
|
+
| Severity | Action |
|
|
362
|
+
| ------------ | ------------------------------------------------------------------ |
|
|
363
|
+
| **CRITICAL** | Stop. Remove violation from plan. Report to user. |
|
|
364
|
+
| **WARNING** | Flag in plan output. Add confirmation checkpoint to affected task. |
|
|
365
|
+
|
|
366
|
+
If no violations found, report: `Constitutional compliance: ✓ PASS`
|
|
367
|
+
|
|
368
|
+
If violations found:
|
|
369
|
+
|
|
370
|
+
```markdown
|
|
371
|
+
## ⚠️ Constitutional Compliance Check
|
|
372
|
+
|
|
373
|
+
| # | Pattern Found | Location | Severity | Action |
|
|
374
|
+
| --- | -------------------- | -------------- | -------- | ----------------------------------- |
|
|
375
|
+
| 1 | `git add .` | Task 3, step 2 | CRITICAL | Removed — use specific file staging |
|
|
376
|
+
| 2 | New dependency `zod` | Task 1 | WARNING | Added approval checkpoint |
|
|
377
|
+
|
|
378
|
+
Violations resolved. Plan is compliant.
|
|
379
|
+
```
|
|
380
|
+
|
|
381
|
+
## Phase 9: Create Child Beads (if --create-beads or L size)
|
|
322
382
|
|
|
323
383
|
For large work, create child beads for each plan phase:
|
|
324
384
|
|
|
@@ -327,7 +387,7 @@ CHILD=$(br create "[Phase title]" --type task --json | jq -r '.id')
|
|
|
327
387
|
br dep add $CHILD $ARGUMENTS
|
|
328
388
|
```
|
|
329
389
|
|
|
330
|
-
## Phase
|
|
390
|
+
## Phase 10: Report
|
|
331
391
|
|
|
332
392
|
Output:
|
|
333
393
|
|
|
@@ -347,8 +407,8 @@ br comments add $ARGUMENTS "Created plan.md: Level [N] discovery, [X] waves, [Y]
|
|
|
347
407
|
|
|
348
408
|
## Related Commands
|
|
349
409
|
|
|
350
|
-
| Need | Command
|
|
351
|
-
| -------------- |
|
|
352
|
-
| Create spec | `/create`
|
|
353
|
-
| Execute plan | `/ship <id>`
|
|
354
|
-
| Research first | `/research`
|
|
410
|
+
| Need | Command |
|
|
411
|
+
| -------------- | ------------ |
|
|
412
|
+
| Create spec | `/create` |
|
|
413
|
+
| Execute plan | `/ship <id>` |
|
|
414
|
+
| Research first | `/research` |
|
|
@@ -10,6 +10,8 @@ agent: build
|
|
|
10
10
|
|
|
11
11
|
```typescript
|
|
12
12
|
skill({ name: "beads" });
|
|
13
|
+
skill({ name: "memory-grounding" });
|
|
14
|
+
skill({ name: "verification-gates" });
|
|
13
15
|
skill({ name: "verification-before-completion" });
|
|
14
16
|
```
|
|
15
17
|
|
|
@@ -28,14 +30,7 @@ git status --porcelain
|
|
|
28
30
|
|
|
29
31
|
If uncommitted changes exist, ask whether to commit first.
|
|
30
32
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
| Project Type | Detect Via | Build | Test | Lint | Typecheck |
|
|
34
|
-
| --------------- | ----------------------------- | ---------------- | --------------- | ----------------------------- | ------------------------------------- |
|
|
35
|
-
| Node/TypeScript | `package.json` | `npm run build` | `npm test` | `npm run lint` | `npm run typecheck` or `tsc --noEmit` |
|
|
36
|
-
| Rust | `Cargo.toml` | `cargo build` | `cargo test` | `cargo clippy -- -D warnings` | (included in build) |
|
|
37
|
-
| Python | `pyproject.toml` / `setup.py` | — | `pytest` | `ruff check .` | `mypy .` |
|
|
38
|
-
| Go | `go.mod` | `go build ./...` | `go test ./...` | `golangci-lint run` | (included in build) |
|
|
33
|
+
Follow the [verification-gates](../skill/verification-gates/SKILL.md) skill protocol. All gates must pass before creating the PR.
|
|
39
34
|
|
|
40
35
|
Check `package.json` scripts, `Makefile`, or `justfile` for project-specific commands first — prefer those over generic defaults.
|
|
41
36
|
|
|
@@ -45,14 +40,7 @@ If any gate fails, stop. Fix errors first, then run `/pr` again.
|
|
|
45
40
|
|
|
46
41
|
### Memory Grounding
|
|
47
42
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
```typescript
|
|
51
|
-
memory-search({ query: "$ARGUMENTS" });
|
|
52
|
-
memory-search({ query: "<branch or feature keywords>", limit: 5 });
|
|
53
|
-
```
|
|
54
|
-
|
|
55
|
-
Include relevant findings in the PR description (e.g., architectural decisions, known limitations).
|
|
43
|
+
Follow the [memory-grounding](../skill/memory-grounding/SKILL.md) skill protocol. Include relevant findings in the PR description.
|
|
56
44
|
|
|
57
45
|
### Git Context
|
|
58
46
|
|
|
@@ -14,6 +14,7 @@ Gather information before implementation. Find answers, document findings, stop
|
|
|
14
14
|
|
|
15
15
|
```typescript
|
|
16
16
|
skill({ name: "beads" });
|
|
17
|
+
skill({ name: "memory-grounding" });
|
|
17
18
|
// For --thorough mode:
|
|
18
19
|
skill({ name: "deep-research" });
|
|
19
20
|
```
|
|
@@ -66,17 +67,7 @@ Read PRD if it exists and extract questions that need answering.
|
|
|
66
67
|
|
|
67
68
|
### Memory Search (Required)
|
|
68
69
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
```typescript
|
|
72
|
-
memory-search({ query: "$ARGUMENTS" });
|
|
73
|
-
memory-search({ query: "<topic keywords>", limit: 10 });
|
|
74
|
-
```
|
|
75
|
-
|
|
76
|
-
If memory returns relevant findings, use them to:
|
|
77
|
-
- Skip questions already answered
|
|
78
|
-
- Narrow research scope to gaps only
|
|
79
|
-
- Avoid contradicting prior decisions without justification
|
|
70
|
+
Follow the [memory-grounding](../skill/memory-grounding/SKILL.md) skill protocol. Use findings to: skip already-answered questions, narrow scope to gaps only, avoid contradicting prior decisions without justification.
|
|
80
71
|
|
|
81
72
|
## Phase 2: Research
|
|
82
73
|
|
|
@@ -130,8 +121,8 @@ Report:
|
|
|
130
121
|
|
|
131
122
|
## Related Commands
|
|
132
123
|
|
|
133
|
-
| Need
|
|
134
|
-
|
|
|
135
|
-
| Create + start | `/create`
|
|
136
|
-
| Plan details
|
|
137
|
-
| Pick up work | `/ship <id>`
|
|
124
|
+
| Need | Command |
|
|
125
|
+
| -------------- | ------------ |
|
|
126
|
+
| Create + start | `/create` |
|
|
127
|
+
| Plan details | `/plan <id>` |
|
|
128
|
+
| Pick up work | `/ship <id>` |
|
|
@@ -12,6 +12,7 @@ Pick up where a previous session left off. Recover context, verify state, contin
|
|
|
12
12
|
|
|
13
13
|
```typescript
|
|
14
14
|
skill({ name: "beads" });
|
|
15
|
+
skill({ name: "memory-grounding" });
|
|
15
16
|
```
|
|
16
17
|
|
|
17
18
|
## Phase 1: Verify Task
|
|
@@ -33,11 +34,7 @@ If not on the right branch, check out the feature branch. If uncommitted changes
|
|
|
33
34
|
|
|
34
35
|
## Phase 3: Find Handoff
|
|
35
36
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
```typescript
|
|
39
|
-
memory_read({ file: "handoffs/$ARGUMENTS" });
|
|
40
|
-
```
|
|
37
|
+
Follow the [memory-grounding](../skill/memory-grounding/SKILL.md) skill protocol. Focus on: handoff file by bead ID, session history.
|
|
41
38
|
|
|
42
39
|
If a handoff exists, it tells you:
|
|
43
40
|
|
|
@@ -46,12 +43,6 @@ If a handoff exists, it tells you:
|
|
|
46
43
|
- What to do next
|
|
47
44
|
- Any blockers
|
|
48
45
|
|
|
49
|
-
Also search previous sessions:
|
|
50
|
-
|
|
51
|
-
```typescript
|
|
52
|
-
find_sessions({ query: "$ARGUMENTS" });
|
|
53
|
-
```
|
|
54
|
-
|
|
55
46
|
## Phase 4: Load Artifacts
|
|
56
47
|
|
|
57
48
|
Read all available context:
|
|
@@ -11,6 +11,7 @@ agent: review
|
|
|
11
11
|
```typescript
|
|
12
12
|
skill({ name: "beads" });
|
|
13
13
|
skill({ name: "requesting-code-review" });
|
|
14
|
+
skill({ name: "verification-gates" });
|
|
14
15
|
```
|
|
15
16
|
|
|
16
17
|
## Determine Input Type
|
|
@@ -32,13 +33,13 @@ skill({ name: "requesting-code-review" });
|
|
|
32
33
|
|
|
33
34
|
## Available Tools
|
|
34
35
|
|
|
35
|
-
| Tool
|
|
36
|
-
|
|
|
37
|
-
| `explore`
|
|
38
|
-
| `scout`
|
|
39
|
-
| `lsp`
|
|
40
|
-
| `tilth_tilth_search` | Finding code patterns
|
|
41
|
-
| `codesearch`
|
|
36
|
+
| Tool | Use When |
|
|
37
|
+
| -------------------- | --------------------------------------- |
|
|
38
|
+
| `explore` | Finding patterns in codebase, prior art |
|
|
39
|
+
| `scout` | External research, best practices |
|
|
40
|
+
| `lsp` | Finding symbol definitions, references |
|
|
41
|
+
| `tilth_tilth_search` | Finding code patterns |
|
|
42
|
+
| `codesearch` | Real-world usage examples |
|
|
42
43
|
|
|
43
44
|
## Phase 1: Gather Context
|
|
44
45
|
|
|
@@ -68,14 +69,7 @@ If bead provided, read `.beads/artifacts/$ID/prd.md` to review against spec.
|
|
|
68
69
|
|
|
69
70
|
## Phase 3: Automated Checks
|
|
70
71
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
| Project Type | Detect Via | Build | Test | Lint | Typecheck |
|
|
74
|
-
| --------------- | ----------------------------- | ---------------- | --------------- | ----------------------------- | ------------------------------------- |
|
|
75
|
-
| Node/TypeScript | `package.json` | `npm run build` | `npm test` | `npm run lint` | `npm run typecheck` or `tsc --noEmit` |
|
|
76
|
-
| Rust | `Cargo.toml` | `cargo build` | `cargo test` | `cargo clippy -- -D warnings` | (included in build) |
|
|
77
|
-
| Python | `pyproject.toml` / `setup.py` | — | `pytest` | `ruff check .` | `mypy .` |
|
|
78
|
-
| Go | `go.mod` | `go build ./...` | `go test ./...` | `golangci-lint run` | (included in build) |
|
|
72
|
+
Follow the [verification-gates](../skill/verification-gates/SKILL.md) skill protocol.
|
|
79
73
|
|
|
80
74
|
Check `package.json` scripts, `Makefile`, or `justfile` for project-specific commands first — prefer those over generic defaults.
|
|
81
75
|
|
|
@@ -16,6 +16,8 @@ Execute PRD tasks, verify each passes, run review, close the bead.
|
|
|
16
16
|
|
|
17
17
|
```typescript
|
|
18
18
|
skill({ name: "beads" });
|
|
19
|
+
skill({ name: "memory-grounding" });
|
|
20
|
+
skill({ name: "workspace-setup" });
|
|
19
21
|
skill({ name: "verification-before-completion" });
|
|
20
22
|
```
|
|
21
23
|
|
|
@@ -38,27 +40,19 @@ skill({ name: "verification-before-completion" });
|
|
|
38
40
|
|
|
39
41
|
## Available Tools
|
|
40
42
|
|
|
41
|
-
| Tool
|
|
42
|
-
|
|
|
43
|
-
| `explore`
|
|
44
|
-
| `scout`
|
|
45
|
-
| `lsp`
|
|
46
|
-
| `tilth_tilth_search` | Finding code patterns
|
|
47
|
-
| `task`
|
|
43
|
+
| Tool | Use When |
|
|
44
|
+
| -------------------- | ----------------------------------------- |
|
|
45
|
+
| `explore` | Finding patterns in codebase, prior art |
|
|
46
|
+
| `scout` | External research, best practices |
|
|
47
|
+
| `lsp` | Finding symbol definitions, references |
|
|
48
|
+
| `tilth_tilth_search` | Finding code patterns |
|
|
49
|
+
| `task` | Spawning subagents for parallel execution |
|
|
48
50
|
|
|
49
51
|
## Phase 1: Guards
|
|
50
52
|
|
|
51
53
|
### Memory Grounding
|
|
52
54
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
```typescript
|
|
56
|
-
memory-search({ query: "$ARGUMENTS" });
|
|
57
|
-
memory-search({ query: "<bead title keywords>", limit: 5 });
|
|
58
|
-
memory-read({ file: "handoffs/last" });
|
|
59
|
-
```
|
|
60
|
-
|
|
61
|
-
Use findings to avoid re-discovering known issues or repeating failed approaches.
|
|
55
|
+
Follow the [memory-grounding](../skill/memory-grounding/SKILL.md) skill protocol. Focus on: failed approaches to avoid repeating.
|
|
62
56
|
|
|
63
57
|
### Bead Validation
|
|
64
58
|
|
|
@@ -85,44 +79,9 @@ br update $ARGUMENTS --status in_progress
|
|
|
85
79
|
|
|
86
80
|
Then ask about workspace:
|
|
87
81
|
|
|
88
|
-
|
|
89
|
-
question({
|
|
90
|
-
questions: [
|
|
91
|
-
{
|
|
92
|
-
header: "Workspace",
|
|
93
|
-
question: "How do you want to set up the workspace?",
|
|
94
|
-
options: [
|
|
95
|
-
{
|
|
96
|
-
label: "Create feature branch (Recommended)",
|
|
97
|
-
description: "git checkout -b feat/<bead-id>-<title>",
|
|
98
|
-
},
|
|
99
|
-
{
|
|
100
|
-
label: "Use current branch",
|
|
101
|
-
description: "Work on current branch",
|
|
102
|
-
},
|
|
103
|
-
],
|
|
104
|
-
},
|
|
105
|
-
],
|
|
106
|
-
});
|
|
107
|
-
```
|
|
108
|
-
|
|
109
|
-
**If feature branch selected:**
|
|
110
|
-
|
|
111
|
-
Map bead type to branch prefix:
|
|
112
|
-
|
|
113
|
-
| Bead Type | Branch Prefix |
|
|
114
|
-
| --------- | ------------- |
|
|
115
|
-
| feature | feat |
|
|
116
|
-
| bug | fix |
|
|
117
|
-
| task | task |
|
|
118
|
-
| epic | epic |
|
|
119
|
-
|
|
120
|
-
```bash
|
|
121
|
-
# Example: feat/br-42-add-auth
|
|
122
|
-
git checkout -b $PREFIX/$BEAD_ID-$TITLE_SLUG
|
|
123
|
-
```
|
|
82
|
+
### Workspace Setup
|
|
124
83
|
|
|
125
|
-
|
|
84
|
+
Follow the [workspace-setup](../skill/workspace-setup/SKILL.md) skill protocol.
|
|
126
85
|
|
|
127
86
|
**If bead is already `in_progress`:** Skip this phase entirely.
|
|
128
87
|
|
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# Beads PRD Template
|
|
2
2
|
|
|
3
|
+
> **Template Instructions:**
|
|
4
|
+
>
|
|
5
|
+
> - Replace ALL bracketed placeholders with real content
|
|
6
|
+
> - If you cannot fill a section with confidence, use `[NEEDS CLARIFICATION: reason]` instead of guessing
|
|
7
|
+
> - Any `[NEEDS CLARIFICATION]` markers MUST be resolved before planning can proceed
|
|
8
|
+
> - Delete this instruction block after filling the template
|
|
9
|
+
|
|
3
10
|
**Bead:** br-[id]
|
|
4
11
|
**Created:** [date]
|
|
5
12
|
**Status:** Draft | In Review | Approved
|
|
@@ -20,11 +27,11 @@ estimated_hours: 2 # Time estimate for planning
|
|
|
20
27
|
|
|
21
28
|
### What problem are we solving?
|
|
22
29
|
|
|
23
|
-
[Clear description of the problem. Include user impact and business impact.]
|
|
30
|
+
[Clear description of the problem. Include user impact and business impact. If unclear, use [NEEDS CLARIFICATION: what specifically is unknown]]
|
|
24
31
|
|
|
25
32
|
### Why now?
|
|
26
33
|
|
|
27
|
-
[What triggered this work? Cost of inaction?]
|
|
34
|
+
[What triggered this work? Cost of inaction? Use [NEEDS CLARIFICATION] if motivation is unclear]
|
|
28
35
|
|
|
29
36
|
### Who is affected?
|
|
30
37
|
|
|
@@ -37,11 +44,11 @@ estimated_hours: 2 # Time estimate for planning
|
|
|
37
44
|
|
|
38
45
|
### In-Scope
|
|
39
46
|
|
|
40
|
-
- [List what's
|
|
47
|
+
- [List what's in scope. Use [NEEDS CLARIFICATION] for ambiguous boundaries]
|
|
41
48
|
|
|
42
49
|
### Out-of-Scope
|
|
43
50
|
|
|
44
|
-
- [List what's explicitly off-limits]
|
|
51
|
+
- [List what's explicitly off-limits. Use [NEEDS CLARIFICATION] for unresolved scope questions]
|
|
45
52
|
- [Deferred to future iterations]
|
|
46
53
|
|
|
47
54
|
---
|
|
@@ -50,7 +57,7 @@ estimated_hours: 2 # Time estimate for planning
|
|
|
50
57
|
|
|
51
58
|
### Overview
|
|
52
59
|
|
|
53
|
-
[One paragraph describing what this feature does when complete.]
|
|
60
|
+
[One paragraph describing what this feature does when complete. Use [NEEDS CLARIFICATION] for uncertain design decisions]
|
|
54
61
|
|
|
55
62
|
### User Flow (if user-facing)
|
|
56
63
|
|
|
@@ -80,6 +87,8 @@ Brief description of what must be true.
|
|
|
80
87
|
- **Accessibility:** [WCAG level if applicable]
|
|
81
88
|
- **Compatibility:** [constraint if applicable]
|
|
82
89
|
|
|
90
|
+
> If any requirement is unknown or unresearched, mark it `[NEEDS CLARIFICATION: what needs investigation]` rather than omitting it.
|
|
91
|
+
|
|
83
92
|
---
|
|
84
93
|
|
|
85
94
|
## Success Criteria
|
|
@@ -127,6 +136,8 @@ files:
|
|
|
127
136
|
| ---------- | ----- | -------- | ------------- |
|
|
128
137
|
| Question 1 | Name | Date | Open/Resolved |
|
|
129
138
|
|
|
139
|
+
> **All `[NEEDS CLARIFICATION]` markers should be converted to entries in this table for tracking.**
|
|
140
|
+
|
|
130
141
|
---
|
|
131
142
|
|
|
132
143
|
## Tasks
|
|
@@ -27,6 +27,12 @@ updated: 2025-01-06
|
|
|
27
27
|
- Language: TypeScript
|
|
28
28
|
- Linter: oxlint
|
|
29
29
|
|
|
30
|
+
## Editing Tool Preferences
|
|
31
|
+
|
|
32
|
+
- **Primary**: `edit` tool (str_replace) and `patch` tool
|
|
33
|
+
- **Secondary/Fallback**: `tilth_tilth_edit` (hash-anchored edits) — only when str_replace fails
|
|
34
|
+
- **Reading/Search**: `tilth_tilth_read` and `tilth_tilth_search` are fine to use freely
|
|
35
|
+
|
|
30
36
|
## Rules to Always Follow
|
|
31
37
|
|
|
32
38
|
- Run `npm run lint:fix` before any commit
|
|
@@ -34,5 +40,6 @@ updated: 2025-01-06
|
|
|
34
40
|
- Don't modify dist/ directly (it's built output)
|
|
35
41
|
- Ask before adding new dependencies
|
|
36
42
|
- Ask before changing .opencode/ structure
|
|
43
|
+
- Ask before schema changes (zod schemas, config shapes)
|
|
37
44
|
- Never commit secrets or .env files
|
|
38
45
|
- Never force push to main
|
|
Binary file
|
|
Binary file
|
|
Binary file
|