opencodekit 0.10.0 → 0.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/dist/index.js +1 -1
  2. package/dist/template/.opencode/agent/planner.md +3 -2
  3. package/dist/template/.opencode/command/accessibility-check.md +293 -30
  4. package/dist/template/.opencode/command/analyze-mockup.md +406 -20
  5. package/dist/template/.opencode/command/analyze-project.md +439 -30
  6. package/dist/template/.opencode/command/brainstorm.md +288 -5
  7. package/dist/template/.opencode/command/commit.md +226 -17
  8. package/dist/template/.opencode/command/create.md +138 -35
  9. package/dist/template/.opencode/command/design-audit.md +477 -29
  10. package/dist/template/.opencode/command/design.md +609 -6
  11. package/dist/template/.opencode/command/edit-image.md +223 -20
  12. package/dist/template/.opencode/command/finish.md +162 -71
  13. package/dist/template/.opencode/command/fix-ci.md +296 -24
  14. package/dist/template/.opencode/command/fix-types.md +345 -13
  15. package/dist/template/.opencode/command/fix-ui.md +293 -13
  16. package/dist/template/.opencode/command/fix.md +256 -9
  17. package/dist/template/.opencode/command/generate-diagram.md +327 -26
  18. package/dist/template/.opencode/command/generate-icon.md +266 -22
  19. package/dist/template/.opencode/command/generate-image.md +232 -12
  20. package/dist/template/.opencode/command/generate-pattern.md +234 -20
  21. package/dist/template/.opencode/command/generate-storyboard.md +231 -21
  22. package/dist/template/.opencode/command/handoff.md +202 -30
  23. package/dist/template/.opencode/command/implement.md +162 -50
  24. package/dist/template/.opencode/command/import-plan.md +247 -51
  25. package/dist/template/.opencode/command/init.md +154 -35
  26. package/dist/template/.opencode/command/integration-test.md +405 -24
  27. package/dist/template/.opencode/command/issue.md +171 -21
  28. package/dist/template/.opencode/command/new-feature.md +382 -54
  29. package/dist/template/.opencode/command/plan.md +144 -118
  30. package/dist/template/.opencode/command/pr.md +229 -28
  31. package/dist/template/.opencode/command/quick-build.md +234 -5
  32. package/dist/template/.opencode/command/research-and-implement.md +436 -12
  33. package/dist/template/.opencode/command/research-ui.md +444 -34
  34. package/dist/template/.opencode/command/research.md +173 -45
  35. package/dist/template/.opencode/command/restore-image.md +416 -22
  36. package/dist/template/.opencode/command/resume.md +439 -63
  37. package/dist/template/.opencode/command/revert-feature.md +341 -64
  38. package/dist/template/.opencode/command/review-codebase.md +193 -4
  39. package/dist/template/.opencode/command/skill-create.md +506 -14
  40. package/dist/template/.opencode/command/skill-optimize.md +487 -16
  41. package/dist/template/.opencode/command/status.md +320 -60
  42. package/dist/template/.opencode/command/summarize.md +374 -33
  43. package/dist/template/.opencode/command/triage.md +355 -0
  44. package/dist/template/.opencode/command/ui-review.md +292 -25
  45. package/dist/template/.opencode/skill/playwriter/SKILL.md +148 -0
  46. package/package.json +1 -1
@@ -1,40 +1,421 @@
1
1
  ---
2
2
  description: Create integration tests within task constraints
3
- argument-hint: "<bead-id>"
3
+ argument-hint: "<bead-id|path> [--pattern=<pattern>] [--framework=<framework>]"
4
4
  agent: build
5
5
  ---
6
6
 
7
7
  # Integration Test: $ARGUMENTS
8
8
 
9
- **Load skills:**
9
+ Create integration tests that verify module boundaries and system interactions.
10
10
 
11
- - `skill({ name: "test-driven-development" })`
12
- - `skill({ name: "condition-based-waiting" })` (for async tests)
13
- - `skill({ name: "testing-anti-patterns" })` (avoid common mistakes)
11
+ ## Load Skills
14
12
 
