create-kuckit-app 2.0.2 → 2.2.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 (62) hide show
  1. package/README.md +24 -14
  2. package/package.json +3 -1
  3. package/templates/base/.claude/skills/beads/CLAUDE.md +87 -0
  4. package/templates/base/.claude/skills/beads/README.md +123 -0
  5. package/templates/base/.claude/skills/beads/SKILL.md +77 -715
  6. package/templates/base/.claude/skills/beads/adr/0001-bd-prime-as-source-of-truth.md +61 -0
  7. package/templates/base/.claude/skills/beads/resources/AGENTS.md +62 -0
  8. package/templates/base/.claude/skills/beads/resources/ASYNC_GATES.md +175 -0
  9. package/templates/base/.claude/skills/beads/resources/BOUNDARIES.md +520 -0
  10. package/templates/base/.claude/skills/beads/resources/CHEMISTRY_PATTERNS.md +197 -0
  11. package/templates/base/.claude/skills/beads/resources/CLI_REFERENCE.md +561 -0
  12. package/templates/base/.claude/skills/beads/resources/DEPENDENCIES.md +754 -0
  13. package/templates/base/.claude/skills/beads/resources/INTEGRATION_PATTERNS.md +438 -0
  14. package/templates/base/.claude/skills/beads/resources/ISSUE_CREATION.md +150 -0
  15. package/templates/base/.claude/skills/beads/resources/MOLECULES.md +370 -0
  16. package/templates/base/.claude/skills/beads/resources/PATTERNS.md +363 -0
  17. package/templates/base/.claude/skills/beads/resources/RESUMABILITY.md +239 -0
  18. package/templates/base/.claude/skills/beads/resources/STATIC_DATA.md +61 -0
  19. package/templates/base/.claude/skills/beads/resources/TROUBLESHOOTING.md +537 -0
  20. package/templates/base/.claude/skills/beads/resources/WORKFLOWS.md +638 -0
  21. package/templates/base/.claude/skills/beads/resources/WORKTREES.md +95 -0
  22. package/templates/base/.claude/skills/browser-skill/SKILL.md +72 -0
  23. package/templates/base/.claude/skills/knowledge/SKILL.md +155 -205
  24. package/templates/base/.claude/skills/knowledge/reference/doc-mapping.md +49 -0
  25. package/templates/base/.claude/skills/knowledge/reference/extraction-prompts.md +102 -0
  26. package/templates/base/.claude/skills/kuckit/SKILL.md +15 -9
  27. package/templates/base/.claude/skills/kuckit/references/MODULE-DEVELOPMENT.md +142 -0
  28. package/templates/base/.claude/skills/kuckit/references/PACKAGES.md +22 -17
  29. package/templates/base/.claude/skills/kuckit/references/PUBLISHING.md +92 -0
  30. package/templates/base/.claude/skills/module-testing/SKILL.md +1 -1
  31. package/templates/base/.claude/skills/planning/SKILL.md +26 -1
  32. package/templates/base/.env.example +1 -1
  33. package/templates/base/AGENTS.md +155 -418
  34. package/templates/base/apps/server/package.json +3 -3
  35. package/templates/base/apps/server/src/modules.ts +14 -1
  36. package/templates/base/apps/web/.env.example +1 -1
  37. package/templates/base/apps/web/package.json +2 -2
  38. package/templates/base/apps/web/src/components/dashboard/nav-user.tsx +3 -3
  39. package/templates/base/apps/web/src/components/ui/sidebar.tsx +2 -1
  40. package/templates/base/apps/web/src/routes/$.tsx +0 -1
  41. package/templates/base/apps/web/src/routes/__root.tsx +7 -1
  42. package/templates/base/apps/web/src/routes/dashboard.tsx +3 -1
  43. package/templates/base/apps/web/src/routes/index.tsx +17 -22
  44. package/templates/base/apps/web/src/routes/login.tsx +81 -50
  45. package/templates/base/apps/web/tsconfig.json +1 -0
  46. package/templates/base/docs/ARCHITECTURE.md +689 -0
  47. package/templates/base/docs/DEPENDENCY-INJECTION.md +871 -0
  48. package/templates/base/docs/DEPLOYMENT.md +573 -0
  49. package/templates/base/docs/INDEX.md +135 -0
  50. package/templates/base/docs/MIGRATION.md +989 -0
  51. package/templates/base/docs/MODULE_CSS.md +343 -0
  52. package/templates/base/docs/MODULE_TESTING.md +368 -0
  53. package/templates/base/docs/MULTI_AGENT_WORKFLOW.md +909 -0
  54. package/templates/base/docs/TESTING.md +579 -0
  55. package/templates/base/docs/TROUBLESHOOTING.md +360 -0
  56. package/templates/base/drizzle.config.ts +17 -1
  57. package/templates/base/package.json +8 -6
  58. package/templates/base/packages/items-module/AGENTS.md +3 -1
  59. package/templates/base/packages/items-module/package.json +4 -4
  60. package/templates/base/packages/items-module/src/server/adapters/{item.drizzle.ts → item.repository.ts} +1 -13
  61. package/templates/base/packages/items-module/src/server/module.ts +2 -1
  62. package/templates/base/packages/items-module/src/server/schema/item.ts +13 -0
