Remove default crew member creation from rig add

- Rig add now creates empty crew/ directory with README
- Crew members must be added explicitly with 'gt crew add <name>'
- Removed --crew flag from rig add command
- Updated help text and output to reflect new behavior

This gives users control over crew member names rather than defaulting to 'max'.
This commit is contained in:
Steve Yegge
2025-12-30 19:29:02 -08:00
parent 210554163f
commit 80cb1aa694
2 changed files with 28 additions and 32 deletions

View File

@@ -48,7 +48,7 @@ This creates a rig container with:
- plugins/ Rig-level plugin directory
- refinery/rig/ Canonical main clone
- mayor/rig/ Mayor's working clone
- crew/max/ Default human workspace
- crew/ Empty crew directory (add members with 'gt crew add')
- witness/ Witness agent directory
- polecats/ Worker directory (empty)
@@ -155,7 +155,6 @@ Examples:
// Flags
var (
rigAddPrefix string
rigAddCrew string
rigResetHandoff bool
rigResetMail bool
rigResetStale bool
@@ -176,7 +175,6 @@ func init() {
rigCmd.AddCommand(rigShutdownCmd)
rigAddCmd.Flags().StringVar(&rigAddPrefix, "prefix", "", "Beads issue prefix (default: derived from name)")
rigAddCmd.Flags().StringVar(&rigAddCrew, "crew", "", "Crew workspace name (default: from town config or 'max')")
rigResetCmd.Flags().BoolVar(&rigResetHandoff, "handoff", false, "Clear handoff content")
rigResetCmd.Flags().BoolVar(&rigResetMail, "mail", false, "Clear stale mail messages")
@@ -200,18 +198,6 @@ func runRigAdd(cmd *cobra.Command, args []string) error {
return fmt.Errorf("not in a Gas Town workspace: %w", err)
}
// Resolve crew name: --crew flag > town config > default constant
crewName := rigAddCrew
if crewName == "" {
// Try loading MayorConfig for default_crew_name
mayorConfigPath := filepath.Join(townRoot, "mayor", "config.json")
if mayorCfg, err := config.LoadMayorConfig(mayorConfigPath); err == nil && mayorCfg.DefaultCrewName != "" {
crewName = mayorCfg.DefaultCrewName
} else {
crewName = config.DefaultCrewName
}
}
// Load rigs config
rigsPath := filepath.Join(townRoot, "mayor", "rigs.json")
rigsConfig, err := config.LoadRigsConfig(rigsPath)
@@ -237,7 +223,6 @@ func runRigAdd(cmd *cobra.Command, args []string) error {
Name: name,
GitURL: gitURL,
BeadsPrefix: rigAddPrefix,
CrewName: crewName,
})
if err != nil {
return fmt.Errorf("adding rig: %w", err)
@@ -277,13 +262,13 @@ func runRigAdd(cmd *cobra.Command, args []string) error {
fmt.Printf(" ├── plugins/ (rig-level plugins)\n")
fmt.Printf(" ├── mayor/rig/ (clone: %s)\n", defaultBranch)
fmt.Printf(" ├── refinery/rig/ (worktree: %s, sees polecat branches)\n", defaultBranch)
fmt.Printf(" ├── crew/%s/ (your workspace)\n", crewName)
fmt.Printf(" ├── crew/ (empty - add crew with 'gt crew add')\n")
fmt.Printf(" ├── witness/\n")
fmt.Printf(" └── polecats/\n")
fmt.Printf("\nNext steps:\n")
fmt.Printf(" cd %s/crew/%s # Work in your clone\n", filepath.Join(townRoot, name), crewName)
fmt.Printf(" bd ready # See available work\n")
fmt.Printf(" gt crew add <name> %s # Create your workspace\n", name)
fmt.Printf(" cd %s/crew/<name> # Work in your clone\n", filepath.Join(townRoot, name))
return nil
}

View File

@@ -156,7 +156,6 @@ type AddRigOptions struct {
Name string // Rig name (directory name)
GitURL string // Repository URL
BeadsPrefix string // Beads issue prefix (defaults to derived from name)
CrewName string // Default crew workspace name (defaults to "main")
}
// AddRig creates a new rig as a container with clones for each agent.
@@ -186,9 +185,6 @@ func (m *Manager) AddRig(opts AddRigOptions) (*Rig, error) {
if opts.BeadsPrefix == "" {
opts.BeadsPrefix = deriveBeadsPrefix(opts.Name)
}
if opts.CrewName == "" {
opts.CrewName = "main"
}
// Create container directory
if err := os.MkdirAll(rigPath, 0755); err != nil {
@@ -271,17 +267,32 @@ func (m *Manager) AddRig(opts AddRigOptions) (*Rig, error) {
fmt.Printf(" Warning: Could not create refinery hooks: %v\n", err)
}
// Clone repository for default crew workspace
crewPath := filepath.Join(rigPath, "crew", opts.CrewName)
if err := os.MkdirAll(filepath.Dir(crewPath), 0755); err != nil {
// Create empty crew directory with README (crew members added via gt crew add)
crewPath := filepath.Join(rigPath, "crew")
if err := os.MkdirAll(crewPath, 0755); err != nil {
return nil, fmt.Errorf("creating crew dir: %w", err)
}
if err := m.git.Clone(opts.GitURL, crewPath); err != nil {
return nil, fmt.Errorf("cloning for crew: %w", err)
}
// Create crew CLAUDE.md (overrides any from cloned repo)
if err := m.createRoleCLAUDEmd(crewPath, "crew", opts.Name, opts.CrewName); err != nil {
return nil, fmt.Errorf("creating crew CLAUDE.md: %w", err)
// Create README with instructions
readmePath := filepath.Join(crewPath, "README.md")
readmeContent := `# Crew Directory
This directory contains crew worker workspaces.
## Adding a Crew Member
` + "```bash" + `
gt crew add <name> # Creates crew/<name>/ with a git clone
` + "```" + `
## Crew vs Polecats
- **Crew**: Persistent, user-managed workspaces (never auto-garbage-collected)
- **Polecats**: Transient, witness-managed workers (cleaned up after work completes)
Use crew for your own workspace. Polecats are for batch work dispatch.
`
if err := os.WriteFile(readmePath, []byte(readmeContent), 0644); err != nil {
return nil, fmt.Errorf("creating crew README: %w", err)
}
// Create witness directory (no clone needed)