15
- ## Task Validation
13
+ ```typescript
14
+ skill({ name: "test-driven-development" });
15
+ skill({ name: "condition-based-waiting" }); // For async tests
16
+ skill({ name: "testing-anti-patterns" }); // Avoid common mistakes
17
+ ```
16
18
 
17
- 1. **Check bead exists:** `bd_show({ id: "$ARGUMENTS" })`
18
- 2. **Read constraints:** `.beads/artifacts/$ARGUMENTS/spec.md` Testing Notes section
19
- 3. **If missing:** STOP. Create with `/create` first.
19
+ ---
20
+
21
+ ## What Are Integration Tests?
22
+
23
+ | Test Type | Scope | Speed | Dependencies |
24
+ | --------------- | --------------------------- | ------------ | -------------------- |
25
+ | **Unit** | Single function/class | Fast (ms) | All mocked |
26
+ | **Integration** | Module boundaries, APIs, DB | Medium (s) | Real or test doubles |
27
+ | **E2E** | Full user flows | Slow (s-min) | Real everything |
28
+
29
+ **Integration tests verify:**
30
+
31
+ - API endpoints work end-to-end
32
+ - Database queries return correct data
33
+ - Services communicate correctly
34
+ - External integrations behave as expected
35
+
36
+ ---
37
+
38
+ ## Phase 1: Task Validation
39
+
40
+ ```typescript
41
+ // Check bead exists
42
+ bd_show({ id: "$ARGUMENTS" });
43
+
44
+ // Read test constraints
45
+ read(".beads/artifacts/$ARGUMENTS/spec.md");
46
+ ```
47
+
48
+ If bead missing: STOP. Create with `/create` first.
49
+
50
+ ---
51
+
52
+ ## Phase 2: Framework Detection
53
+
54
+ ```bash
55
+ # Detect test framework
56
+ glob pattern="**/jest.config.*"
57
+ glob pattern="**/vitest.config.*"
58
+ glob pattern="**/pytest.ini"
59
+ glob pattern="**/pyproject.toml"
60
+
61
+ # Read package.json for test command
62
+ read package.json
63
+ ```
64
+
65
+ | Framework | File Pattern | Test Command |
66
+ | --------- | ------------------------ | ------------ |
67
+ | Jest | `*.test.ts`, `*.spec.ts` | `npm test` |
68
+ | Vitest | `*.test.ts`, `*.spec.ts` | `npm test` |
69
+ | pytest | `test_*.py`, `*_test.py` | `pytest` |
70
+ | Go | `*_test.go` | `go test` |
71
+
72
+ ---
73
+
74
+ ## Phase 3: Test Structure
75
+
76
+ ### File Location
77
+
78
+ ```
79
+ src/
80
+ ├── auth/
81
+ │ ├── login.ts
82
+ │ └── login.test.ts # Co-located unit tests
83
+ tests/
84
+ ├── integration/
85
+ │ ├── auth.test.ts # Integration tests here
86
+ │ ├── api.test.ts
87
+ │ └── database.test.ts
88
+ └── fixtures/
89
+ ├── users.json
90
+ └── factories.ts
91
+ ```
92
+
93
+ ### Test File Structure
94
+
95
+ ```typescript
96
+ // tests/integration/auth.test.ts
97
+
98
+ import { describe, it, expect, beforeAll, afterAll, beforeEach } from "vitest";
99
+ import { createTestDatabase, cleanupDatabase } from "../fixtures/database";
100
+ import { createTestUser } from "../fixtures/factories";
101
+ import { app } from "../../src/app";
102
+
103
+ describe("Auth Integration", () => {
104
+ let db: TestDatabase;
105
+
106
+ beforeAll(async () => {
107
+ db = await createTestDatabase();
108
+ });
109
+
110
+ afterAll(async () => {
111
+ await cleanupDatabase(db);
112
+ });
113
+
114
+ beforeEach(async () => {
115
+ await db.clear(); // Clean slate each test
116
+ });
117
+
118
+ describe("POST /login", () => {
119
+ it("returns JWT for valid credentials", async () => {
120
+ // Arrange
121
+ const user = await createTestUser(db, { email: "test@example.com" });
122
+
123
+ // Act
124
+ const response = await app.request("/login", {
125
+ method: "POST",
126
+ body: JSON.stringify({ email: user.email, password: "password123" }),
127
+ });
128
+
129
+ // Assert
130
+ expect(response.status).toBe(200);
131
+ const body = await response.json();
132
+ expect(body.token).toBeDefined();
133
+ expect(body.user.email).toBe(user.email);
134
+ });
135
+
136
+ it("returns 401 for invalid password", async () => {
137
+ const user = await createTestUser(db);
138
+
139
+ const response = await app.request("/login", {
140
+ method: "POST",
141
+ body: JSON.stringify({ email: user.email, password: "wrong" }),
142
+ });
143
+
144
+ expect(response.status).toBe(401);
145
+ });
146
+ });
147
+ });
148
+ ```
149
+
150
+ ---
151
+
152
+ ## Phase 4: Common Test Patterns
153
+
154
+ ### Database Integration
155
+
156
+ ```typescript
157
+ describe("User Repository", () => {
158
+ let db: Database;
159
+
160
+ beforeAll(async () => {
161
+ db = await createTestDatabase();
162
+ await db.migrate();
163
+ });
164
+
165
+ afterEach(async () => {
166
+ await db.exec("DELETE FROM users"); // Clean between tests
167
+ });
168
+
169
+ afterAll(async () => {
170
+ await db.close();
171
+ });
172
+
173
+ it("creates user with hashed password", async () => {
174
+ const repo = new UserRepository(db);
175
+
176
+ const user = await repo.create({
177
+ email: "test@example.com",
178
+ password: "plaintext123",
179
+ });
180
+
181
+ expect(user.id).toBeDefined();
182
+ expect(user.password).not.toBe("plaintext123"); // Should be hashed
183
+ });
184
+ });
185
+ ```
186
+
187
+ ### API Integration
188
+
189
+ ```typescript
190
+ describe("API Integration", () => {
191
+ let server: TestServer;
192
+
193
+ beforeAll(async () => {
194
+ server = await createTestServer();
195
+ });
196
+
197
+ afterAll(async () => {
198
+ await server.close();
199
+ });
200
+
201
+ it("GET /users returns paginated list", async () => {
202
+ // Seed data
203
+ await seedUsers(10);
204
+
205
+ const response = await fetch(`${server.url}/users?page=1&limit=5`);
206
+ const data = await response.json();
207
+
208
+ expect(response.status).toBe(200);
209
+ expect(data.users).toHaveLength(5);
210
+ expect(data.total).toBe(10);
211
+ expect(data.page).toBe(1);
212
+ });
213
+ });
214
+ ```
20
215
 