@@ -0,0 +1,561 @@
1
+ # CLI Command Reference
2
+
3
+ **For:** AI agents and developers using bd command-line interface
4
+ **Version:** 0.43.0+
5
+
6
+ ## Quick Navigation
7
+
8
+ - [Basic Operations](#basic-operations)
9
+ - [Issue Management](#issue-management)
10
+ - [Dependencies & Labels](#dependencies--labels)
11
+ - [Filtering & Search](#filtering--search)
12
+ - [Advanced Operations](#advanced-operations)
13
+ - [Database Management](#database-management)
14
+
15
+ ## Basic Operations
16
+
17
+ ### Check Status
18
+
19
+ ```bash
20
+ # Check database path and daemon status
21
+ bd info --json
22
+
23
+ # Example output:
24
+ # {
25
+ # "database_path": "/path/to/.beads/beads.db",
26
+ # "issue_prefix": "bd",
27
+ # "daemon_running": true
28
+ # }
29
+ ```
30
+
31
+ ### Find Work
32
+
33
+ ```bash
34
+ # Find ready work (no blockers)
35
+ bd ready --json
36
+
37
+ # Find stale issues (not updated recently)
38
+ bd stale --days 30 --json # Default: 30 days
39
+ bd stale --days 90 --status in_progress --json # Filter by status
40
+ bd stale --limit 20 --json # Limit results
41
+ ```
42
+
43
+ ## Issue Management
44
+
45
+ ### Create Issues
46
+
47
+ ```bash
48
+ # Basic creation
49
+ # IMPORTANT: Always quote titles and descriptions with double quotes
50
+ bd create "Issue title" -t bug|feature|task -p 0-4 -d "Description" --json
51
+
52
+ # Create with explicit ID (for parallel workers)
53
+ bd create "Issue title" --id worker1-100 -p 1 --json
54
+
55
+ # Create with labels (--labels or --label work)
56
+ bd create "Issue title" -t bug -p 1 -l bug,critical --json
57
+ bd create "Issue title" -t bug -p 1 --label bug,critical --json
58
+
59
+ # Examples with special characters (all require quoting):
60
+ bd create "Fix: auth doesn't validate tokens" -t bug -p 1 --json
61
+ bd create "Add support for OAuth 2.0" -d "Implement RFC 6749 (OAuth 2.0 spec)" --json
62
+
63
+ # Create multiple issues from markdown file
64
+ bd create -f feature-plan.md --json
65
+
66
+ # Create epic with hierarchical child tasks
67
+ bd create "Auth System" -t epic -p 1 --json # Returns: bd-a3f8e9
68
+ bd create "Login UI" -p 1 --json # Auto-assigned: bd-a3f8e9.1
69
+ bd create "Backend validation" -p 1 --json # Auto-assigned: bd-a3f8e9.2
70
+ bd create "Tests" -p 1 --json # Auto-assigned: bd-a3f8e9.3
71
+
72
+ # Create and link discovered work (one command)
73
+ bd create "Found bug" -t bug -p 1 --deps discovered-from:<parent-id> --json
74
+ ```
75
+
76
+ ### Update Issues
77
+
78
+ ```bash
79
+ # Update one or more issues
80
+ bd update <id> [<id>...] --status in_progress --json
81
+ bd update <id> [<id>...] --priority 1 --json
82
+
83
+ # Edit issue fields in $EDITOR (HUMANS ONLY - not for agents)
84
+ # NOTE: This command is intentionally NOT exposed via the MCP server
85
+ # Agents should use 'bd update' with field-specific parameters instead
86
+ bd edit <id> # Edit description
87
+ bd edit <id> --title # Edit title
88
+ bd edit <id> --design # Edit design notes
89
+ bd edit <id> --notes # Edit notes
90
+ bd edit <id> --acceptance # Edit acceptance criteria
91
+ ```
92
+
93
+ ### Close/Reopen Issues
94
+
95
+ ```bash
96
+ # Complete work (supports multiple IDs)
97
+ bd close <id> [<id>...] --reason "Done" --json
98
+
99
+ # Reopen closed issues (supports multiple IDs)
100
+ bd reopen <id> [<id>...] --reason "Reopening" --json
101
+ ```
102
+
103
+ ### View Issues
104
+
105
+ ```bash
106
+ # Show dependency tree
107
+ bd dep tree <id>
108
+
109
+ # Get issue details (supports multiple IDs)
110
+ bd show <id> [<id>...] --json
111
+ ```
112
+
113
+ ## Dependencies & Labels
114
+
115
+ ### Dependencies
116
+
117
+ ```bash
118
+ # Link discovered work (old way - two commands)
119
+ bd dep add <discovered-id> <parent-id> --type discovered-from
120
+
121
+ # Create and link in one command (new way - preferred)
122
+ bd create "Issue title" -t bug -p 1 --deps discovered-from:<parent-id> --json
123
+ ```
124
+
125
+ ### Labels
126
+
127
+ ```bash
128
+ # Label management (supports multiple IDs)
129
+ bd label add <id> [<id>...] <label> --json
130
+ bd label remove <id> [<id>...] <label> --json
131
+ bd label list <id> --json
132
+ bd label list-all --json
133
+ ```
134
+
135
+ ## Filtering & Search
136
+
137
+ ### Basic Filters
138
+
139
+ ```bash
140
+ # Filter by status, priority, type
141
+ bd list --status open --priority 1 --json # Status and priority
142
+ bd list --assignee alice --json # By assignee
143
+ bd list --type bug --json # By issue type
144
+ bd list --id bd-123,bd-456 --json # Specific IDs
145
+ ```
146
+
147
+ ### Label Filters
148
+
149
+ ```bash
150
+ # Labels (AND: must have ALL)
151
+ bd list --label bug,critical --json
152
+
153
+ # Labels (OR: has ANY)
154
+ bd list --label-any frontend,backend --json
155
+ ```
156
+
157
+ ### Text Search
158
+
159
+ ```bash
160
+ # Title search (substring)
161
+ bd list --title "auth" --json
162
+
163
+ # Pattern matching (case-insensitive substring)
164
+ bd list --title-contains "auth" --json # Search in title
165
+ bd list --desc-contains "implement" --json # Search in description
166
+ bd list --notes-contains "TODO" --json # Search in notes
167
+ ```
168
+
169
+ ### Date Range Filters
170
+
171
+ ```bash
172
+ # Date range filters (YYYY-MM-DD or RFC3339)
173
+ bd list --created-after 2024-01-01 --json # Created after date
174
+ bd list --created-before 2024-12-31 --json # Created before date
175
+ bd list --updated-after 2024-06-01 --json # Updated after date
176
+ bd list --updated-before 2024-12-31 --json # Updated before date
177
+ bd list --closed-after 2024-01-01 --json # Closed after date
178
+ bd list --closed-before 2024-12-31 --json # Closed before date
179
+ ```
180
+
181
+ ### Empty/Null Checks
182
+
183
+ ```bash
184
+ # Empty/null checks
185
+ bd list --empty-description --json # Issues with no description
186
+ bd list --no-assignee --json # Unassigned issues
187
+ bd list --no-labels --json # Issues with no labels
188
+ ```
189
+
190
+ ### Priority Ranges
191
+
192
+ ```bash
193
+ # Priority ranges
194
+ bd list --priority-min 0 --priority-max 1 --json # P0 and P1 only
195
+ bd list --priority-min 2 --json # P2 and below
196
+ ```
197
+
198
+ ### Combine Filters
199
+
200
+ ```bash
201
+ # Combine multiple filters
202
+ bd list --status open --priority 1 --label-any urgent,critical --no-assignee --json
203
+ ```
204
+
205
+ ## Global Flags
206
+
207
+ Global flags work with any bd command and must appear **before** the subcommand.
208
+
209
+ ### Sandbox Mode
210
+
211
+ **Auto-detection (v0.21.1+):** bd automatically detects sandboxed environments and enables sandbox mode.
212
+
213
+ When detected, you'll see: `ℹ️ Sandbox detected, using direct mode`
214
+
215
+ **Manual override:**
216
+
217
+ ```bash
218
+ # Explicitly enable sandbox mode
219
+ bd --sandbox <command>
220
+
221
+ # Equivalent to combining these flags:
222
+ bd --no-daemon --no-auto-flush --no-auto-import <command>
223
+ ```
224
+
225
+ **What it does:**
226
+
227
+ - Disables daemon (uses direct SQLite mode)
228
+ - Disables auto-export to JSONL
229
+ - Disables auto-import from JSONL
230
+
231
+ **When to use:** Sandboxed environments where daemon can't be controlled (permission restrictions), or when auto-detection doesn't trigger.
232
+
233
+ ### Staleness Control
234
+
235
+ ```bash
236
+ # Skip staleness check (emergency escape hatch)
237
+ bd --allow-stale <command>
238
+
239
+ # Example: access database even if out of sync with JSONL
240
+ bd --allow-stale ready --json
241
+ bd --allow-stale list --status open --json
242
+ ```
243
+
244
+ **Shows:** `⚠️ Staleness check skipped (--allow-stale), data may be out of sync`
245
+
246
+ **⚠️ Caution:** May show stale or incomplete data. Use only when stuck and other options fail.
247
+
248
+ ### Force Import
249
+
250
+ ```bash
251
+ # Force metadata update even when DB appears synced
252
+ bd import --force -i .beads/issues.jsonl
253
+ ```
254
+
255
+ **When to use:** `bd import` reports "0 created, 0 updated" but staleness errors persist.
256
+
257
+ **Shows:** `Metadata updated (database already in sync with JSONL)`
258
+
259
+ ### Other Global Flags
260
+
261
+ ```bash
262
+ # JSON output for programmatic use
263
+ bd --json <command>
264
+
265
+ # Force direct mode (bypass daemon)
266
+ bd --no-daemon <command>
267
+
268
+ # Disable auto-sync
269
+ bd --no-auto-flush <command> # Disable auto-export to JSONL
270
+ bd --no-auto-import <command> # Disable auto-import from JSONL
271
+
272
+ # Custom database path
273
+ bd --db /path/to/.beads/beads.db <command>
274
+
275
+ # Custom actor for audit trail
276
+ bd --actor alice <command>
277
+ ```
278
+
279
+ **See also:**
280
+
281
+ - [TROUBLESHOOTING.md - Sandboxed environments](TROUBLESHOOTING.md#sandboxed-environments-codex-claude-code-etc) for detailed sandbox troubleshooting
282
+ - [DAEMON.md](DAEMON.md) for daemon mode details
283
+
284
+ ## Advanced Operations
285
+
286
+ ### Cleanup
287
+
288
+ ```bash
289
+ # Clean up closed issues (bulk deletion)
290
+ bd admin cleanup --force --json # Delete ALL closed issues
291
+ bd admin cleanup --older-than 30 --force --json # Delete closed >30 days ago
292
+ bd admin cleanup --dry-run --json # Preview what would be deleted
293
+ bd admin cleanup --older-than 90 --cascade --force --json # Delete old + dependents
294
+ ```
295
+
296
+ ### Duplicate Detection & Merging
297
+
298
+ ```bash
299
+ # Find and merge duplicate issues
300
+ bd duplicates # Show all duplicates
301
+ bd duplicates --auto-merge # Automatically merge all
302
+ bd duplicates --dry-run # Preview merge operations
303
+
304
+ # Merge specific duplicate issues
305
+ bd merge <source-id...> --into <target-id> --json # Consolidate duplicates
306
+ bd merge bd-42 bd-43 --into bd-41 --dry-run # Preview merge
307
+ ```
308
+
309
+ ### Compaction (Memory Decay)
310
+
311
+ ```bash
312
+ # Agent-driven compaction
313
+ bd admin compact --analyze --json # Get candidates for review
314
+ bd admin compact --analyze --tier 1 --limit 10 --json # Limited batch
315
+ bd admin compact --apply --id bd-42 --summary summary.txt # Apply compaction
316
+ bd admin compact --apply --id bd-42 --summary - < summary.txt # From stdin
317
+ bd admin compact --stats --json # Show statistics
318
+
319
+ # Legacy AI-powered compaction (requires ANTHROPIC_API_KEY)
320
+ bd admin compact --auto --dry-run --all # Preview
321
+ bd admin compact --auto --all --tier 1 # Auto-compact tier 1
322
+
323
+ # Restore compacted issue from git history
324
+ bd restore <id> # View full history at time of compaction
325
+ ```
326
+
327
+ ### Rename Prefix
328
+
329
+ ```bash
330
+ # Rename issue prefix (e.g., from 'knowledge-work-' to 'kw-')
331
+ bd rename-prefix kw- --dry-run # Preview changes
332
+ bd rename-prefix kw- --json # Apply rename
333
+ ```
334
+
335
+ ## Database Management
336
+
337
+ ### Import/Export
338
+
339
+ ```bash
340
+ # Import issues from JSONL
341
+ bd import -i .beads/issues.jsonl --dry-run # Preview changes
342
+ bd import -i .beads/issues.jsonl # Import and update issues
343
+ bd import -i .beads/issues.jsonl --dedupe-after # Import + detect duplicates
344
+
345
+ # Handle missing parents during import
346
+ bd import -i issues.jsonl --orphan-handling allow # Default: import orphans without validation
347
+ bd import -i issues.jsonl --orphan-handling resurrect # Auto-resurrect deleted parents as tombstones
348
+ bd import -i issues.jsonl --orphan-handling skip # Skip orphans with warning
349
+ bd import -i issues.jsonl --orphan-handling strict # Fail if parent is missing
350
+
351
+ # Configure default orphan handling behavior
352
+ bd config set import.orphan_handling "resurrect"
353
+ bd sync # Now uses resurrect mode by default
354
+ ```
355
+
356
+ **Orphan handling modes:**
357
+
358
+ - **`allow` (default)** - Import orphaned children without parent validation. Most permissive, ensures no data loss even if hierarchy is temporarily broken.
359
+ - **`resurrect`** - Search JSONL history for deleted parents and recreate them as tombstones (Status=Closed, Priority=4). Preserves hierarchy with minimal data. Dependencies are also resurrected on best-effort basis.
360
+ - **`skip`** - Skip orphaned children with warning. Partial import succeeds but some issues are excluded.
361
+ - **`strict`** - Fail import immediately if a child's parent is missing. Use when database integrity is critical.
362
+
363
+ **When to use:**
364
+
365
+ - Use `allow` (default) for daily imports and auto-sync
366
+ - Use `resurrect` when importing from databases with deleted parents
367
+ - Use `strict` for controlled imports requiring guaranteed parent existence
368
+ - Use `skip` rarely - only for selective imports
369
+
370
+ See [CONFIG.md](CONFIG.md#example-import-orphan-handling) and [TROUBLESHOOTING.md](TROUBLESHOOTING.md#import-fails-with-missing-parent-errors) for more details.
371
+
372
+ ### Migration
373
+
374
+ ```bash
375
+ # Migrate databases after version upgrade
376
+ bd migrate # Detect and migrate old databases
377
+ bd migrate --dry-run # Preview migration
378
+ bd migrate --cleanup --yes # Migrate and remove old files
379
+
380
+ # AI-supervised migration (check before running bd migrate)
381
+ bd migrate --inspect --json # Show migration plan for AI agents
382
+ bd info --schema --json # Get schema, tables, config, sample IDs
383
+ ```
384
+
385
+ **Migration workflow for AI agents:**
386
+
387
+ 1. Run `--inspect` to see pending migrations and warnings
388
+ 2. Check for `missing_config` (like issue_prefix)
389
+ 3. Review `invariants_to_check` for safety guarantees
390
+ 4. If warnings exist, fix config issues first
391
+ 5. Then run `bd migrate` safely
392
+
393
+ **Migration safety invariants:**
394
+
395
+ - **required_config_present**: Ensures issue_prefix and schema_version are set
396
+ - **foreign_keys_valid**: No orphaned dependencies or labels
397
+ - **issue_count_stable**: Issue count doesn't decrease unexpectedly
398
+
399
+ These invariants prevent data loss and would have caught issues like GH #201 (missing issue_prefix after migration).
400
+
401
+ ### Daemon Management
402
+
403
+ See [docs/DAEMON.md](DAEMON.md) for complete daemon management reference.
404
+
405
+ ```bash
406
+ # List all running daemons
407
+ bd daemons list --json
408
+
409
+ # Check health (version mismatches, stale sockets)
410
+ bd daemons health --json
411
+
412
+ # Stop/restart specific daemon
413
+ bd daemons stop /path/to/workspace --json
414
+ bd daemons restart 12345 --json # By PID
415
+
416
+ # View daemon logs
417
+ bd daemons logs /path/to/workspace -n 100
418
+ bd daemons logs 12345 -f # Follow mode
419
+
420
+ # Stop all daemons
421
+ bd daemons killall --json
422
+ bd daemons killall --force --json # Force kill if graceful fails
423
+ ```
424
+
425
+ ### Sync Operations
426
+
427
+ ```bash
428
+ # Manual sync (force immediate export/import/commit/push)
429
+ bd sync
430
+
431
+ # What it does:
432
+ # 1. Export pending changes to JSONL
433
+ # 2. Commit to git
434
+ # 3. Pull from remote
435
+ # 4. Import any updates
436
+ # 5. Push to remote
437
+ ```
438
+
439
+ ## Issue Types
440
+
441
+ - `bug` - Something broken that needs fixing
442
+ - `feature` - New functionality
443
+ - `task` - Work item (tests, docs, refactoring)
444
+ - `epic` - Large feature composed of multiple issues (supports hierarchical children)
445
+ - `chore` - Maintenance work (dependencies, tooling)
446
+
447
+ **Hierarchical children:** Epics can have child issues with dotted IDs (e.g., `bd-a3f8e9.1`, `bd-a3f8e9.2`). Children are auto-numbered sequentially. Up to 3 levels of nesting supported.
448
+
449
+ ## Priorities
450
+
451
+ - `0` - Critical (security, data loss, broken builds)
452
+ - `1` - High (major features, important bugs)
453
+ - `2` - Medium (nice-to-have features, minor bugs)
454
+ - `3` - Low (polish, optimization)
455
+ - `4` - Backlog (future ideas)
456
+
457
+ ## Dependency Types
458
+
459
+ - `blocks` - Hard dependency (issue X blocks issue Y)
460
+ - `related` - Soft relationship (issues are connected)
461
+ - `parent-child` - Epic/subtask relationship
462
+ - `discovered-from` - Track issues discovered during work
463
+
464
+ Only `blocks` dependencies affect the ready work queue.
465
+
466
+ **Note:** When creating an issue with a `discovered-from` dependency, the new issue automatically inherits the parent's `source_repo` field.
467
+
468
+ ## Output Formats
469
+
470
+ ### JSON Output (Recommended for Agents)
471
+
472
+ Always use `--json` flag for programmatic use:
473
+
474
+ ```bash
475
+ # Single issue
476
+ bd show bd-42 --json
477
+
478
+ # List of issues
479
+ bd ready --json
480
+
481
+ # Operation result
482
+ bd create "Issue" -p 1 --json
483
+ ```
484
+
485
+ ### Human-Readable Output
486
+
487
+ Default output without `--json`:
488
+
489
+ ```bash
490
+ bd ready
491
+ # bd-42 Fix authentication bug [P1, bug, in_progress]
492
+ # bd-43 Add user settings page [P2, feature, open]
493
+ ```
494
+
495
+ ## Common Patterns for AI Agents
496
+
497
+ ### Claim and Complete Work
498
+
499
+ ```bash
500
+ # 1. Find available work
501
+ bd ready --json
502
+
503
+ # 2. Claim issue
504
+ bd update bd-42 --status in_progress --json
505
+
506
+ # 3. Work on it...
507
+
508
+ # 4. Close when done
509
+ bd close bd-42 --reason "Implemented and tested" --json
510
+ ```
511
+
512
+ ### Discover and Link Work
513
+
514
+ ```bash
515
+ # While working on bd-100, discover a bug
516
+
517
+ # Old way (two commands):
518
+ bd create "Found auth bug" -t bug -p 1 --json # Returns bd-101
519
+ bd dep add bd-101 bd-100 --type discovered-from
520
+
521
+ # New way (one command):
522
+ bd create "Found auth bug" -t bug -p 1 --deps discovered-from:bd-100 --json
523
+ ```
524
+
525
+ ### Batch Operations
526
+
527
+ ```bash
528
+ # Update multiple issues at once
529
+ bd update bd-41 bd-42 bd-43 --priority 0 --json
530
+
531
+ # Close multiple issues
532
+ bd close bd-41 bd-42 bd-43 --reason "Batch completion" --json
533
+
534
+ # Add label to multiple issues
535
+ bd label add bd-41 bd-42 bd-43 urgent --json
536
+ ```
537
+
538
+ ### Session Workflow
539
+
540
+ ```bash
541
+ # Start of session
542
+ bd ready --json # Find work
543
+
544
+ # During session
545
+ bd create "..." -p 1 --json
546
+ bd update bd-42 --status in_progress --json
547
+ # ... work ...
548
+
549
+ # End of session (IMPORTANT!)
550
+ bd sync # Force immediate sync, bypass debounce
551
+ ```
552
+
553
+ **ALWAYS run `bd sync` at end of agent sessions** to ensure changes are committed/pushed immediately.
554
+
555
+ ## See Also
556
+
557
+ - [AGENTS.md](../AGENTS.md) - Main agent workflow guide
558
+ - [DAEMON.md](DAEMON.md) - Daemon management and event-driven mode
559
+ - [GIT_INTEGRATION.md](GIT_INTEGRATION.md) - Git workflows and merge strategies
560
+ - [LABELS.md](../LABELS.md) - Label system guide
561
+ - [README.md](../README.md) - User documentation