Commit graph

72 commits

Author SHA1 Message Date
Chris Sells
cc9601f85c fix(cli): printed doc paths point at the new docs locations
Per decision 7, bd's user-facing strings now reference the Mintlify-era
paths: prime policy-profiles help, storage-backend comparison help
(store_factory_nocgo, init --backend), init-safety help (recovery
playbooks now docs/recovery/init-safety.md; the ADR reference now
engdocs/adr/), the pk-fork-refused recovery URL (dolt.go), doctor's plugin
suggestions (claude.go) and managed-handoff pointer, aider setup guidance
and the shared recipe template (quickstart URL), and the agent instruction
templates (sync-concepts URL, quickstart URL). bd mol pour's help no
longer claims molecules are 'synced with git' — they sync via Dolt like
any other bead.

Also corrects the stale claude recipe ProjectPath metadata
(.claude/settings.local.json -> .claude/settings.json; the dedicated
installer has written settings.json since the migration sweep).

This repo's AGENTS.md managed section is refreshed to the new template
body (hash bacef91e, has-remote variant preserved), and agents.md.tmpl's
embedded marker matches. Template tests updated to pin the new fragment;
CLI docs regenerated.

Recorded, not fixed (behavior-level, see the decision record):
routing.mode's maintainer/contributor no-op values and the
sync.require_confirmation_on_mass_delete key with no consumer.

