Consolidate Claude settings management
Settings creation was scattered across multiple places (createPatrolHooks, ensurePatrolHooks, inline code). Now unified via claude.EnsureSettingsForRole(). Changes: - Add "deacon" to autonomous roles in claude/settings.go - Remove ensurePatrolHooks() from cmd/deacon.go, use EnsureSettingsForRole - Remove createPatrolHooks() from rig/manager.go (no longer needed at rig add) - Add EnsureSettingsForRole call in crew_lifecycle.go - Add doctor check for stale/missing Claude settings files - Wire up claude-settings check in cmd/doctor.go 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -27,7 +27,7 @@ const (
|
||||
// RoleTypeFor returns the RoleType for a given role name.
|
||||
func RoleTypeFor(role string) RoleType {
|
||||
switch role {
|
||||
case "polecat", "witness", "refinery":
|
||||
case "polecat", "witness", "refinery", "deacon":
|
||||
return Autonomous
|
||||
default:
|
||||
return Interactive
|
||||
@@ -35,8 +35,8 @@ func RoleTypeFor(role string) RoleType {
|
||||
}
|
||||
|
||||
// EnsureSettings ensures .claude/settings.json exists in the given directory.
|
||||
// If the file doesn't exist, it copies the appropriate template based on role type.
|
||||
// If the file already exists, it's left unchanged.
|
||||
// For worktrees, we use sparse checkout to exclude source repo's .claude/ directory,
|
||||
// so our settings.json is the only one Claude Code sees.
|
||||
func EnsureSettings(workDir string, roleType RoleType) error {
|
||||
claudeDir := filepath.Join(workDir, ".claude")
|
||||
settingsPath := filepath.Join(claudeDir, "settings.json")
|
||||
|
||||
Reference in New Issue
Block a user