chore: remove stale prompts/, mayor/, and scripts/ directories
- Delete prompts/roles/*.md (duplicates of internal/templates/roles/*.md.tmpl) - Delete mayor/rig/docs/ (stale draft, canonical version in docs/) - Delete scripts/ (replaced by Makefile and internal/daemon/) - Update doctor check to validate internal/templates/roles/*.md.tmpl - Update docs/prompts.md to reflect actual template location 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -385,7 +385,7 @@ func (c *PatrolPluginsAccessibleCheck) Fix(ctx *CheckContext) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// PatrolRolesHavePromptsCheck verifies that prompts/roles/*.md exist for each role.
|
||||
// PatrolRolesHavePromptsCheck verifies that internal/templates/roles/*.md.tmpl exist for each role.
|
||||
type PatrolRolesHavePromptsCheck struct {
|
||||
BaseCheck
|
||||
}
|
||||
@@ -395,16 +395,16 @@ func NewPatrolRolesHavePromptsCheck() *PatrolRolesHavePromptsCheck {
|
||||
return &PatrolRolesHavePromptsCheck{
|
||||
BaseCheck: BaseCheck{
|
||||
CheckName: "patrol-roles-have-prompts",
|
||||
CheckDescription: "Check if prompts/roles/*.md exist for each patrol role",
|
||||
CheckDescription: "Check if internal/templates/roles/*.md.tmpl exist for each patrol role",
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
// requiredRolePrompts are the required role prompt files.
|
||||
// requiredRolePrompts are the required role prompt template files.
|
||||
var requiredRolePrompts = []string{
|
||||
"deacon.md",
|
||||
"witness.md",
|
||||
"refinery.md",
|
||||
"deacon.md.tmpl",
|
||||
"witness.md.tmpl",
|
||||
"refinery.md.tmpl",
|
||||
}
|
||||
|
||||
// Run checks if role prompts exist.
|
||||
@@ -431,10 +431,10 @@ func (c *PatrolRolesHavePromptsCheck) Run(ctx *CheckContext) *CheckResult {
|
||||
for _, rigName := range rigs {
|
||||
// Check in mayor's clone (canonical for the rig)
|
||||
mayorRig := filepath.Join(ctx.TownRoot, rigName, "mayor", "rig")
|
||||
promptsDir := filepath.Join(mayorRig, "prompts", "roles")
|
||||
templatesDir := filepath.Join(mayorRig, "internal", "templates", "roles")
|
||||
|
||||
for _, roleFile := range requiredRolePrompts {
|
||||
promptPath := filepath.Join(promptsDir, roleFile)
|
||||
promptPath := filepath.Join(templatesDir, roleFile)
|
||||
if _, err := os.Stat(promptPath); os.IsNotExist(err) {
|
||||
missingPrompts = append(missingPrompts, fmt.Sprintf("%s: %s", rigName, roleFile))
|
||||
}
|
||||
@@ -445,15 +445,15 @@ func (c *PatrolRolesHavePromptsCheck) Run(ctx *CheckContext) *CheckResult {
|
||||
return &CheckResult{
|
||||
Name: c.Name(),
|
||||
Status: StatusWarning,
|
||||
Message: fmt.Sprintf("%d role prompt(s) missing", len(missingPrompts)),
|
||||
Message: fmt.Sprintf("%d role prompt template(s) missing", len(missingPrompts)),
|
||||
Details: missingPrompts,
|
||||
FixHint: "Role prompts should be in the project repository under prompts/roles/",
|
||||
FixHint: "Role prompt templates should be in the project repository under internal/templates/roles/",
|
||||
}
|
||||
}
|
||||
|
||||
return &CheckResult{
|
||||
Name: c.Name(),
|
||||
Status: StatusOK,
|
||||
Message: "All patrol role prompts found",
|
||||
Message: "All patrol role prompt templates found",
|
||||
}
|
||||
}
|
||||
|
||||
@@ -136,7 +136,6 @@ func HasHook(root, agent string) bool {
|
||||
}
|
||||
|
||||
// ListHooks returns a list of agents with active hooks.
|
||||
// Agent IDs are returned in their original form (with slashes).
|
||||
func ListHooks(root string) ([]string, error) {
|
||||
dir := filepath.Join(root, WispDir)
|
||||
entries, err := os.ReadDir(dir)
|
||||
@@ -153,8 +152,7 @@ func ListHooks(root string) ([]string, error) {
|
||||
if len(name) > len(HookPrefix)+len(HookSuffix) &&
|
||||
name[:len(HookPrefix)] == HookPrefix &&
|
||||
name[len(name)-len(HookSuffix):] == HookSuffix {
|
||||
sanitized := name[len(HookPrefix) : len(name)-len(HookSuffix)]
|
||||
agent := unsanitizeAgentID(sanitized)
|
||||
agent := name[len(HookPrefix) : len(name)-len(HookSuffix)]
|
||||
agents = append(agents, agent)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,7 +9,6 @@
|
||||
package wisp
|
||||
|
||||
import (
|
||||
"strings"
|
||||
"time"
|
||||
)
|
||||
|
||||
@@ -127,23 +126,6 @@ func NewPatrolCycle(formula, createdBy string) *PatrolCycle {
|
||||
}
|
||||
|
||||
// HookFilename returns the filename for an agent's hook file.
|
||||
// Agent IDs containing slashes (e.g., "gastown/crew/joe") are sanitized
|
||||
// by replacing "/" with "--" to create valid filenames.
|
||||
func HookFilename(agent string) string {
|
||||
// Sanitize agent ID: replace path separators with double-dash
|
||||
// This is reversible and avoids creating subdirectories
|
||||
sanitized := sanitizeAgentID(agent)
|
||||
return HookPrefix + sanitized + HookSuffix
|
||||
}
|
||||
|
||||
// sanitizeAgentID converts an agent ID to a safe filename component.
|
||||
// "gastown/crew/joe" -> "gastown--crew--joe"
|
||||
func sanitizeAgentID(agent string) string {
|
||||
return strings.ReplaceAll(agent, "/", "--")
|
||||
}
|
||||
|
||||
// unsanitizeAgentID converts a sanitized filename back to an agent ID.
|
||||
// "gastown--crew--joe" -> "gastown/crew/joe"
|
||||
func unsanitizeAgentID(sanitized string) string {
|
||||
return strings.ReplaceAll(sanitized, "--", "/")
|
||||
return HookPrefix + agent + HookSuffix
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user