Commit Graph

59 Commits

Author SHA1 Message Date
Steve Yegge
6a024fb4d9 fix: git hooks now stage deletions.jsonl for cross-clone propagation
The pre-commit and pre-push hooks were only staging beads.jsonl and
issues.jsonl, but not deletions.jsonl. This caused deletions.jsonl
to remain untracked after bd cleanup or bd delete operations.

Updated all hook locations:
- cmd/bd/templates/hooks/pre-commit
- cmd/bd/templates/hooks/pre-push
- examples/git-hooks/pre-commit
- examples/git-hooks/pre-push
- .beads-hooks/pre-commit
- .beads-hooks/pre-push

Users with existing hooks should run: bd hooks install

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-26 20:29:47 -08:00
Steve Yegge
eeda2053b8 bd sync: 2025-11-26 18:07:01 2025-11-26 18:07:01 -08:00
matt wilkie
eb69da3184 improve pre-push hook error message to clarify all uncommitted changes 2025-11-26 09:09:37 -07:00
Steve Yegge
6c06f5cb5f gh2jsonl: add intra-batch collision detection for hash IDs
When using --id-mode hash, the script now tracks generated IDs and
retries with increasing nonce (0-9) then increasing length (up to 8)
if a collision is detected within the same import batch.

This matches the collision handling behavior in the Go implementation
(internal/storage/sqlite/ids.go).

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-25 20:33:35 -08:00
Steve Yegge
384debad0f Merge pull request #383 from deangiberson/main
gh2jsonl: Add hash-based ID generation support
2025-11-25 20:29:38 -08:00
Steve Yegge
3fe94f280f feat: add bd doctor --check-health for lightweight git hook health checks
- Add --check-health flag for quick, silent health checks (exit 0 on success)
- Check version mismatch (CLI vs database), sync.branch config, outdated hooks
- Add hints.doctor config option to suppress doctor hints globally
- Update post-merge/post-checkout hooks to call bd doctor --check-health
- Suggest running bd doctor in upgrade notification
- Modernize post-checkout hook (bash→sh, use bd sync instead of bd import)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-25 19:28:13 -08:00
Dean Giberson
eb4b52dd6a gh2jsonl: Add hash-based ID generation support
Adds --id-mode flag to gh2jsonl.py with support for both sequential
and hash-based IDs, matching the algorithm in internal/storage/sqlite/ids.go.

New features:
- encode_base36() function for base36 encoding
- generate_hash_id() matching Go implementation (SHA256 + base36)
- --id-mode {sequential|hash} CLI flag (default: sequential)
- --hash-length {3,4,5,6,7,8} for configurable hash length (default: 6)

Hash IDs are deterministic and content-based, using title, description,
creator, and timestamp. Sequential mode remains the default for backward
compatibility.

Examples:
  python gh2jsonl.py --repo owner/repo --id-mode hash | bd import
  python gh2jsonl.py --file issues.json --id-mode hash --hash-length 4
2025-11-25 16:57:25 -08:00
Steve Yegge
e6db383a53 Merge branch 'main' of https://github.com/steveyegge/beads 2025-11-23 16:30:02 -08:00
Steve Yegge
1cc238f61d feat: Add agent upgrade awareness documentation and tooling
Implements bd-hwmp and bd-5otr (part of epic bd-nxgk) to help AI agents
automatically detect and adapt to bd upgrades.

## Changes

### Documentation (bd-hwmp)
- Added "After Upgrading bd" section to AGENTS.md with step-by-step workflow
- Enhanced "Pro Tips for Agents" with upgrade detection guidance
- Documents bd info --whats-new and bd hooks install commands
- References GitHub Discussion #239

### Startup Hook (bd-5otr)
- Created examples/startup-hooks/bd-version-check.sh
  - Auto-detects bd version changes via .beads/metadata.json
  - Shows bd info --whats-new when upgrade detected
  - Auto-updates outdated git hooks
  - Handles edge cases (no jq, not in beads project, etc.)
- Created examples/startup-hooks/README.md with integration examples
  - Claude Code, GitHub Copilot, Cursor integration patterns
  - Comprehensive usage and troubleshooting guide
- Updated examples/README.md with new startup-hooks section

## Impact

