Two fixes:
1. `bd init` chaining was broken - the code referenced `.old` hooks but
never actually renamed the existing hooks. Added the missing os.Rename().
2. `bd hooks install` now supports --chain flag to chain with existing hooks
(e.g., pre-commit framework). When used, existing hooks are renamed to
.old and bd hooks run will call them before the bd logic.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
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>