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:
@@ -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