21
- ## Workflow
216
+ ### External Service Integration
22
217
 
23
- 1. **Load skill** - `skill({ name: "test-driven-development" })`
24
- 2. **Follow TDD cycle:**
25
- - Write failing integration test first
26
- - Verify it fails for the right reason
27
- - Implement minimal code to pass
28
- - Refactor while green
29
- 3. **Test only task integration points** from spec architecture
218
+ ```typescript
219
+ describe("Payment Service", () => {
220
+ it("processes payment with Stripe test mode", async () => {
221
+ const stripe = new Stripe(process.env.STRIPE_TEST_KEY);
30
222
 
31
- ## Anti-Hallucination
223
+ const paymentIntent = await stripe.paymentIntents.create({
224
+ amount: 1000,
225
+ currency: "usd",
226
+ payment_method: "pm_card_visa", // Stripe test card
227
+ confirm: true,
228
+ });
32
229
 
33
- - Test only modules from bead spec scope
34
- - Mock only dependencies from spec
35
- - Use test framework from spec testing notes
36
- - Update `.beads/artifacts/$ARGUMENTS/review.md` after work
230
+ expect(paymentIntent.status).toBe("succeeded");
231
+ });
232
+ });
233
+ ```
234
+
235
+ ### Async/Queue Integration
236
+
237
+ ```typescript
238
+ describe("Job Queue", () => {
239
+ it("processes email job within timeout", async () => {
240
+ const queue = createTestQueue();
241
+
242
+ // Add job
243
+ await queue.add("send-email", { to: "test@example.com" });
244
+
245
+ // Wait for processing (use condition-based-waiting skill)
246
+ await waitFor(
247
+ async () => {
248
+ const job = await queue.getJob("send-email");
249
+ return job?.status === "completed";
250
+ },
251
+ { timeout: 5000, interval: 100 },
252
+ );
253
+
254
+ const job = await queue.getJob("send-email");
255
+ expect(job.status).toBe("completed");
256
+ });
257
+ });
258
+ ```
259
+
260
+ ---
261
+
262
+ ## Phase 5: Test Data Management
263
+
264
+ ### Factories
265
+
266
+ ```typescript
267
+ // tests/fixtures/factories.ts
268
+
269
+ export function createTestUser(db: Database, overrides = {}) {
270
+ return db.insert("users", {
271
+ id: randomUUID(),
272
+ email: `test-${Date.now()}@example.com`,
273
+ password: hashSync("password123", 10),
274
+ createdAt: new Date(),
275
+ ...overrides,
276
+ });
277
+ }
278
+
279
+ export function createTestOrder(db: Database, userId: string, overrides = {}) {
280
+ return db.insert("orders", {
281
+ id: randomUUID(),
282
+ userId,
283
+ status: "pending",
284
+ total: 100,
285
+ ...overrides,
286
+ });
287
+ }
288
+ ```
289
+
290
+ ### Cleanup Strategies
291
+
292
+ | Strategy | Pros | Cons |
293
+ | ------------------------ | ----------- | ------------------ |
294
+ | **Transaction rollback** | Fast, clean | Complex setup |
295
+ | **DELETE after each** | Simple | Slower |
296
+ | **Fresh DB per test** | Isolated | Very slow |
297
+ | **Truncate tables** | Fast reset | May miss FK issues |
298
+
299
+ **Recommended:** Transaction rollback for speed, DELETE for simplicity.
300
+
301
+ ---
302
+
303
+ ## Phase 6: Isolation Patterns
304
+
305
+ ### Database Isolation
306
+
307
+ ```typescript
308
+ // Wrap each test in transaction that rolls back
309
+ beforeEach(async () => {
310
+ await db.exec("BEGIN");
311
+ });
312
+
313
+ afterEach(async () => {
314
+ await db.exec("ROLLBACK");
315
+ });
316
+ ```
317
+
318
+ ### Port Isolation (Parallel Tests)
319
+
320
+ ```typescript
321
+ // Use dynamic ports for parallel test runners
322
+ const server = await app.listen(0); // Random available port
323
+ const port = server.address().port;
324
+ ```
325
+
326
+ ### Environment Isolation
327
+
328
+ ```bash
329
+ # .env.test
330
+ DATABASE_URL=postgres://localhost/myapp_test
331
+ STRIPE_KEY=sk_test_xxx
332
+ REDIS_URL=redis://localhost:6379/1 # Separate DB number
333
+ ```
334
+
335
+ ---
336
+
337
+ ## Phase 7: TDD Workflow
338
+
339
+ Follow the cycle:
340
+
341
+ 1. **Write failing test first**
342
+ - Test should fail for the RIGHT reason
343
+ - Not a syntax error, but missing functionality
344
+
345
+ 2. **Verify failure message**
346
+ - Should clearly indicate what's missing
347
+ - "Expected 200, got 404" = endpoint missing
348
+
349
+ 3. **Implement minimal code**
350
+ - Just enough to pass
351
+ - Don't over-engineer
352
+
353
+ 4. **Refactor while green**
354
+ - Improve code quality
355
+ - Keep tests passing
356
+
357
+ ---
358
+
359
+ ## Anti-Patterns to Avoid
360
+
361
+ | Anti-Pattern | Problem | Do Instead |
362
+ | ------------------------------ | --------------------------- | --------------------------------- |
363
+ | Testing implementation details | Brittle tests | Test behavior/outcomes |
364
+ | Excessive mocking | Tests don't reflect reality | Use real dependencies |
365
+ | Shared mutable state | Flaky tests | Isolate each test |
366
+ | Testing third-party code | Waste of time | Trust libraries, test integration |
367
+ | No cleanup | Tests affect each other | Always clean up |
368
+ | Hardcoded test data | Fragile | Use factories |
369
+
370
+ ---
371
+
372
+ ## Coverage Guidelines
373
+
374
+ | Coverage Type | Target | Notes |
375
+ | -------------------- | --------- | ----------------------------- |
376
+ | Line coverage | 70-80% | Higher for critical paths |
377
+ | Branch coverage | 60-70% | Cover main branches |
378
+ | Integration coverage | Key paths | All API endpoints, main flows |
379
+
380
+ **Focus on:** Happy paths, error cases, edge cases in that order.
381
+
382
+ ---
383
+
384
+ ## CI Considerations
385
+
386
+ ```yaml
387
+ # .github/workflows/test.yml
388
+ jobs:
389
+ integration-tests:
390
+ services:
391
+ postgres:
392
+ image: postgres:15
393
+ env:
394
+ POSTGRES_DB: test
395
+ steps:
396
+ - run: npm run test:integration
397
+ env:
398
+ DATABASE_URL: postgres://postgres@localhost/test
399
+ ```
400
+
401
+ ---
402
+
403
+ ## Output
404
+
405
+ After writing tests:
406
+
407
+ 1. **Run tests**: Verify all pass
408
+ 2. **Check coverage**: Meet guidelines
409
+ 3. **Update review.md**: `.beads/artifacts/$ARGUMENTS/review.md`
410
+ 4. **Complete**: `/finish $ARGUMENTS`
411
+
412
+ ---
37
413
 
