opencodekit 0.16.15 → 0.16.17
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 +1 -1
- package/dist/template/.opencode/agent/plan.md +77 -161
- package/dist/template/.opencode/command/create.md +75 -307
- package/dist/template/.opencode/command/design.md +53 -589
- package/dist/template/.opencode/command/handoff.md +76 -180
- package/dist/template/.opencode/command/init.md +45 -211
- package/dist/template/.opencode/command/plan.md +62 -514
- package/dist/template/.opencode/command/pr.md +56 -226
- package/dist/template/.opencode/command/research.md +55 -266
- package/dist/template/.opencode/command/resume.md +33 -138
- package/dist/template/.opencode/command/review-codebase.md +54 -202
- package/dist/template/.opencode/command/ship.md +78 -127
- package/dist/template/.opencode/command/start.md +47 -577
- package/dist/template/.opencode/command/status.md +55 -354
- package/dist/template/.opencode/command/ui-review.md +52 -298
- package/dist/template/.opencode/command/verify.md +36 -250
- package/dist/template/.opencode/memory.db-shm +0 -0
- package/dist/template/.opencode/memory.db-wal +0 -0
- package/dist/template/.opencode/plugin/README.md +8 -4
- package/dist/template/.opencode/plugin/swarm-enforcer.ts +182 -27
- package/dist/template/.opencode/skill/augment-context-engine/SKILL.md +112 -0
- package/dist/template/.opencode/skill/augment-context-engine/mcp.json +6 -0
- package/dist/template/.opencode/skill/core-data-expert/SKILL.md +82 -0
- package/dist/template/.opencode/skill/core-data-expert/references/batch-operations.md +543 -0
- package/dist/template/.opencode/skill/core-data-expert/references/cloudkit-integration.md +259 -0
- package/dist/template/.opencode/skill/core-data-expert/references/concurrency.md +522 -0
- package/dist/template/.opencode/skill/core-data-expert/references/fetch-requests.md +643 -0
- package/dist/template/.opencode/skill/core-data-expert/references/glossary.md +233 -0
- package/dist/template/.opencode/skill/core-data-expert/references/migration.md +393 -0
- package/dist/template/.opencode/skill/core-data-expert/references/model-configuration.md +597 -0
- package/dist/template/.opencode/skill/core-data-expert/references/performance.md +300 -0
- package/dist/template/.opencode/skill/core-data-expert/references/persistent-history.md +553 -0
- package/dist/template/.opencode/skill/core-data-expert/references/project-audit.md +60 -0
- package/dist/template/.opencode/skill/core-data-expert/references/saving.md +574 -0
- package/dist/template/.opencode/skill/core-data-expert/references/stack-setup.md +625 -0
- package/dist/template/.opencode/skill/core-data-expert/references/testing.md +300 -0
- package/dist/template/.opencode/skill/core-data-expert/references/threading.md +589 -0
- package/dist/template/.opencode/skill/swift-concurrency/SKILL.md +246 -0
- package/dist/template/.opencode/skill/swift-concurrency/references/actors.md +640 -0
- package/dist/template/.opencode/skill/swift-concurrency/references/async-algorithms.md +822 -0
- package/dist/template/.opencode/skill/swift-concurrency/references/async-await-basics.md +249 -0
- package/dist/template/.opencode/skill/swift-concurrency/references/async-sequences.md +670 -0
- package/dist/template/.opencode/skill/swift-concurrency/references/core-data.md +533 -0
- package/dist/template/.opencode/skill/swift-concurrency/references/glossary.md +128 -0
- package/dist/template/.opencode/skill/swift-concurrency/references/linting.md +142 -0
- package/dist/template/.opencode/skill/swift-concurrency/references/memory-management.md +542 -0
- package/dist/template/.opencode/skill/swift-concurrency/references/migration.md +1076 -0
- package/dist/template/.opencode/skill/swift-concurrency/references/performance.md +574 -0
- package/dist/template/.opencode/skill/swift-concurrency/references/sendable.md +578 -0
- package/dist/template/.opencode/skill/swift-concurrency/references/tasks.md +604 -0
- package/dist/template/.opencode/skill/swift-concurrency/references/testing.md +565 -0
- package/dist/template/.opencode/skill/swift-concurrency/references/threading.md +452 -0
- package/dist/template/.opencode/skill/swiftui-expert-skill/SKILL.md +290 -0
- package/dist/template/.opencode/skill/swiftui-expert-skill/references/animation-advanced.md +351 -0
- package/dist/template/.opencode/skill/swiftui-expert-skill/references/animation-basics.md +284 -0
- package/dist/template/.opencode/skill/swiftui-expert-skill/references/animation-transitions.md +326 -0
- package/dist/template/.opencode/skill/swiftui-expert-skill/references/image-optimization.md +286 -0
- package/dist/template/.opencode/skill/swiftui-expert-skill/references/layout-best-practices.md +312 -0
- package/dist/template/.opencode/skill/swiftui-expert-skill/references/liquid-glass.md +377 -0
- package/dist/template/.opencode/skill/swiftui-expert-skill/references/list-patterns.md +153 -0
- package/dist/template/.opencode/skill/swiftui-expert-skill/references/modern-apis.md +400 -0
- package/dist/template/.opencode/skill/swiftui-expert-skill/references/performance-patterns.md +377 -0
- package/dist/template/.opencode/skill/swiftui-expert-skill/references/scroll-patterns.md +305 -0
- package/dist/template/.opencode/skill/swiftui-expert-skill/references/sheet-navigation-patterns.md +292 -0
- package/dist/template/.opencode/skill/swiftui-expert-skill/references/state-management.md +447 -0
- package/dist/template/.opencode/skill/swiftui-expert-skill/references/text-formatting.md +285 -0
- package/dist/template/.opencode/skill/swiftui-expert-skill/references/view-structure.md +276 -0
- package/package.json +1 -1
|
@@ -2,236 +2,88 @@
|
|
|
2
2
|
description: Review code for quality, security, and compliance
|
|
3
3
|
argument-hint: "[path|bead-id|pr-number|'all'] [--quick|--thorough]"
|
|
4
4
|
agent: review
|
|
5
|
-
subtask: true
|
|
6
5
|
---
|
|
7
6
|
|
|
8
7
|
# Review: $ARGUMENTS
|
|
9
8
|
|
|
10
|
-
## Load
|
|
9
|
+
## Load Skills
|
|
11
10
|
|
|
12
11
|
```typescript
|
|
13
12
|
skill({ name: "beads" });
|
|
14
|
-
skill({ name: "memory-system" });
|
|
15
|
-
```
|
|
16
|
-
|
|
17
|
-
## Check Memory for Context
|
|
18
|
-
|
|
19
|
-
Search for existing patterns and gotchas before review:
|
|
20
|
-
|
|
21
|
-
```typescript
|
|
22
|
-
// Find related past reviews and findings
|
|
23
|
-
memory_search({ query: "[path/module] review security", limit: 3 });
|
|
24
|
-
|
|
25
|
-
// Find known gotchas for this area
|
|
26
|
-
memory_search({ query: "[module keywords] gotchas patterns", limit: 3 });
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
Apply past learnings to the review - don't repeat known issues.
|
|
30
|
-
|
|
31
|
-
## Phase 1: Determine Scope
|
|
32
|
-
|
|
33
|
-
Parse `$ARGUMENTS` to determine what to review:
|
|
34
|
-
|
|
35
|
-
| Input | Scope | How to Get Code |
|
|
36
|
-
| ------------------------ | ---------------------- | ------------------------------------------- |
|
|
37
|
-
| File/directory path | That path only | `read` or `glob` + `read` |
|
|
38
|
-
| Bead ID (e.g., `br-123`) | Implementation vs spec | `br show` then `git diff` from spec |
|
|
39
|
-
| PR number (e.g., `#45`) | PR changes | `gh pr diff 45` |
|
|
40
|
-
| `all` or empty | Recent changes | `git diff main...HEAD` or `git diff HEAD~5` |
|
|
41
|
-
|
|
42
|
-
If bead exists, load spec from `.beads/artifacts/$ID/spec.md` and review against constraints.
|
|
43
|
-
|
|
44
|
-
## Phase 2: Automated Analysis
|
|
45
|
-
|
|
46
|
-
Run these checks first (batch for speed):
|
|
47
|
-
|
|
48
|
-
```typescript
|
|
49
|
-
// Type/lint errors
|
|
50
|
-
lsp_lsp_diagnostics(); // for each changed file
|
|
51
|
-
```
|
|
52
|
-
|
|
53
|
-
!`npm run type-check || tsc --noEmit`
|
|
54
|
-
!`npm run lint || true`
|
|
55
|
-
|
|
56
|
-
```typescript
|
|
57
|
-
// Anti-pattern detection with grep
|
|
58
|
-
grep({ pattern: "console\\.log" }); // Debug statements
|
|
59
|
-
grep({ pattern: "any" }); // TypeScript any
|
|
60
|
-
grep({ pattern: "TODO|FIXME|HACK|XXX" });
|
|
61
|
-
grep({ pattern: "password\\s*=" }); // Hardcoded secrets
|
|
62
|
-
```
|
|
63
|
-
|
|
64
|
-
!`npm test || pytest || cargo test`
|
|
65
|
-
|
|
66
|
-
Collect all automated findings before manual review.
|
|
67
|
-
|
|
68
|
-
## Phase 3: Manual Review Categories
|
|
69
|
-
|
|
70
|
-
```typescript
|
|
71
13
|
skill({ name: "requesting-code-review" });
|
|
72
14
|
```
|
|
73
15
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
### Security
|
|
77
|
-
|
|
78
|
-
- Authentication/authorization checks on all endpoints
|
|
79
|
-
- Input validation and sanitization
|
|
80
|
-
- No secrets in code (API keys, passwords, tokens)
|
|
81
|
-
- SQL/command injection prevention
|
|
82
|
-
- XSS prevention (output encoding)
|
|
83
|
-
|
|
84
|
-
### Performance
|
|
85
|
-
|
|
86
|
-
- N+1 query patterns
|
|
87
|
-
- Unbounded loops or recursion
|
|
88
|
-
- Missing pagination on large datasets
|
|
89
|
-
- Expensive operations in hot paths
|
|
90
|
-
- Missing caching where appropriate
|
|
91
|
-
|
|
92
|
-
### Maintainability
|
|
93
|
-
|
|
94
|
-
- Cyclomatic complexity (functions > 10 branches)
|
|
95
|
-
- DRY violations (duplicated logic)
|
|
96
|
-
- Dead code or unreachable branches
|
|
97
|
-
- Naming clarity (can you understand without comments?)
|
|
98
|
-
- Single Responsibility violations
|
|
99
|
-
|
|
100
|
-
### Error Handling
|
|
101
|
-
|
|
102
|
-
- All async operations have error handling
|
|
103
|
-
- Errors are logged with context
|
|
104
|
-
- User-facing errors are sanitized (no stack traces)
|
|
105
|
-
- Graceful degradation where appropriate
|
|
106
|
-
|
|
107
|
-
### Testing
|
|
108
|
-
|
|
109
|
-
- Test coverage on new/changed code
|
|
110
|
-
- Tests verify behavior, not implementation
|
|
111
|
-
- Edge cases covered (empty, null, boundary)
|
|
112
|
-
- No excessive mocking (tests actually test something)
|
|
113
|
-
|
|
114
|
-
### Type Safety (TypeScript/typed languages)
|
|
115
|
-
|
|
116
|
-
- No `any` types without justification
|
|
117
|
-
- Proper null/undefined handling
|
|
118
|
-
- Generic types used appropriately
|
|
119
|
-
- Return types explicit on public APIs
|
|
120
|
-
|
|
121
|
-
## Phase 4: Create Tracking Issues
|
|
122
|
-
|
|
123
|
-
For each Critical or Important finding:
|
|
124
|
-
|
|
125
|
-
```bash
|
|
126
|
-
br create "[Review] <brief issue description>" --type bug --priority 1
|
|
127
|
-
```
|
|
128
|
-
|
|
129
|
-
Skip creating beads for Minor issues (just report them).
|
|
130
|
-
|
|
131
|
-
## Phase 5: Output Format
|
|
132
|
-
|
|
133
|
-
### Summary
|
|
134
|
-
|
|
135
|
-
| Metric | Value |
|
|
136
|
-
| ------------------ | ------- |
|
|
137
|
-
| Files reviewed | X |
|
|
138
|
-
| Lines changed | +X / -Y |
|
|
139
|
-
| Critical issues | X |
|
|
140
|
-
| Important issues | X |
|
|
141
|
-
| Minor issues | X |
|
|
142
|
-
| Automated findings | X |
|
|
143
|
-
|
|
144
|
-
### Automated Findings
|
|
145
|
-
|
|
146
|
-
```
|
|
147
|
-
[LSP] src/auth.ts:45 - Type 'string' is not assignable to type 'User'
|
|
148
|
-
[AST] src/utils.ts:12 - console.log detected
|
|
149
|
-
[GREP] src/config.ts:8 - TODO: implement rate limiting
|
|
150
|
-
```
|
|
151
|
-
|
|
152
|
-
### Manual Findings
|
|
153
|
-
|
|
154
|
-
#### Critical (Must Fix Before Merge)
|
|
155
|
-
|
|
156
|
-
| File:Line | Issue | Category | Fix |
|
|
157
|
-
| ---------------- | ------------------------------------ | -------- | ------------------------------ |
|
|
158
|
-
| `src/auth.ts:45` | Missing auth check on admin endpoint | Security | Add `requireAuth()` middleware |
|
|
159
|
-
|
|
160
|
-
#### Important (Should Fix)
|
|
161
|
-
|
|
162
|
-
| File:Line | Issue | Category | Fix |
|
|
163
|
-
| -------------- | ---------------------- | ----------- | ---------------------------- |
|
|
164
|
-
| `src/db.ts:89` | N+1 query in user list | Performance | Use `include` or batch query |
|
|
165
|
-
|
|
166
|
-
#### Minor (Nice to Have)
|
|
167
|
-
|
|
168
|
-
| File:Line | Issue | Category | Fix |
|
|
169
|
-
| ----------------- | ------------------------ | --------------- | --------------------------- |
|
|
170
|
-
| `src/utils.ts:12` | Console.log left in code | Maintainability | Remove or use proper logger |
|
|
171
|
-
|
|
172
|
-
### Strengths
|
|
16
|
+
## Phase 1: Determine Scope
|
|
173
17
|
|
|
174
|
-
|
|
18
|
+
| Input | Scope | How to Get Code |
|
|
19
|
+
| ------------------------ | --------------------- | ------------------------- |
|
|
20
|
+
| File/directory path | That path only | `read` or `glob` + `read` |
|
|
21
|
+
| Bead ID (e.g., `br-123`) | Implementation vs PRD | `br show` then `git diff` |
|
|
22
|
+
| PR number (e.g., `#45`) | PR changes | `gh pr diff 45` |
|
|
23
|
+
| `all` or empty | Recent changes | `git diff main...HEAD` |
|
|
175
24
|
|
|
176
|
-
|
|
25
|
+
If bead provided, read `.beads/artifacts/$ID/prd.md` to review against spec.
|
|
177
26
|
|
|
178
|
-
|
|
27
|
+
## Phase 2: Automated Checks
|
|
179
28
|
|
|
180
|
-
|
|
29
|
+
Detect project type and run the appropriate checks in parallel:
|
|
181
30
|
|
|
182
|
-
|
|
31
|
+
| Project Type | Detect Via | Build | Test | Lint | Typecheck |
|
|
32
|
+
| --------------- | ----------------------------- | ---------------- | --------------- | ----------------------------- | ------------------------------------- |
|
|
33
|
+
| Node/TypeScript | `package.json` | `npm run build` | `npm test` | `npm run lint` | `npm run typecheck` or `tsc --noEmit` |
|
|
34
|
+
| Rust | `Cargo.toml` | `cargo build` | `cargo test` | `cargo clippy -- -D warnings` | (included in build) |
|
|
35
|
+
| Python | `pyproject.toml` / `setup.py` | — | `pytest` | `ruff check .` | `mypy .` |
|
|
36
|
+
| Go | `go.mod` | `go build ./...` | `go test ./...` | `golangci-lint run` | (included in build) |
|
|
183
37
|
|
|
184
|
-
|
|
38
|
+
Check `package.json` scripts, `Makefile`, or `justfile` for project-specific commands first — prefer those over generic defaults.
|
|
185
39
|
|
|
186
|
-
|
|
40
|
+
Also scan for common issues appropriate to the detected language:
|
|
187
41
|
|
|
188
|
-
|
|
42
|
+
- Debug statements (`console.log`, `print()`, `println!`, `fmt.Println`)
|
|
43
|
+
- Loose typing (`any` in TypeScript, `type: ignore` in Python)
|
|
44
|
+
- `TODO|FIXME|HACK` markers
|
|
45
|
+
- Hardcoded secrets patterns
|
|
189
46
|
|
|
190
|
-
##
|
|
47
|
+
## Phase 3: Manual Review
|
|
191
48
|
|
|
192
|
-
|
|
193
|
-
**--thorough** (default, ~15-30 min): Full automated + manual review of all categories
|
|
194
|
-
**--security**: Focus only on security category with deeper analysis
|
|
49
|
+
Review each category:
|
|
195
50
|
|
|
196
|
-
|
|
51
|
+
| Category | Focus |
|
|
52
|
+
| ------------------- | ----------------------------------------------------------------------- |
|
|
53
|
+
| **Security** | Auth checks, input validation, no secrets in code, injection prevention |
|
|
54
|
+
| **Performance** | N+1 queries, unbounded loops, missing pagination, hot path ops |
|
|
55
|
+
| **Maintainability** | Complexity, DRY violations, dead code, naming clarity |
|
|
56
|
+
| **Error Handling** | Async error handling, error context, sanitized user errors |
|
|
57
|
+
| **Testing** | Coverage on changed code, behavior tests, edge cases |
|
|
58
|
+
| **Type Safety** | No unjustified `any`, null handling, explicit return types |
|
|
197
59
|
|
|
198
|
-
|
|
199
|
-
# Review a specific file
|
|
200
|
-
/review-codebase src/auth/login.ts
|
|
60
|
+
**Depth levels:**
|
|
201
61
|
|
|
202
|
-
|
|
203
|
-
|
|
62
|
+
- `--quick`: Automated checks + skim, critical issues only
|
|
63
|
+
- Default: Full automated + manual review
|
|
64
|
+
- `--thorough`: Deep analysis of all categories
|
|
204
65
|
|
|
205
|
-
|
|
206
|
-
/review-codebase #45
|
|
66
|
+
## Phase 4: Report
|
|
207
67
|
|
|
208
|
-
|
|
209
|
-
/review-codebase all --quick
|
|
68
|
+
Group findings by severity:
|
|
210
69
|
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
70
|
+
- **Critical** (must fix before merge): with file:line, issue, fix
|
|
71
|
+
- **Important** (should fix): with file:line, issue, fix
|
|
72
|
+
- **Minor** (nice to have): with file:line, suggestion
|
|
214
73
|
|
|
215
|
-
|
|
74
|
+
Include:
|
|
216
75
|
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
- Skipping automated checks "to save time"
|
|
222
|
-
- Not creating beads for real issues (they get forgotten)
|
|
76
|
+
1. Summary metrics (files reviewed, issues by severity)
|
|
77
|
+
2. Strengths (what's done well, with file:line)
|
|
78
|
+
3. Verdict: Ready to merge / With fixes / No
|
|
79
|
+
4. Reasoning (1-2 sentences)
|
|
223
80
|
|
|
224
|
-
|
|
81
|
+
Record significant findings with `observation()`.
|
|
225
82
|
|
|
226
|
-
|
|
83
|
+
## Related Commands
|
|
227
84
|
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
facts: "[key facts about the issue]",
|
|
234
|
-
concepts: "[module], security, [issue keywords]",
|
|
235
|
-
confidence: "high",
|
|
236
|
-
});
|
|
237
|
-
```
|
|
85
|
+
| Need | Command |
|
|
86
|
+
| ------------------- | -------------- |
|
|
87
|
+
| Ship after review | `/ship <id>` |
|
|
88
|
+
| Verify completeness | `/verify <id>` |
|
|
89
|
+
| Check status | `/status` |
|
|
@@ -1,161 +1,120 @@
|
|
|
1
1
|
---
|
|
2
|
-
description: Ship a bead - implement, verify, review, close
|
|
3
|
-
argument-hint: "<bead-id>
|
|
2
|
+
description: Ship a bead - implement PRD tasks, verify, review, close
|
|
3
|
+
argument-hint: "<bead-id>"
|
|
4
4
|
agent: build
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
# Ship: $ARGUMENTS
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
Execute PRD tasks, verify each passes, run review, close the bead.
|
|
10
|
+
|
|
11
|
+
> **Workflow:** `/create` → `/start <id>` → **`/ship <id>`**
|
|
12
|
+
>
|
|
13
|
+
> ⛔ Bead MUST be `in_progress` with `prd.md`. Run `/start` first if not.
|
|
10
14
|
|
|
11
15
|
## Load Skills
|
|
12
16
|
|
|
13
17
|
```typescript
|
|
14
18
|
skill({ name: "beads" });
|
|
15
|
-
skill({ name: "test-driven-development" });
|
|
16
19
|
skill({ name: "verification-before-completion" });
|
|
17
|
-
skill({ name: "finishing-a-development-branch" });
|
|
18
|
-
skill({ name: "receiving-code-review" });
|
|
19
|
-
skill({ name: "swarm-coordination" });
|
|
20
|
-
skill({ name: "beads-bridge" });
|
|
21
|
-
skill({ name: "memory-system" });
|
|
22
|
-
```
|
|
23
|
-
|
|
24
|
-
## Check Memory for Context
|
|
25
|
-
|
|
26
|
-
Search for related patterns and gotchas before shipping:
|
|
27
|
-
|
|
28
|
-
```typescript
|
|
29
|
-
// Find related patterns and decisions
|
|
30
|
-
memory_search({ query: "$ARGUMENTS [feature keywords]", limit: 3 });
|
|
31
|
-
|
|
32
|
-
// Find gotchas for affected modules
|
|
33
|
-
memory_search({ query: "[affected modules] gotchas", limit: 3 });
|
|
34
20
|
```
|
|
35
21
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
## Skill Routing
|
|
39
|
-
|
|
40
|
-
- Use **systematic-debugging** when a gate fails and root cause is unclear.
|
|
41
|
-
- Use **receiving-code-review** to triage review feedback after the review agent runs.
|
|
42
|
-
|
|
43
|
-
## Verify Task & Claim
|
|
22
|
+
## Phase 1: Guards
|
|
44
23
|
|
|
45
24
|
```bash
|
|
46
25
|
br show $ARGUMENTS
|
|
47
|
-
br update $ARGUMENTS --status in_progress
|
|
48
26
|
```
|
|
49
27
|
|
|
50
|
-
|
|
28
|
+
Verify:
|
|
51
29
|
|
|
52
|
-
|
|
30
|
+
- Bead status is `in_progress` (if not, tell user to run `/start $ARGUMENTS`)
|
|
31
|
+
- `.beads/artifacts/$ARGUMENTS/prd.md` exists (if not, tell user to run `/create` first)
|
|
53
32
|
|
|
54
|
-
|
|
55
|
-
- All gates passing
|
|
56
|
-
- No obvious contradictions
|
|
33
|
+
Check what artifacts exist:
|
|
57
34
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
35
|
+
```bash
|
|
36
|
+
ls .beads/artifacts/$ARGUMENTS/
|
|
37
|
+
```
|
|
61
38
|
|
|
62
|
-
|
|
63
|
-
- Delegate research if unclear (Task → explore/scout)
|
|
64
|
-
- Keep scope ≤ 3 files or create subtasks
|
|
39
|
+
## Phase 2: Route to Execution
|
|
65
40
|
|
|
66
|
-
|
|
41
|
+
| Artifact exists | Action |
|
|
42
|
+
| --------------- | -------------------------------------------------------- |
|
|
43
|
+
| `plan.md` | Load `executing-plans` skill, follow its batch process |
|
|
44
|
+
| `prd.json` | Proceed to PRD task loop below |
|
|
45
|
+
| Only `prd.md` | Load `prd-task` skill to create `prd.json`, then proceed |
|
|
67
46
|
|
|
68
|
-
##
|
|
47
|
+
## Phase 3: PRD Task Loop
|
|
69
48
|
|
|
70
|
-
|
|
49
|
+
For each task in `prd.json` (respecting `depends_on` ordering):
|
|
71
50
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
**
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
npm run build 2>/dev/null || true
|
|
80
|
-
npm test
|
|
81
|
-
npm run lint 2>/dev/null || true
|
|
82
|
-
npm run typecheck 2>/dev/null || true
|
|
83
|
-
```
|
|
51
|
+
1. **Read** the task description, verification steps, and affected files
|
|
52
|
+
2. **Read** the affected files before editing
|
|
53
|
+
3. **Implement** the changes — stay within the task's `files` list
|
|
54
|
+
4. **Verify** — run each verification step from the task
|
|
55
|
+
5. **If verification fails**, fix and retry (max 2 attempts per task)
|
|
56
|
+
6. **Mark** `passes: true` in `prd.json`
|
|
57
|
+
7. **Append** progress to `.beads/artifacts/$ARGUMENTS/progress.txt`
|
|
84
58
|
|
|
85
|
-
|
|
59
|
+
### Stop Conditions
|
|
86
60
|
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
cargo clippy -- -D warnings
|
|
91
|
-
```
|
|
61
|
+
- Verification fails 2x on same task → stop, report blocker
|
|
62
|
+
- Blocked by unfinished dependency → stop, report which one
|
|
63
|
+
- Modifying files outside task scope → stop, ask user
|
|
92
64
|
|
|
93
|
-
|
|
65
|
+
## Phase 4: Verification Gates
|
|
94
66
|
|
|
95
|
-
|
|
96
|
-
pytest
|
|
97
|
-
ruff check .
|
|
98
|
-
mypy . 2>/dev/null || true
|
|
99
|
-
```
|
|
67
|
+
After all PRD tasks pass, detect project type and run the appropriate verification gates:
|
|
100
68
|
|
|
101
|
-
|
|
69
|
+
| Project Type | Detect Via | Build | Test | Lint | Typecheck |
|
|
70
|
+
| --------------- | ----------------------------- | ---------------- | --------------- | ----------------------------- | ------------------------------------- |
|
|
71
|
+
| Node/TypeScript | `package.json` | `npm run build` | `npm test` | `npm run lint` | `npm run typecheck` or `tsc --noEmit` |
|
|
72
|
+
| Rust | `Cargo.toml` | `cargo build` | `cargo test` | `cargo clippy -- -D warnings` | (included in build) |
|
|
73
|
+
| Python | `pyproject.toml` / `setup.py` | — | `pytest` | `ruff check .` | `mypy .` |
|
|
74
|
+
| Go | `go.mod` | `go build ./...` | `go test ./...` | `golangci-lint run` | (included in build) |
|
|
102
75
|
|
|
103
|
-
|
|
104
|
-
go build ./...
|
|
105
|
-
go test ./...
|
|
106
|
-
golangci-lint run
|
|
107
|
-
```
|
|
76
|
+
Check `package.json` scripts, `Makefile`, or `justfile` for project-specific commands first — prefer those over generic defaults.
|
|
108
77
|
|
|
109
|
-
|
|
78
|
+
Also read the PRD's success criteria and run each `Verify:` command.
|
|
110
79
|
|
|
111
|
-
|
|
80
|
+
If any gate fails, fix before proceeding.
|
|
112
81
|
|
|
113
|
-
|
|
114
|
-
git add -A
|
|
115
|
-
git status
|
|
116
|
-
git diff --cached --stat
|
|
117
|
-
```
|
|
82
|
+
## Phase 5: Review
|
|
118
83
|
|
|
119
|
-
|
|
84
|
+
Spawn review agent to check changes against the PRD:
|
|
120
85
|
|
|
121
86
|
```typescript
|
|
122
87
|
Task({
|
|
123
88
|
subagent_type: "review",
|
|
124
89
|
description: "Review changes for $ARGUMENTS",
|
|
125
|
-
prompt: `Review
|
|
90
|
+
prompt: `Review changes for bead $ARGUMENTS.
|
|
126
91
|
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
- Focus on correctness, edge cases, and risks
|
|
130
|
-
- Report issues with file:line references
|
|
92
|
+
Read PRD: .beads/artifacts/$ARGUMENTS/prd.md
|
|
93
|
+
Review: git diff HEAD
|
|
131
94
|
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
95
|
+
Check:
|
|
96
|
+
1. Changes satisfy PRD success criteria
|
|
97
|
+
2. Correctness, edge cases, security
|
|
98
|
+
3. No scope creep beyond PRD files
|
|
99
|
+
|
|
100
|
+
Return: findings by severity, whether success criteria are met.`,
|
|
136
101
|
});
|
|
137
102
|
```
|
|
138
103
|
|
|
139
|
-
If review finds issues
|
|
104
|
+
If review finds critical issues → fix → re-run Phase 4 → re-review.
|
|
140
105
|
|
|
141
|
-
##
|
|
106
|
+
## Phase 6: Close
|
|
142
107
|
|
|
143
|
-
|
|
144
|
-
cat .beads/artifacts/$ARGUMENTS/prd.md
|
|
145
|
-
```
|
|
146
|
-
|
|
147
|
-
Ensure all criteria are met before closing.
|
|
148
|
-
|
|
149
|
-
## Close Bead (Ask First)
|
|
108
|
+
Ask user before closing:
|
|
150
109
|
|
|
151
110
|
```typescript
|
|
152
111
|
question({
|
|
153
112
|
questions: [
|
|
154
113
|
{
|
|
155
114
|
header: "Close",
|
|
156
|
-
question: "
|
|
115
|
+
question: "All tasks pass, gates green, review clean. Close bead $ARGUMENTS?",
|
|
157
116
|
options: [
|
|
158
|
-
{ label: "Yes, close it (Recommended)", description: "All
|
|
117
|
+
{ label: "Yes, close it (Recommended)", description: "All checks passed" },
|
|
159
118
|
{ label: "No, keep open", description: "Need more work" },
|
|
160
119
|
],
|
|
161
120
|
},
|
|
@@ -166,34 +125,26 @@ question({
|
|
|
166
125
|
If confirmed:
|
|
167
126
|
|
|
168
127
|
```bash
|
|
169
|
-
br close $ARGUMENTS --reason "Shipped: verification + review passed"
|
|
128
|
+
br close $ARGUMENTS --reason "Shipped: all PRD tasks pass, verification + review passed"
|
|
170
129
|
br sync --flush-only
|
|
171
130
|
```
|
|
172
131
|
|
|
173
|
-
|
|
132
|
+
Record significant learnings with `observation()`.
|
|
174
133
|
|
|
175
|
-
|
|
134
|
+
## Output
|
|
176
135
|
|
|
177
|
-
|
|
178
|
-
// Record significant decisions or patterns discovered
|
|
179
|
-
observation({
|
|
180
|
-
type: "feature", // or "decision", "pattern"
|
|
181
|
-
title: "$ARGUMENTS: [brief description]",
|
|
182
|
-
narrative: "Implemented [feature]. Key approach: [summary]...",
|
|
183
|
-
facts: "[key implementation details]",
|
|
184
|
-
concepts: "[domain keywords], [tech stack]",
|
|
185
|
-
bead_id: "$ARGUMENTS",
|
|
186
|
-
files_modified: "[key files changed]",
|
|
187
|
-
confidence: "high",
|
|
188
|
-
});
|
|
136
|
+
Report:
|
|
189
137
|
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
138
|
+
1. PRD task results (completed/total, each task status)
|
|
139
|
+
2. Verification gate results (typecheck, build, test, lint)
|
|
140
|
+
3. Success criteria results
|
|
141
|
+
4. Review summary
|
|
142
|
+
5. Next steps: commit changes or create PR
|
|
143
|
+
|
|
144
|
+
## Related Commands
|
|
145
|
+
|
|
146
|
+
| Need | Command |
|
|
147
|
+
| ----------- | ------------- |
|
|
148
|
+
| Create spec | `/create` |
|
|
149
|
+
| Claim task | `/start <id>` |
|
|
150
|
+
| Create PR | `/pr` |
|