feat: Add bd init --contributor and --team wizards

- Implement OSS contributor workflow wizard
  - Auto-detects fork relationships (upstream remote)
  - Checks push access (SSH vs HTTPS)
  - Creates separate planning repository
  - Configures auto-routing to keep planning out of PRs

- Implement team workflow wizard
  - Detects protected main branches
  - Creates sync branch if needed
  - Configures auto-commit/auto-push
  - Supports both direct and PR-based workflows

- Add comprehensive documentation
  - examples/contributor-workflow/README.md
  - examples/team-workflow/README.md
  - Updated AGENTS.md, README.md, QUICKSTART.md
  - Updated docs/MULTI_REPO_MIGRATION.md

Closes: bd-kla1, bd-twlr, bd-6z7l
Amp-Thread-ID: https://ampcode.com/threads/T-b4d124a2-447e-47d1-8124-d7c5dab9a97b
Co-authored-by: Amp <amp@ampcode.com>
This commit is contained in:
Steve Yegge
2025-11-05 19:03:57 -08:00
parent c20aabe263
commit b230a2270d
10 changed files with 1140 additions and 2 deletions

View File

@@ -27,6 +27,8 @@ With --no-db: creates .beads/ directory and issues.jsonl file instead of SQLite
prefix, _ := cmd.Flags().GetString("prefix")
quiet, _ := cmd.Flags().GetBool("quiet")
branch, _ := cmd.Flags().GetString("branch")
contributor, _ := cmd.Flags().GetBool("contributor")
team, _ := cmd.Flags().GetBool("team")
// Initialize config (PersistentPreRun doesn't run for init command)
if err := config.Initialize(); err != nil {
@@ -272,6 +274,24 @@ bd.db
}
}
// Run contributor wizard if --contributor flag is set
if contributor {
if err := runContributorWizard(ctx, store); err != nil {
fmt.Fprintf(os.Stderr, "Error running contributor wizard: %v\n", err)
_ = store.Close()
os.Exit(1)
}
}
// Run team wizard if --team flag is set
if team {
if err := runTeamWizard(ctx, store); err != nil {
fmt.Fprintf(os.Stderr, "Error running team wizard: %v\n", err)
_ = store.Close()
os.Exit(1)
}
}
if err := store.Close(); err != nil {
fmt.Fprintf(os.Stderr, "Warning: failed to close database: %v\n", err)
}
@@ -331,6 +351,8 @@ func init() {
initCmd.Flags().StringP("prefix", "p", "", "Issue prefix (default: current directory name)")
initCmd.Flags().BoolP("quiet", "q", false, "Suppress output (quiet mode)")
initCmd.Flags().StringP("branch", "b", "", "Git branch for beads commits (default: current branch)")
initCmd.Flags().Bool("contributor", false, "Run OSS contributor setup wizard")
initCmd.Flags().Bool("team", false, "Run team workflow setup wizard")
rootCmd.AddCommand(initCmd)
}