38
- ## Complete
414
+ ## Related Commands
39
415
 
40
- Run `/finish $ARGUMENTS` when done.
416
+ | Need | Command |
417
+ | ------------------- | ------------------------- |
418
+ | Create unit tests | Use TDD skill directly |
419
+ | Fix failing tests | `/fix` |
420
+ | Review test quality | `/review-codebase tests/` |
421
+ | Complete task | `/finish <bead-id>` |
@@ -1,37 +1,115 @@
1
1
  ---
2
2
  description: Analyze GitHub issue and create bead for tracking
3
- argument-hint: "[issue-number]"
3
+ argument-hint: "<issue-number>"
4
4
  agent: build
5
5
  ---
6
6
 
7
7
  # Analyze Issue: $ARGUMENTS
8
8
 
9
- ## Fetch Issue
9
+ ## Phase 1: Check for Duplicates
10
+
11
+ Before creating, search for existing beads:
12
+
13
+ ```typescript
14
+ bd_ls({ status: "all", limit: 20 });
15
+ memory - search({ query: "[keywords from issue title]" });
16
+ ```
17
+
18
+ If similar bead exists:
19
+
20
+ - Link as related, or
21
+ - Add to existing bead, or
22
+ - Confirm this is intentionally separate
23
+
24
+ ## Phase 2: Fetch GitHub Issue
10
25
 
