From 2ebacf2b2e3a1aa7f7ba21cef9d806b870685ced Mon Sep 17 00:00:00 2001 From: Levi Neely Date: Thu, 5 Mar 2026 21:38:26 +0100 Subject: [PATCH] refining role/skill/tool discovery --- SKILLS_PROMPT.md | 98 ++++--------------------- claude/agent/anvillm-agent.md | 100 ++++---------------------- skills/acme-api/SKILL.md | 2 +- skills/anvillm-communication/SKILL.md | 47 +++++++----- skills/beads/SKILL.md | 71 ++++++++---------- skills/denote/SKILL.md | 4 +- 6 files changed, 88 insertions(+), 234 deletions(-) diff --git a/SKILLS_PROMPT.md b/SKILLS_PROMPT.md index 02a15ff..5fcefbb 100644 --- a/SKILLS_PROMPT.md +++ b/SKILLS_PROMPT.md @@ -1,97 +1,25 @@ # CRITICAL: AnviLLM Discovery Protocol -**FORBIDDEN**: Raw 9p commands (9p read, 9p write, 9p ls) for AnviLLM operations. - -**REQUIRED**: Use discovered tools with execute_code tool. Tool output is always correct. - -**IMPORTANT**: execute_code runs in extremely restricted sandbox; do not use for coding activities. - -## Proactive Skill Discovery - -**BEFORE responding to ANY user request**, identify relevant capabilities and load skills using execute_code: - -1. Map user intent to capabilities (tasks, agents, messaging, github, search, etc.) -2. List skills for each capability: -``` -Tool: execute_code -Language: bash -Code: -9p ls agent/skills/ -``` -3. Load relevant skill files: -``` -Tool: execute_code -Language: bash -Code: -9p read agent/skills///SKILL.md -``` - -**Common capability mappings:** -- Task/project management → `tasks`, `workflow` -- Agent operations → `agents`, `sessions`, `messaging` -- GitHub/Git → `github`, `vcs` -- Web search → `search`, `web` -- Documentation → `documentation`, `notes` -- Knowledge management → `knowledge`, `learning` - ## Proactive Role Discovery -**When user assigns you an identity**, using patterns such as "you're a(n)...", "you are a(n)...", "act as...", "be a(n)...", discover and load the appropriate role and adopt it if found. Otherwise, acknowledge directly. - -1. Search for roles by **specific task keywords**: -``` -Tool: execute_code -Language: bash -Code: -bash <(9p read agent/tools/mcp/discover_role.sh) -``` - -2. Load role content: -``` -Tool: execute_code -Language: bash -Code: -9p read agent/roles//.md -``` +REQUIRED FIRST STEP: **If assigned a role or identity**, using patterns such as "you're a(n)...", "you are a(n)...", "act as...", "be a(n)...", discover and load the appropriate role and adopt it if found. Otherwise, advise the user that no suitable role was found and acknowledge. Use the `execute_code` (language: bash) tool to: +1. Search for roles by **specific task keywords**: `bash <(9p read agent/tools/mcp/discover_role.sh) ` +2. Load role content: `9p read agent/roles//.md` 3. Adopt the role's persona and expertise for your response -**Use specific keywords, not broad categories:** -- ✓ "API testing", "backend architect", "security audit" (specific) -- ✗ "testing", "engineering", "QA" (too broad) +## Proactive Skill Discovery + +REQUIRED NEXT STEP: Identify user intents, and load relevant skills: + +1. Search for skills by **specific intent keywords**: `bash <(9p read agent/tools/mcp/discover_skill.sh) ` +2. Load relevant skill files: `9p read agent/skills///SKILL.md` ## Tool Discovery -For ANY AnviLLM task (sessions, messages, beads, agents, etc.): +Skills provide instructions on certain tools, but they are not exhaustive. Identify other useful tools by: -1. Search for a tool using execute_code: -``` -Tool: execute_code -Language: bash -Code: -bash <(9p read agent/tools/mcp/discover_tool.sh) -``` +1. Mapping user intent to capabilities +2. Search for tools by **specific capability keywords**: `bash <(9p read agent/tools/mcp/discover_tool.sh) ` -2. If no tool, search for a skill using execute_code: -``` -Tool: execute_code -Language: bash -Code: -bash <(9p read agent/tools/mcp/discover_skill.sh) -``` - -3. Execute what you found using execute_code. If nothing found, tell the user. - -## After Discovery - -Execute tool using execute_code: -``` -Tool: execute_code -Language: bash -Code: -bash <(9p read agent/tools//.sh) [args...] -``` - -**IMPORTANT**: All bead tools require `` as first arg (e.g., `label_bead.sh anvillm anv-123 claimable`, `read_bead.sh anvillm anv-123 json`). Only exceptions: `mount_beads.sh` (takes cwd), `umount_beads.sh` (takes name), `list_mounts.sh` (no args). - -**Trust the tool output. Never use raw 9p commands as verification or fallback.** +Keep these tools and their usage in your memory for later use, when appropriate. diff --git a/claude/agent/anvillm-agent.md b/claude/agent/anvillm-agent.md index b7aa3eb..3ccaa41 100644 --- a/claude/agent/anvillm-agent.md +++ b/claude/agent/anvillm-agent.md @@ -4,8 +4,6 @@ description: Agent for AnviLLM multi-agent workflows with Claude Code backend permissionMode: bypassPermissions --- -You are an AI assistant for AnviLLM multi-agent workflows. You have full access to all tools and operate in a sandbox without permission restrictions. - # Output Protocol Be terse. No preamble. No summaries of completed actions. No narration. @@ -30,100 +28,26 @@ If a step succeeded, do not announce it — the tool output is the confirmation. - One-line status: `Created bd-abc.` not a paragraph about what was created - No preamble, no postamble -# CRITICAL: AnviLLM Discovery Protocol +## Proactive Role Discovery -**FORBIDDEN**: Raw 9p commands (9p read, 9p write, 9p ls) for AnviLLM operations. +REQUIRED FIRST STEP: **If assigned a role or identity**, using patterns such as "you're a(n)...", "you are a(n)...", "act as...", "be a(n)...", discover and load the appropriate role and adopt it if found. Otherwise, advise the user that no suitable role was found and acknowledge. Use the `execute_code` (language: bash) tool to: -**REQUIRED**: Use discovered tools with execute_code tool. Tool output is always correct. - -**IMPORTANT**: execute_code runs in extremely restricted sandbox; do not use for coding activities. +1. Search for roles by **specific task keywords**: `bash <(9p read agent/tools/mcp/discover_role.sh) ` +2. Load role content: `9p read agent/roles//.md` +3. Adopt the role's persona and expertise for your response ## Proactive Skill Discovery -**BEFORE responding to ANY user request**, identify relevant capabilities and load skills using execute_code: +REQUIRED NEXT STEP: Identify user intents, and load relevant skills: -1. Map user intent to capabilities (tasks, agents, messaging, github, search, etc.) -2. List skills for each capability: -``` -Tool: execute_code -Language: bash -Code: -9p ls agent/skills/ -``` -3. Load relevant skill files: -``` -Tool: execute_code -Language: bash -Code: -9p read agent/skills///SKILL.md -``` - -**Common capability mappings:** -- Task/project management → `tasks`, `workflow` -- Agent operations → `agents`, `sessions`, `messaging` -- GitHub/Git → `github`, `vcs` -- Web search → `search`, `web` -- Documentation → `documentation`, `notes` -- Knowledge management → `knowledge`, `learning` - -## Proactive Role Discovery - -**When user assigns you an identity**, using patterns such as "you're a(n)...", "you are a(n)...", "act as...", "be a(n)...", discover and load the appropriate role and adopt it if found. Otherwise, acknowledge directly. - -1. Search for roles by **specific task keywords**: -``` -Tool: execute_code -Language: bash -Code: -bash <(9p read agent/tools/mcp/discover_role.sh) -``` - -2. Load role content: -``` -Tool: execute_code -Language: bash -Code: -9p read agent/roles//.md -``` - -3. Adopt the role's persona and expertise for your response - -**Use specific keywords, not broad categories:** -- ✓ "API testing", "backend architect", "security audit" (specific) -- ✗ "testing", "engineering", "QA" (too broad) +1. Search for skills by **specific intent keywords**: `bash <(9p read agent/tools/mcp/discover_skill.sh) ` +2. Load relevant skill files: `9p read agent/skills///SKILL.md` ## Tool Discovery -For ANY AnviLLM task (sessions, messages, beads, agents, etc.): +Skills provide instructions on certain tools, but they are not exhaustive. Identify other useful tools by: -1. Search for a tool using execute_code: -``` -Tool: execute_code -Language: bash -Code: -bash <(9p read agent/tools/mcp/discover_tool.sh) -``` +1. Mapping user intent to capabilities +2. Search for tools by **specific capability keywords**: `bash <(9p read agent/tools/mcp/discover_tool.sh) ` -2. If no tool, search for a skill using execute_code: -``` -Tool: execute_code -Language: bash -Code: -bash <(9p read agent/tools/mcp/discover_skill.sh) -``` - -3. Execute what you found using execute_code. If nothing found, tell the user. - -## After Discovery - -Execute tool using execute_code: -``` -Tool: execute_code -Language: bash -Code: -bash <(9p read agent/tools//.sh) [args...] -``` - -**IMPORTANT**: All bead tools require `` as first arg (e.g., `label_bead.sh anvillm anv-123 claimable`, `read_bead.sh anvillm anv-123 json`). Only exceptions: `mount_beads.sh` (takes cwd), `umount_beads.sh` (takes name), `list_mounts.sh` (no args). - -**Trust the tool output. Never use raw 9p commands as verification or fallback.** +Keep these tools and their usage in your memory for later use, when appropriate. diff --git a/skills/acme-api/SKILL.md b/skills/acme-api/SKILL.md index 7896ba2..ec86da5 100644 --- a/skills/acme-api/SKILL.md +++ b/skills/acme-api/SKILL.md @@ -1,6 +1,6 @@ --- name: acme-api -intent: editor, acme +intent: api, acme description: Programming the acme text editor 9P API. Use when writing code to control acme windows, handle events, manipulate text, or integrate with acme via its file interface. version: 1.1.0 --- diff --git a/skills/anvillm-communication/SKILL.md b/skills/anvillm-communication/SKILL.md index bb5a5d4..87328cf 100644 --- a/skills/anvillm-communication/SKILL.md +++ b/skills/anvillm-communication/SKILL.md @@ -1,29 +1,42 @@ --- name: anvillm-communication -intent: messaging, agents +intent: messaging, agents, inbox description: Agent discovery and messaging via the mailbox system. when_to_load: Load when you need to send messages to other agents, respond to the user, discover peer agents, check your inbox, or coordinate with other agents in a workflow. --- -# Anvillm Communication +# Anvillm Communication Skill -## Commands +## Tools -All commands listed in this skill must be run via `execute_code` tool: +**IMPORTANT:** All anvillm-communication tools must be run via `execute_code` tool. -- Discover agents: `list_sessions.sh` -- Send message: `send_message.sh FROM TO TYPE SUBJECT BODY` -- Check inbox: `read_inbox.sh AGENT_ID` +- Discover agents: `bash <(9p read agent/tools/agents/list_sessions.sh | grep "$(pwd)")` +- Send message: `bash <(9p read agent/tools/messaging/send_message.sh FROM TO TYPE SUBJECT BODY)` +- Check inbox: `bash <(9p read agent/tools/messaging/read_inbox.sh AGENT_ID)` -## Use Cases +## Rules + +0. Read the $AGENT_ID environment variable to get your agent ID + +### Discovering Agents + +1. You communicate only with "user", or other agents working in the same $(pwd) as yourself + +### Sending Messages + +1. FROM is your agent ID +2. TO is the agent ID of the receiving bot, or "user" +3. TYPE is the message type: [PROMPT_REQUEST, QUERY_REQUEST, REVIEW_REQUEST, APPROVAL_REQUEST] +3a. Response types mirror request types: PROMPT_REQUEST→PROMPT_RESPONSE, QUERY_REQUEST→QUERY_RESPONSE, REVIEW_REQUEST→REVIEW_RESPONSE, APPROVAL_REQUEST→APPROVAL_RESPONSE. +4. SUBJECT is a brief description of what you did +4a. Response subjects are the subject of the original message prefixed by "Re: " +5. BODY is a detailed summary of what you did, including actions performed, files changed, diffs, etc. + +### Receiving Messages + +1. Check your inbox +2. Follow the instructions in the message +3. Respond to the sender appropriately (see Sending Messages) -| Goal | TO | TYPE | BODY format | -|------|----|------|-------------| -| Reply to user | user | PROMPT_RESPONSE | `Status: completed\|failed\|blocked\nBeads: bd-xxx\nErrors: none` | -| Ask user question | user | QUERY_REQUEST | one-line question | -| Request user approval | user | APPROVAL_REQUEST | `Action: ...\nRisk: ...` | -| Request user review | user | REVIEW_REQUEST | `Bead: bd-xxx\nDiff: ...\nQuestion: ...` | -| Send work to agent | agent_id | PROMPT_REQUEST | task description | -| Answer agent question | agent_id | QUERY_RESPONSE | one-line answer | -Response types mirror request types: PROMPT→PROMPT, QUERY→QUERY, REVIEW→REVIEW, APPROVAL→APPROVAL. diff --git a/skills/beads/SKILL.md b/skills/beads/SKILL.md index de2589f..59807fd 100644 --- a/skills/beads/SKILL.md +++ b/skills/beads/SKILL.md @@ -4,56 +4,41 @@ intent: tasks, workflow description: Manage tasks using the beads 9P interface. Use when creating, updating, listing, or deleting tasks/beads, or managing task dependencies. --- -# Beads Task System - -Hierarchical task tracking via 9P. Persists to Dolt immediately. +# Beads Skill ## Project Mount Discovery -All beads commands listed in this skill must be run via `execute_code` tool. +1. Find your project's beads mount: `MOUNT=$(list_mounts.sh | grep "$(pwd)" | awk '{print $1}')` +2. If no mount exists, create one and use it: `mount_beads.sh "$(pwd)"`. The mount will be named for the base directory of $(pwd). -Find your project's beads mount: -```bash -MY_CWD=$(pwd) -MOUNT=$(list_mounts.sh | grep "$MY_CWD" | awk '{print $1}') -``` +## Tools -If no mount exists, create one: -```bash -mount_beads.sh "$MY_CWD" -``` +**IMPORTANT:** All beads tools listed must be run via `execute_code` tool. -## Commands +**IMPORTANT:** All tools require `` as first argument. Exceptions: `list_mounts.sh`, `mount_beads.sh`, `umount_beads.sh`. -All beads commands listed in this skill must be run via `execute_code` tool. - -**CRITICAL:** All commands require `` as first argument. Exceptions: `list_mounts.sh`, `mount_beads.sh`, `umount_beads.sh`. - -- Claim bead: `claim_bead.sh bd-abc [$AGENT_ID]` -- Complete bead: `complete_bead.sh bd-abc` -- Fail bead: `fail_bead.sh bd-abc "reason"` -- Create bead: `create_bead.sh "title" "desc" [parent]` -- Update bead: `update_bead.sh bd-abc ` -- Add dependency: `add_dependency.sh ` -- Comment on bead: `comment_bead.sh bd-abc "text"` -- Label bead: `label_bead.sh bd-abc