Merge pull request #93 from markov-kernel/fix/mayor-session-hooks

fix: deploy SessionStart hooks in gt install for Mayor role
This commit is contained in:
Steve Yegge
2026-01-04 13:09:24 -08:00
committed by GitHub
3 changed files with 29 additions and 1 deletions

View File

@@ -11,6 +11,7 @@ import (
"github.com/spf13/cobra"
"github.com/steveyegge/gastown/internal/beads"
"github.com/steveyegge/gastown/internal/claude"
"github.com/steveyegge/gastown/internal/config"
"github.com/steveyegge/gastown/internal/deps"
"github.com/steveyegge/gastown/internal/formula"
@@ -178,6 +179,15 @@ func runInstall(cmd *cobra.Command, args []string) error {
fmt.Printf(" ✓ Created CLAUDE.md\n")
}
// Ensure Mayor has Claude settings with SessionStart hooks.
// This ensures gt prime runs on Claude startup, which outputs the Mayor
// delegation protocol - critical for preventing direct implementation.
if err := claude.EnsureSettingsForRole(absPath, "mayor"); err != nil {
fmt.Printf(" %s Could not create .claude/settings.json: %v\n", style.Dim.Render("⚠"), err)
} else {
fmt.Printf(" ✓ Created .claude/settings.json\n")
}
// Initialize town-level beads database (optional)
// Town beads (hq- prefix) stores mayor mail, cross-rig coordination, and handoffs.
// Rig beads are separate and have their own prefixes.