11
26
  ```bash
12
- gh issue view $ARGUMENTS
27
+ gh issue view $ARGUMENTS --json title,body,labels,state,assignees,milestone
13
28
  ```
14
29
 
15
- ## Analysis
30
+ Extract:
31
+
32
+ - **Title**: Issue title
33
+ - **Labels**: For tag mapping
34
+ - **Body**: For analysis
35
+
36
+ ## Phase 3: Analysis
37
+
38
+ Parse the issue content:
39
+
40
+ | Field | Extract From |
41
+ | ------------ | ------------------------------- |
42
+ | **Problem** | What's broken/needed? |
43
+ | **Expected** | What should happen? |
44
+ | **Current** | What happens now? |
45
+ | **Steps** | How to reproduce? |
46
+ | **Files** | Mentioned files or components |
47
+ | **Labels** | bug, feature, enhancement, etc. |
48
+
49
+ ## Phase 4: Map Labels & Priority
50
+
51
+ **Label → Tag mapping:**
52
+
53
+ | GitHub Label | Bead Tag |
54
+ | ------------- | -------- |
55
+ | bug | bug |
56
+ | enhancement | feature |
57
+ | feature | feature |
58
+ | documentation | docs |
59
+ | frontend, ui | fe |
60
+ | backend, api | be |
61
+ | mobile | mobile |
62
+ | devops, infra | devops |
63
+ | testing | qa |
16
64
 
