fix(priming): use bootstrap pointers instead of full CLAUDE.md templates
Fresh installs and rig adds were creating full CLAUDE.md files (285 lines for mayor, ~100 lines for other roles), causing gt doctor to fail the priming check immediately. Per the priming architecture, CLAUDE.md should be a minimal bootstrap pointer (<30 lines) that tells agents to run gt prime. Full context is injected ephemerally at session start. Changes: - install.go: createMayorCLAUDEmd now writes 12-line bootstrap pointer - manager.go: createRoleCLAUDEmd now writes role-specific bootstrap pointers for mayor, refinery, crew, and polecat roles Note: The AGENTS.md issue mentioned in #316 could not be reproduced - the code does not appear to create AGENTS.md at rig level. May be from an older version or different configuration. Partial fix for #316 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -16,7 +16,6 @@ import (
|
||||
"github.com/steveyegge/gastown/internal/config"
|
||||
"github.com/steveyegge/gastown/internal/deps"
|
||||
"github.com/steveyegge/gastown/internal/formula"
|
||||
"github.com/steveyegge/gastown/internal/session"
|
||||
"github.com/steveyegge/gastown/internal/shell"
|
||||
"github.com/steveyegge/gastown/internal/state"
|
||||
"github.com/steveyegge/gastown/internal/style"
|
||||
@@ -310,14 +309,23 @@ func runInstall(cmd *cobra.Command, args []string) error {
|
||||
}
|
||||
|
||||
func createMayorCLAUDEmd(mayorDir, townRoot string) error {
|
||||
townName, _ := workspace.GetTownName(townRoot)
|
||||
return templates.CreateMayorCLAUDEmd(
|
||||
mayorDir,
|
||||
townRoot,
|
||||
townName,
|
||||
session.MayorSessionName(),
|
||||
session.DeaconSessionName(),
|
||||
)
|
||||
// Create a minimal bootstrap pointer instead of full context.
|
||||
// Full context is injected ephemerally by `gt prime` at session start.
|
||||
// This keeps the on-disk file small (<30 lines) per priming architecture.
|
||||
bootstrap := `# Mayor Context
|
||||
|
||||
> **Recovery**: Run ` + "`gt prime`" + ` after compaction, clear, or new session
|
||||
|
||||
Full context is injected by ` + "`gt prime`" + ` at session start.
|
||||
|
||||
## Quick Reference
|
||||
|
||||
- Check mail: ` + "`gt mail inbox`" + `
|
||||
- Check rigs: ` + "`gt rig list`" + `
|
||||
- Start patrol: ` + "`gt patrol start`" + `
|
||||
`
|
||||
claudePath := filepath.Join(mayorDir, "CLAUDE.md")
|
||||
return os.WriteFile(claudePath, []byte(bootstrap), 0644)
|
||||
}
|
||||
|
||||
func writeJSON(path string, data interface{}) error {
|
||||
|
||||
Reference in New Issue
Block a user