get-tbd 0.1.8

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 (60) hide show
  1. package/README.md +508 -0
  2. package/dist/bin-bootstrap.cjs +25 -0
  3. package/dist/bin-bootstrap.cjs.map +1 -0
  4. package/dist/bin.d.mts +2 -0
  5. package/dist/bin.mjs +106320 -0
  6. package/dist/bin.mjs.map +1 -0
  7. package/dist/cli.d.mts +13 -0
  8. package/dist/cli.mjs +9711 -0
  9. package/dist/cli.mjs.map +1 -0
  10. package/dist/docs/README.md +508 -0
  11. package/dist/docs/SKILL.md +222 -0
  12. package/dist/docs/guidelines/backward-compatibility-rules.md +78 -0
  13. package/dist/docs/guidelines/commit-conventions.md +78 -0
  14. package/dist/docs/guidelines/convex-limits-best-practices.md +170 -0
  15. package/dist/docs/guidelines/convex-rules.md +942 -0
  16. package/dist/docs/guidelines/general-coding-rules.md +36 -0
  17. package/dist/docs/guidelines/general-comment-rules.md +45 -0
  18. package/dist/docs/guidelines/general-eng-assistant-rules.md +54 -0
  19. package/dist/docs/guidelines/general-style-rules.md +37 -0
  20. package/dist/docs/guidelines/general-tdd-guidelines.md +52 -0
  21. package/dist/docs/guidelines/general-testing-rules.md +26 -0
  22. package/dist/docs/guidelines/golden-testing-guidelines.md +72 -0
  23. package/dist/docs/guidelines/python-cli-patterns.md +84 -0
  24. package/dist/docs/guidelines/python-rules.md +60 -0
  25. package/dist/docs/guidelines/typescript-cli-tool-rules.md +346 -0
  26. package/dist/docs/guidelines/typescript-code-coverage.md +171 -0
  27. package/dist/docs/guidelines/typescript-monorepo-patterns.md +71 -0
  28. package/dist/docs/guidelines/typescript-rules.md +55 -0
  29. package/dist/docs/install/claude-header.md +12 -0
  30. package/dist/docs/install/ensure-gh-cli.sh +88 -0
  31. package/dist/docs/shortcuts/standard/commit-code.md +23 -0
  32. package/dist/docs/shortcuts/standard/create-or-update-pr-simple.md +29 -0
  33. package/dist/docs/shortcuts/standard/create-or-update-pr-with-validation-plan.md +48 -0
  34. package/dist/docs/shortcuts/standard/implement-beads.md +31 -0
  35. package/dist/docs/shortcuts/standard/new-architecture-doc.md +31 -0
  36. package/dist/docs/shortcuts/standard/new-implementation-beads-from-spec.md +28 -0
  37. package/dist/docs/shortcuts/standard/new-plan-spec.md +49 -0
  38. package/dist/docs/shortcuts/standard/new-research-brief.md +30 -0
  39. package/dist/docs/shortcuts/standard/new-validation-plan.md +51 -0
  40. package/dist/docs/shortcuts/standard/precommit-process.md +88 -0
  41. package/dist/docs/shortcuts/standard/review-code-python.md +47 -0
  42. package/dist/docs/shortcuts/standard/review-code-typescript.md +46 -0
  43. package/dist/docs/shortcuts/standard/welcome-user.md +65 -0
  44. package/dist/docs/shortcuts/system/shortcut-explanation.md +61 -0
  45. package/dist/docs/shortcuts/system/skill-brief.md +40 -0
  46. package/dist/docs/shortcuts/system/skill.md +210 -0
  47. package/dist/docs/skill-brief.md +40 -0
  48. package/dist/docs/tbd-closing.md +31 -0
  49. package/dist/docs/tbd-design.md +5308 -0
  50. package/dist/docs/tbd-docs.md +1113 -0
  51. package/dist/docs/tbd-prime.md +119 -0
  52. package/dist/docs/templates/architecture-doc.md +117 -0
  53. package/dist/docs/templates/plan-spec.md +69 -0
  54. package/dist/docs/templates/research-brief.md +71 -0
  55. package/dist/index.d.mts +567 -0
  56. package/dist/index.mjs +3 -0
  57. package/dist/src-CWD4YCBk.mjs +319 -0
  58. package/dist/src-CWD4YCBk.mjs.map +1 -0
  59. package/dist/tbd +106320 -0
  60. package/package.json +92 -0