17
- 1. **Problem:** What's broken/needed?
18
- 2. **Expected:** What should happen?
19
- 3. **Current:** What happens now?
20
- 4. **Steps:** How to reproduce?
65
+ **Priority mapping:**
21
66
 
22
- ## Create Tracking Bead
67
+ | GitHub Signal | Bead Priority |
68
+ | ------------------------- | ------------- |
69
+ | critical, P0, blocker | 0 |
70
+ | high, P1, urgent | 1 |
71
+ | medium, P2 (default) | 2 |
72
+ | low, P3 | 3 |
73
+ | backlog, P4, nice-to-have | 4 |
23
74
 
24
- Create a bead to track this work, linking it to the GitHub issue:
75
+ ## Phase 5: Estimate Complexity
76
+
77
+ Based on issue analysis:
78
+
79
+ | Signals | Estimate | Next Step |
80
+ | ------------------------------------- | -------- | ---------- |
81
+ | Single file, obvious fix, clear repro | S (~10) | /implement |
82
+ | Few files, clear scope, known area | M (~30) | /implement |
83
+ | Multiple files, needs investigation | L (~100) | /research |
84
+ | Vague, architectural, cross-cutting | XL | Decompose |
85
+
86
+ ## Phase 6: Create Tracking Bead
87
+
88
+ Reserve spec file:
25
89
 
26
90
  ```typescript
27
- bd_add({ title: "<issue title>", type: "task", pri: 2 });
91
+ bd_reserve({
92
+ paths: [".beads/artifacts/<bead-id>/spec.md"],
93
+ reason: "Creating issue bead",
94
+ ttl: 600,
95
+ });
28
96
  ```
29
97
 
30
- Save the bead ID for subsequent commands. Add the GitHub issue reference via `bd_msg` or in the spec.
98
+ Create bead with mapped values:
99
+
100
+ ```typescript
101
+ bd_add({
102
+ title: "<issue title>",
103
+ type: "[bug|feature|task]", // from label mapping
104
+ pri: [0 - 4], // from priority mapping
105
+ tags: ["[role]", "[estimate]"], // e.g., ["fe", "M"]
106
+ desc: "GitHub Issue #$ARGUMENTS",
107
+ });
108
+ ```
31
109
 
32
- ## Create Spec from PRD Template
110
+ ## Phase 7: Create Spec
33
111
 
34
- Use `.opencode/memory/_templates/prd.md` as the base structure.
112
+ Use `.opencode/memory/_templates/prd.md` as base structure.
35
113
 
36
114
  Save to `.beads/artifacts/<bead-id>/spec.md`:
37
115
 
@@ -42,6 +120,7 @@ Save to `.beads/artifacts/<bead-id>/spec.md`:
42
120
  **Created:** [date]
43
121
  **Status:** To Do
44
122
  **GitHub Issue:** #$ARGUMENTS
123
+ **Estimate:** [S/M/L/XL] (~[N] tool calls)
45
124
 
46
125
  ## Goal
47
126
 
@@ -49,12 +128,12 @@ Save to `.beads/artifacts/<bead-id>/spec.md`:
49
128
 
50
129
  ## Scope
51
130
 