Note: TestCheckBeadsRole_NotConfigured/_NotGitRepo in cmd/bd/doctor fail
on any machine with beads.role in the global git config (no HOME
isolation) — pre-existing, unrelated to this change.
2026-07-12 10:37:17 -07:00
Michael Hackner
6829d2418a
feat(cursor): bring Cursor integration to parity with Claude/Codex (#4649)
Cursor support is anemic compared to Claude Code and Codex. It ships
only a static rules file: no agent lifecycle hooks, so `bd prime`
context is never injected at session start and is silently lost after
context compaction, and it has no `bd init` auto-install, no `--global`
scope, no shared agent skill, and no `bd doctor` coverage.

This PR brings Cursor up to the same footing as the tier-1 integrations.

- `bd setup cursor` now installs agent lifecycle hooks
  (`.cursor/hooks.json`) alongside the rules file, wiring
  sessionStart/preCompact/postToolUse to a hidden `bd cursor-hook`
  command so Beads context survives compaction:
  * sessionStart injects full `bd prime` context into new sessions
  * preCompact arms a one-shot refresh marker
  * postToolUse re-injects `bd prime` once after a compaction, then
    no-ops
- `bd init` auto-installs Cursor (rules + skill + hooks) and stages
  `.cursor/`
- `bd setup cursor --global` writes `~/.cursor/hooks.json` +
  `~/.agents/skills/beads`
- Canonical rules: `.cursor/rules/beads.mdc` wraps the shared
  `recipes.Template` instead of a hand-maintained copy
- Shared agent skill (`.agents/skills/beads`), removed only once neither
  Cursor nor Codex still relies on it
- `bd doctor` reports Cursor Integration, Settings Health, and Hook
  Completeness checks with agent-mode enrichment

Shared hook mechanics (prime runner + one-shot refresh marker) are
factored into `cmd/bd/agent_hook.go` and reused by codex-hook.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-10 13:10:46 -07:00
matt wilkie
31a6ec9511
feat: add bd unclaim command to release stuck issues (replaces #3694) (#4614)
* feat: Add bd unclaim command to release stuck issues

- Add UnclaimIssue method to storage interface and implementations
- Add bd unclaim CLI command: clears assignee, resets status to 'open'
- Improve claim error message when issue has assignee but status is 'open'
  (now suggests using bd unclaim)
- Update documentation: CLI_REFERENCE.md, QUICKSTART.md, setup templates
- Add unclaim tests
- Fix telemetry wrapper to implement UnclaimIssue method
- Add test mocks for UnclaimIssue in jira tests

* docs: regenerate CLI reference for bd unclaim

Runs scripts/generate-cli-docs.sh to add the bd unclaim entry that
gastownhall/beads#3694 introduced but whose CLI_REFERENCE.md/website
delta was lost in the conflict resolution during the cherry-pick.
Scoped to only the unclaim addition; unrelated doc drift already
present on main (formula/lint/types/linear entries) is left untouched.

Agent-Signature: claude-fable-5-medium on behalf of matt wilkie

---------

Co-authored-by: Abner S. Alves Junior <abnersajr@gmail.com>
2026-07-06 22:51:35 -07:00
coffeegoddd☕️✨
d7d7a34607 : refactor to use RunE, emit usage metrics, skip metrics in CI
(cherry picked from commit 9596c7233d)
2026-06-22 20:44:43 +00:00
Jim Wordelman
fae194f6e3
test(dolt): add TestNoPushSkipsDoltPush for push guard coverage (#4323)
* feat(no-push): guard dolt push/pull and strip push from rendered templates

- bd dolt push/pull skip silently (exit 0) when no-push: true in config
- RenderOpts gains NoPush bool; !HasRemote || NoPush strips bd dolt push
- NoPush propagated through AgentsFileParams, fs_adapters, init, setup/agents, init_proxied_server

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix(no-push): anchor stripDoltPushReferences to prevent 4-space indent false match

Without the newline anchor, ReplaceAll matched any line containing "   bd
dolt push\n" as a substring — including 4-space indented code blocks that
happen to share the prefix. Pad body with newlines so the match is anchored
to the start of the line.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix(no-push): remove pull guard from bd dolt pull (be-ve2x6)

no-push means "do not publish local state to the remote"; it must not
prevent receiving remote updates. The guard at dolt.go:330 made
bd dolt pull return success without contacting the remote when
no-push: true, leaving contributor clones stale.

Remove the pull guard. Add TestNoPushDoesNotSkipDoltPull to prevent
reintroduction: injects a minimal fake store and asserts Pull() is
called even under no-push: true.

Push guard (dolt.go:257) and template stripping (render.go:217)
are unchanged — both are correct behavior per maphew's review of #4212.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* test(dolt): add TestNoPushSkipsDoltPush for push guard coverage (be-i9e2)

Direct unit test for the no-push guard at cmd/bd/dolt.go:247-249.
Asserts Push() is not called and output contains "skipping push"
when BD_NO_PUSH=true. Mirrors TestNoPushDoesNotSkipDoltPull pattern.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* chore: release gate PASS for be-i9e2 (no-push dolt push test)

* test(dolt): fix minimalPullStore for current main (ListRemotes drift)

Rebasing #4323 onto current main surfaced a latent defect hidden by cached
green checks: main now routes bd dolt pull failure handling through
isConfirmedNoRemote, which calls st.ListRemotes during error classification
(cmd/bd/dolt.go). minimalPullStore embeds a nil storage.DoltStorage and
overrode only Pull, so TestNoPushDoesNotSkipDoltPull nil-panicked once merged
into current main.

Add a ListRemotes that reports no remotes, keeping the simulated pull failure
on the benign no-remote path (clean exit) so the test still proves the no-push
guard does not short-circuit bd dolt pull. Same fix quad341 applied on #4212.

Verified against current main: TestNoPushSkipsDoltPush, TestNoPushDoesNotSkipDoltPull,
TestIsConfirmedNoRemote, TestDoltPushPullCommitNeedStore all pass.

Agent-Signature: claude-opus-4-8-high on behalf of maphew

---------

Co-authored-by: Jim Wordelman <jim@wordelman.name>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: matt wilkie <maphew@gmail.com>
2026-06-20 13:23:40 -07:00
Masanori Iwata
f6dba5b915
fix(setup): match beads plugin name exactly, not by substring (#4252)
* fix(setup): match beads plugin name exactly, not by substring (#4244)

bd setup claude decided whether the beads hook plugin was enabled with a
substring test, strings.Contains(lower(key), "beads"). Any enabledPlugins
key merely containing "beads" (e.g. design-to-beads@xexr-marketplace) was
mistaken for the beads hook plugin, so the SessionStart hook write was
skipped and the hook landed nowhere.

enabledPlugins keys are "<pluginName>@<marketplace>"; match the plugin-name
segment exactly instead. A real beads@<marketplace> still matches, so the
GH#3192 double-fire prevention is preserved.

- Split the key on the first "@" and compare the name == "beads"
- Add regression subtests: design-to-beads alone is not detected; a real
  beads plugin is still found alongside a *beads* decoy

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* fix(setup): match codex beads plugin name exactly, not by substring (#4244)

bd setup codex decided whether the beads hook plugin was enabled with a
substring test, strings.Contains(lower(table), "beads") on the TOML plugin
table header. Any [plugins.<name>] whose name merely contains "beads" (e.g.
design-to-beads) was mistaken for the beads hook plugin, so the hooks
fallback write was skipped — the codex sibling of the claude.go bug already
fixed in this PR.

Codex plugin tables are [plugins.<name>] or [plugins."<name>@<marketplace>"]
(TOML quotes a key containing "@"). Strip the "plugins." prefix and any
quotes, then match the <name> segment of <name>@<marketplace> exactly,
mirroring the claude.go fix. A real beads@<marketplace> still matches, so the
GH#3192 double-fire prevention is preserved.

- Exact-match the plugin-name segment instead of a substring test
- Add TestCodexConfigEnablesBeadsPlugin: design-to-beads (quoted and bare) is
  not detected; a real quoted/bare beads plugin still is, including alongside
  a *beads* decoy; a disabled beads plugin is not detected

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-16 08:50:41 -07:00
Christopher Tso
d101e0fe30
fix(codex): correct hook path to resolve from plugin root (#4377)
PR #4188 moved hook files from plugins/beads/hooks/ to
plugins/beads/.codex-plugin/hooks/ to stop Claude from discovering
Codex-only hooks. However, the hooks path in .codex-plugin/plugin.json
remained "./hooks/hooks.json" which Codex resolves relative to the
plugin root (plugins/beads/), not relative to .codex-plugin/. This
caused a runtime error:

  failed to read .../beads/1.0.5/hooks/hooks.json: No such file or directory

Fix: update the hooks path to "./.codex-plugin/hooks/hooks.json" so
it correctly resolves to plugins/beads/.codex-plugin/hooks/hooks.json.

Update TestPluginLayoutUsesSharedBeadsRoot to assert the corrected path.

Fixes #4210. Follow-up to #4188.
2026-06-16 07:51:16 -07:00
matt wilkie
2141b65823
Merge pull request #4201 from maphew/fix/setup-symlink-followups
fix(setup): harden symlink follow-up handling
2026-05-28 08:08:32 -07:00
matt wilkie
23829521e4
cleanup: remove unused private helpers (#4205)
Remove two zero-call helpers found during the pattern-collapse inventory pass.

_codex-gpt-5.5-medium on behalf of matt wilkie_
2026-05-27 17:53:16 -07:00
matt wilkie
86545f64f3 fix(setup): harden symlink follow-up handling
Refuse setup atomic writes through symlinks unless a caller explicitly opts into following the link, and report partial Claude/Mux setup when agent instructions are skipped.

Document repair steps for repositories already affected by corrupted mode-120000 CLAUDE.md entries.

Refs #3722.

_codex-gpt-5.5-medium on behalf of matt wilkie_
2026-05-27 13:32:00 -07:00
Chris DiMartino
0afd3d5b94
fix(codex): ship hook release safely
Move Codex native hook metadata under the Codex-only plugin directory so Claude keeps using only its inline `bd prime` hooks.

Leave release version bumps to the maintainer release flow while documenting hook metadata isolation under Unreleased.

Refs #3924.

_codex-gpt-5.5-medium on behalf of matt wilkie_
2026-05-27 13:19:41 -07:00
CI Bot
4db8d74f4d fix(setup): clarify symlinked agents skip
Warn on stderr with the symlink target and a concrete recovery path when setup skips managed-section injection through an agent-file symlink. This keeps the corruption guard explicit without pretending the integration text was written.

Also cover the Lstat inspect-error branch called out in PR review coverage.

_codex-gpt-5.5-medium on behalf of matt wilkie_
2026-05-27 12:51:57 -07:00
CI Bot
182bf2e13b fix setup injection for symlinked agent files
Avoid following symlinked agent instruction files when installing managed setup sections. This preserves symlink mode and target content while still allowing normal files to receive integration text.\n\nRefs gastownhall/beads#3722\n\n_codex-gpt-5.5-medium on behalf of matt wilkie_
2026-05-27 11:21:06 -07:00
Eugene Brevdo
5d33b4c891
init: run Codex project setup by default
Run Codex project setup during `bd init` using the existing setup installer, and stage generated Codex project files in the bootstrap commit.

Also refresh the generated setup/init docs for the new default behavior.

Co-authored-by: Eugene Brevdo <ebrevdo@gmail.com>

_codex-gpt-5.5-medium on behalf of CI Bot_
2026-05-26 13:03:37 -07:00
matt wilkie
0c47b3c5ac
fix(init): use git origin as default Dolt remote (#3909)
* fix(init): wire git origin as Dolt remote

Default bd init now treats a git origin as the Dolt remote, persists sync.remote, and still skips synthesis in --stealth. JSONL auto-export/import paths now warn or skip based on sync.remote so exports do not masquerade as cross-machine sync.

Docs and generated agent/CLI references now state that Dolt is canonical, refs/dolt/data is the sync channel, and .beads/issues.jsonl is export/interchange/backup only.

_codex-gpt-5-xhigh on behalf of maphew_

* test: keep embedded command stderr out of parsed stdout

Embedded command tests parse IDs and JSON from command output. The new auto-export warnings correctly go to stderr, but several tests used CombinedOutput and treated warnings as stdout, which broke CI shards that parse issue IDs or JSON lists. Capture stdout separately on success while preserving combined output for error diagnostics.\n\n_codex-gpt-5-medium on behalf of CI Bot_

---------

Co-authored-by: CI Bot <ci@beads.test>
2026-05-13 07:02:39 -07:00
matt wilkie
f52c78b2a1 fix(setup): finish hook JSON migration 2026-05-08 09:21:39 -07:00
Scott Hamilton
287d8a84c8 feat(setup): Gemini/Claude hook JSON compliance, --hook-json flag, legacy migration
Fixes Gemini CLI hook integration by emitting the required SessionStart JSON envelope. Extends the same standard to Claude Code hooks (documented spec, not just tolerated raw text). Adds legacy detection in bd setup gemini --check.

- Add `--hook-json` flag to `bd prime` wrapping output in the cross-CLI `hookSpecificOutput.additionalContext` JSON envelope (Claude Code, Gemini CLI, and Codex all share this contract)
- Update `bd setup gemini` to register `bd prime --hook-json` on SessionStart; remove PreCompress registration (advisory-only, no additionalContext support per Gemini docs v0.40.1)
- Update `bd setup claude` to register `bd prime --hook-json` on SessionStart and PreCompact (JSON form is the documented spec; raw text was merely tolerated)
- Migration sweeps in both setup commands so re-running upgrades bare-command installs cleanly
- `bd setup gemini --check` distinguishes current (`--hook-json`) from legacy (bare `bd prime`) installs and emits upgrade advisory for legacy
- Fix `removeHookCommand` bug: previously dropped entire hook entry on first command match, silently deleting sibling commands; now filters only the matching command and drops the entry only when empty
- Refresh docs and recipes to reflect SessionStart-only Gemini hook behavior

🤖 Generated with [Claude Code](https://claude.com/claude-code)
2026-05-08 09:16:25 -07:00
matt wilkie
65a61df6f7
Merge pull request #3819 from cdimartino/codex-hooks-integration
feat(setup): add add proper codex hook integration
2026-05-08 09:15:08 -07:00
seanmartinsmith
4eaced4092
test(setup): use filepath.Join in TestGeminiSettingsPaths assertions (#3555)
Test hardcoded forward-slash path literals against output from
filepath.Join, so it failed on Windows even though the production
code (geminiProjectSettingsPath, geminiGlobalSettingsPath) was
correct.

Matches the existing pattern from TestMuxProjectAgentsPath and
TestMuxGlobalAgentsPath in the same package, which compare
filepath.Join(...) on both sides.

Fixes #3554
2026-05-08 08:20:11 -07:00
cdimartino
e69c53d893 Add proper hook integration 2026-05-08 11:16:49 -04:00
Kevin Glynn
059d729b1a
fix(setup): drop bd sync from Mux fallback; warn on stale Claude hooks (GH#3546) (#3642)
Mux post-edit hook now calls bd dolt push when only ~/bin/bd is available,
matching the primary branch.

bd setup claude --check scans Claude settings for removed bd sync hook
commands and prints a stderr warning with remediation.

Tests: TestClaudeSettingsUsesRemovedSyncCommand.
2026-05-06 12:57:09 -07:00
Harry Miller
b47a36ec85
Merge pull request #3742 from seanmartinsmith/fix/plugin-claude-agents-validation
fix(plugin): move claude agent out of shared codex dir to fix plugin install
2026-05-06 11:36:37 -07:00
Scott Hamilton
2cfbe4ef32 fix(setup): removeHookCommand drops sibling commands on first match
When removeHookCommand found a matching command it set keepHook = false and broke out of the loop, discarding the entire hook entry rather than just the matching command. Any sibling commands in the same entry were silently deleted.

Fix: build a remaining slice by filtering only the matching command. The hook entry is dropped only when remaining becomes empty, preserving all sibling commands.

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
2026-05-06 18:38:53 +02:00
sms
1cfb6e5d97 fix(plugin): move claude agent out of shared codex dir to fix plugin install
the claude plugin manifest declared agents at ./skills/beads/agents/, which
also contains openai.yaml (codex interface metadata). claude code's plugin
loader scans that dir and rejects non-md files, failing manifest validation
with 'agents: Invalid input'.

move task-agent.md back to plugins/beads/agents/ (the claude default, what
v1.0.0 used) and drop the explicit agents key from .claude-plugin/plugin.json.
codex's openai.yaml stays at skills/beads/agents/openai.yaml where bd setup
codex writes it and where the embed in internal/templates/ lives.

shared skill tree and dual claude/codex manifests are preserved per #3664.

Fixes #3741
2026-05-06 08:18:36 -04:00
Eugene Brevdo
4f1c296708
Add explicit Codex skill setup (#3670)
* Add explicit Codex skill setup

* Refine Codex setup guidance
2026-05-05 19:33:35 -07:00
matt wilkie
acd2b7d97d
Merge pull request #3559 from kevglynn/feat/conditional-dolt-push-template
feat(setup): omit bd dolt push from template when no remote configured
2026-05-02 19:04:41 -07:00
Eugene Brevdo
43715adde7 Add shared Beads plugin package 2026-05-02 10:59:40 -07:00
matt wilkie
c9ae42b3d8 fix(setup): align Claude PreCompact hook docs 2026-04-28 07:04:35 -07:00
kev
e90f980ada feat(setup): omit bd dolt push from template when no remote configured
RenderSection() and ReplaceSection() now accept RenderOpts with a
HasRemote flag. When false, "bd dolt push" is stripped from the
session-completion code block (and the Auto-Sync informational bullet
in the full profile). This prevents agents from dutifully running a
no-op every session on solo/local-only projects.

bd init detects the remote via shouldWireInitRemote(); bd setup detects
it by reading sync.remote / sync.git-remote from config.yaml. The
existing no-arg RenderSection() and ReplaceSection() default to
HasRemote=true for full backward compatibility.

Closes beads-ozg.
2026-04-27 17:37:42 -04:00
matt wilkie
ecd2f7268c fix packaging and windows install regressions
Fixes #3388
Fixes #3399
Fixes #3404
Fixes #3454

Co-authored-by: jasononeil <315158+jasononeil@users.noreply.github.com>
Co-authored-by: seanmartinsmith <114885497+seanmartinsmith@users.noreply.github.com>
2026-04-24 11:48:39 -07:00
Steven Syrek
e312332568
fix(setup): skip duplicate hooks when beads plugin is installed (GH#3192) (#3196)
When both the beads Claude Code plugin and `bd setup claude` are active,
bd prime fires twice per session — wasting ~1-2k tokens each time. The
plugin already declares identical SessionStart/PreCompact hooks in its
plugin.json, so project-level hooks are redundant.

Now `bd setup claude` detects the plugin via enabledPlugins in settings
files and skips writing hooks when the plugin is already providing them.
The CLAUDE.md integration section is still installed since the plugin
does not provide that. `bd setup claude --check` reports "plugin-managed"
as a valid success state instead of "No hooks installed".

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-20 17:40:31 -07:00
Steven Syrek
39ee50d64c
fix(setup): add alwaysApply frontmatter to Cursor rules template (GH#3191) (#3193)
Without YAML frontmatter, Cursor defaults .mdc files to Manual mode,
requiring users to @-reference the rule explicitly. Add alwaysApply: true
so beads context loads automatically every session, consistent with the
Claude and Gemini integrations.

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-20 17:40:28 -07:00
matt wilkie
223895b89f
fix: make bd setup claude project-local by default and auto-setup in bd init (#2935) (#2972)
Changes:
- bd setup claude now defaults to project-local (.claude/settings.json)
  instead of global (~/.claude/settings.json)
- bd setup claude --global explicitly installs globally
- bd init automatically runs Claude hook setup (project-local)
- Legacy .claude/settings.local.json hooks are auto-migrated on install
  and cleaned on remove
- bd setup claude --check detects legacy installs with migration hint
- bd init stages .claude/settings.json and CLAUDE.md for git commit

Closes #2935

Amp-Thread-ID: https://ampcode.com/threads/T-019d4fc1-6587-75cb-bdcb-1912a98cb1c1

Co-authored-by: Amp <amp@ampcode.com>
2026-04-02 20:28:36 -07:00
Harry
e64dee561e feat(init): add --agents-file flag to customize agent instructions filename
Add --agents-file flag to bd init allowing users to specify a custom
filename for agent instructions (default remains AGENTS.md). This
addresses the use case where projects prefer different naming
conventions (e.g. BEADS.md) without requiring a post-init rename.

Changes:
- Add config.AgentsFile() accessor and config.ValidateAgentsFile()
  with security validation (path traversal, symlinks, extension check)
- Add --agents-file flag to bd init with config persistence
- Thread configured filename through init_agent.go
- Update setup/agents.go to use config.AgentsFile()
- Update doctor checks to search configured filename
- Update onboard messaging to reference configured filename
- Add DefaultAgentsFile constant for consistent fallback

The filename is persisted to .beads/config.yaml under agents.file
and read by all subsystems via config.AgentsFile().

Fixes #2737

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-22 11:17:43 -07:00
emma
468c8630be fix: Windows Dolt server lifecycle — stale state files and false auto-stop warning (GH#2670)
Introduce ErrServerNotRunning sentinel so callers can distinguish "already
stopped" from real failures. Stop now cleans up leftover PID/port files even
when the server is not running, preventing bd dolt status from reporting stale
state. Consolidate IsAutoStartDisabled into a single exported function covering
both env var and config sources.

PR: #2740

Co-Authored-By: Harry Miller <harry-miller-trimble@users.noreply.github.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-21 12:31:20 -07:00
obsidian
05142d0160 feat: consolidate prime SSOT section replacement into canonical ReplaceSection (bd-jfe5)
Create agents.ReplaceSection(content, profile) as the single canonical
function for replacing beads integration sections. Both init_agent.go
(upgradeBeadsSection) and setup/agents.go (updateBeadsSectionWithProfile)
now delegate to it.

Key changes:
- Hash-based freshness check skips rewrite when content is current
- Returns error on malformed markers (missing/reversed) instead of
  silent append
- Marker format now includes v:1 version field for forward compat
- atomicWriteFile accepts optional permissions param (default 0644)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-15 18:59:15 -07:00
maphew
6edd905b1b feat(setup): target CLAUDE.md and GEMINI.md for hooks integrations
Amp-Thread-ID: https://ampcode.com/threads/T-019cf2bd-bf1b-7269-abd8-ec65edb98bd5
Co-authored-by: Amp <amp@ampcode.com>
2026-03-15 15:02:52 -07:00
maphew
e12502b62e fix: suppress gosec G304 for resolved agent path
Amp-Thread-ID: https://ampcode.com/threads/T-019ced8f-f8dc-76ca-b8b1-7650879f3633
Co-authored-by: Amp <amp@ampcode.com>
2026-03-15 15:02:52 -07:00
maphew
a0720f2402 feat: prime SSOT tasks 8-12 — init upgrade, recipe cleanup, symlink safety, staleness detection (#2139)
Task 8: bd init now upgrades legacy beads sections to versioned format
instead of silently skipping them. New files created via EmbeddedDefault()
also get versioned markers.

Task 9: Replace stale bd sync references with bd dolt push in recipes
template. Add bd prime SSOT messaging.

Task 10: installAgents resolves symlinks via ResolveForWrite before
reading content. Profile precedence: if file already has full profile
and minimal is requested, full is preserved to avoid information loss.

Task 11: Added tests for staleness detection, profile extraction,
profile precedence, symlink safety, and legacy-to-new migration.
checkAgents now reports stale/current/missing status.

Task 12: Updated SETUP.md with prime SSOT, profiles, and profile
precedence documentation. Updated CLI_REFERENCE.md with --check
behavior and Gemini integration description.

Amp-Thread-ID: https://ampcode.com/threads/T-019ced7a-0c86-708d-930c-ee35d00eda8d
Co-authored-by: Amp <amp@ampcode.com>
2026-03-15 15:02:52 -07:00
maphew
6588c53d6f feat: Claude and Gemini setup install minimal AGENTS.md section (#2139, tasks 5-6)
When running 'bd setup claude --project' or 'bd setup gemini --project',
after installing hooks in settings.json, also install a minimal-profile
beads section in AGENTS.md. This provides a quick reference pointer to
'bd prime' for the full workflow, while hooks handle the heavy lifting.

On removal, the beads section is cleaned up from AGENTS.md as well.

The minimal profile contains: quick reference commands, pointer to
bd prime, and the landing-the-plane session close protocol — without
the full issue types, priorities, and sync details that hook-enabled
agents get dynamically from bd prime.

Amp-Thread-ID: https://ampcode.com/threads/T-019ced5e-0acd-7158-93ad-0695c6d02580
Co-authored-by: Amp <amp@ampcode.com>
2026-03-15 15:02:52 -07:00
maphew
f79ba311da feat: explicit profile:full on all AGENTS.md integrations (#2139, task 4)
Set profile: agents.ProfileFull explicitly on codex, factory, mux
(all three layers), and opencode integrations. This makes the profile
intent clear and prepares for adding minimal-profile integrations.

Amp-Thread-ID: https://ampcode.com/threads/T-019ced5e-0acd-7158-93ad-0695c6d02580
Co-authored-by: Amp <amp@ampcode.com>
2026-03-15 15:02:52 -07:00
maphew
46816ee05b feat: prime SSOT tasks 1-3 — shared render API, template profiles, prefix-aware parser (#2139)
Implement the foundational pieces for making bd prime the single source
of truth for agent instructions:

Task 1 - Shared render API (internal/templates/agents/render.go):
  - Profile type with Full and Minimal constants
  - RenderSection(profile) generates sections with marker metadata
  - ParseMarker() extracts profile/hash from begin markers
  - CurrentHash(profile) for staleness detection
  - 8-char SHA-256 hash for deterministic freshness

Task 2 - Template splitting:
  - New beads-section-minimal.md for hook-enabled agents (Claude, Gemini)
  - Minimal profile: pointer to bd prime + quick reference + landing protocol
  - Existing beads-section.md preserved as full profile body

Task 3 - Parser refactor (cmd/bd/setup/agents.go):
  - Prefix-based marker matching via containsBeadsMarker/findBeginMarker
  - Legacy markers (no metadata) detected and upgradable
  - New markers: <!-- BEGIN BEADS INTEGRATION profile:full hash:a1b2c3d4 -->
  - agentsIntegration gains profile field (defaults to full)
  - updateBeadsSectionWithProfile for profile-aware updates
  - createNewAgentsFileWithProfile for new file creation

Backward compatible: EmbeddedBeadsSection/EmbeddedDefault still work.
Legacy markers are auto-upgraded on next bd setup run.

Amp-Thread-ID: https://ampcode.com/threads/T-019ced5e-0acd-7158-93ad-0695c6d02580
Co-authored-by: Amp <amp@ampcode.com>
2026-03-15 15:02:52 -07:00
Marco Del Pin
b7bd6d6fae fix: replace stale 'bd sync' references with bd dolt push/commit (GH#2435)
bd sync was removed as a command but references persisted in:
- CLI help text (--dolt-auto-commit flag description)
- Code comments (dolt_autocommit.go, init_contributor.go)
- Agent setup generators (aider, cursor, junie, mux)
- Doctor agent remediation commands
- Jujutsu hook alias (init_git_hooks.go)
- Copilot integration docs

All references now point to the current commands:
- bd dolt commit (for committing changes)
- bd dolt push (for pushing to remote)

Tests updated to match.

Complements #2389 (config/sync.mode removal) and #2419 (command removal).
Remaining stale references in other docs tracked in GH#2435.
2026-03-07 17:00:19 +01:00
Matt Wilkie
5ea0eaa16d feat: add OpenCode recipe to bd setup
Add OpenCode as a built-in TypeSection recipe that injects a beads
workflow section into AGENTS.md, following the same pattern as the
existing factory and codex recipes.

- Register 'opencode' in BuiltinRecipes (internal/recipes/recipes.go)
- Add cmd/bd/setup/opencode.go with Install/Check/Remove functions
- Wire up 'bd setup opencode' subcommand in cmd/bd/setup.go
- Add tests for install and check modes

Supports: bd setup opencode, bd setup opencode --check,
          bd setup opencode --remove

Fixes steveyegge/beads#1321

Amp-Thread-ID: https://ampcode.com/threads/T-019cb569-6bbd-73fd-85a8-167984100b35
Co-authored-by: Amp <amp@ampcode.com>
2026-03-03 13:39:56 -07:00
beads/crew/jane
8140c1a49e fix: move Landing the Plane inside beads integration markers (#2265)
bd init appended the "Landing the Plane" section outside the
<!-- BEGIN/END BEADS INTEGRATION --> markers, making it unmanaged
debris that removeBeadsSection() could never clean up.

Move landing content into beads-section.md and agents.md.tmpl within
the markers, simplify updateAgentFile() to stop separately appending
it, invert TestBeadsSectionDoesNotContainLanding, and add a round-trip
test proving add→remove leaves no beads content behind.

Closes #2265

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-02 14:01:35 -08:00
vp
6a70a3ecf8 docs(setup): use --claim in generated agent templates 2026-02-24 03:29:33 +03:00
beads/crew/lizzy
f383ce3efd feat(setup): add Mux setup recipe with layered AGENTS and managed hooks
Adds bd setup mux with support for layered AGENTS.md installation
(root, project .mux/, global ~/.mux/) and managed hook files
(.mux/init, .mux/tool_post, .mux/tool_env). Makes AGENTS removal
non-destructive (preserves user content outside managed markers).

From: PR #1888 by alexx-ftw (cherry-picked, rebased onto current main)

Co-Authored-By: Alexx <alexx-ftw@users.noreply.github.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-22 15:33:06 -08:00
beads/crew/wickham
4102096666 refactor: standardize error handling with FatalError wrappers (bd-qioh)
Convert ~250 instances of direct fmt.Fprintf(os.Stderr)+os.Exit(1)
to FatalError/FatalErrorWithHint/FatalErrorRespectJSON across 54 files.

Complex multi-line messages, warnings, loop-internal errors, and
JSON-branching patterns intentionally preserved where the helpers
do not fit cleanly.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 16:27:09 -08:00
beads/crew/emma
87d49a6cc1 feat: embed AGENTS.md templates with embed.FS and add --agents-template flag
Move AGENTS.md content from Go string concatenation into embedded template
files using embed.FS. Add --agents-template flag to bd init for custom
templates. Inspired by PR #1879.

- New internal/templates/agents/ package with EmbeddedDefault() and
  EmbeddedBeadsSection() loaders
- Remove landingThePlaneSection and agentsBeadsSection string constants
- bd init --agents-template <path> overrides the embedded default
- Net -86 lines of code

Co-authored-by: iliyafa <20426296+iliyafa@users.noreply.github.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

Executed-By: beads/crew/emma
Rig: beads
Role: crew
2026-02-21 14:14:35 -08:00
matt wilkie
ce622f5688
feat(setup): add Codex CLI setup recipe (#1243)
* Add Codex setup recipe

* Sync beads issues (bd-1zo)

---------

Co-authored-by: Amp <amp@example.com>
2026-01-21 21:50:01 -08:00