feat(crew): Provision .claude/commands/ for crew and polecat workspaces (gt-jhr85)

When adding a crew member with 'gt crew add' or spawning a polecat,
provision the .claude/commands/ directory with standard slash commands
like /handoff. This ensures all agents have Gas Town utilities even if
the source repo does not have them tracked.

Changes:
- Add embedded commands templates (internal/templates/commands/)
- Add ProvisionCommands() to templates package
- Call ProvisionCommands from crew and polecat managers
- Add gt doctor commands-provisioned check with --fix support
This commit is contained in:
slit
2026-01-02 17:21:43 -08:00
committed by Steve Yegge
parent a62b35a85c
commit d4eed2dcf2
6 changed files with 304 additions and 0 deletions

View File

@@ -12,6 +12,7 @@ import (
"github.com/steveyegge/gastown/internal/config"
"github.com/steveyegge/gastown/internal/git"
"github.com/steveyegge/gastown/internal/rig"
"github.com/steveyegge/gastown/internal/templates"
"github.com/steveyegge/gastown/internal/workspace"
)
@@ -244,6 +245,13 @@ func (m *Manager) AddWithOptions(name string, opts AddOptions) (*Polecat, error)
fmt.Printf("Warning: could not set up shared beads: %v\n", err)
}
// Provision .claude/commands/ with standard slash commands (e.g., /handoff)
// This ensures polecats have Gas Town utilities even if source repo lacks them.
if err := templates.ProvisionCommands(polecatPath); err != nil {
// Non-fatal - polecat can still work, warn but don't fail
fmt.Printf("Warning: could not provision slash commands: %v\n", err)
}
// Create agent bead for ZFC compliance (self-report state).
// State starts as "spawning" - will be updated to "working" when Claude starts.
// HookBead is set atomically at creation time if provided (avoids cross-beads routing issues).
@@ -460,6 +468,11 @@ func (m *Manager) RecreateWithOptions(name string, force bool, opts AddOptions)
fmt.Printf("Warning: could not set up shared beads: %v\n", err)
}
// Provision .claude/commands/ with standard slash commands (e.g., /handoff)
if err := templates.ProvisionCommands(polecatPath); err != nil {
fmt.Printf("Warning: could not provision slash commands: %v\n", err)
}
// Create fresh agent bead for ZFC compliance
// HookBead is set atomically at recreation time if provided.
_, err = m.beads.CreateAgentBead(agentID, agentID, &beads.AgentFields{