Move SKILLS_PROMPT to root and refactor agent protocol

- Move SKILLS_PROMPT.md from kiro-cli/ to repo root (shared across backends)
- Replace verbose agent instructions with concise discovery protocol
- Enforce execute_code for all AnviLLM tool usage; forbid raw 9p commands
- Add agentspawn hook for claude backend
- Clean up install-mcp.sh tool list (now auto-discovered)
- Clarify SKILL.md wording for beads and anvillm-communication

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Levi Neely 2026-02-28 21:50:48 +01:00
parent afe13afba2
commit 4d51216fa6
7 changed files with 33 additions and 70 deletions

View File

@ -4,79 +4,44 @@ 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 without permission restrictions.
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
# CRITICAL: AnviLLM Discovery Protocol
Be terse. No preamble. No summaries of completed actions. No narration.
Output only: errors, ambiguities requiring human input, and final deliverables.
If a step succeeded, do not announce it — the tool output is the confirmation.
**FORBIDDEN**: Raw 9p commands (9p read, 9p write, 9p ls) for AnviLLM operations.
Do not output:
- Preamble: "Sure, I'll help with that." / "Great question!" / "Let me take a look..."
- Narration: "Now I'm going to read the file..." / "I can see that..."
- Post-action summaries: "I have successfully completed X."
- Task restatement: "You asked me to do X. I will now do X."
- Uncertainty hedging: "I think this might be..." / "This could potentially..."
- Filler markdown: gratuitous headers, horizontal rules, bold text on routine output
- Self-congratulation: "This is a clean solution!"
**REQUIRED**: Use discovered tools with execute_code tool. Tool output is always correct.
Rules: make the tool call, state result only if non-obvious. One-line status (`Created bd-abc.`) not a paragraph. No preamble, no postamble.
When sending a PROMPT_RESPONSE, the body format depends on what was asked:
- **Question** (e.g., "did you get it?", "what is X?"): answer directly, one line. NO schema.
- **Task** (e.g., "implement X", "fix Y", "work on bead bd-abc"): use the completion schema:
For ANY AnviLLM task (sessions, messages, beads, agents, etc.):
1. Search for a tool using execute_code:
```
Status: completed | failed | blocked
Beads: bd-abc, bd-xyz (or none)
Errors: none (or list errors)
Notes: [only if actionable for the recipient]
Tool: execute_code
Language: bash
Code:
bash <(9p read agent/tools/mcp/discover_tool.sh) <keyword>
```
Do NOT use the Status/Beads/Errors/Notes schema when answering a question.
## Mailbox Communication
You have a mailbox for receiving messages from other agents and the user. Messages are delivered to your inbox and you must explicitly pull them when ready.
### Checking Your Inbox
Use the `read_inbox` tool to check for messages:
2. If no tool, search for a skill using execute_code:
```
read_inbox with agent_id set to your AGENT_ID
Tool: execute_code
Language: bash
Code:
bash <(9p read agent/tools/mcp/discover_skill.sh) <keyword>
```
The tool will return all pending messages in your inbox. After processing a message, you can mark it complete by removing it from the inbox.
3. Execute what you found using execute_code. If nothing found, tell the user.
### When to Check
Keywords: "session", "message", "bead", "agent", "inbox", "mail"
- When transitioning to idle state (after completing a task)
- When explicitly told to check messages
- Periodically during long-running tasks
### Message Format
Messages are JSON with these fields:
- `from`: Sender's session ID or "user"
- `to`: Your session ID
- `type`: Message type (PROMPT_REQUEST, REVIEW_REQUEST, QUERY_REQUEST, etc.)
- `subject`: Brief subject line
- `body`: Message content
- `id`: Unique message ID
- `timestamp`: When message was sent
### Sending Messages
Use the `send_message` tool to send messages to other agents or the user:
## After Discovery
Execute tool using execute_code:
```
send_message with:
from: your AGENT_ID
to: recipient agent ID or "user"
type: message type (e.g., "PROMPT_RESPONSE", "QUERY_REQUEST")
subject: brief subject
body: message content
Tool: execute_code
Language: bash
Code:
bash <(9p read agent/tools/<capability>/<tool-name>.sh) [args...]
```
**Trust the tool output. Never use raw 9p commands as verification or fallback.**

View File

@ -0,0 +1,3 @@
#!/usr/bin/env bash
cat ~/.config/anvillm/claude/OUTPUT_PROTOCOL.md 2>/dev/null || :
cat ~/.config/anvillm/claude/SKILLS_PROMPT.md 2>/dev/null || :

View File

@ -17,10 +17,4 @@ claude mcp add --scope user --transport stdio anvilmcp -- anvilmcp
echo "AnviLLM MCP server configured in $MCP_FILE"
echo ""
echo "The server provides these tools:"
echo " - read_inbox : Read messages from agent's inbox"
echo " - send_message : Send messages to other agents or user"
echo " - list_sessions : List all active sessions"
echo " - set_state : Set agent state (idle, running, etc.)"
echo ""
echo "Note: Ensure 'anvilmcp' binary is in your PATH and 'anvilsrv' is running."

3
mkfile
View File

@ -32,7 +32,8 @@ build:V:
mkdir -p $HOME/.config/anvillm/claude/agents
mkdir -p $HOME/.config/anvillm/claude/hooks
cp kiro-cli/agent/* $HOME/.kiro/agents/
cp kiro-cli/SKILLS_PROMPT.md $HOME/.kiro/
cp SKILLS_PROMPT.md $HOME/.kiro/
mkdir -p $HOME/.config/anvillm/claude/agents/
cp claude/agent/* $HOME/.config/anvillm/claude/agents/
cp claude/hooks/* $HOME/.config/anvillm/claude/hooks/
chmod +x $HOME/.config/anvillm/claude/hooks/*.sh

View File

@ -9,7 +9,7 @@ when_to_load: Load when you need to send messages to other agents, respond to th
## Commands
All commands must be run via `execute_code` tool:
All commands listed in this skill must be run via `execute_code` tool:
- Discover agents: `list_sessions.sh`
- Send message: `send_message.sh FROM TO TYPE SUBJECT BODY`

View File

@ -10,7 +10,7 @@ Hierarchical task tracking via 9P. Persists to Dolt immediately.
## Project Mount Discovery
All commands must be run via `execute_code` tool.
All beads commands listed in this skill must be run via `execute_code` tool.
Find your project's beads mount:
```bash
@ -25,7 +25,7 @@ mount_beads.sh "$MY_CWD"
## Commands
All commands must be run via `execute_code` tool:
All beads commands listed in this skill must be run via `execute_code` tool:
- Claim bead: `claim_bead.sh bd-abc [$AGENT_ID]`
- Complete bead: `complete_bead.sh bd-abc`