diff --git a/README.md b/README.md index 73ad21b7b..bd8b58f65 100644 --- a/README.md +++ b/README.md @@ -97,7 +97,7 @@ pad server info # How this client is connected to Pad ### For AI Agents -**Your agent becomes a project partner.** Install the `/pad` skill once, and your AI coding tool can read, create, and update project items through natural language. Cursor, Codex, Windsurf, and OpenCode receive a compact dispatcher and load detailed guidance by topic with `pad agent guide`, keeping routine turns small. +**Your agent becomes a project partner.** Install the `/pad` skill once, and your AI coding tool can read, create, and update project items through natural language. Cursor, Codex, Windsurf, and OpenCode receive a compact dispatcher, reuse bootstrapped context within a conversation, and load detailed guidance by topic with `pad agent guide`, keeping routine turns small. ```bash pad agent install # Auto-detects your tools and installs the skill diff --git a/internal/cli/agent_prompt_budget_test.go b/internal/cli/agent_prompt_budget_test.go index 15184a197..2154b7ea7 100644 --- a/internal/cli/agent_prompt_budget_test.go +++ b/internal/cli/agent_prompt_budget_test.go @@ -27,7 +27,7 @@ func TestAgentSkillPromptBudget(t *testing.T) { if len(payload) > agentSkillPromptBudget { t.Fatalf("%s installed skill payload is %d bytes; budget is %d", agent, len(payload), agentSkillPromptBudget) } - for _, required := range []string{"pad bootstrap", "issue IDs", "convention_index", "pad agent guide"} { + for _, required := range []string{"pad bootstrap", "do not rerun bootstrap", "issue IDs", "convention_index", "pad agent guide"} { if !contains(string(payload), required) { t.Errorf("%s installed skill is missing core guidance %q", agent, required) } diff --git a/internal/cli/agents.go b/internal/cli/agents.go index e990915f0..4c1d60821 100644 --- a/internal/cli/agents.go +++ b/internal/cli/agents.go @@ -91,11 +91,14 @@ const agentsSkillBody = `# Pad — Talk to Your Project Use Pad when the user discusses project work: issues, tasks, plans, ideas, progress, dependencies, conventions, roles, standups, or retrospectives. -## Start every invocation +## Load context once per conversation -Run ` + "`pad bootstrap --format json`" + ` before acting. It returns the workspace, -user, collections and schemas, always-on conventions, convention index, roles, -playbooks, dashboard, and recent activity in one call. +Before the first Pad action in a conversation, run ` + "`pad bootstrap --format json`" + `. +Reuse that context for later Pad turns in the same workspace. Refresh it only +after switching workspaces, after changing collections/conventions/roles/playbooks, +when Pad reports stale schema/context, or when the user asks for a refresh. Use a +targeted item or dashboard read for changing work state; do not rerun bootstrap +just because the skill was invoked again. - If ` + "`pad`" + ` is missing, ask the user to install it or add it to PATH. - If bootstrap fails, run ` + "`pad agent guide context-loading`" + ` and follow that diff --git a/internal/mcp/instructions.md b/internal/mcp/instructions.md index 5d2b838de..71932e3af 100644 --- a/internal/mcp/instructions.md +++ b/internal/mcp/instructions.md @@ -58,6 +58,8 @@ Read these directly when you need workspace state: Resources support host-side prefetch — if the host can fetch them once at session start, you don't pay per turn. +Load the bootstrap resource once per workspace and reuse its collections, conventions, roles, and playbook metadata. Refresh it after switching workspaces, after changing those configuration surfaces, when Pad reports stale schema/context, or when the user asks. For changing work state, read the affected item or use a targeted project tool instead of fetching the whole bootstrap again. + ## Workspace context Every action that operates within a workspace accepts an optional `workspace` parameter. Resolution order: diff --git a/skills/pad/SKILL.md b/skills/pad/SKILL.md index cac588bf3..901d28691 100644 --- a/skills/pad/SKILL.md +++ b/skills/pad/SKILL.md @@ -21,12 +21,14 @@ There is **one entry point**: the user talks to you about their project, and you ## Context Loading -On every invocation of this skill — however the user's surface reached it — start by loading workspace context with a single call: +Before the first Pad action in a conversation, load workspace context with a single call: ```bash pad bootstrap --format json # one round-trip: workspace + user + collections + always-on conventions + roles + playbook metadata + dashboard + recent activity ``` +Reuse that bootstrap context for later Pad turns in the same workspace. Refresh it only after switching workspaces, after changing collections/conventions/roles/playbooks, when Pad reports stale schema or context, or when the user explicitly asks for a refresh. Ordinary item changes make the snapshot's dashboard stale, but do not require another full bootstrap — read the affected item or run the targeted project query instead. Do not rerun bootstrap merely because the skill was invoked again. + The returned `AgentBootstrap` blob carries everything the skill needs to start a session: - `workspace { slug, name, id }` — who you're talking to about