52
- ### In-Scope:
131
+ **In-Scope:**
53
132
 
54
133
  - [Files to change]
55
134
  - [Specific functionality to fix/add]
56
135
 
57
- ### Out-of-Scope:
136
+ **Out-of-Scope:**
58
137
 
59
138
  - [What we are NOT touching]
60
139
 
@@ -65,9 +144,22 @@ Save to `.beads/artifacts/<bead-id>/spec.md`:
65
144
 
66
145
  ## Success Criteria
67
146
 
68
- - [ ] [Specific fix verified]
69
- - [ ] [Test cases pass]
70
- - [ ] [No regression]
147
+ - [ ] [Criterion 1]
148
+ - Verify: `[actual command to test]`
149
+ - [ ] [Criterion 2]
150
+ - Verify: `[actual command to test]`
151
+ - [ ] No regression in related functionality
152
+ - Verify: `npm test`
153
+
154
+ ## Constraints
155
+
156
+ **Must:**
157
+
158
+ - [Required constraint from issue]
159
+
160
+ **Never:**
161
+
162
+ - [Anti-pattern or forbidden action]
71
163
 
72
164
  ## Dependencies
73
165
 
@@ -77,11 +169,62 @@ Save to `.beads/artifacts/<bead-id>/spec.md`:
77
169
 
78
170
  - **Risks/edge cases:** [What could go wrong]
79
171
  - **Testing strategy:** [How to verify fix]
172
+ - **Related issues:** [Link to related GitHub issues]
173
+ ```
174
+
175
+ ## Phase 8: Comment on GitHub Issue
176
+
177
+ Add bead reference back to GitHub:
178
+
179
+ ```bash
180
+ gh issue comment $ARGUMENTS --body "Tracking: \`<bead-id>\`
181
+
182
+ Estimate: [S/M/L/XL]
183
+ Next: [/implement or /research]"
80
184
  ```
81
185
 
186
+ ## Phase 9: Assign Role (optional)
187
+
188
+ For multi-agent workflows:
189
+
190
+ ```typescript
191
+ bd_assign({ id: "<bead-id>", role: "[fe/be/mobile/devops/qa]", notify: true });
192
+ ```
193
+
194
+ ## Phase 10: Sync & Report
195
+
196
+ ```typescript
197
+ bd_release({ _: true });
198
+ bd_sync({ reason: "Created bead for issue #$ARGUMENTS" });
199
+ ```
200
+
201
+ ```
202
+ Issue Imported: #$ARGUMENTS
203
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━
204
+
205
+ Bead: <bead-id>
206
+ Type: [bug/feature/task]
207
+ Priority: [0-4]
208
+ Estimate: [S/M/L/XL] (~[N] tool calls)
209
+
210
+ Labels mapped: [list]
211
+ Tags: [list]
212
+
213
+ Spec: .beads/artifacts/<bead-id>/spec.md
214
+ GitHub: Commented with bead reference ✓
215
+ ```
216
+
217
+ **Next steps by estimate:**
218
+
219
+ | Estimate | Command |
220
+ | -------- | ---------------------- |
221
+ | S/M | `/implement <bead-id>` |
222
+ | L | `/research <bead-id>` |
223
+ | XL | Decompose first |
224
+
82
225
  ## Discovered Work
83
226
 
84
- If analysis reveals additional issues, create child beads:
227
+ If analysis reveals additional issues:
85
228
 
86
229
  ```typescript
87
230
  bd_add({
@@ -89,7 +232,14 @@ bd_add({
89
232
  type: "task",
90
233
  pri: 2,
91
234
  parent: "<parent-bead-id>",
235
+ tags: ["[role]", "[estimate]"],
92
236
  });
93
237
  ```
94
238
 
95
- **Next:** Use `/implement <bead-id>` to start implementation.
239
+ Report discovered work:
240
+
241
+ ```
242
+ Discovered Work:
243
+ - <child-bead-id>: [title] ([estimate])
244
+ - <child-bead-id>: [title] ([estimate])
245
+ ```