opencodekit 0.10.0 → 0.11.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/dist/index.js +1 -1
- package/dist/template/.opencode/agent/planner.md +3 -2
- package/dist/template/.opencode/command/accessibility-check.md +297 -30
- package/dist/template/.opencode/command/analyze-mockup.md +412 -20
- package/dist/template/.opencode/command/analyze-project.md +445 -30
- package/dist/template/.opencode/command/brainstorm.md +294 -5
- package/dist/template/.opencode/command/commit.md +231 -17
- package/dist/template/.opencode/command/create.md +415 -77
- package/dist/template/.opencode/command/design-audit.md +483 -29
- package/dist/template/.opencode/command/design.md +615 -6
- package/dist/template/.opencode/command/edit-image.md +223 -20
- package/dist/template/.opencode/command/finish.md +163 -71
- package/dist/template/.opencode/command/fix-ci.md +297 -24
- package/dist/template/.opencode/command/fix-types.md +351 -13
- package/dist/template/.opencode/command/fix-ui.md +299 -13
- package/dist/template/.opencode/command/fix.md +262 -9
- package/dist/template/.opencode/command/generate-diagram.md +327 -26
- package/dist/template/.opencode/command/generate-icon.md +266 -22
- package/dist/template/.opencode/command/generate-image.md +232 -12
- package/dist/template/.opencode/command/generate-pattern.md +234 -20
- package/dist/template/.opencode/command/generate-storyboard.md +231 -21
- package/dist/template/.opencode/command/handoff.md +208 -31
- package/dist/template/.opencode/command/implement.md +163 -50
- package/dist/template/.opencode/command/import-plan.md +253 -52
- package/dist/template/.opencode/command/init.md +154 -35
- package/dist/template/.opencode/command/integration-test.md +410 -24
- package/dist/template/.opencode/command/issue.md +177 -21
- package/dist/template/.opencode/command/new-feature.md +390 -54
- package/dist/template/.opencode/command/plan.md +394 -107
- package/dist/template/.opencode/command/pr.md +235 -29
- package/dist/template/.opencode/command/quick-build.md +234 -5
- package/dist/template/.opencode/command/research-and-implement.md +442 -12
- package/dist/template/.opencode/command/research-ui.md +444 -34
- package/dist/template/.opencode/command/research.md +179 -45
- package/dist/template/.opencode/command/restore-image.md +416 -22
- package/dist/template/.opencode/command/resume.md +447 -63
- package/dist/template/.opencode/command/revert-feature.md +347 -65
- package/dist/template/.opencode/command/review-codebase.md +199 -4
- package/dist/template/.opencode/command/skill-create.md +506 -14
- package/dist/template/.opencode/command/skill-optimize.md +487 -16
- package/dist/template/.opencode/command/status.md +326 -60
- package/dist/template/.opencode/command/summarize.md +374 -33
- package/dist/template/.opencode/command/triage.md +361 -0
- package/dist/template/.opencode/command/ui-review.md +296 -25
- package/dist/template/.opencode/skill/beads/SKILL.md +108 -3
- package/dist/template/.opencode/skill/playwriter/SKILL.md +148 -0
- package/package.json +1 -1
|
@@ -1,40 +1,243 @@
|
|
|
1
1
|
---
|
|
2
2
|
description: Edit image with natural language instructions
|
|
3
|
-
argument-hint: "<image-path> <edit-instruction>"
|
|
3
|
+
argument-hint: "<image-path> <edit-instruction> [--hd] [--preserve-size] [--compare]"
|
|
4
4
|
agent: vision
|
|
5
5
|
model: proxypal/gemini-3-pro-image-preview
|
|
6
6
|
---
|
|
7
7
|
|
|
8
8
|
# Edit Image: $ARGUMENTS
|
|
9
9
|
|
|
10
|
-
Edit an existing image using natural language.
|
|
10
|
+
Edit an existing image using natural language instructions.
|
|
11
11
|
|
|
12
|
-
##
|
|
12
|
+
## Parse Arguments
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
Extract from `$ARGUMENTS`:
|
|
15
15
|
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
| Argument | Required | Description |
|
|
17
|
+
| ----------------- | -------- | ------------------------------ |
|
|
18
|
+
| Image path | Yes | Path to source image |
|
|
19
|
+
| Edit instruction | Yes | Natural language edit request |
|
|
20
|
+
| `--hd` | No | Higher quality output (slower) |
|
|
21
|
+
| `--preserve-size` | No | Maintain original dimensions |
|
|
22
|
+
| `--compare` | No | Output before/after comparison |
|
|
18
23
|
|
|
19
|
-
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
## Edit Types & What Works
|
|
27
|
+
|
|
28
|
+
### Works Well
|
|
29
|
+
|
|
30
|
+
| Edit Type | Example | Success Rate |
|
|
31
|
+
| -------------------------- | ----------------------------------------- | ------------ |
|
|
32
|
+
| **Background removal** | "remove the background" | High |
|
|
33
|
+
| **Background replacement** | "replace background with beach sunset" | High |
|
|
34
|
+
| **Color changes** | "change the shirt to blue" | High |
|
|
35
|
+
| **Style transfer** | "make it look like a watercolor painting" | High |
|
|
36
|
+
| **Add elements** | "add a hat to the person" | Medium-High |
|
|
37
|
+
| **Remove objects** | "remove the car from the image" | Medium-High |
|
|
38
|
+
| **Lighting adjustments** | "make it look like golden hour" | High |
|
|
39
|
+
| **Extend canvas** | "extend the image to the right" | Medium |
|
|
20
40
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
41
|
+
### Works Poorly (Set Expectations)
|
|
42
|
+
|
|
43
|
+
| Edit Type | Why It's Hard | Alternative |
|
|
44
|
+
| ------------------------------- | ------------------------------ | ----------------------- |
|
|
45
|
+
| **Text changes** | AI struggles with precise text | Use image editor |
|
|
46
|
+
| **Face/hand details** | Often distorts | Mask specific region |
|
|
47
|
+
| **Precise positioning** | "Move object 50px left" | Use coordinates in mask |
|
|
48
|
+
| **Multiple simultaneous edits** | Conflicts | Do one edit at a time |
|
|
49
|
+
| **Preserving fine details** | May blur/change | Use `--preserve-size` |
|
|
50
|
+
|
|
51
|
+
---
|
|
25
52
|
|
|
26
53
|
## Process
|
|
27
54
|
|
|
28
|
-
1. Load
|
|
29
|
-
2.
|
|
30
|
-
3.
|
|
31
|
-
4.
|
|
55
|
+
1. **Load** the source image from path
|
|
56
|
+
2. **Analyze** the original (note key features to preserve)
|
|
57
|
+
3. **Interpret** the edit instruction
|
|
58
|
+
4. **Apply** the edit, preserving unaffected areas
|
|
59
|
+
5. **Save** with versioning to track iterations
|
|
60
|
+
6. **Compare** if `--compare` flag set
|
|
61
|
+
|
|
62
|
+
---
|
|
63
|
+
|
|
64
|
+
## Common Edit Patterns
|
|
65
|
+
|
|
66
|
+
### Background Operations
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
# Remove background (transparent)
|
|
70
|
+
/edit-image photo.jpg remove the background
|
|
71
|
+
|
|
72
|
+
# Replace background
|
|
73
|
+
/edit-image photo.jpg replace background with a modern office
|
|
74
|
+
|
|
75
|
+
# Extend/outpaint
|
|
76
|
+
/edit-image landscape.jpg extend the sky upward
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
### Color & Style
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
# Color change
|
|
83
|
+
/edit-image product.jpg change the product color to red
|
|
84
|
+
|
|
85
|
+
# Style transfer
|
|
86
|
+
/edit-image photo.jpg convert to anime style
|
|
87
|
+
|
|
88
|
+
# Mood change
|
|
89
|
+
/edit-image scene.jpg make it look like nighttime with city lights
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
### Object Manipulation
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
# Add object
|
|
96
|
+
/edit-image room.jpg add a plant in the corner
|
|
97
|
+
|
|
98
|
+
# Remove object
|
|
99
|
+
/edit-image street.jpg remove the person on the left
|
|
100
|
+
|
|
101
|
+
# Replace object
|
|
102
|
+
/edit-image desk.jpg replace the laptop with a typewriter
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
### Enhancement
|
|
106
|
+
|
|
107
|
+
```bash
|
|
108
|
+
# Lighting
|
|
109
|
+
/edit-image portrait.jpg add dramatic studio lighting
|
|
110
|
+
|
|
111
|
+
# Quality
|
|
112
|
+
/edit-image old-photo.jpg enhance and sharpen, remove grain --hd
|
|
113
|
+
|
|
114
|
+
# Composition
|
|
115
|
+
/edit-image product.jpg add subtle shadow underneath
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
---
|
|
32
119
|
|
|
33
120
|
## Output
|
|
34
121
|
|
|
35
|
-
|
|
122
|
+
### Standard Output
|
|
123
|
+
|
|
124
|
+
```markdown
|
|
125
|
+
## Edit Complete
|
|
126
|
+
|
|
127
|
+
**Source:** `path/to/original.jpg`
|
|
128
|
+
**Edit:** "remove the background"
|
|
129
|
+
**Output:** `.opencode/memory/design/edited/original-v1-bg-removed.png`
|
|
130
|
+
|
|
131
|
+
### Original Analysis
|
|
132
|
+
|
|
133
|
+
- Dimensions: 1920x1080
|
|
134
|
+
- Key elements: Person in center, office background
|
|
135
|
+
- Preserved: Person, clothing, pose
|
|
136
|
+
|
|
137
|
+
### Edit Applied
|
|
138
|
+
|
|
139
|
+
- Background detected and removed
|
|
140
|
+
- Edges refined with feathering
|
|
141
|
+
- Output format: PNG (transparent)
|
|
142
|
+
|
|
143
|
+
### Refinements Available
|
|
144
|
+
|
|
145
|
+
- "Soften the edges more"
|
|
146
|
+
- "Keep the shadow underneath"
|
|
147
|
+
- "Make background white instead of transparent"
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
### Comparison Output (--compare)
|
|
151
|
+
|
|
152
|
+
```markdown
|
|
153
|
+
## Before/After Comparison
|
|
154
|
+
|
|
155
|
+
| Aspect | Before | After |
|
|
156
|
+
| ---------- | ------------ | ----------- |
|
|
157
|
+
| Background | Office scene | Transparent |
|
|
158
|
+
| Subject | Unchanged | Unchanged |
|
|
159
|
+
| Dimensions | 1920x1080 | 1920x1080 |
|
|
160
|
+
| File size | 450KB | 380KB |
|
|
161
|
+
|
|
162
|
+
**Visual diff:** Key changes highlighted in output
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
---
|
|
166
|
+
|
|
167
|
+
## Version History
|
|
168
|
+
|
|
169
|
+
Edits are saved with version tracking:
|
|
170
|
+
|
|
171
|
+
```
|
|
172
|
+
.opencode/memory/design/edited/
|
|
173
|
+
├── photo-v1-bg-removed.png # First edit
|
|
174
|
+
├── photo-v2-color-change.png # Second edit
|
|
175
|
+
├── photo-v3-add-shadow.png # Third edit
|
|
176
|
+
└── photo-history.json # Edit history
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
**History file:**
|
|
180
|
+
|
|
181
|
+
```json
|
|
182
|
+
{
|
|
183
|
+
"source": "photo.jpg",
|
|
184
|
+
"edits": [
|
|
185
|
+
{ "v": 1, "instruction": "remove background", "timestamp": "..." },
|
|
186
|
+
{ "v": 2, "instruction": "change shirt to blue", "timestamp": "..." }
|
|
187
|
+
]
|
|
188
|
+
}
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
To revert: Reference previous version as source.
|
|
192
|
+
|
|
193
|
+
---
|
|
194
|
+
|
|
195
|
+
## Tips for Better Results
|
|
196
|
+
|
|
197
|
+
1. **Be specific**: "Add a red baseball cap" > "add a hat"
|
|
198
|
+
2. **One edit at a time**: Chain simple edits for complex changes
|
|
199
|
+
3. **Describe what to keep**: "Change background but keep the shadow"
|
|
200
|
+
4. **Use style references**: "Make it look like a Pixar movie"
|
|
201
|
+
5. **Specify format needs**: "Remove background, keep as PNG with transparency"
|
|
202
|
+
|
|
203
|
+
---
|
|
204
|
+
|
|
205
|
+
## Limitations
|
|
206
|
+
|
|
207
|
+
- **Text editing**: AI cannot reliably modify or add text
|
|
208
|
+
- **Precise geometry**: Exact pixel-level positioning not supported
|
|
209
|
+
- **Faces**: May alter facial features unintentionally
|
|
210
|
+
- **Hands**: Often produces artifacts
|
|
211
|
+
- **Multiple subjects**: May struggle to isolate specific elements
|
|
212
|
+
- **Brand logos**: May distort or refuse (safety filters)
|
|
213
|
+
|
|
214
|
+
For precise edits, consider: Photoshop, GIMP, or Figma.
|
|
215
|
+
|
|
216
|
+
---
|
|
217
|
+
|
|
218
|
+
## Examples
|
|
219
|
+
|
|
220
|
+
```bash
|
|
221
|
+
# Basic edit
|
|
222
|
+
/edit-image screenshot.png remove the background
|
|
223
|
+
|
|
224
|
+
# High quality with comparison
|
|
225
|
+
/edit-image product.jpg enhance lighting and add reflection --hd --compare
|
|
226
|
+
|
|
227
|
+
# Preserve dimensions
|
|
228
|
+
/edit-image banner.png change the color scheme to dark mode --preserve-size
|
|
229
|
+
|
|
230
|
+
# Style transfer
|
|
231
|
+
/edit-image photo.jpg convert to oil painting style --hd
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
---
|
|
235
|
+
|
|
236
|
+
## Related Commands
|
|
36
237
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
-
|
|
40
|
-
-
|
|
238
|
+
| Need | Command |
|
|
239
|
+
| ------------------ | ----------------- |
|
|
240
|
+
| Generate new image | `/generate-image` |
|
|
241
|
+
| Analyze image | `/analyze-mockup` |
|
|
242
|
+
| Restore old photo | `/restore-image` |
|
|
243
|
+
| Create icon | `/generate-icon` |
|
|
@@ -8,15 +8,21 @@ agent: build
|
|
|
8
8
|
|
|
9
9
|
**Load skills:**
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
```typescript
|
|
12
|
+
skill({ name: "beads" }); // Session protocol
|
|
13
|
+
skill({ name: "verification-before-completion" });
|
|
14
|
+
skill({ name: "finishing-a-development-branch" });
|
|
15
|
+
```
|
|
13
16
|
|
|
14
|
-
## Phase 1: Load Bead
|
|
17
|
+
## Phase 1: Load Bead & Check Messages
|
|
15
18
|
|
|
16
19
|
```typescript
|
|
17
20
|
bd_show({ id: "$ARGUMENTS" });
|
|
21
|
+
bd_inbox({ n: 5, unread: true, global: false });
|
|
18
22
|
```
|
|
19
23
|
|
|
24
|
+
Review any messages about this bead before proceeding.
|
|
25
|
+
|
|
20
26
|
Verify status is `in-progress` or `open`.
|
|
21
27
|
|
|
22
28
|
## Phase 2: Detect Project Type
|
|
@@ -27,50 +33,24 @@ Check which project files exist to determine verification commands:
|
|
|
27
33
|
ls package.json Cargo.toml pyproject.toml setup.py Makefile go.mod 2>/dev/null || true
|
|
28
34
|
```
|
|
29
35
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
**Rust** (`Cargo.toml` exists):
|
|
38
|
-
|
|
39
|
-
- Build: `cargo build`
|
|
40
|
-
- Test: `cargo test`
|
|
41
|
-
- Lint: `cargo clippy -- -D warnings`
|
|
42
|
-
|
|
43
|
-
**Python** (`pyproject.toml` or `setup.py` exists):
|
|
44
|
-
|
|
45
|
-
- Test: `pytest`
|
|
46
|
-
- Lint: `ruff check .` or `flake8`
|
|
47
|
-
- Type check: `mypy .`
|
|
36
|
+
| Project Type | Build | Test | Lint |
|
|
37
|
+
| ------------------ | ---------------- | --------------- | ----------------------------- |
|
|
38
|
+
| Node.js/TypeScript | `npm run build` | `npm test` | `npm run lint && type-check` |
|
|
39
|
+
| Rust | `cargo build` | `cargo test` | `cargo clippy -- -D warnings` |
|
|
40
|
+
| Python | - | `pytest` | `ruff check . && mypy .` |
|
|
41
|
+
| Go | `go build ./...` | `go test ./...` | `golangci-lint run` |
|
|
42
|
+
| Make-based | `make build` | `make test` | `make lint` |
|
|
48
43
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
- Build: `go build ./...`
|
|
52
|
-
- Test: `go test ./...`
|
|
53
|
-
- Lint: `golangci-lint run`
|
|
54
|
-
|
|
55
|
-
**Make-based** (`Makefile` exists, no other markers):
|
|
56
|
-
|
|
57
|
-
- Build: `make build`
|
|
58
|
-
- Test: `make test`
|
|
59
|
-
- Lint: `make lint`
|
|
60
|
-
|
|
61
|
-
**No recognized files:** Skip automated gates, proceed to Phase 4.
|
|
62
|
-
|
|
63
|
-
Check if each command actually exists before running (e.g., verify script exists in `package.json`).
|
|
44
|
+
Check if each command actually exists before running.
|
|
64
45
|
|
|
65
46
|
## Phase 3: Hard Gates (MUST ALL PASS)
|
|
66
47
|
|
|
67
|
-
Run detected verification commands. Skip any that don't exist
|
|
68
|
-
|
|
69
|
-
Report:
|
|
48
|
+
Run detected verification commands. Skip any that don't exist.
|
|
70
49
|
|
|
71
50
|
```
|
|
72
51
|
Finish Gates: <bead-id>
|
|
73
52
|
━━━━━━━━━━━━━━━━━━━━━━
|
|
53
|
+
|
|
74
54
|
Project: [detected type]
|
|
75
55
|
|
|
76
56
|
Build: [✓/✗/skipped]
|
|
@@ -97,13 +77,19 @@ Read spec:
|
|
|
97
77
|
cat .beads/artifacts/<bead-id>/spec.md
|
|
98
78
|
```
|
|
99
79
|
|
|
100
|
-
Check each success criterion:
|
|
80
|
+
Check each success criterion with its verification command:
|
|
101
81
|
|
|
102
82
|
```
|
|
103
83
|
Success Criteria:
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
- [
|
|
84
|
+
━━━━━━━━━━━━━━━━
|
|
85
|
+
|
|
86
|
+
- [x] [Criterion 1]
|
|
87
|
+
Verify: `[command]` ✓
|
|
88
|
+
- [x] [Criterion 2]
|
|
89
|
+
Verify: `[command]` ✓
|
|
90
|
+
- [ ] [Criterion 3] - NOT MET
|
|
91
|
+
Verify: `[command]` ✗
|
|
92
|
+
Reason: [what failed]
|
|
107
93
|
```
|
|
108
94
|
|
|
109
95
|
**If any criterion not met: STOP.**
|
|
@@ -115,7 +101,38 @@ Missing:
|
|
|
115
101
|
- [Criterion] - [what's needed]
|
|
116
102
|
```
|
|
117
103
|
|
|
118
|
-
## Phase 5:
|
|
104
|
+
## Phase 5: Verify ADR (for L/XL tasks)
|
|
105
|
+
|
|
106
|
+
Check if spec indicated L/XL complexity:
|
|
107
|
+
|
|
108
|
+
```bash
|
|
109
|
+
cat .beads/artifacts/<bead-id>/adr.md 2>/dev/null || echo "No ADR"
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
For L/XL tasks, ADR should exist documenting the design decision.
|
|
113
|
+
|
|
114
|
+
If missing and was L/XL: Warn but don't block.
|
|
115
|
+
|
|
116
|
+
## Phase 6: Calculate Estimation Accuracy
|
|
117
|
+
|
|
118
|
+
Extract estimate from spec/plan and compare to actual:
|
|
119
|
+
|
|
120
|
+
```
|
|
121
|
+
Estimation Accuracy:
|
|
122
|
+
━━━━━━━━━━━━━━━━━━━
|
|
123
|
+
|
|
124
|
+
Estimated: [S/M/L] (~[N] tool calls)
|
|
125
|
+
Actual: [N] tool calls
|
|
126
|
+
Variance: [+/-N%] ([over/under]estimated)
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
**Learning signals:**
|
|
130
|
+
|
|
131
|
+
- > 50% over: Task was harder than expected. Document why in review.
|
|
132
|
+
- > 50% under: Task was easier. Consider if similar tasks should be estimated lower.
|
|
133
|
+
- Within 20%: Good estimate. Pattern worth remembering.
|
|
134
|
+
|
|
135
|
+
## Phase 7: Create Review
|
|
119
136
|
|
|
120
137
|
Write `.beads/artifacts/<bead-id>/review.md`:
|
|
121
138
|
|
|
@@ -125,6 +142,16 @@ Write `.beads/artifacts/<bead-id>/review.md`:
|
|
|
125
142
|
**Bead:** <bead-id>
|
|
126
143
|
**Completed:** <date>
|
|
127
144
|
|
|
145
|
+
## Estimation Accuracy
|
|
146
|
+
|
|
147
|
+
| Metric | Value |
|
|
148
|
+
| --------- | -------------------- |
|
|
149
|
+
| Estimated | [S/M/L] (~[N] calls) |
|
|
150
|
+
| Actual | [N] calls |
|
|
151
|
+
| Variance | [+/-N%] |
|
|
152
|
+
|
|
153
|
+
**Why variance?** [If significant, explain]
|
|
154
|
+
|
|
128
155
|
## Changes Made
|
|
129
156
|
|
|
130
157
|
| File | Change |
|
|
@@ -136,13 +163,18 @@ Write `.beads/artifacts/<bead-id>/review.md`:
|
|
|
136
163
|
|
|
137
164
|
- [Thing that went well]
|
|
138
165
|
|
|
166
|
+
## What Was Difficult
|
|
167
|
+
|
|
168
|
+
- [Challenge encountered and how resolved]
|
|
169
|
+
|
|
139
170
|
## What Was Skipped
|
|
140
171
|
|
|
141
172
|
- [Thing intentionally not done and why]
|
|
142
173
|
|
|
143
|
-
##
|
|
174
|
+
## Lessons Learned
|
|
144
175
|
|
|
145
|
-
- [
|
|
176
|
+
- [Pattern worth documenting]
|
|
177
|
+
- [Gotcha to remember]
|
|
146
178
|
|
|
147
179
|
## Test Coverage
|
|
148
180
|
|
|
@@ -155,7 +187,51 @@ Write `.beads/artifacts/<bead-id>/review.md`:
|
|
|
155
187
|
- [x] [Criterion 2]
|
|
156
188
|
```
|
|
157
189
|
|
|
158
|
-
## Phase
|
|
190
|
+
## Phase 8: Create Observation (if notable findings)
|
|
191
|
+
|
|
192
|
+
If you discovered something worth remembering:
|
|
193
|
+
|
|
194
|
+
```typescript
|
|
195
|
+
observation({
|
|
196
|
+
type: "learning", // or: decision, bugfix, pattern, discovery, warning
|
|
197
|
+
title: "[concise title]",
|
|
198
|
+
content: "[what was learned and why it matters]",
|
|
199
|
+
concepts: "[keywords]",
|
|
200
|
+
files: "[affected files]",
|
|
201
|
+
bead_id: "<bead-id>",
|
|
202
|
+
});
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
**Create observations for:**
|
|
206
|
+
|
|
207
|
+
- Patterns that should be reused
|
|
208
|
+
- Gotchas that wasted time
|
|
209
|
+
- Design decisions with rationale
|
|
210
|
+
- Bug root causes
|
|
211
|
+
|
|
212
|
+
## Phase 9: Update Memory (if applicable)
|
|
213
|
+
|
|
214
|
+
If patterns or gotchas discovered:
|
|
215
|
+
|
|
216
|
+
```typescript
|
|
217
|
+
// For new patterns
|
|
218
|
+
memory -
|
|
219
|
+
update({
|
|
220
|
+
file: "project/conventions",
|
|
221
|
+
content: "## [Pattern Name]\n\n[Description and example]",
|
|
222
|
+
mode: "append",
|
|
223
|
+
});
|
|
224
|
+
|
|
225
|
+
// For gotchas
|
|
226
|
+
memory -
|
|
227
|
+
update({
|
|
228
|
+
file: "project/gotchas",
|
|
229
|
+
content: "## [Gotcha Title]\n\n[What happened and how to avoid]",
|
|
230
|
+
mode: "append",
|
|
231
|
+
});
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
## Phase 10: Final Commit
|
|
159
235
|
|
|
160
236
|
```bash
|
|
161
237
|
git add -A
|
|
@@ -173,27 +249,36 @@ git commit -m "<bead-id>: [summary of changes]
|
|
|
173
249
|
Closes: <bead-id>"
|
|
174
250
|
```
|
|
175
251
|
|
|
176
|
-
## Phase
|
|
252
|
+
## Phase 11: Close Bead & Notify
|
|
177
253
|
|
|
178
|
-
Complete the task
|
|
254
|
+
Complete the task:
|
|
179
255
|
|
|
180
256
|
```typescript
|
|
181
257
|
bd_done({ id: "$ARGUMENTS", msg: "Implemented: [1-liner summary]" });
|
|
182
258
|
```
|
|
183
259
|
|
|
184
|
-
|
|
260
|
+
Notify dependent tasks are now unblocked:
|
|
185
261
|
|
|
186
|
-
|
|
262
|
+
```typescript
|
|
263
|
+
bd_msg({
|
|
264
|
+
subj: "<bead-id> completed",
|
|
265
|
+
body: "Dependent tasks now unblocked. Summary: [1-liner]",
|
|
266
|
+
to: "all",
|
|
267
|
+
importance: "normal",
|
|
268
|
+
global: true,
|
|
269
|
+
});
|
|
270
|
+
```
|
|
187
271
|
|
|
188
|
-
|
|
272
|
+
## Phase 12: Database Health Check
|
|
189
273
|
|
|
190
274
|
```typescript
|
|
191
275
|
bd_ls({ status: "all", limit: 1 });
|
|
192
276
|
```
|
|
193
277
|
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
278
|
+
| Issue Count | Action |
|
|
279
|
+
| ----------- | -------------------------------------------- |
|
|
280
|
+
| >200 | Warn about performance |
|
|
281
|
+
| >500 | Strongly recommend `bd_cleanup({ days: 7 })` |
|
|
197
282
|
|
|
198
283
|
## Output
|
|
199
284
|
|
|
@@ -205,37 +290,44 @@ Gates: All passed ✓
|
|
|
205
290
|
Criteria: All met ✓
|
|
206
291
|
Commit: [commit hash]
|
|
207
292
|
|
|
293
|
+
Estimation:
|
|
294
|
+
- Estimated: [S/M/L] (~[N] calls)
|
|
295
|
+
- Actual: [N] calls
|
|
296
|
+
- Accuracy: [good/over/under]
|
|
297
|
+
|
|
208
298
|
Artifacts:
|
|
209
299
|
- .beads/artifacts/<bead-id>/spec.md
|
|
210
|
-
- .beads/artifacts/<bead-id>/research.md
|
|
211
|
-
- .beads/artifacts/<bead-id>/plan.md
|
|
212
300
|
- .beads/artifacts/<bead-id>/review.md
|
|
301
|
+
[- .beads/artifacts/<bead-id>/research.md]
|
|
302
|
+
[- .beads/artifacts/<bead-id>/plan.md]
|
|
303
|
+
[- .beads/artifacts/<bead-id>/adr.md]
|
|
213
304
|
|
|
214
305
|
Branch: <bead-id>
|
|
215
306
|
```
|
|
216
307
|
|
|
217
|
-
**
|
|
308
|
+
**Next steps:**
|
|
218
309
|
|
|
219
310
|
```
|
|
220
|
-
|
|
221
|
-
bd_cleanup({ days: 7 })
|
|
222
|
-
bd_sync()
|
|
223
|
-
```
|
|
311
|
+
━━━━━━━━━━━━━━━━━━━━━
|
|
224
312
|
|
|
225
|
-
|
|
313
|
+
Ready to merge:
|
|
314
|
+
/pr <bead-id> # Create pull request
|
|
315
|
+
git checkout main && git merge <bead-id> # Direct merge
|
|
226
316
|
|
|
317
|
+
Or start fresh:
|
|
318
|
+
→ Start new session for next task
|
|
319
|
+
→ Previous work: read_session("last")
|
|
227
320
|
```
|
|
228
|
-
━━━━━━━━━━━━━━━━━━━━━
|
|
229
|
-
Task complete. For best performance:
|
|
230
|
-
→ Start a fresh agent session for next task
|
|
231
|
-
→ Previous work available via read_session("last")
|
|
232
321
|
|
|
233
|
-
|
|
234
|
-
```
|
|
322
|
+
**If issue count >200:**
|
|
235
323
|
|
|
236
|
-
|
|
324
|
+
```
|
|
325
|
+
⚠️ Database has [count] issues. Run:
|
|
326
|
+
bd_cleanup({ days: 7 })
|
|
327
|
+
bd_sync({ reason: "Cleanup after finish" })
|
|
328
|
+
```
|
|
237
329
|
|
|
238
|
-
**If work was
|
|
330
|
+
**If work was incomplete:**
|
|
239
331
|
|
|
240
332
|
```
|
|
241
333
|
⚠️ Work incomplete? Create handoff:
|