Agents can now:
- Automatically detect bd upgrades at session start
- See what changed without re-reading all documentation
- Keep git hooks in sync automatically
- Adapt workflows based on new features

Works today with zero bd code changes required!

Related: #239

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-23 16:29:56 -08:00
Steve Yegge
106499c4fc Improve pre-push hook: suggest bd sync with auto-sync option
The pre-push hook now provides better guidance when beads JSONL has
uncommitted changes:

- Interactive terminals: Prompts to auto-run 'bd sync' (y/N)
- Non-interactive/CI: Shows 'bd sync' command to run
- Fallback: Manual git commands if bd not available

This addresses the UX issue where users weren't sure they should
run 'bd sync' instead of manual git commands.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-23 16:10:02 -08:00
Zack Rosen
39ef32a9ac fix: use nullish coalescing to fix priority 0 bug display
Fixes display bug where P0 issues were shown as P2 due to JavaScript treating 0 as falsy. Also adds P0 to the priority filter dropdown.

Changes:
- Replace || with ?? operator for priority defaults in monitor UI
- Add P0 option to priority filter selector

Co-authored-by: Zack Rosen <zjrosen@users.noreply.github.com>
2025-11-23 14:58:58 -08:00
Steve Yegge
e75b228576 Add tests and documentation for --shared hooks feature
- Fix existing tests to work with new installHooks signature
- Add TestInstallHooksShared to verify shared hooks functionality
- Update git-hooks README with comprehensive --shared documentation
- Document benefits, use cases, and workflow for shared hooks
2025-11-23 12:39:11 -08:00
matt wilkie
c50695b3d4 Monitor Web UI fixes and updates
Fixes status filter bug, adds multi-select priority filter, find-as-you-type search, and interactive stats cards. Includes visual improvements for hover effects and alignment.

Co-authored-by: maphew <matt.wilkie@yukon.ca>
2025-11-23 10:32:22 -08:00
Steve Yegge
21a0656a4c Refactor AGENTS.md: Extract detailed instructions to prevent context pollution
Fixes #340

Created AGENT_INSTRUCTIONS.md to house detailed operational instructions,
reducing AGENTS.md from 963 to 626 lines (~35% reduction).

Changes:
- New AGENT_INSTRUCTIONS.md with development, testing, and release procedures
- AGENTS.md now serves as quick overview with references to detailed docs
- Updated README.md link to "Landing the Plane" section
- Fixed broken team-workflow README links

Benefits:
- Prevents context pollution when multiple tools add instructions
- Better separation: quick reference vs detailed operations
- Enables tool-specific instruction files
- Maintains all content, just reorganized

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-20 22:04:17 -05:00
Matt Wilkie
2682fc7003 add panic func in case of early exit
During 1st test monitor quit early with no error. Subsequent runs were fine. Added this func to give a wee bit of feedback for next time.
2025-11-19 14:44:26 -07:00
Matt Wilkie
e36baee506 fix monitor-webui failure to detect running daemon
monitor-webui fails to connect to the bd daemon because it calculates the socket path incorrectly. It expects beads.db.sock in a nested .beads directory, whereas the daemon listens on bd.sock in the .beads directory.

Updated `getSocketPath` function to:
- Check if dbPath directory is already .beads.
- Use bd.sock as the socket name instead of [dbName].sock.
- Handle both nested and non-nested cases correctly.
2025-11-19 14:33:37 -07:00
Steve Yegge
77ba8b1c56 Add go.mod to go-agent example to fix goreleaser 2025-11-08 23:10:53 -08:00
Steve Yegge
4fd9e1c9cc Add Go agent example with Agent Mail support
Amp-Thread-ID: https://ampcode.com/threads/T-b50a2f5e-cad0-43f0-b3ec-afe9bd5fa654
Co-authored-by: Amp <amp@ampcode.com>
2025-11-08 19:33:33 -08:00
Steve Yegge
54702b59a2 Fix #264 and #262: Remove stale --resolve-collisions references
- Update examples/git-hooks README to use 'bd hooks install' instead of non-existent install.sh
- Fix post-merge hook error message to not suggest --resolve-collisions flag (removed in v0.20)
- Clean up all doc references to --resolve-collisions (flag removed, hash IDs prevent collisions)