@@ -0,0 +1,1113 @@
1
+ # tbd CLI Documentation
2
+
3
+ Git-native issue tracking for AI agents and humans.
4
+
5
+ > [!NOTE]
6
+ > This is the tbd reference (`tbd docs`). See the tbd readme (`tbd readme`) for a quick
7
+ > intro or the design doc (`tbd design`) for more technical details.
8
+
9
+ ## Key Design Features
10
+
11
+ ### Issues stored in one place
12
+
13
+ tbd stores issues on a dedicated `tbd-sync` branch, separate from your code:
14
+
15
+ ```
16
+ .tbd/
17
+ ├── config.yml # Configuration (tracked on main)
18
+ └── data-sync-worktree/ # Hidden worktree (gitignored)
19
+ └── .tbd/data-sync/
20
+ ├── issues/ # One .md file per issue
21
+ ├── mappings/ids.yml # Short ID → ULID mapping
22
+ └── attic/ # Conflict archive (no data loss)
23
+ ```
24
+
25
+ Why a separate branch?
26
+
27
+ - No noisy issue commits in your code history
28
+ - No conflicts across main or feature branches
29
+ - Issues shared across all branches
30
+
31
+ ## File format
32
+
33
+ You usually don’t need to worry about where issues are stored, but it may be comforting
34
+ to know that internally it’s very simple and transparent.
35
+ Every issue is a Markdown file with YAML frontmatter, stored on the `tbd-sync` branch.
36
+
37
+ ```markdown
38
+ ---
39
+ id: is-01hx5zzkbkactav9wevgemmvrz
40
+ kind: bug
41
+ title: API returns 500 on malformed input
42
+ status: open
43
+ priority: 1
44
+ labels: [backend, urgent]
45
+ created_at: 2025-01-15T10:30:00Z
46
+ updated_at: 2025-01-15T10:30:00Z
47
+ ---
48
+
49
+ The /api/users endpoint crashes when given invalid JSON.
50
+ ```
51
+
52
+ ### Automatic git push
53
+
54
+ Unlike Beads (where you manually `git add`/`commit`/`push` the JSONL file), `tbd sync`
55
+ handles all git operations automatically.
56
+ One command commits and pushes issues to the sync branch.
57
+ Your normal `git push` is only for code changes.
58
+
59
+ ### Conflict handling
60
+
61
+ - Separate issues never conflict since they are separate files.
62
+ - If two agents modify the same issue at the same time, does field-level merge
63
+ (last-write-wins for scalars, union for arrays)
64
+ - In that case lost values preserved in attic—no data loss ever
65
+
66
+ ### Unique internal ids
67
+
68
+ Issues have a short display ID like `proj-a7k2` (where `proj` is your project’s prefix)
69
+ but these map to unique ULID-based internal IDs for reliable sorting and storage.
70
+
71
+ ## Requirements and Installation
72
+
73
+ **Requirements:**
74
+
75
+ - Node.js 20+
76
+ - Git 2.42+ (for orphan worktree support)
77
+
78
+ ```bash
79
+ # Check your Git version
80
+ git --version # Should be 2.42.0 or higher
81
+
82
+ # Global install (recommended)
83
+ npm install -g get-tbd@latest
84
+
85
+ # Or run without installing
86
+ npx get-tbd@latest <command>
87
+ ```
88
+
89
+ tbd requires Git 2.42+ for orphan worktree support (`git worktree add --orphan`). See
90
+ [git-scm.com/downloads](https://git-scm.com/downloads) for platform-specific
91
+ instructions.
92
+
93
+ ## Quick Reference
94
+
95
+ ### Find and claim work
96
+
97
+ ```bash
98
+ tbd ready # What's available to work on?
99
+ tbd show proj-1847 # Review the issue details
100
+ tbd update proj-1847 --status=in_progress # Claim it
101
+ ```
102
+
103
+ ### Complete work
104
+
105
+ ```bash
106
+ tbd close proj-1847 --reason="Fixed in auth.ts, added retry logic"
107
+ tbd sync # Push to remote
108
+ ```
109
+
110
+ ### Create issues
111
+
112
+ ```bash
113
+ tbd create "API returns 500 on malformed input" --type=bug --priority=P1
114
+ tbd create "Add rate limiting to /api/upload" --type=feature
115
+ tbd create "Refactor database connection pooling" --type=task --priority=P3
116
+
117
+ # With description and labels
118
+ tbd create "Users can't reset password" --type=bug --priority=P0 \
119
+ --description="Reset emails not sending. Affects all users since deploy." \
120
+ --label=urgent --label=auth
121
+ ```
122
+
123
+ ### Track dependencies
124
+
125
+ ```bash
126
+ tbd create "Write integration tests" --type=task
127
+ tbd dep add proj-1850 proj-1847 # 1850 depends on 1847 (can't test until 1847 done)
128
+ tbd blocked # See what's waiting
129
+ ```
130
+
131
+ ### Daily workflow
132
+
133
+ ```bash
134
+ tbd sync # Start of session
135
+ tbd ready # Find work
136
+ # ... do the work ...
137
+ tbd close proj-xxxx # Mark complete
138
+ tbd sync # End of session
139
+ ```
140
+
141
+ ### Issue lifecycle
142
+
143
+ ```
144
+ open → in_progress → closed
145
+
146
+ blocked/deferred
147
+ ```
148
+
149
+ ## Commands
150
+
151
+ ### setup
152
+
153
+ The recommended way to initialize tbd and configure agent integrations.
154
+
155
+ ```bash
156
+ tbd setup --auto # Full setup with auto-detection (recommended)
157
+ tbd setup --interactive # Interactive setup with prompts
158
+ tbd setup --from-beads # Migrate from existing Beads setup
159
+ ```
160
+
161
+ Options:
162
+ - `--auto` - Automatic mode: auto-detect prefix, migrate beads if present
163
+ - `--interactive` - Interactive mode: prompt for all options
164
+ - `--from-beads` - Migrate issues from existing Beads setup
165
+ - `--prefix <name>` - Override auto-detected prefix
166
+
167
+ Subcommands for specific integrations:
168
+ ```bash
169
+ tbd setup claude # Install Claude Code hooks
170
+ tbd setup codex # Install Codex AGENTS.md (also used by Cursor)
171
+ tbd setup beads --disable # Disable coexisting Beads
172
+ ```
173
+
174
+ ### init
175
+
176
+ Surgical initialization: creates `.tbd/` directory only (no integrations).
177
+
178
+ ```bash
179
+ tbd init --prefix=proj # Initialize with prefix (required)
180
+ tbd init --prefix=myapp --sync-branch=my-sync # Custom sync branch name
181
+ tbd init --prefix=tk --remote=upstream # Use different remote
182
+ ```
183
+
184
+ Options:
185
+ - `--prefix <name>` - **Required.** Project prefix for display IDs (e.g., “proj”,
186
+ “myapp”)
187
+ - `--sync-branch <name>` - Sync branch name (default: tbd-sync)
188
+ - `--remote <name>` - Remote name (default: origin)
189
+
190
+ Note: For most users, `tbd setup --auto` is recommended instead.
191
+ It auto-detects the prefix and configures agent integrations.
192
+
193
+ ### create
194
+
195
+ Create a new issue.
196
+
197
+ ```bash
198
+ tbd create "Implement user auth" # Basic task
199
+ tbd create "Fix crash on login" --type=bug --priority=P0 # Critical bug
200
+ tbd create "Dark mode support" --type=feature # Feature request
201
+ tbd create "Refactor database layer" --type=chore # Technical debt
202
+ tbd create "Q1 Goals" --type=epic # Epic for grouping
203
+
204
+ # Link to a spec document
205
+ tbd create "Add schema fields" --spec docs/project/specs/active/plan-2026-01-26-feature.md
206
+
207
+ # With description
208
+ tbd create "Add rate limiting" --description="Prevent API abuse with 100 req/min limit"
209
+
210
+ # With labels
211
+ tbd create "Fix mobile layout" --label=frontend --label=urgent
212
+
213
+ # With assignee and due date
214
+ tbd create "Security audit" --assignee=alice --due=2025-02-01
215
+
216
+ # From YAML file
217
+ tbd create --from-file=issue.yml
218
+ ```
219
+
220
+ Options:
221
+ - `--type <type>` - Issue type: bug, feature, task, epic, chore (default: task)
222
+ - `--priority <0-4>` - Priority: 0=critical, 1=high, 2=medium, 3=low, 4=backlog
223
+ (default: 2)
224
+ - `--description <text>` - Issue description
225
+ - `--file <path>` - Read description from file
226
+ - `--assignee <name>` - Assign to someone
227
+ - `--due <date>` - Due date (ISO8601 format)
228
+ - `--defer <date>` - Defer until date
229
+ - `--parent <id>` - Parent issue ID (for sub-issues).
230
+ If the parent has a `spec_path` and `--spec` is not provided, the child inherits the
231
+ parent’s `spec_path`.
232
+ - `--spec <path>` - Link to spec document (validated, normalized to project root)
233
+ - `--label <label>` - Add label (can repeat)
234
+ - `--from-file <path>` - Create from YAML+Markdown file
235
+
236
+ ### list
237
+
238
+ List issues with filtering and sorting.
239
+
240
+ ```bash
241
+ tbd list # Open issues, sorted by priority
242
+ tbd list --all # Include closed issues
243
+ tbd list --status=in_progress # Currently being worked on
244
+ tbd list --status=blocked # Blocked issues
245
+ tbd list --type=bug # Only bugs
246
+ tbd list --priority=P0 # Critical priority only
247
+ tbd list --assignee=alice # Assigned to alice
248
+ tbd list --label=urgent # With 'urgent' label
249
+ tbd list --label=backend --label=api # Multiple labels (AND)
250
+ tbd list --parent=proj-x1y2 # Children of an epic
251
+ tbd list --spec=plan-2026-01-26-feature.md # Linked to spec (gradual matching)
252
+ tbd list --sort=created # Sort by creation date
253
+ tbd list --sort=updated # Sort by last update
254
+ tbd list --limit=10 # Limit results
255
+ tbd list --count # Just show count
256
+ tbd list --long # Show descriptions
257
+ tbd list --pretty # Tree view with parent-child hierarchy
258
+ tbd list --pretty --long # Tree view with descriptions
259
+
260
+ # JSON output for scripting
261
+ tbd list --json | jq '.[].title'
262
+ ```
263
+
264
+ Options:
265
+ - `--status <status>` - Filter: open, in_progress, blocked, deferred, closed
266
+ - `--all` - Include closed issues
267
+ - `--type <type>` - Filter: bug, feature, task, epic, chore
268
+ - `--priority <0-4>` - Filter by priority
269
+ - `--assignee <name>` - Filter by assignee
270
+ - `--label <label>` - Filter by label (repeatable, AND logic)
271
+ - `--parent <id>` - List children of parent issue
272
+ - `--spec <path>` - Filter by spec path (supports gradual matching: filename, partial
273
+ path, or full path)
274
+ - `--deferred` - Show only deferred issues
275
+ - `--defer-before <date>` - Deferred before date
276
+ - `--sort <field>` - Sort by: priority, created, updated (default: priority)
277
+ - `--limit <n>` - Limit number of results
278
+ - `--count` - Output only the count of matching issues
279
+ - `--long` - Show issue descriptions on a second line
280
+ - `--pretty` - Show tree view with parent-child relationships
281
+
282
+ ### show
283
+
284
+ Display detailed information about an issue.
285
+
286
+ ```bash
287
+ tbd show proj-a7k2 # YAML output
288
+ tbd show proj-a7k2 --json # JSON output
289
+ ```
290
+
291
+ Output includes all fields: title, description, status, priority, labels, dependencies,
292
+ timestamps, and working notes.
293
+
294
+ ### update
295
+
296
+ Modify an existing issue.
297
+
298
+ ```bash
299
+ tbd update proj-a7k2 --status=in_progress # Start working
300
+ tbd update proj-a7k2 --status=blocked # Mark as blocked
301
+ tbd update proj-a7k2 --priority=P0 # Escalate priority
302
+ tbd update proj-a7k2 --assignee=bob # Reassign
303
+ tbd update proj-a7k2 --description="New description"
304
+ tbd update proj-a7k2 --notes="Found root cause in auth.ts"
305
+ tbd update proj-a7k2 --notes-file=notes.md # Notes from file
306
+ tbd update proj-a7k2 --due=2025-03-01 # Set due date
307
+ tbd update proj-a7k2 --defer=2025-02-15 # Defer until later
308
+ tbd update proj-a7k2 --add-label=blocked # Add label
309
+ tbd update proj-a7k2 --remove-label=urgent # Remove label
310
+ tbd update proj-a7k2 --parent=proj-x1y2 # Set parent epic
311
+ tbd update proj-a7k2 --spec=docs/spec.md # Link to spec
312
+ tbd update proj-a7k2 --spec="" # Clear spec link
313
+
314
+ # Update from YAML file
315
+ tbd update proj-a7k2 --from-file=updated.yml
316
+ ```
317
+
318
+ Options:
319
+ - `--from-file <path>` - Update all fields from YAML+Markdown file
320
+ - `--status <status>` - Set status
321
+ - `--type <type>` - Set type
322
+ - `--priority <0-4>` - Set priority
323
+ - `--assignee <name>` - Set assignee
324
+ - `--description <text>` - Set description
325
+ - `--notes <text>` - Set working notes
326
+ - `--notes-file <path>` - Set notes from file
327
+ - `--due <date>` - Set due date
328
+ - `--defer <date>` - Set deferred until date
329
+ - `--add-label <label>` - Add label
330
+ - `--remove-label <label>` - Remove label
331
+ - `--parent <id>` - Set parent issue.
332
+ If the new parent has a `spec_path` and `--spec` is not also provided, the child
333
+ inherits the parent’s `spec_path` (only if the child currently has no `spec_path`).
334
+ - `--spec <path>` - Set or clear spec path (empty string clears; validated and
335
+ normalized). When updating a parent issue’s spec, the new value propagates to children
336
+ whose `spec_path` was null or matched the old value.
337
+
338
+ ### close
339
+
340
+ Close a completed issue.
341
+
342
+ ```bash
343
+ tbd close proj-a7k2 # Close issue
344
+ tbd close proj-a7k2 --reason="Fixed in PR #42"
345
+ ```
346
+
347
+ Options:
348
+ - `--reason <text>` - Reason for closing
349
+
350
+ ### reopen
351
+
352
+ Reopen a closed issue.
353
+
354
+ ```bash
355
+ tbd reopen proj-a7k2 # Reopen issue
356
+ tbd reopen proj-a7k2 --reason="Bug reappeared"
357
+ ```
358
+
359
+ Options:
360
+ - `--reason <text>` - Reason for reopening
361
+
362
+ ### ready
363
+
364
+ List issues ready to work on (open, unblocked, unassigned).
365
+
366
+ ```bash
367
+ tbd ready # All ready issues
368
+ tbd ready --type=bug # Ready bugs
369
+ tbd ready --limit=5 # Top 5 ready issues
370
+ tbd ready --long # Show descriptions
371
+ ```
372
+
373
+ Options:
374
+ - `--type <type>` - Filter by type
375
+ - `--limit <n>` - Limit results
376
+ - `--long` - Show issue descriptions
377
+
378
+ ### blocked
379
+
380
+ List issues that are blocked by dependencies.
381
+
382
+ ```bash
383
+ tbd blocked # All blocked issues
384
+ tbd blocked --limit=10 # Limit results
385
+ tbd blocked --long # Show descriptions
386
+ ```
387
+
388
+ Options:
389
+ - `--limit <n>` - Limit results
390
+ - `--long` - Show issue descriptions
391
+
392
+ ### stale
393
+
394
+ List issues not updated recently.
395
+
396
+ ```bash
397
+ tbd stale # Not updated in 7 days
398
+ tbd stale --days=30 # Not updated in 30 days
399
+ tbd stale --status=open # Only open stale issues
400
+ tbd stale --limit=20 # Limit results
401
+ ```
402
+
403
+ Options:
404
+ - `--days <n>` - Days since last update (default: 7)
405
+ - `--status <status>` - Filter by status (default: open, in_progress)
406
+ - `--limit <n>` - Limit results
407
+
408
+ ### label
409
+
410
+ Manage issue labels.
411
+
412
+ ```bash
413
+ tbd label add proj-a7k2 urgent # Add single label
414
+ tbd label add proj-a7k2 backend api # Add multiple labels
415
+ tbd label remove proj-a7k2 urgent # Remove label
416
+ tbd label list # List all labels in use
417
+ ```
418
+
419
+ Subcommands:
420
+ - `add <id> <labels...>` - Add labels to an issue
421
+ - `remove <id> <labels...>` - Remove labels from an issue
422
+ - `list` - List all labels currently in use
423
+
424
+ ### dep
425
+
426
+ Manage issue dependencies.
427
+
428
+ **Semantics:** `tbd dep add A B` means “A depends on B” (B must complete before A can
429
+ start).
430
+
431
+ ```bash
432
+ # proj-b3m9 depends on proj-a7k2 (a7k2 must be done first)
433
+ tbd dep add proj-b3m9 proj-a7k2
434
+ # Output: ✓ proj-b3m9 now depends on proj-a7k2
435
+
436
+ # Remove dependency
437
+ tbd dep remove proj-b3m9 proj-a7k2
438
+
439
+ # List what blocks/is blocked by an issue
440
+ tbd dep list proj-a7k2
441
+ # Output shows "Blocks:" and "Blocked by:" sections
442
+ ```
443
+
444
+ Subcommands:
445
+ - `add <issue> <depends-on>` - Issue depends on depends-on (depends-on blocks issue)
446
+ - `remove <issue> <depends-on>` - Remove dependency
447
+ - `list <id>` - List dependencies for an issue (what it blocks and what blocks it)
448
+
449
+ ### sync
450
+
451
+ Synchronize issues with remote repository.
452
+
453
+ ```bash
454
+ tbd sync # Full sync (pull + push)
455
+ tbd sync --status # Check sync status
456
+ tbd sync --pull # Pull only
457
+ tbd sync --push # Push only
458
+ tbd sync --force # Force sync (overwrite conflicts)
459
+ ```
460
+
461
+ Options:
462
+ - `--push` - Push local changes only
463
+ - `--pull` - Pull remote changes only
464
+ - `--status` - Show sync status without syncing
465
+ - `--force` - Force sync, overwriting conflicts
466
+
467
+ ### search
468
+
469
+ Search issues by text content.
470
+
471
+ ```bash
472
+ tbd search "login" # Search all fields
473
+ tbd search "auth" --field=title # Search only titles
474
+ tbd search "TODO" --field=notes # Search working notes
475
+ tbd search "api" --status=open # Filter by status
476
+ tbd search "bug" --limit=10 # Limit results
477
+ tbd search "Error" --case-sensitive # Case-sensitive search
478
+ ```
479
+
480
+ Options:
481
+ - `--status <status>` - Filter by status
482
+ - `--field <field>` - Search specific field: title, description, notes, labels
483
+ - `--limit <n>` - Limit results
484
+ - `--no-refresh` - Skip worktree refresh
485
+ - `--case-sensitive` - Case-sensitive search
486
+
487
+ ### stats
488
+
489
+ Show repository statistics.
490
+
491
+ ```bash
492
+ tbd stats # Show statistics
493
+ tbd stats --json # JSON output
494
+ ```
495
+
496
+ Displays: issue counts by status, type, priority, and label.
497
+
498
+ ### doctor
499
+
500
+ Diagnose and repair repository issues.
501
+
502
+ ```bash
503
+ tbd doctor # Check for problems
504
+ tbd doctor --fix # Attempt to fix issues
505
+ ```
506
+
507
+ Options:
508
+ - `--fix` - Attempt to automatically fix detected issues
509
+
510
+ ### config
511
+
512
+ Manage tbd configuration.
513
+
514
+ ```bash
515
+ tbd config show # Show all config
516
+ tbd config get display.id_prefix # Get specific value
517
+ tbd config set display.id_prefix "tk" # Set value
518
+ ```
519
+
520
+ Subcommands:
521
+ - `show` - Show all configuration
522
+ - `get <key>` - Get a configuration value
523
+ - `set <key> <value>` - Set a configuration value
524
+
525
+ Common config keys:
526
+ - `display.id_prefix` - ID prefix (required, set during init or import)
527
+ - `sync.branch` - Sync branch name
528
+ - `sync.remote` - Remote name
529
+
530
+ ### attic
531
+
532
+ Manage conflict archive.
533
+ When sync conflicts occur, the losing values are preserved in the attic for recovery.
534
+
535
+ ```bash
536
+ tbd attic list # List all attic entries
537
+ tbd attic list proj-a7k2 # Entries for specific issue
538
+ tbd attic show proj-a7k2 2025-01-15T10:30:00Z # Show specific entry
539
+ tbd attic restore proj-a7k2 2025-01-15T10:30:00Z # Restore from attic
540
+ ```
541
+
542
+ Subcommands:
543
+ - `list [id]` - List attic entries (optionally for specific issue)
544
+ - `show <id> <timestamp>` - Show attic entry details
545
+ - `restore <id> <timestamp>` - Restore a value from the attic
546
+
547
+ ### import
548
+
549
+ Import issues from JSONL file.
550
+
551
+ ```bash
552
+ tbd import issues.jsonl # Import from JSONL file
553
+ tbd import issues.jsonl --merge # Merge with existing
554
+ tbd import --validate # Validate existing import
555
+ tbd import issues.jsonl --verbose # Show detailed progress
556
+ ```
557
+
558
+ Options:
559
+ - `--merge` - Merge with existing issues instead of skipping duplicates
560
+ - `--verbose` - Show detailed import progress
561
+
562
+ > **Note:** `tbd import --from-beads` is deprecated.
563
+ > Use `tbd setup --auto` or `tbd setup --from-beads` instead for migrating from Beads.
564
+ - `--validate` - Validate existing import against Beads source
565
+
566
+ ### beads
567
+
568
+ Beads migration utilities.
569
+
570
+ ```bash
571
+ tbd setup beads # Show usage
572
+ tbd setup beads --disable # Preview what will be moved
573
+ tbd setup beads --disable --confirm # Actually disable Beads
574
+ ```
575
+
576
+ The `--disable` option safely moves all Beads files to `.beads-disabled/`:
577
+ - `.beads/` → `.beads-disabled/beads/`
578
+ - `.beads-hooks/` → `.beads-disabled/beads-hooks/`
579
+ - `.cursor/rules/beads.mdc` → `.beads-disabled/cursor-rules-beads.mdc`
580
+ - Removes `bd` hooks from `.claude/settings.local.json` (with backup)
581
+ - Removes Beads section from `AGENTS.md` (with backup)
582
+
583
+ This preserves all data for potential rollback.
584
+ To restore Beads, move files back from `.beads-disabled/`.
585
+
586
+ ### status
587
+
588
+ Show repository status.
589
+ Works even when tbd is not initialized.
590
+
591
+ ```bash
592
+ tbd status # Show repo status
593
+ tbd status --json # JSON output
594
+ ```
595
+
596
+ Displays: initialization state, sync status, issue counts, detected integrations.
597
+
598
+ When not initialized, detects Beads and suggests migration:
599
+ ```
600
+ Not a tbd repository.
601
+
602
+ Detected:
603
+ ✓ Git repository (main branch)
604
+ ✓ Beads repository (.beads/ with 142 issues)
605
+
606
+ To get started:
607
+ tbd setup --auto # Full setup with auto-detection
608
+ tbd init --prefix=X # Surgical init only
609
+ ```
610
+
611
+ ### prime
612
+
613
+ Output workflow context for AI agents.
614
+ Called automatically by Claude Code hooks.
615
+
616
+ ```bash
617
+ tbd prime # Output workflow context
618
+ tbd prime --export # Output default (ignores PRIME.md)
619
+ ```
620
+
621
+ Behavior:
622
+ - Silent exit (code 0) if not in a tbd project
623
+ - Custom output: create `.tbd/PRIME.md` to override default content
624
+
625
+ ### setup (subcommands)
626
+
627
+ Configure specific editor and agent integrations.
628
+
629
+ ```bash
630
+ tbd setup claude # Install Claude Code hooks
631
+ tbd setup claude --check # Verify installation status
632
+ tbd setup claude --remove # Remove tbd hooks
633
+
634
+ tbd setup codex # Create/update AGENTS.md
635
+ tbd setup codex --check # Verify AGENTS.md
636
+ tbd setup codex --remove # Remove tbd section from AGENTS.md
637
+
638
+ tbd setup auto # Auto-detect and configure all integrations
639
+ tbd setup beads --disable # Disable Beads (for migration)
640
+ ```
641
+
642
+ #### setup auto
643
+
644
+ The `tbd setup --auto` command (or `tbd setup auto`) detects which coding agents are
645
+ available and configures integrations automatically:
646
+
647
+ - **Claude Code**: Checks for `~/.claude/` directory, installs SessionStart hooks
648
+ - **Codex/AGENTS.md**: Checks for `AGENTS.md`, adds tbd integration section (also used
649
+ by Cursor v1.6+)
650
+
651
+ This is the recommended way to set up tbd:
652
+
653
+ ```bash
654
+ tbd setup --auto # Full setup: init + integrations
655
+ ```
656
+
657
+ For already-configured integrations, `setup --auto` reports them as “Already configured”
658
+ and skips reinstallation.
659
+
660
+ ### Documentation Commands
661
+
662
+ Built-in documentation viewers:
663
+
664
+ ```bash
665
+ tbd readme # Display README (same as GitHub landing page)
666
+ tbd docs # Display CLI reference documentation
667
+ tbd docs --list # List available documentation sections
668
+ tbd design # Display design documentation
669
+ tbd design --list # List design doc sections
670
+ tbd closing # Display session closing protocol reminder
671
+ ```
672
+
673
+ Shortcuts, guidelines, and templates:
674
+
675
+ ```bash
676
+ tbd shortcut --list # List all shortcuts
677
+ tbd shortcut <name> # Display a shortcut
678
+ tbd guidelines --list # List all guidelines
679
+ tbd guidelines <name> # Display a guideline
680
+ tbd template --list # List all templates
681
+ tbd template <name> # Display a template
682
+ ```
683
+
684
+ Add external docs by URL:
685
+
686
+ ```bash
687
+ tbd guidelines --add=<url> --name=<name> # Add a guideline from URL
688
+ tbd shortcut --add=<url> --name=<name> # Add a shortcut from URL
689
+ tbd template --add=<url> --name=<name> # Add a template from URL
690
+ ```
691
+
692
+ Options:
693
+ - `--add <url>` - URL to fetch the document from (GitHub blob URLs auto-converted to
694
+ raw)
695
+ - `--name <name>` - Name for the added document (required with `--add`)
696
+
697
+ GitHub blob URLs are automatically converted to raw.githubusercontent.com URLs.
698
+ On HTTP 403, fetching falls back to `gh api` for authenticated access.
699
+ User-added shortcuts go to `shortcuts/custom/` (separate from bundled
700
+ `shortcuts/standard/`).
701
+
702
+ ### uninstall
703
+
704
+ Remove tbd from a repository.
705
+
706
+ ```bash
707
+ tbd uninstall --confirm # Remove tbd (requires --confirm)
708
+ tbd uninstall --confirm --keep-branch # Keep local sync branch
709
+ tbd uninstall --confirm --remove-remote # Also remove remote sync branch
710
+ ```
711
+
712
+ Options:
713
+ - `--confirm` - Required to proceed with removal
714
+ - `--keep-branch` - Keep the local sync branch
715
+ - `--remove-remote` - Also remove the remote sync branch
716
+
717
+ ## Global Options
718
+
719
+ These options work with any command:
720
+
721
+ ```bash
722
+ tbd list --json # JSON output
723
+ tbd list --quiet # Suppress non-essential output
724
+ tbd list --verbose # Enable verbose output
725
+ tbd create "Test" --dry-run # Show what would happen
726
+ tbd close proj-a7k2 --no-sync # Skip automatic sync
727
+ tbd list --debug # Show internal IDs
728
+ tbd update proj-a7k2 --yes # Assume yes to prompts
729
+ tbd list --non-interactive # Fail if input required
730
+ tbd list --color=never # Disable colors
731
+ ```
732
+
733
+ Options:
734
+ - `--version` - Show version number
735
+ - `--dry-run` - Show what would be done without making changes
736
+ - `--verbose` - Enable verbose output
737
+ - `--quiet` - Suppress non-essential output
738
+ - `--json` - Output as JSON
739
+ - `--color <when>` - Colorize output: auto, always, never
740
+ - `--non-interactive` - Disable all prompts, fail if input required
741
+ - `--yes` - Assume yes to confirmation prompts
742
+ - `--no-sync` - Skip automatic sync after write operations
743
+ - `--debug` - Show internal IDs alongside display IDs
744
+
745
+ ## For AI Agents
746
+
747
+ tbd is designed for AI coding agents.
748
+ This section covers agent-specific patterns.
749
+
750
+ ### Agent Workflow Loop
751
+
752
+ ```bash
753
+ tbd ready --json # Find available work
754
+ tbd update proj-xxxx --status=in_progress # Claim it (advisory)
755
+ # ... do the work ...
756
+ tbd close proj-xxxx --reason="Fixed in commit abc123"
757
+ tbd sync # Push changes
758
+ ```
759
+
760
+ ### Agent-Friendly Flags
761
+
762
+ | Flag | Purpose |
763
+ | --- | --- |
764
+ | `--json` | Machine-parseable output |
765
+ | `--non-interactive` | Fail if input required (auto-enabled in CI) |
766
+ | `--yes` | Auto-confirm prompts |
767
+ | `--dry-run` | Preview changes before applying |
768
+ | `--quiet` | Suppress informational output |
769
+
770
+ ### Actor Resolution
771
+
772
+ The actor name (for `created_by` field) is resolved in order:
773
+
774
+ 1. `--actor <name>` flag
775
+ 2. `TBD_ACTOR` environment variable
776
+ 3. Git `user.email` from config
777
+ 4. System username
778
+
779
+ ```bash
780
+ TBD_ACTOR=claude-agent tbd create "Fix bug" --type=bug
781
+ ```
782
+
783
+ ### Claude Code Integration
784
+
785
+ Install hooks for automatic context injection:
786
+
787
+ ```bash
788
+ tbd setup claude # One-time global setup
789
+ ```
790
+
791
+ This runs `tbd prime` at session start and before context compaction, ensuring the agent
792
+ remembers the tbd workflow.
793
+
794
+ ### Closing Multiple Issues
795
+
796
+ Close several issues at once (more efficient than one at a time):
797
+
798
+ ```bash
799
+ tbd close proj-a1 proj-b2 proj-c3 --reason="Sprint complete"
800
+ ```
801
+
802
+ ## Common Workflows
803
+
804
+ ### Starting a New Project
805
+
806
+ ```bash
807
+ cd my-project
808
+ git init
809
+ tbd init
810
+ tbd create "Initial setup" --type=chore
811
+ ```
812
+
813
+ ### Daily Workflow
814
+
815
+ ```bash
816
+ # Start of day - sync and find work
817
+ tbd sync
818
+ tbd ready
819
+
820
+ # Pick up an issue
821
+ tbd update proj-a7k2 --status=in_progress --assignee=myname
822
+
823
+ # Work on it...
824
+
825
+ # Add notes as you work
826
+ tbd update proj-a7k2 --notes="Found the bug in auth.ts line 42"
827
+
828
+ # Complete and sync
829
+ tbd close proj-a7k2 --reason="Fixed in commit abc123"
830
+ tbd sync
831
+ ```
832
+
833
+ ### Managing an Epic
834
+
835
+ ```bash
836
+ # Create epic linked to a spec
837
+ tbd create "User Authentication System" --type=epic --priority=P1 --spec=docs/specs/auth.md
838
+
839
+ # Create child tasks (they inherit spec_path from the epic automatically)
840
+ tbd create "Design auth API" --parent=proj-epic
841
+ tbd create "Implement login endpoint" --parent=proj-epic
842
+ tbd create "Add password reset" --parent=proj-epic
843
+
844
+ # View epic and children
845
+ tbd show proj-epic
846
+ tbd list --parent=proj-epic
847
+ ```
848
+
849
+ ### Handling Dependencies
850
+
851
+ ```bash
852
+ # Create issues
853
+ tbd create "Set up database" --type=task
854
+ tbd create "Implement API" --type=task
855
+
856
+ # API depends on database (database blocks API)
857
+ tbd dep add proj-api proj-database
858
+
859
+ # Check what's blocked
860
+ tbd blocked
861
+
862
+ # Once database is done
863
+ tbd close proj-database
864
+ tbd ready # API now appears as ready
865
+ ```
866
+
867
+ ### Bug Triage
868
+
869
+ ```bash
870
+ # List all open bugs by priority
871
+ tbd list --type=bug --sort=priority
872
+
873
+ # Escalate a critical bug
874
+ tbd update proj-bug1 --priority=P0 --label=critical
875
+
876
+ # Assign bugs
877
+ tbd update proj-bug1 --assignee=alice
878
+ tbd update proj-bug2 --assignee=bob
879
+ ```
880
+
881
+ ### Code Review Workflow
882
+
883
+ ```bash
884
+ # Find stale issues (awaiting review?)
885
+ tbd stale --days=3
886
+
887
+ # Search for review-related issues
888
+ tbd search "review" --status=open
889
+ ```
890
+
891
+ ### Migration from Beads
892
+
893
+ ```bash
894
+ # Recommended: one-step migration
895
+ tbd setup --auto # Auto-detects beads, imports, sets up integrations
896
+
897
+ # Or explicit migration
898
+ tbd setup --from-beads # Migrate from beads with prompts
899
+
900
+ # Manual step-by-step migration
901
+ bd sync # Final Beads sync
902
+ tbd init --prefix=myproj # Initialize tbd
903
+ tbd import issues.jsonl # Import from exported JSONL
904
+ tbd setup beads --disable --confirm # Disable Beads
905
+
906
+ # Verify migration
907
+ tbd stats
908
+ tbd list --all
909
+ ```
910
+
911
+ The `tbd setup beads --disable` command safely moves all Beads files to
912
+ `.beads-disabled/` for potential rollback, including:
913
+
914
+ - `.beads/` directory (data and config)
915
+ - `.beads-hooks/` directory (git hooks)
916
+ - `.cursor/rules/beads.mdc` (Cursor rules)
917
+ - `bd` hooks from `.claude/settings.local.json`
918
+ - Beads section from `AGENTS.md`
919
+
920
+ ## File Structure
921
+
922
+ tbd stores data in the following locations:
923
+
924
+ ```
925
+ my-project/
926
+ ├── .tbd/
927
+ │ ├── config.yml # Project configuration (tracked)
928
+ │ ├── .gitignore # Ignores local files
929
+ │ ├── cache/ # Local state (gitignored)
930
+ │ └── data-sync-worktree/ # Hidden worktree (gitignored)
931
+ │ └── .tbd/
932
+ │ └── data-sync/
933
+ │ ├── issues/ # Issue files (*.md)
934
+ │ ├── mappings/ # ID mappings
935
+ │ │ └── ids.yml # Short ID → ULID mapping
936
+ │ ├── attic/ # Conflict archive
937
+ │ └── meta.yml # Schema version
938
+ ```
939
+
940
+ ### Issue File Format
941
+
942
+ Each issue is stored as a Markdown file with YAML frontmatter:
943
+
944
+ ```markdown
945
+ ---
946
+ created_at: 2025-01-15T10:30:00Z
947
+ dependencies: []
948
+ id: is-01hx5zzkbkactav9wevgemmvrz
949
+ kind: task
950
+ labels: [backend, urgent]
951
+ priority: 2
952
+ status: open
953
+ title: Fix login bug
954
+ type: is
955
+ updated_at: 2025-01-15T10:30:00Z
956
+ version: 1
957
+ ---
958
+
959
+ User reports intermittent login failures.
960
+
961
+ ## Notes
962
+
963
+ Found the issue in auth.ts - race condition in token refresh.
964
+ ```
965
+
966
+ ## Configuration Reference
967
+
968
+ Configuration is stored in `.tbd/config.yml`:
969
+
970
+ ```yaml
971
+ tbd_version: "0.1.0"
972
+
973
+ display:
974
+ id_prefix: proj # Prefix for display IDs (required, set during init)
975
+
976
+ sync:
977
+ branch: tbd-sync # Sync branch name
978
+ remote: origin # Remote name
979
+ auto_sync: true # Auto-sync after writes
980
+ ```
981
+
982
+ ## Priority Scale
983
+
984
+ | Value | Alias | Meaning |
985
+ | --- | --- | --- |
986
+ | 0 | P0 | Critical—drop everything |
987
+ | 1 | P1 | High—this sprint |
988
+ | 2 | P2 | Medium—soon (default) |
989
+ | 3 | P3 | Low—backlog |
990
+ | 4 | P4 | Lowest—maybe/someday |
991
+
992
+ Both formats work: `--priority=P1` or `--priority=1` (P-prefix is the canonical display
993
+ format)
994
+
995
+ ## Date Formats
996
+
997
+ Commands like `--due` and `--defer` accept flexible date input:
998
+
999
+ | Format | Example | Result |
1000
+ | --- | --- | --- |
1001
+ | Full datetime | `2025-02-15T10:00:00Z` | Exact time (UTC) |
1002
+ | Date only | `2025-02-15` | Midnight UTC |
1003
+ | Relative | `+7d` | 7 days from now |
1004
+ | Relative | `+2w` | 2 weeks from now |
1005
+
1006
+ ## How Sync Works
1007
+
1008
+ tbd stores issues on a dedicated `tbd-sync` branch, separate from your code branches.
1009
+
1010
+ **Fully automatic**: Unlike Beads (where you manually `git add`/`commit`/`push` the
1011
+ JSONL file), `tbd sync` handles all git operations on the sync branch automatically.
1012
+ You never need to manually push issue data—just run `tbd sync` and it’s done.
1013
+
1014
+ **Why this matters:**
1015
+ - No merge conflicts in feature branches
1016
+ - Issues shared across all branches
1017
+ - Clean code history (no issue churn)
1018
+ - No manual git operations for issues
1019
+
1020
+ **Conflict handling:**
1021
+ - Detection via content hash comparison
1022
+ - Automatic field-level merge (last-write-wins for scalars, union for arrays)
1023
+ - Lost values preserved in the attic—no data loss
1024
+
1025
+ **Daily usage:**
1026
+ ```bash
1027
+ tbd sync # Pull + push (run at session start/end)
1028
+ tbd sync --status # Check what's pending
1029
+ ```
1030
+
1031
+ Note: Your normal `git push` is only for code changes.
1032
+ Issue sync is separate and automatic.
1033
+
1034
+ ## Troubleshooting
1035
+
1036
+ ### Sync Issues
1037
+
1038
+ ```bash
1039
+ # Check sync status
1040
+ tbd sync --status
1041
+
1042
+ # Force sync if conflicts
1043
+ tbd sync --force
1044
+
1045
+ # Run diagnostics
1046
+ tbd doctor
1047
+ tbd doctor --fix
1048
+ ```
1049
+
1050
+ ### ID Not Found
1051
+
1052
+ If you get “Unknown issue ID” errors:
1053
+
1054
+ ```bash
1055
+ # Verify the issue exists
1056
+ tbd list --all | grep <partial-id>
1057
+
1058
+ # Use --debug to see internal IDs
1059
+ tbd list --debug
1060
+ # proj-a7k2 (is-01hx5zzkbkactav9wevgemmvrz) Fix login bug
1061
+ ```
1062
+
1063
+ ### Debugging with Internal IDs
1064
+
1065
+ tbd uses short display IDs (`proj-a7k2`) that map to internal ULIDs
1066
+ (`is-01hx5zzkbk...`). You normally don’t need internal IDs, but they’re useful for:
1067
+
1068
+ ```bash
1069
+ # Find the actual issue file
1070
+ ls .tbd/data-sync-worktree/.tbd/data-sync/issues/is-01hx5*.md
1071
+
1072
+ # Internal IDs sort chronologically (creation order)
1073
+ ls .tbd/data-sync-worktree/.tbd/data-sync/issues/ | sort
1074
+ ```
1075
+
1076
+ ### Performance
1077
+
1078
+ For large repositories with many issues:
1079
+
1080
+ ```bash
1081
+ # Limit results
1082
+ tbd list --limit=50
1083
+
1084
+ # Use specific filters
1085
+ tbd list --status=open --type=bug
1086
+ ```
1087
+
1088
+ ## Tips
1089
+
1090
+ 1. **Use labels for workflow states**: `needs-review`, `blocked-external`, `wontfix`
1091
+
1092
+ 2. **Set priorities consistently**: 0=drop everything, 1=this sprint, 2=soon, 3=backlog,
1093
+ 4=maybe
1094
+
1095
+ 3. **Use epics for grouping**: Create an epic and link child tasks with `--parent`
1096
+
1097
+ 4. **Add working notes**: Use `--notes` to track investigation progress
1098
+
1099
+ 5. **Sync regularly**: Run `tbd sync` at start and end of work sessions
1100
+
1101
+ 6. **Use JSON for scripting**: `tbd list --json | jq '.[] | select(.priority == 0)'`
1102
+
1103
+ 7. **Alias for convenience**: `alias bd=tbd` for muscle memory from Beads
1104
+
1105
+ ## Getting Help
1106
+
1107
+ ```bash
1108
+ tbd --help # General help
1109
+ tbd <command> --help # Command-specific help
1110
+ tbd help <command> # Alternative help syntax
1111
+ ```
1112
+
1113
+ **Project Repo**: https://github.com/jlevy/tbd