Commit graph

10 commits

Author SHA1 Message Date
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
coffeegoddd☕️✨
a44d4f9d58 fix(init): replace 'bd onboard' references with 'bd prime' in AGENTS.md (#2902)
bd init creates a complete AGENTS.md but tells users to "Run bd onboard
to get started", which suggests different/conflicting content. Replace
with "Run bd prime" which is the correct entry point for workflow context.

Also migrates the Claude settings prompt from bd onboard to bd prime,
with backward-compatible detection of existing onboard references.

Closes #2902

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-30 10:42:50 -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
beads/crew/emma
a44ecef743 feat(init): default AGENTS.md to minimal profile, add --agents-profile flag
bd init now defaults to ProfileMinimal (lean pointer to bd prime) instead
of the full ~110-line command reference. Added --agents-profile flag:
'minimal' (default) or 'full' (complete command reference for hookless
agents like Codex, Factory).

Existing full profiles are never downgraded to minimal (preserves
higher-information content). bd onboard updated to reference the new flag
instead of calling the full approach deprecated.

Fixes #2696

Co-Authored-By: matt wilkie <maphew@gmail.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-20 15:42:54 -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
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
7ff5406f0f refactor: init uses RenderSection with profile metadata (#2139, task 7)
Update init_agent.go to use agents.RenderSection(ProfileFull) instead
of agents.EmbeddedBeadsSection() when appending beads sections to
existing AGENTS.md files. This ensures new installs get the versioned
marker format with profile and hash metadata.

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
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
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
Steve Yegge
7ea7aee411 refactor: Split init.go from 1928 to 705 lines (bd-xtf5)
Extract init.go into multiple focused files:

- init_git_hooks.go: Git hooks installation and merge driver setup (~480 lines)
- init_stealth.go: Stealth mode and fork/exclude configuration (~310 lines)
- init_agent.go: AGENTS.md and Claude settings setup (~170 lines)
- init_templates.go: config.yaml and README.md templates (~180 lines)

This reduces init.go from 1928 lines to 705 lines, meeting the <800 line target.
Each extracted file handles a cohesive set of functionality.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-28 18:43:09 -08:00