Commit Graph

120 Commits

Author SHA1 Message Date
Steve Yegge
4ffbab5311 docs(worktrees): Add 'Fully Separate Beads Repository' section (GH#195)
Document the BEADS_DIR workflow for storing beads in a completely
separate git repository from your code. This feature was added in
PR #533 by @dand-oss but wasn't documented.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-25 20:48:59 -08:00
Steve Yegge
f3a5e02a35 feat(close): Add --suggest-next flag to show newly unblocked issues (GH#679)
When closing an issue, the new --suggest-next flag returns a list of
issues that became unblocked (ready to work on) as a result of the close.

This helps agents and users quickly identify what work is now available
after completing a blocker.

Example:
  $ bd close bd-5 --suggest-next
  ✓ Closed bd-5: Completed

  Newly unblocked:
    • bd-7 "Implement feature X" (P1)
    • bd-8 "Write tests for X" (P2)

Implementation:
- Added GetNewlyUnblockedByClose to storage interface
- Implemented efficient single-query for SQLite using blocked_issues_cache
- Added SuggestNext field to CloseArgs in RPC protocol
- Added CloseResult type for structured response
- CLI handles both daemon and direct modes

Thanks to @kraitsura for the detailed feature request and design.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-25 20:05:04 -08:00
Steve Yegge
cfecadc8a5 docs: Clarify formulas are JSON, add distillation and sharing docs
- Fix YAML → JSON references in formula.go and types.go
- Update MOLECULES.md with ephemeral proto architecture
- Add Distillation section: extract formulas from completed work
- Add Sharing section: Mol Mall formula marketplace
- Update Layer Cake diagram to show ephemeral proto flow

Related: bd-1dez (Mol Mall epic)

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-25 18:43:08 -08:00
Steve Yegge
47cc84de3a fix(docs): standardize sync branch name and daemon syntax (GH#376)
- Replace beads-metadata with beads-sync throughout docs
  (matches code default and internal examples)
- Fix bd daemon start → bd daemon --start (correct flag syntax)

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-25 16:22:09 -08:00
Steve Yegge
e068ac574f refactor: Simplify wisp architecture - badges not separate storage
Wisps are now just issues with Wisp=true flag in the main database,
not exported to JSONL. Removes all references to .beads-wisp/ directory.

- Update docs: CLAUDE.md, CLI_REFERENCE.md, MOLECULES.md, DELETIONS.md
- Update code comments: wisp.go
- Update changelog and info.go version notes

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-25 01:49:57 -08:00
Steve Yegge
e6ce0d6365 refactor: Switch formula format from YAML to JSON
- Change file extension from .formula.yaml to .formula.json
- Replace gopkg.in/yaml.v3 with encoding/json in parser
- Remove yaml struct tags, keep json tags only
- Update all test cases to use JSON format
- Update documentation references

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-25 01:37:22 -08:00
Steve Yegge
5f16d10634 docs: rewrite MOLECULES.md with workflow-first structure (bd-ul59)
Completely rewrote the molecular chemistry doc to be more practical:
- Start with execution semantics (what users care about)
- TL;DR section at top with 5 key concepts
- Explain dependency types and blocking behavior
- Clarify molecules = epics (no special types needed)
- Move chemistry metaphor to secondary section
- Add common patterns (sequential, fanout, dynamic bonding)
- Keep agent pitfalls and quick reference

The doc now reads like a reference manual with examples rather than
a philosophical treatise on work composition.

Filed gt-qe9w for Gas Town docs to follow same pattern.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-24 19:52:01 -08:00
Steve Yegge
5e971bd90a docs: add molecular chemistry documentation (bd-ul59)
Create docs/MOLECULES.md with comprehensive coverage of:
- Layer cake architecture (formulas → protos → molecules → epics → issues)
- Phase metaphor (solid/proto, liquid/mol, vapor/wisp)
- Phase transitions (pour, wisp create, squash, burn)
- Bonding patterns (proto+proto, proto+mol, mol+mol)
- Agent pitfalls (temporal language, forgetting to squash)
- Orphan vs stale matrix
- Progress tracking (computed, not stored)
- Parallelism model (default parallel, opt-in sequential)

Update CLI_REFERENCE.md with Molecular Chemistry section covering:
- Proto/template commands
- Pour command
- Wisp commands
- Bonding commands
- Squash and burn commands

Update ARCHITECTURE.md with cross-reference to new MOLECULES.md.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-24 19:31:14 -08:00
Steve Yegge
9ad70cce64 refactor(mol): remove bd mol spawn - use pour/wisp only (bd-8y9t)
Remove the spawn command from bd mol. Proto instantiation now uses:
- bd pour <proto> - Instantiate as persistent mol (liquid phase)
- bd wisp create <proto> - Instantiate as ephemeral wisp (vapor phase)

Rationale:
- 'spawn' doesn't fit the chemistry metaphor
- Two phase transitions (pour/wisp) are clearer than one command with flags
- Avoids confusion about defaults

Changes:
- Delete mol_spawn.go
- Update mol.go, mol_catalog.go, mol_distill.go to reference pour/wisp
- Update pour.go and wisp.go to remove 'Equivalent to spawn' comments
- Update info.go changelog entries
- Update CHANGELOG.md, ARCHITECTURE.md, DELETIONS.md

Closes bd-8y9t
2025-12-24 12:52:47 -08:00
Steve Yegge
3c786f2333 feat: add Windows code signing infrastructure (bd-14v0)
Implements Authenticode signing for Windows binaries to reduce AV false positives.

Changes:
- Add scripts/sign-windows.sh for osslsigncode-based signing
- Update .goreleaser.yml with post-build signing hook
- Update release.yml to install osslsigncode and pass secrets
- Update docs/ANTIVIRUS.md with signing verification instructions
- Update scripts/README.md with signing script documentation

The signing is gracefully degraded - releases continue without signing
if the certificate secrets are not configured.

Required secrets for signing:
- WINDOWS_SIGNING_CERT_PFX_BASE64: base64-encoded PFX certificate
- WINDOWS_SIGNING_CERT_PASSWORD: certificate password

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-24 00:07:16 -08:00
Steve Yegge
e67f27c092 bd sync: 2025-12-23 23:38:57 2025-12-24 00:06:41 -08:00
Steve Yegge
2de1695615 bd sync: 2025-12-23 22:33:32 2025-12-23 22:33:33 -08:00
Steve Yegge
cf9e5a597b bd sync: 2025-12-23 20:50:50 2025-12-23 20:50:50 -08:00
Steve Yegge
9c8761abc9 bd sync: 2025-12-23 20:45:19 2025-12-23 20:45:19 -08:00
Steve Yegge
7b671662aa bd sync: 2025-12-23 13:49:07 2025-12-23 14:39:07 -08:00
Steve Yegge
c46b1a0bbb Add config-based close hooks (bd-g4b4)
Implements on_close hooks in .beads/config.yaml for automation and
notifications. Hooks receive issue data via environment variables
(BEAD_ID, BEAD_TITLE, BEAD_TYPE, BEAD_PRIORITY, BEAD_CLOSE_REASON)
and run via sh -c.

Changes:
- internal/config: Add HookEntry type and GetCloseHooks()
- internal/hooks: Add RunConfigCloseHooks() for executing config hooks
- cmd/bd: Call RunConfigCloseHooks after successful close
- docs/CONFIG.md: Document hooks configuration with examples

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 13:39:51 -08:00
Steve Yegge
25061ea9a7 chore: code health review - test fix and error comments (bd-9g1z, bd-ork0)
- Remove TestFindJSONLPathDefault from .test-skip (now passes)
- Add explanatory comments to 24 ignored error locations in cmd/bd:
  - Cobra flag methods (MarkHidden, MarkRequired, MarkDeprecated)
  - Best-effort cleanup/close operations
  - Process signaling operations

Part of code health review epic bd-tggf.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-22 21:30:57 -08:00
Charles P. Cross
ca348a29cb docs(daemon): update event-driven mode documentation
- Update Event-Driven Daemon Mode section from 'Experimental' to 'Default'
- Document that event-driven mode is default since v0.21.0
- Add detailed architecture diagram showing export and import flows
- Add remote-sync-interval configuration section with examples
- Document BEADS_REMOTE_SYNC_INTERVAL environment variable
- Add config.yaml example for remote-sync-interval
- Update 'Enabling Event-Driven Mode' to reflect default behavior
- Add 'Switch to Polling Mode' section for edge cases

The documentation now accurately reflects the current implementation where
event-driven mode is the default and includes periodic remote sync for
multi-clone workflows.
2025-12-22 18:49:46 -05:00
Steve Yegge
e7f09660c0 feat: add cross-project dependency support - config and external: prefix (bd-66w1, bd-om4a)
Config (bd-66w1):
- Add external_projects config for mapping project names to paths
- Add GetExternalProjects() and ResolveExternalProjectPath() functions
- Add config documentation and tests

External deps (bd-om4a):
- bd dep add accepts external:project:capability syntax
- External refs stored as-is in dependencies table
- GetBlockedIssues includes external deps in blocked_by list
- blocked_issues_cache includes external dependencies
- Add validation and parsing helpers for external refs

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-21 23:08:00 -08:00
Steve Yegge
98d665c6fd docs: add Wisps and Molecules architecture section
Document that wisps are intentionally local-only and use hard delete
instead of tombstones. This is by design - wisps never sync to other
clones, so tombstones are unnecessary overhead.

Closes bd-4bsb
2025-12-21 21:08:57 -08:00
Steve Yegge
c195dc1874 Merge branch 'main' into subtle-ux-improvements
Resolved modify/delete conflict: cmd/bd/mail.go was deleted on main
(mail functionality moved to Gas Town), accepting deletion.
2025-12-20 23:26:35 -08:00
Steve Yegge
3743e9ed70 chore: remove obsolete BD_GUIDE.md references
BD_GUIDE.md generation was removed in 125e36d5 when bd onboard was
simplified to output a minimal snippet pointing to bd prime.

This commit:
- Removes stale BD_GUIDE.md references from CLAUDE.md
- Removes dead checkAndSuggestBDGuideUpdate() code from version_tracking.go
- Removes BD_GUIDE.md from UNINSTALLING.md file list

Closes #660 (already fixed in v0.30.7 via f1380e8b)

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-20 20:50:33 -08:00
Steve Yegge
4fa0866fcf refactor: remove bd mail commands - mail moves to Gas Town
Mail is orchestration, not data plane. The bd mail commands were just
sugar over bd create/list/show with type=message. Gas Town (gt) now
owns mail routing and delivery.

Removed:
- cmd/bd/mail.go - all mail subcommands (send, inbox, read, ack, reply)
- cmd/bd/mail_test.go - mail command tests
- docs/messaging.md - dedicated mail documentation
- EventMessage hook - no longer triggered

Kept (data plane):
- type=message as valid issue type
- Sender, Ephemeral fields on issues
- replies_to dependency type for threading

Coordination: gt-9xg implements native mail in Gas Town.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-20 17:56:46 -08:00
Ryan Snodgrass
6ca141712c refactor(ui): standardize on lipgloss semantic color system
Replace all fatih/color usages with internal/ui package that provides:
- Semantic color tokens (Pass, Warn, Fail, Accent, Muted)
- Adaptive light/dark mode support via Lipgloss AdaptiveColor
- Ayu theme colors for consistent, accessible output
- Tufte-inspired data-ink ratio principles

Files migrated: 35 command files in cmd/bd/

Add docs/ui-philosophy.md documenting:
- Semantic token usage guidelines
- Light/dark terminal optimization rationale
- Tufte and perceptual UI/UX theory application
- When to use (and not use) color in CLI output
2025-12-20 17:09:50 -08:00
Ryan Snodgrass
fb1dff4f56 feat(ux): reorganize command groups and add Tufte-inspired help styling
- Add semantic coloring to help output (section headers, flags, types)
- Reorganize commands into clearer categories:
  - "Views & Reports" for readonly queries (ready, stats, blocked, etc.)
  - "Maintenance" for health/repair tasks (doctor, validate, migrate, etc.)
  - Merge "Issue Metadata" back into "Working With Issues"
- Highlight "doctor" as primary maintenance entry point with "(start here)"
- Create docs/UI_PHILOSOPHY.md documenting Tufte-inspired design principles
- Add guidance for PR to not include .beads/issues.jsonl
2025-12-20 12:57:16 -08:00
Steve Yegge
244ba1471b feat(config): add directory-aware label scoping for monorepos (fixes #541)
Adds automatic label filtering based on current working directory:
- New config option: directory.labels (maps directory patterns to labels)
- bd ready and bd list auto-apply label filtering when in matching directory
- Uses --label-any semantics (shows issues with any of the matching labels)

Config example:
```yaml
directory:
  labels:
    packages/maverick: maverick
    packages/agency: agency
```

When running `bd ready` from `packages/maverick/`, issues labeled
"maverick" are automatically shown first, without needing --label-any.

Closes #541

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-20 03:41:09 -08:00
Steve Yegge
c988b171e8 feat(config): add git.author and git.no-gpg-sign options (fixes #600)
Adds configuration options for beads git commits:
- git.author: Override commit author (e.g., "beads-bot <beads@example.com>")
- git.no-gpg-sign: Disable GPG signing for beads commits

This is useful for users with Touch ID commit signing (like Secretive)
who get prompted for every beads auto-commit.

Config example:
```yaml
git:
  author: "beads-bot <beads@example.com>"
  no-gpg-sign: true
```

Environment variables: BD_GIT_AUTHOR, BD_GIT_NO_GPG_SIGN

Closes #600

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-20 03:36:41 -08:00
Ryan
3c08e5eb9d DOCTOR IMPROVEMENTS: visual improvements/grouping + add comprehensive tests + fix gosec warnings (#656)
* test(doctor): add comprehensive tests for fix and check functions

Add edge case tests, e2e tests, and improve test coverage for:
- database_test.go: database integrity and sync checks
- git_test.go: git hooks, merge driver, sync branch tests
- gitignore_test.go: gitignore validation
- prefix_test.go: ID prefix handling
- fix/fix_test.go: fix operations
- fix/e2e_test.go: end-to-end fix scenarios
- fix/fix_edge_cases_test.go: edge case handling

* docs: add testing philosophy and anti-patterns guide

- Create TESTING_PHILOSOPHY.md covering test pyramid, priority matrix,
  what NOT to test, and 5 anti-patterns with code examples
- Add cross-reference from README_TESTING.md
- Document beads-specific guidance (well-covered areas vs gaps)
- Include target metrics (test-to-code ratio, execution time targets)

* chore: revert .beads/ to upstream/main state

* refactor(doctor): add category grouping and Ayu theme colors

- Add Category field to DoctorCheck for organizing checks by type
- Define category constants: Core, Git, Runtime, Data, Integration, Metadata
- Update thanks command to use shared Ayu color palette from internal/ui
- Simplify test fixtures by removing redundant test cases

* fix(doctor): prevent test fork bomb and fix test failures

- Add ErrTestBinary guard in getBdBinary() to prevent tests from
  recursively executing the test binary when calling bd subcommands
- Update claude_test.go to use new check names (CLI Availability,
  Prime Documentation)
- Fix syncbranch test path comparison by resolving symlinks
  (/var vs /private/var on macOS)
- Fix permissions check to use exact comparison instead of bitmask
- Fix UntrackedJSONL to use git commit --only to preserve staged changes
- Fix MergeDriver edge case test by making both .git dir and config
  read-only
- Add skipIfTestBinary helper for E2E tests that need real bd binary

* test(doctor): skip read-only config test in CI environments

GitHub Actions containers may have CAP_DAC_OVERRIDE or similar
capabilities that allow writing to read-only files, causing
the test to fail. Skip the test when CI=true or GITHUB_ACTIONS=true.
2025-12-20 03:10:06 -08:00
Steve Yegge
b4bc682d93 feat(create): add require-description config option (GH#596)
Add create.require-description config option that enforces descriptions
when creating issues. When enabled, bd create will error if no
description is provided (except for test issues).

- Config in .beads/config.yaml or ~/.config/bd/config.yaml
- Also supports BD_CREATE_REQUIRE_DESCRIPTION env var
- Default: false (preserves current behavior with warning)

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-20 02:38:56 -08:00
Justin Williams
df5ceb5d82 feat: Linear Integration (#655)
* Add Linear integration CLI with sync and status commands

- Add `bd linear sync` for bidirectional issue sync with Linear
- Add `bd linear status` to show configuration and sync state
- Stub pull/push functions pending GraphQL client (bd-b6b.2)

* Implement Linear GraphQL client with full sync support

- Add LinearClient with auth, fetch, create, update methods
- Implement pull/push operations with Beads type mapping
- Clean up redundant comments and remove unused code

* Add configurable data mapping and dependency sync for Linear

- Add LinearMappingConfig with configurable priority/state/label/relation maps
- Import parent-child and issue relations as Beads dependencies
- Support custom workflow states via linear.state_map.* config

* Add incremental sync support for Linear integration

- Add FetchIssuesSince() method using updatedAt filter in GraphQL
- Check linear.last_sync config to enable incremental pulls
- Track sync mode (incremental vs full) in LinearPullStats

* feat(linear): implement push updates for existing Linear issues

Add FetchIssueByIdentifier method to retrieve single issues by identifier
(e.g., "TEAM-123") for timestamp comparison during push.

Update doPushToLinear to:
- Fetch Linear issue to get internal ID and UpdatedAt timestamp
- Compare timestamps: only update if local is newer
- Build update payload with title, description, priority, and state
- Call UpdateIssue for issues where local has newer changes

Closes bd-b6b.5

* Implement Linear conflict resolution strategies

- Add true conflict detection by fetching Linear timestamps via API
- Implement --prefer-linear resolution (re-import from Linear)
- Implement timestamp-based resolution (newer wins as default)
- Fix linter issues: handle resp.Body.Close() and remove unused error return

* Add Linear integration tests and documentation

- Add comprehensive unit tests for Linear mapping (priority, state, labels, relations)
- Update docs/CONFIG.md with Linear configuration reference
- Add examples/linear-workflow guide for bidirectional sync
- Remove AI section header comments from tests

* Fix Linear GraphQL filter construction and improve test coverage

- Refactor filter handling to combine team ID into main filter object
- Add test for duplicate issue relation mapping
- Add HTTP round-trip helper for testing request payload validation

* Refactor Linear queries to use shared constant and add UUID validation

- Extract linearIssuesQuery to deduplicate FetchIssues/FetchIssuesSince
- Add linearMaxPageSize constant and UUID validation with regex
- Expand test coverage for new functionality

* Refactor Linear integration into internal/linear package

- Extract types, client, and mapping logic from cmd/bd/linear.go
- Create internal/linear/ package for better code organization
- Update tests to work with new package structure

* Add linear teams command to list available teams

- Add FetchTeams GraphQL query to Linear client
- Refactor config reading to support daemon mode
- Add tests for teams listing functionality

* Refactor Linear config to use getLinearConfig helper

- Consolidate config/env var lookup using getLinearConfig function
- Add LINEAR_TEAM_ID environment variable support
- Update error messages to include env var configuration options

* Add hash ID generation and improve Linear conflict detection

- Add configurable hash ID mode for Linear imports (matches bd/Jira)
- Improve conflict detection with content hash comparison
- Enhance conflict resolution with skip/force update tracking

* Fix test for updated doPushToLinear signature

- Add missing skipUpdateIDs parameter to test call
2025-12-19 17:58:24 -08:00
Andrei Onel
9382aa34fa Update CLI reference with new --body-file options (#627)
Documentation update for --body-file option
2025-12-18 18:25:09 -08:00
Steve Yegge
332c9b9b8f Merge pull request #619 from qmx/add-push-configuration
feat: add no-push config to disable automatic git push
2025-12-18 11:14:56 -08:00
Steve Yegge
83ae110508 refactor: Remove legacy MCP Agent Mail integration (bd-6gd)
Remove the external MCP Agent Mail server integration that required
running a separate HTTP server and configuring environment variables.

The native `bd mail` system (stored as git-synced issues) remains
unchanged and is the recommended approach for inter-agent messaging.

Files removed:
- cmd/bd/message.go - Legacy `bd message` command
- integrations/beads-mcp/src/beads_mcp/mail.py, mail_tools.py
- lib/beads_mail_adapter.py - Python adapter library
- examples/go-agent/ - Agent Mail-focused example
- examples/python-agent/agent_with_mail.py, AGENT_MAIL_EXAMPLE.md
- docs/AGENT_MAIL*.md, docs/adr/002-agent-mail-integration.md
- tests/integration/test_agent_race.py, test_mail_failures.py, etc.
- tests/benchmarks/ - Agent Mail benchmarks

Updated documentation to remove Agent Mail references while keeping
native `bd mail` documentation intact.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-17 23:14:23 -08:00
Doug Campos
eff58e494c feat: add no-push config to disable automatic git push
Wire up the existing --no-push flag to a config option so it can be
set as the default, and update bd prime output accordingly.

- Add no-push default to config.go, matching existing pattern
- Check config in sync.go when --no-push flag not explicitly set
- Update bd prime output to omit git push step when enabled
2025-12-18 00:49:07 -05:00
Steve Yegge
8d73a86f7a feat: complete bd-kwro messaging & knowledge graph epic
- Add bd cleanup --ephemeral flag for transient message cleanup (bd-kwro.9)
- Add Ephemeral filter to IssueFilter type
- Add ephemeral filtering to SQLite storage queries

Tests (bd-kwro.10):
- Add internal/hooks/hooks_test.go for hook system
- Add cmd/bd/mail_test.go for mail commands
- Add internal/storage/sqlite/graph_links_test.go for graph links

Documentation (bd-kwro.11):
- Add docs/messaging.md for full messaging reference
- Add docs/graph-links.md for graph link types
- Update AGENTS.md with inter-agent messaging section
- Update CHANGELOG.md with all bd-kwro features

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-16 20:36:47 -08:00
Jordan Hubbard
e0528de590 feat: add Factory.ai (Droid) support to bd setup command (#598)
Adds Factory.ai (Droid) support to bd setup command via AGENTS.md integration.

- New command: bd setup factory (with --check and --remove flags)
- Creates/updates AGENTS.md with beads workflow instructions
- Uses HTML comment markers for safe idempotent updates
- Comprehensive documentation

Thanks @jordanhubbard!
2025-12-16 13:42:43 -08:00
Steve Yegge
dedfc43d1f Merge GH#409 2025-12-16 01:19:07 -08:00
Steve Yegge
109fa6364b Merge GH#518 setup docs 2025-12-16 01:18:51 -08:00
Steve Yegge
8306b2b8f3 Merge bd-2k5f-pumpjack: GH#483 2025-12-16 01:18:02 -08:00
Steve Yegge
b3fef08fd4 Merge bd-bscs-driller: GH#403 doctor --fix 2025-12-16 01:15:51 -08:00
Steve Yegge
166d66205c docs: update beads.jsonl references to issues.jsonl
Fixes GH#409 - Documentation inconsistently referred to beads.jsonl
as the canonical filename when issues.jsonl has been the default
since v0.25.1 (bd-6xd).

Updated files:
- docs/ARCHITECTURE.md
- docs/CLI_REFERENCE.md
- docs/PROTECTED_BRANCHES.md
- docs/ADVANCED.md
- docs/GIT_INTEGRATION.md
- docs/MULTI_REPO_AGENTS.md
- docs/MULTI_REPO_MIGRATION.md
- docs/TROUBLESHOOTING.md
- examples/*/README.md
- skills/beads/references/CLI_REFERENCE.md

Note: beads.jsonl is still supported for backward compatibility.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-16 01:08:46 -08:00
Steve Yegge
39a58fd085 docs: document bd setup command
Add comprehensive documentation for the bd setup command which was
largely undocumented (GH#518):

- CLI_REFERENCE.md: Add new "Editor Integration" section documenting
  bd setup claude/cursor/aider commands with all flags
- INSTALLING.md: Fix incorrect reference to "bd hooks install" for
  editor integration - should be "bd setup <editor>"
- CLAUDE_INTEGRATION.md: Add Installation section with bd setup claude
  examples

Fixes: GH#518

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-16 01:08:42 -08:00
Steve Yegge
25ea1e7de3 docs: fix broken relative links across documentation
Fixes 46 broken relative links across 20 documentation files in docs/.

Changes:
- Added ../ prefix for root files (README.md, AGENTS.md)
- Removed ../ prefix for sibling docs files
- Removed dead links to non-existent files
- Fixed subdirectory paths

Based on PR #574 by chrisvaillancourt.

Co-Authored-By: Chris Vaillancourt <chrisvaillancourt@users.noreply.github.com>
2025-12-16 00:46:08 -08:00
Charles P. Cross
a69e94a958 Auto-disable daemon in git worktrees for safety (#567)
* feat: auto-disable daemon in git worktrees for safety

Implement worktree daemon compatibility as proposed in the analysis.
The daemon is now automatically disabled when running in a git worktree
unless sync-branch is configured.

Git worktrees share the same .beads directory, and the daemon commits
to whatever branch its working directory has checked out. This causes
commits to go to the wrong branch when using daemon in worktrees.

- Add shouldDisableDaemonForWorktree() helper that checks:
  1. If current directory is a git worktree (via git rev-parse)
  2. If sync-branch is configured (env var or config.yaml)
- Modify shouldAutoStartDaemon() to call the helper
- Modify daemon connection logic in main.go to skip connection
- Add FallbackWorktreeSafety constant for daemon status reporting
- Update warnWorktreeDaemon() to skip warning when sync-branch configured

- In worktree WITHOUT sync-branch: daemon auto-disabled, direct mode used
- In worktree WITH sync-branch: daemon enabled (commits go to dedicated branch)
- In regular repo: no change (daemon works as before)

- Added comprehensive unit tests for shouldDisableDaemonForWorktree()
- Added integration tests for shouldAutoStartDaemon() in worktree contexts
- Manual E2E testing verified correct behavior

- Updated WORKTREES.md with new automatic safety behavior
- Updated DAEMON.md with Git Worktrees section

* feat: check database config for sync-branch in worktree safety logic

Previously, the worktree daemon safety check only looked at:
- BEADS_SYNC_BRANCH environment variable
- sync-branch in config.yaml

This meant users who configured sync-branch via `bd config set sync-branch`
(which stores in the database) would still have daemon disabled in worktrees.

Now the check also reads sync.branch from the database config table,
making daemon work in worktrees when sync-branch is configured via any method.

Changes:
- Add IsConfiguredWithDB() function that checks env, config.yaml, AND database
- Add findBeadsDB() to locate database (worktree-aware via git-common-dir)
- Add getMainRepoRoot() helper using git rev-parse
- Add getConfigFromDB() for lightweight database reads
- Update shouldDisableDaemonForWorktree() to use IsConfiguredWithDB()
- Update warnWorktreeDaemon() to use IsConfiguredWithDB()
- Add test case for database config path

* refactor: use existing beads.FindDatabasePath() instead of duplicating code

Remove duplicate getMainRepoRoot() and findBeadsDB() functions from
syncbranch.go and use the existing beads.FindDatabasePath() which is
already worktree-aware.

Changes:
- Replace custom findBeadsDB() with beads.FindDatabasePath()
- Remove duplicate getMainRepoRoot() (git.GetMainRepoRoot() exists)
- Remove unused imports (exec, strings, filepath)
- Clean up debug logging in tests

---------

Co-authored-by: Charles P. Cross <cpdata@users.noreply.github.com>
2025-12-16 00:06:19 -08:00
Christian Catalan
c669a61faa docs: fix bd daemon CLI syntax to use flag format (#568)
The bd daemon command only accepts flags with '--' prefix, not subcommands.
Fixed all documentation to use correct syntax:

- bd daemon start -> bd daemon --start
- bd daemon status -> bd daemon --status
- bd daemon stop -> bd daemon --stop
- bd daemon restart -> bd daemon --stop && bd daemon --start

Files updated:
- docs/PROTECTED_BRANCHES.md (13 occurrences)
- examples/team-workflow/README.md (4 occurrences)
- examples/protected-branch/README.md (3 occurrences)
- examples/multi-phase-development/README.md (1 occurrence)
- examples/multiple-personas/README.md (1 occurrence)
- integrations/beads-mcp/README.md (1 occurrence)
- integrations/beads-mcp/SETUP_DAEMON.md (1 occurrence)

Co-authored-by: cc-vps <crcatala+vps@gmail.com>
2025-12-15 21:16:02 -08:00
Steve Yegge
344fc1b95d docs: explain sync-branch worktree behavior (GH#510)
Add comprehensive documentation about beads-created worktrees:
- New section in WORKTREES.md explaining why and where beads creates worktrees
- Common confusion: 'beads took over main!' with solution
- Troubleshooting entries for 'branch already checked out' errors
- FAQ entry: 'Why did beads create worktrees in my .git directory?'

This addresses user confusion when beads' sync-branch feature creates
internal worktrees that can lock branches users want to checkout.

Closes #510

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-14 17:20:12 -08:00
Steve Yegge
80e56d58f3 docs: document bd setup command
Add comprehensive documentation for the `bd setup` command:

- New docs/SETUP.md with full documentation for all three integrations:
  - Claude Code (hooks for SessionStart/PreCompact)
  - Cursor IDE (rules file in .cursor/rules/)
  - Aider (config file with human-in-the-loop workflow)

- Updated docs/CLI_REFERENCE.md:
  - Added Setup & Integration section
  - Added SETUP.md to See Also links
  - Added to Quick Navigation

Closes #518

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-14 17:20:10 -08:00
Steve Yegge
5d71ca6356 fix: improve JSONL-only mode detection and error messages (GH #534)
- Add JSONL-only mode detection in ensureStoreActive() with context-aware
  error messages that suggest correct actions based on project state
- Improve error messages in main.go to detect JSONL presence and suggest
  appropriate solutions (bd init, --no-db flag, or config.yaml setting)
- Update documentation to use issues.jsonl as canonical filename:
  - AGENT_INSTRUCTIONS.md, README.md, resolve-beads-conflict.md
  - docs/GIT_INTEGRATION.md
- Update hook template comments to clarify issues.jsonl is canonical
  while maintaining backward compatibility for beads.jsonl

Fixes #534

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-13 12:50:33 -08:00
matt wilkie
e01b7412d9 feat: add Git worktree compatibility (PR #478)
Adds comprehensive Git worktree support for beads issue tracking:

Core changes:
- New internal/git/gitdir.go package for worktree detection
- GetGitDir() returns proper .git location (main repo, not worktree)
- Updated all hooks to use git.GetGitDir() instead of local helper
- BeadsDir() now prioritizes main repository's .beads directory

Features:
- Hooks auto-install in main repo when run from worktree
- Shared .beads directory across all worktrees
- Config option no-install-hooks to disable auto-install
- New bd worktree subcommand for diagnostics

Documentation:
- New docs/WORKTREES.md with setup instructions
- Updated CHANGELOG.md and AGENT_INSTRUCTIONS.md

Testing:
- Updated tests to use exported git.GetGitDir()
- Added worktree detection tests

Co-authored-by: Claude <noreply@anthropic.com>
Closes: #478
2025-12-13 12:50:33 -08:00
Logan Thomas
520e1007f1 fix/doc: Go version inconsistencies and broken documentation links (#535)
* docs: fix Go version typo in CONTRIBUTING.md (1.25 -> 1.24)

* docs: update Go version requirement to 1.24+ across docs

* docs: fix broken links to docs/ in npm-package/README.md

* docs: fix QUICKSTART.md path reference in AGENTS.md
2025-12-13 10:48:44 -08:00