diff --git a/cmd/pad/agent_guide_test.go b/cmd/pad/agent_guide_test.go index ac6a93fe1..bf58fa15b 100644 --- a/cmd/pad/agent_guide_test.go +++ b/cmd/pad/agent_guide_test.go @@ -1,8 +1,12 @@ package main import ( + "regexp" "strings" "testing" + + pad "github.com/PerpetualSoftware/pad" + "github.com/PerpetualSoftware/pad/internal/cli" ) const guideFixture = `# Pad @@ -45,3 +49,23 @@ func TestAgentGuideSectionRejectsUnknownTopic(t *testing.T) { t.Fatal("unknown topic resolved") } } + +func TestAgentDispatcherGuideTopicsResolve(t *testing.T) { + dispatcher := cli.FormatForTool(*cli.ResolveTool("agents"), pad.PadSkill) + guide := string(cli.StripFrontmatter(pad.PadSkill)) + matches := regexp.MustCompile(`pad agent guide ([a-z0-9][a-z0-9-]*)`).FindAllSubmatch(dispatcher, -1) + seen := map[string]bool{} + for _, match := range matches { + topic := string(match[1]) + if topic == "all" || seen[topic] { + continue + } + seen[topic] = true + if _, ok := agentGuideSection(guide, topic); !ok { + t.Errorf("dispatcher guide topic %q does not resolve", topic) + } + } + if len(seen) == 0 { + t.Fatal("dispatcher contains no guide topics") + } +} diff --git a/internal/cli/agents.go b/internal/cli/agents.go index 9c16321e1..e990915f0 100644 --- a/internal/cli/agents.go +++ b/internal/cli/agents.go @@ -112,6 +112,7 @@ playbooks, dashboard, and recent activity in one call. - Read an item before updating it. Send only changed fields and include a comment with status changes. - Read collection schemas instead of guessing field names or terminal statuses. +- Never read ` + "`~/.pad/attachments/`" + ` directly. Always use ` + "`pad attachment`" + `. - Confirm each mutation from the returned object before saying it succeeded. - Use active playbooks when intent or an invocation slug matches; never run draft or deprecated playbooks unless the user explicitly asks. @@ -125,7 +126,7 @@ pad item show TASK-5 --format json pad item list [collection] --format json pad item create "Title" [flags] pad item update TASK-5 [flags] -pad item comment TASK-5 -m "Message" +pad item comment TASK-5 "Message" pad playbook list --format json pad playbook show --format markdown ` + "```" + `