Add a Python script to push bd issues to Jira.
Features:
- Create new Jira issues from bd issues without external_ref
- Update existing Jira issues matched by external_ref
- Handle Jira workflow transitions for status changes
- Reverse field mappings (bd -> Jira) via config
- Dry-run mode for previewing changes
- Auto-update external_ref after creation (--update-refs)
Also updates README to document bidirectional sync workflow.
Closes bd-93d
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Add a Python script to import Jira issues into beads JSONL format.
Features:
- Fetch issues from Jira Cloud or Server/Data Center REST API
- JQL query support for flexible filtering
- Configurable field mappings via bd config
- Hash-based or sequential ID generation
- Issue links converted to dependencies
- external_ref set for re-sync capability
Configuration options:
- jira.url, jira.project, jira.api_token
- jira.status_map.*, jira.type_map.*, jira.priority_map.*
Closes bd-tjn
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Change comments from sync.branch to sync-branch for consistency
- Add head -1 to handle malformed YAML with duplicate keys
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Previously sync.branch was stored in the database via bd config set.
Now it is in config.yaml (version controlled, shared across clones):
sync-branch: "beads-sync"
Changes:
- Add sync-branch to .beads/config.yaml
- Update syncbranch.Get() to check config.yaml before database
- Add syncbranch.GetFromYAML() and IsConfigured() for fast checks
- Update hooks to read sync-branch from config.yaml directly
- Update bd doctor to check config.yaml instead of database
- Remove auto-fix (config.yaml changes should be committed)
Precedence: BEADS_SYNC_BRANCH env > config.yaml > database (legacy)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
When sync.branch is configured, .beads changes are committed to a
separate branch via worktree rather than the current branch. Updated
both hooks to detect this configuration and skip the uncommitted
.beads check in that scenario.
Changes:
- pre-push: Skip uncommitted .beads check when sync.branch is set
- pre-commit: Skip flush and auto-staging when sync.branch is set
- Both: Use --json output for reliable config value detection
- Bump version to 0.22.2
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Adds worktree detection to post-checkout hooks. When entering a git
worktree, displays a warning explaining that daemon mode has limitations
with worktrees and recommends using BEADS_NO_DAEMON=1.
Detection uses `git rev-parse --git-dir` vs `--git-common-dir` comparison
to identify worktree checkouts.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: maphew <maphew@users.noreply.github.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Two fixes to prevent git pull --rebase from failing:
1. Skip hook execution during rebase operations by detecting
.git/rebase-merge or .git/rebase-apply directories
2. Use --no-git-history flag to prevent git-history-backfill
from writing to deletions.jsonl during imports
The root cause was that post-checkout hooks were running during
rebase, triggering the git-history-backfill which appends to
deletions.jsonl. This created uncommitted changes that blocked
the rebase from continuing.
Bump hooks version to 0.26.0.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Update examples/claude-code-skill/references/CLI_REFERENCE.md to match
docs/CLI_REFERENCE.md. The skill version was ~17% smaller and missing
newer sections like Global Flags, Sandbox Mode, Orphan Handling, etc.
Fixes#401🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
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>
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>
- 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>
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
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>
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>
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>
- 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
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>
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>
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.
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>
- 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>
- 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>
* 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>
* 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>
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.
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>
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>
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>
- 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.