Fixes #264 (git hooks installer missing)
Fixes #262 (misleading error message)

Amp-Thread-ID: https://ampcode.com/threads/T-c9f0e4cb-fba2-4db2-a3d5-36dc1892be9d
Co-authored-by: Amp <amp@ampcode.com>
2025-11-08 13:18:50 -08:00
Steve Yegge
abb1d1c714 Fix post-merge hook to show actual error messages
Previously the hook redirected stderr to /dev/null, hiding useful error
messages like 'Git conflict markers detected'. Users only saw a generic
warning with no indication of the root cause.

Now captures and displays the actual error output, making it immediately
clear what went wrong (e.g., merge conflicts in JSONL).

Fixes bd-nszi

Amp-Thread-ID: https://ampcode.com/threads/T-6231e968-2c06-44ad-855d-bb5fafe452f6
Co-authored-by: Amp <amp@ampcode.com>
2025-11-08 02:46:04 -08:00
Steve Yegge
37f9d3610d Complete Agent Mail documentation (bd-nl8z)
- Add AGENT_MAIL_QUICKSTART.md: 5-minute setup guide
- Add examples/python-agent/AGENT_MAIL_EXAMPLE.md: working code examples
- Add examples/python-agent/agent_with_mail.py: runnable multi-agent demo
- Update README.md: add Agent Mail to features and docs index
- Update AGENTS.md: enhance with quickstart/example references
- Update examples README: add Agent Mail example to index

Amp-Thread-ID: https://ampcode.com/threads/T-5d5e711d-7b5f-42ca-b75a-5b6cd843ad98
Co-authored-by: Amp <amp@ampcode.com>
2025-11-08 02:36:27 -08:00
Steve Yegge
497f12fca5 Remove old install.sh script, replaced by bd hooks install
Amp-Thread-ID: https://ampcode.com/threads/T-6d470bf0-ada4-4b71-95ca-21d926837764
Co-authored-by: Amp <amp@ampcode.com>
2025-11-08 01:29:36 -08:00
Steve Yegge
187fdd258a Add bd hooks install command with embedded git hooks (bd-908z)
- Embed git hooks in binary using go:embed and templates directory
- Add bd hooks install/uninstall/list subcommands
- Install hooks with automatic backup of existing hooks
- Update AGENTS.md to reference 'bd hooks install' instead of install.sh
- Add comprehensive tests for hooks commands
- Update hook version to 0.22.1

Closes bd-908z
2025-11-08 01:28:19 -08:00
Steve Yegge
c3856bb140 Add Agent Mail documentation and bash-agent integration
- Added Agent Mail section to QUICKSTART.md with benefits and setup
- Integrated Agent Mail into bash-agent example with reservation/notification
- Added multi-agent usage instructions to bash-agent README
- Closed bd-eimz (QUICKSTART), bd-fkdw (bash-agent), bd-sc57 (production)
- Completed bd-nl8z documentation epic

Amp-Thread-ID: https://ampcode.com/threads/T-5b0d67ff-5eb2-41b3-bc9b-7f33719e0c85
Co-authored-by: Amp <amp@ampcode.com>
2025-11-08 01:10:20 -08:00
Steve Yegge
ef94641541 Add multi-agent race condition test (bd-zo7o)
- Created test_agent_race.py with 3 test scenarios
- Tests collision prevention with Agent Mail reservations
- Validates that only one agent claims an issue when reservations active
- Demonstrates collision problem when Agent Mail disabled
- Includes stress test with 10 agents
- Non-interactive mode support for CI/automation

Amp-Thread-ID: https://ampcode.com/threads/T-2fb10899-490f-4d41-b003-8bc4d467cc54
Co-authored-by: Amp <amp@ampcode.com>
2025-11-08 00:36:21 -08:00
Steve Yegge
046e852861 Fix GH#254: bd init now detects and chains with existing git hooks
- Detect existing git hooks (pre-commit framework, custom scripts)
- Prompt user with 3 options: chain (recommended), overwrite, skip
- Chain mode preserves existing hooks by calling them first
- Overwrite mode creates timestamped backups
- Add tests for hook detection and installation
- Update documentation with chaining feature

Fixes silent overwrites of pre-commit framework hooks that caused
test failures to slip through.

Amp-Thread-ID: https://ampcode.com/threads/T-37164fd7-6452-40b0-b5dd-c13672dcb843
Co-authored-by: Amp <amp@ampcode.com>
2025-11-07 15:55:19 -08:00
Matteo Landi
64742cd574 Fix SQLite driver name mismatch causing "unknown driver" errors (#252)
* fix: Use correct SQLite driver name 'sqlite3' instead of 'sqlite'

The ncruces/go-sqlite3 driver registers as 'sqlite3', but doctor.go
and example code were using 'sqlite', causing 'unknown driver' errors.

This fix corrects all sql.Open() calls to use the proper driver name:
- cmd/bd/doctor.go: 6 instances fixed
- docs/EXTENDING.md: 2 documentation examples updated
- examples/bd-example-extension-go/: Fixed example code and README

Fixes #230

Amp-Thread-ID: https://ampcode.com/threads/T-1e8c5473-cb79-4457-be07-4517bfdb73f4
Co-authored-by: Amp <amp@ampcode.com>

* Revert CGO_ENABLED back to 0 for pure-Go SQLite driver

The ncruces/go-sqlite3 driver is pure-Go and doesn't require CGO.
The previous change to CGO_ENABLED=1 in commit f9771cd was an
attempted fix for #230, but the real issue was the driver name
mismatch ('sqlite' vs 'sqlite3'), which is now fixed.

Benefits of CGO_ENABLED=0:
- Simpler cross-compilation (no C toolchain required)
- Smaller binaries
- Faster builds
- Matches the intended design of the pure-Go driver

---------

Co-authored-by: Amp <amp@ampcode.com>
2025-11-07 14:19:14 -08:00
Markus Flür
e7f532db93 Implementing an RPC monitoring solution with a web-ui as implementation example. (#244)
* bd sync: 2025-10-30 12:12:27

* Working on frontend

* bd sync: 2025-11-06 16:55:55

* feat: finish bd monitor human viewer

* Merge conflicts resolved and added tests

* bd sync: 2025-11-06 17:23:41

* bd sync: 2025-11-06 17:34:52

* feat: Add reload button and multiselect status filter to monitor

- Changed status filter from single select to multiselect with 'Open' selected by default
- Added reload button with visual feedback (hover/active states)
- Updated filterIssues() to handle multiple selected statuses
- Added reloadData() function that reloads both stats and issues
- Improved responsive design for mobile devices
- Filter controls now use flexbox layout with better spacing

* fix: Update monitor statistics to show Total, In Progress, Open, Closed

- Replaced 'Ready to Work' stat with 'In Progress' stat
- Reordered stats to show logical progression: Total -> In Progress -> Open -> Closed
- Updated loadStats() to fetch in-progress count from stats API
- Removed unnecessary separate API call for ready count

* fix: Correct API field names in monitor stats JavaScript

The JavaScript was using incorrect field names (stats.total, stats.by_status)
that don't match the actual types.Statistics struct which uses flat fields
with underscores (total_issues, in_progress_issues, etc).

Fixed by updating loadStats() to use correct field names:
- stats.total -> stats.total_issues
- stats.by_status?.['in-progress'] -> stats.in_progress_issues
- stats.by_status?.open -> stats.open_issues
- stats.by_status?.closed -> stats.closed_issues

Fixes beads-9

* bd sync: 2025-11-06 17:51:24

* bd sync: 2025-11-06 17:56:09

* fix: Make monitor require daemon to prevent SQLite locking

Implemented Option 1 from beads-eel: monitor now requires daemon and never
opens direct SQLite connection.

Changes:
- Added 'monitor' to noDbCommands list in main.go to skip normal DB initialization
- Added validateDaemonForMonitor() PreRun function that:
  - Finds database path using beads.FindDatabasePath()
  - Validates daemon is running and healthy
  - Fails gracefully with clear error message if no daemon
  - Only uses RPC connection, never opens SQLite directly

Benefits:
- Eliminates SQLite locking conflicts between monitor and daemon
- Users can now close/update issues via CLI while monitor runs
- Clear error messages guide users to start daemon first

Fixes beads-eel

* bd sync: 2025-11-06 18:03:50

* docs: Add bd daemons restart subcommand documentation

Added documentation for the 'bd daemons restart' subcommand across all documentation files:

- commands/daemons.md: Added full restart subcommand section with synopsis, description, arguments, flags, and examples
- README.md: Added restart examples to daemon management section
- AGENTS.md: Added restart examples with --json flag for agents

The restart command gracefully stops and starts a specific daemon by workspace path or PID,
useful after upgrading bd or when a daemon needs refreshing.

Fixes beads-11

* bd sync: 2025-11-06 18:13:16

* Separated the web ui from the general monitoring functionality

---------

Co-authored-by: Steve Yegge <stevey@sourcegraph.com>
2025-11-07 09:49:12 -08:00
Steve Yegge
0b0d9a43d1 Improve bd-my64 fix based on oracle review
Oracle identified a critical race condition in the initial fix:
- Pre-push hook checked for changes but didn't flush first
- Pending 5s-debounced flushes could land after the check
- Result: stale JSONL could still be pushed

Improvements:
1. Pre-push now flushes pending changes FIRST (bd sync --flush-only)
2. Uses git status --porcelain to catch ALL change types:
   - Staged, unstaged, untracked, deleted, renamed, conflicts
3. Handles both beads.jsonl and issues.jsonl (backward compat)
4. Works even without bd installed (git-only check)
5. Pre-commit stages both JSONL files (simpler loop)

This completely eliminates the race condition.
2025-11-06 19:01:28 -08:00
Steve Yegge
3ba245e6c0 Fix bd-my64: Pre-push hook blocks instead of exports
The original pre-push hook tried to export DB → JSONL during the push,
then run 'git add', but this doesn't work because:

1. The commit is already created when pre-push runs
2. git add in pre-push stages files for a FUTURE commit
3. The current push sends the old commit with stale JSONL
4. Result: dirty git status after push

Fix:
- Pre-push now CHECKS for uncommitted JSONL changes
- If found, it FAILS the push with clear instructions
- User must commit JSONL before pushing
- This prevents stale JSONL from reaching remote

The pre-commit hook already properly flushes changes, so this
catch-all prevents changes made BETWEEN commit and push.

Amp-Thread-ID: https://ampcode.com/threads/T-39a89553-c301-4d4f-b39f-6df9c403d22b
Co-authored-by: Amp <amp@ampcode.com>
2025-11-06 18:57:34 -08:00
Steve Yegge
991c6248ca Add git hooks support and refactor info command 2025-11-06 15:00:15 -08:00
Steve Yegge
584c266684 Reorganize project structure: move Go files to internal/beads, docs to docs/
Amp-Thread-ID: https://ampcode.com/threads/T-7a71671d-dd5c-4c7c-b557-fa427fceb04f
Co-authored-by: Amp <amp@ampcode.com>
2025-11-05 21:04:00 -08:00
Steve Yegge
3ecc16e0e3 Add workflow examples: multi-phase development and multiple personas (bd-p68x)
Amp-Thread-ID: https://ampcode.com/threads/T-b0f16435-48af-40ee-be66-ba0636fdd0fb
Co-authored-by: Amp <amp@ampcode.com>
2025-11-05 19:12:58 -08:00
Steve Yegge
b230a2270d feat: Add bd init --contributor and --team wizards
- Implement OSS contributor workflow wizard
  - Auto-detects fork relationships (upstream remote)
  - Checks push access (SSH vs HTTPS)
  - Creates separate planning repository
  - Configures auto-routing to keep planning out of PRs

- Implement team workflow wizard
  - Detects protected main branches
  - Creates sync branch if needed
  - Configures auto-commit/auto-push
  - Supports both direct and PR-based workflows

- Add comprehensive documentation
  - examples/contributor-workflow/README.md
  - examples/team-workflow/README.md
  - Updated AGENTS.md, README.md, QUICKSTART.md
  - Updated docs/MULTI_REPO_MIGRATION.md

Closes: bd-kla1, bd-twlr, bd-6z7l
Amp-Thread-ID: https://ampcode.com/threads/T-b4d124a2-447e-47d1-8124-d7c5dab9a97b
Co-authored-by: Amp <amp@ampcode.com>
2025-11-05 19:04:14 -08:00
Steve Yegge
edf1f71fa7 Add comprehensive protected branch workflow documentation (bd-5ce8)
Created complete documentation suite for using beads with protected branches:

1. **docs/PROTECTED_BRANCHES.md** - Comprehensive 600+ line guide covering:
   - Quick start and setup
   - How git worktrees work
   - Daily workflow for agents and humans
   - Merging strategies (PR and direct)
   - Troubleshooting common issues
   - Platform-specific notes (GitHub, GitLab, Bitbucket)
   - Advanced topics (CI/CD, multi-clone sync, etc.)

2. **AGENTS.md** - Added "Protected Branch Workflow" section:
   - Quick reference for agents
   - No changes needed to agent workflows
   - Commands for setup and merging
   - Link to detailed docs

3. **README.md** - Updated with:
   - Protected branch support feature flag
   - Quick start instructions with --branch flag
   - Link to comprehensive guide

4. **examples/protected-branch/** - Working example with:
   - Step-by-step demo
   - Multi-clone sync workflow
   - GitHub Actions integration example
   - Directory structure explanation
   - Troubleshooting tips

All commands verified:
- bd init --branch <name>
- bd config get/set sync.branch
- bd sync --status
- bd sync --merge

Documentation is platform-agnostic and works with GitHub, GitLab,
Bitbucket, or any git platform with branch protection.

Closes bd-5ce8

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-02 18:41:51 -08:00
Steve Yegge
6ecfd04ec8 Implement BEADS_DIR environment variable (bd-e16b)
Add BEADS_DIR as a replacement for BEADS_DB to point to the .beads
directory instead of the database file directly.

Rationale:
- With --no-db mode, there's no .db file to point to
- The .beads directory is the logical unit (contains config.yaml, db
  files, jsonl files)
- More intuitive: point to the beads directory not the database file

Implementation:
- Add BEADS_DIR environment variable support to FindDatabasePath()
- Priority order: BEADS_DIR > BEADS_DB > auto-discovery
- Maintain backward compatibility with BEADS_DB (now deprecated)
- Update --no-db mode to respect BEADS_DIR
- Update MCP integration (config.py, bd_client.py)
- Update documentation to show BEADS_DIR as preferred method

Testing:
- Backward compatibility: BEADS_DB still works
- BEADS_DIR works with regular database mode
- BEADS_DIR works with --no-db mode
- Priority: BEADS_DIR takes precedence over BEADS_DB

Follow-up issues for refactoring:
- bd-efe8: Refactor path canonicalization into helper function
- bd-c362: Extract database search logic into helper function

Closes bd-e16b

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-02 18:36:30 -08:00
Steve Yegge
9c38082cbf Add pre-push hook to prevent stale JSONL exports 2025-11-01 22:22:55 -07:00
Steve Yegge
e5a3f8ce25 Add quoting guidance to AGENTS.md and SKILL.md
Fixes #194 - Claude Code was failing to quote titles/descriptions with
special characters. Added explicit warnings and examples showing proper
quoting for arguments containing spaces, apostrophes, and special chars.

Amp-Thread-ID: https://ampcode.com/threads/T-0570ff80-8115-479d-b39c-dbdf2ada5215
Co-authored-by: Amp <amp@ampcode.com>
2025-11-01 12:23:39 -07:00
Steve Yegge
d5488cb97f Remove collision-era language from docs and code
- Updated FAQ.md, ADVANCED.md, TROUBLESHOOTING.md to explain hash IDs eliminate collisions
- Removed --resolve-collisions references from all documentation and examples
- Renamed handleCollisions() to detectUpdates() to reflect update semantics
- Updated test names: TestAutoImportWithCollision → TestAutoImportWithUpdate
- Clarified: with hash IDs, same-ID = update operation, not collision

Closes: bd-50a7, bd-b84f, bd-bda8, bd-650c, bd-3ef2, bd-c083, bd-85a6
2025-10-31 14:24:50 -07:00
Steve Yegge
5d137ffeeb Remove sequential ID generation and SyncAllCounters (bd-c7af, bd-8e05, bd-4c74)
- Removed SyncAllCounters() and all call sites (already no-op with hash IDs)
- Removed AllocateNextID() and getNextIDForPrefix() - sequential ID generation
- Removed collision remapping logic in internal/storage/sqlite/collision.go
- Removed rename collision handling in internal/importer/importer.go
- Removed branch-merge example (collision resolution no longer needed)
- Updated EXTENDING.md to remove counter sync examples

These were all deprecated code paths for sequential IDs that are obsolete
with hash-based IDs. Hash ID collisions are handled by extending the hash,
not by remapping to new sequential IDs.
2025-10-30 22:24:42 -07:00
Steve Yegge
897edc6ce7 Update post-merge hook to use bd sync --import-only and auto-detect *.jsonl files (bd-126) 2025-10-27 18:27:01 -07:00
Steve Yegge
0344e1f08b Fix bd-51: Add git hooks to eliminate auto-flush race condition
- Added --flush-only flag to bd sync command
- Created pre-commit hook to flush pending changes before commit
- Created post-merge hook to import changes after pull/merge
- Added install script for easy setup
- Updated AGENTS.md with git hooks workflow
- Resolves race condition where daemon auto-flush fires after commit

Amp-Thread-ID: https://ampcode.com/threads/T-00b80d3a-4194-4c75-a60e-25a318cf9f91
Co-authored-by: Amp <amp@ampcode.com>
2025-10-24 22:17:06 -07:00
spm1001
bdaf82026a Enhance Claude Code skill with real-world usage patterns (#116)
* Update skill installation path and document new features

Installation path changes:
- Update from ~/.claude/skills/bd to bd-issue-tracking
- Matches internal skill name for consistency with other skills

Documentation additions:
- Add 3 new reference files to documentation list
- Document compaction survival patterns (critical for Claude Code)
- Mention self-check checklists and quality guidelines

This prepares the README for upcoming skill content improvements.

* Add new reference files for enhanced skill guidance

New reference documentation:

1. ISSUE_CREATION.md - When to ask vs create issues
   - Decision criteria for knowledge work vs technical work
   - Issue quality guidelines and best practices
   - Design vs acceptance criteria guidance
   - Self-check questions for well-scoped issues

2. RESUMABILITY.md - Making issues resumable across sessions
   - Patterns for complex technical work with APIs
   - Working code examples and API response samples
   - When enhanced documentation matters vs simple descriptions
   - Critical for multi-session work and crash recovery

3. STATIC_DATA.md - Using bd for reference databases
   - Alternative use case beyond work tracking
   - Glossaries and terminology management
   - Dual format patterns (database + markdown)
   - When bd helps vs when simpler formats suffice

These additions emerged from real-world usage patterns and enable
Claude to make better decisions about issue structure and resumability.

* Enhance existing skill files with real-world usage patterns

SKILL.md major enhancements (~194 net lines added):
- Add "Test Yourself" decision framework with self-check questions
- Document compaction survival patterns (critical for Claude Code)
- Add Notes Quality Self-Check (future-me test, stranger test)
- Session Start Checklist with copy-paste templates
- Field Usage Reference table (when to use each bd field)
- Progress Checkpointing triggers and patterns
- Issue Creation Checklist with quality self-checks
- Enhanced session handoff protocols

WORKFLOWS.md enhancements (~114 lines added):
- Session handoff workflow with detailed checklists
- Collaborative handoff between Claude and user
- Compaction survival workflow
- Notes format guidelines (current state, not cumulative)
- Session start checklist expansion

BOUNDARIES.md updates (~49 lines removed):
- Streamlined content (moved detailed workflows to WORKFLOWS.md)
- Retained core decision criteria
- Improved examples and integration patterns

CLI_REFERENCE.md minor updates:
- Additional command examples
- Clarified flag usage

These improvements emerged from extensive real-world usage, particularly
around crash recovery, compaction events, and multi-session workflows.
The additions make the skill more practical for autonomous agent use.
2025-10-23 09:26:30 -07:00
Steve Yegge
5e7b3aa43a Add Beads library API for Go integration
Expose full Storage interface and all types through public beads.go API,
enabling external Go projects (like VC) to import Beads directly instead
of spawning CLI processes.

Changes:
- Expanded beads.go with all public types (Issue, Dependency, Comment, etc.)
- Added all constants (Status, IssueType, DependencyType, EventType)
- Created comprehensive integration tests (beads_integration_test.go)
- Added library usage example at examples/library-usage/
- Documented library integration in README.md

Test coverage: 96.4% on public API, 14 integration tests, all passing.

Closes bd-58, bd-59

Amp-Thread-ID: https://ampcode.com/threads/T-f0093c79-7422-45e2-b0ed-0ddfebc9ffea
Co-authored-by: Amp <amp@ampcode.com>
2025-10-22 15:49:40 -07:00
Steve Yegge
a86f3e139e Add native Windows support (#91)
- Native Windows daemon using TCP loopback endpoints
- Direct-mode fallback for CLI/daemon compatibility
- Comment operations over RPC
- PowerShell installer script
- Go 1.24 requirement
- Cross-OS testing documented

Co-authored-by: danshapiro <danshapiro@users.noreply.github.com>
Amp-Thread-ID: https://ampcode.com/threads/T-c6230265-055f-4af1-9712-4481061886db
Co-authored-by: Amp <amp@ampcode.com>
2025-10-20 21:08:49 -07:00
Steve Yegge
c8bee73e10 Refactor: Slim down SKILL.md by moving details to reference files
- Move detailed compaction survival content to WORKFLOWS.md (already had section)
- Move detailed TodoWrite integration (temporal layering) to BOUNDARIES.md
- Condense database discovery rules to one line
- Keep SKILL.md focused on essentials with links to detailed docs

Result: SKILL.md reduced from 511 to 443 lines (-68 lines, 13% reduction)
Amp-Thread-ID: https://ampcode.com/threads/T-244a1772-7dbe-448e-bff2-f4d840095190
Co-authored-by: Amp <amp@ampcode.com>
2025-10-19 09:39:59 -07:00
spm1001
69e8fb1f6d Update Claude Code skill with compaction survival, enhanced TodoWrite integration, and CLI docs (#85)
Thanks for accepting the original contribution! I've made some updates based on
real-world usage.

Some of the examples in the original were a bit idiosyncratic to my own work,
so I've generalized them to use universal programming scenarios (authentication,
database migrations, API design) that should be more relatable to any developer.

I've also added some broader improvements to the skill. Apologies for not doing
these as two separate pull requests - I hope bundling them together is OK.

These improvements came largely from asking Claude to reflect on what was useful
and difficult about using the skill - in particular, Claude felt that the
post-compaction scenario was a powerful one because normally a context compaction
causes severe loss of state.

Main changes:
- Add comprehensive compaction survival guide with note-taking patterns
- Replace basic TodoWrite integration with temporal layering pattern
- Add bd export/import documentation with collision resolution
- Clarify when to ask before creating issues vs creating directly
- Add database discovery rules for multi-DB scenarios
2025-10-19 09:33:24 -07:00
Steve Yegge
b0fba2eef2 feat: implement --max-depth flag for bd dep tree (closes #87, bd-3, bd-159)
- Add --max-depth/-d flag with default of 50
- Wire flag through to store.GetDependencyTree()
- Add input validation (must be >= 1)
- Show inline '… [truncated]' markers on truncated nodes
- Update truncation warning to show actual depth used
- Add comprehensive tests (truncation, default depth, boundary cases)
- Update CLI docs and reference

Thanks to @yashwanth-reddy909 for the initial implementation in PR #87.
This commit completes the feature with full wiring, validation, tests, and docs.

Amp-Thread-ID: https://ampcode.com/threads/T-c439b09c-cff2-48d9-8988-cf9353f0d32e
Co-authored-by: Amp <amp@ampcode.com>
2025-10-19 09:00:11 -07:00
spm1001
a373f8ab40 Clarify CLI vs MCP approach and context benefits 2025-10-18 17:58:04 +01:00
spm1001
7f93a602d2 Add Claude Code skill for beads usage
- Provides comprehensive workflow patterns and decision criteria
- Includes quick reference (SKILL.md) and detailed references
- Teaches when to use bd vs markdown/TodoWrite
- Covers dependency types and issue lifecycle management
- Complements existing plugin with usage philosophy
2025-10-18 17:54:46 +01:00