refining role/skill/tool discovery
This commit is contained in:
parent
b246e4df5b
commit
2ebacf2b2e
|
|
@ -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/<capability>
|
||||
```
|
||||
3. Load relevant skill files:
|
||||
```
|
||||
Tool: execute_code
|
||||
Language: bash
|
||||
Code:
|
||||
9p read agent/skills/<capability>/<skill-name>/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) <specific-keyword>
|
||||
```
|
||||
|
||||
2. Load role content:
|
||||
```
|
||||
Tool: execute_code
|
||||
Language: bash
|
||||
Code:
|
||||
9p read agent/roles/<focus-area>/<role-filename>.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) <specific-keyword>`
|
||||
2. Load role content: `9p read agent/roles/<focus-area>/<role-filename>.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) <specific-keyword>`
|
||||
2. Load relevant skill files: `9p read agent/skills/<intent>/<skill-name>/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) <keyword>
|
||||
```
|
||||
1. Mapping user intent to capabilities
|
||||
2. Search for tools by **specific capability keywords**: `bash <(9p read agent/tools/mcp/discover_tool.sh) <specific-keyword>`
|
||||
|
||||
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) <keyword>
|
||||
```
|
||||
|
||||
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/<capability>/<tool-name>.sh) [args...]
|
||||
```
|
||||
|
||||
**IMPORTANT**: All bead tools require `<mount>` 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.
|
||||
|
|
|
|||
|
|
@ -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) <specific-keyword>`
|
||||
2. Load role content: `9p read agent/roles/<focus-area>/<role-filename>.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/<capability>
|
||||
```
|
||||
3. Load relevant skill files:
|
||||
```
|
||||
Tool: execute_code
|
||||
Language: bash
|
||||
Code:
|
||||
9p read agent/skills/<capability>/<skill-name>/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) <specific-keyword>
|
||||
```
|
||||
|
||||
2. Load role content:
|
||||
```
|
||||
Tool: execute_code
|
||||
Language: bash
|
||||
Code:
|
||||
9p read agent/roles/<focus-area>/<role-filename>.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) <specific-keyword>`
|
||||
2. Load relevant skill files: `9p read agent/skills/<intent>/<skill-name>/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) <keyword>
|
||||
```
|
||||
1. Mapping user intent to capabilities
|
||||
2. Search for tools by **specific capability keywords**: `bash <(9p read agent/tools/mcp/discover_tool.sh) <specific-keyword>`
|
||||
|
||||
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) <keyword>
|
||||
```
|
||||
|
||||
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/<capability>/<tool-name>.sh) [args...]
|
||||
```
|
||||
|
||||
**IMPORTANT**: All bead tools require `<mount>` 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.
|
||||
|
|
|
|||
|
|
@ -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
|
||||
---
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
|
|
|||
|
|
@ -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 `<mount>` 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 `<mount>` as first argument. Exceptions: `list_mounts.sh`, `mount_beads.sh`, `umount_beads.sh`.
|
||||
|
||||
- Claim bead: `claim_bead.sh <mount> bd-abc [$AGENT_ID]`
|
||||
- Complete bead: `complete_bead.sh <mount> bd-abc`
|
||||
- Fail bead: `fail_bead.sh <mount> bd-abc "reason"`
|
||||
- Create bead: `create_bead.sh <mount> "title" "desc" [parent]`
|
||||
- Update bead: `update_bead.sh <mount> bd-abc <field> <value>`
|
||||
- Add dependency: `add_dependency.sh <mount> <child> <parent>`
|
||||
- Comment on bead: `comment_bead.sh <mount> bd-abc "text"`
|
||||
- Label bead: `label_bead.sh <mount> bd-abc <label>`
|
||||
- Delete bead: `delete_bead.sh <mount> bd-abc`
|
||||
- List mounts: `bash <(9p read tools/beads/list_mounts.sh)`
|
||||
- List ready beads: `bash <(9p read tools/beads/list_ready_beads.sh <mount>)`
|
||||
- List all beads: `bash <(9p read tools/beads/list_beads.sh <mount>)`
|
||||
- Read bead: `bash <(9p read tools/beads/read_bead.sh <mount> <id> <property>)`
|
||||
- Read bead JSON: `bash <(9p read tools/beads/read_bead.sh <mount> <id> json)`
|
||||
- Read bead comments: `bash <(9p read tools/beads/read_bead.sh <mount> <id> comments)`
|
||||
- Claim bead: `bash <(9p read tools/beads/claim_bead.sh <mount> bd-abc [$AGENT_ID])`
|
||||
- Complete bead: `bash <(9p read tools/beads/complete_bead.sh <mount> bd-abc)`
|
||||
- Fail bead: `bash <(9p read tools/beads/fail_bead.sh <mount> bd-abc "reason")`
|
||||
- Create bead: `bash <(9p read tools/beads/create_bead.sh <mount> "title" "desc" [parent])`
|
||||
- Update bead: `bash <(9p read tools/beads/update_bead.sh <mount> bd-abc <field> <value>)`
|
||||
- Add dependency: `bash <(9p read tools/beads/add_dependency.sh <mount> <child> <parent>)`
|
||||
- Comment on bead: `bash <(9p read tools/beads/comment_bead.sh <mount> bd-abc "text")`
|
||||
- Label bead: `bash <(9p read tools/beads/label_bead.sh <mount> bd-abc <label>)`
|
||||
- Delete bead: `bash <(9p read tools/beads/delete_bead.sh <mount> bd-abc)`
|
||||
|
||||
**Note:** Delete does not cascade. To delete a parent and all children, delete children first, then parent.
|
||||
|
||||
## Queries
|
||||
|
||||
- List mounts: `list_mounts.sh`
|
||||
- List ready beads: `list_ready_beads.sh <mount>`
|
||||
- List all beads: `list_beads.sh <mount>`
|
||||
- Read bead: `read_bead.sh <mount> <id> <property>`
|
||||
- Read bead JSON: `read_bead.sh <mount> <id> json`
|
||||
- Read bead comments: `read_bead.sh <mount> <id> comments`
|
||||
## Workflow
|
||||
|
||||
**IMPORTANT:** When working on a bead, always check `comment_count` in the JSON output. If > 0, read comments for additional context, decisions, or blockers.
|
||||
|
||||
## Workflow
|
||||
|
||||
1. Find a ready task
|
||||
2. Claim the ticket being worked on
|
||||
3. Use agent-kb skill to search the knowledge base.
|
||||
|
|
@ -65,17 +50,21 @@ All beads commands listed in this skill must be run via `execute_code` tool.
|
|||
|
||||
- Discover your mount first using mtab
|
||||
- Claim before working
|
||||
- Complete children before parent
|
||||
- Complete children before parent, if present
|
||||
- Only parse JSON output
|
||||
- Never access `.beads/` directly
|
||||
- When creating, updating, or commenting on a bead, always escape JSON properly for bash
|
||||
- Comment during work (decisions, dead ends, discoveries)
|
||||
- Search past beads before starting
|
||||
- Always favor atomic actions
|
||||
- Good: complete_bead myproj bd-123
|
||||
- Bad: update_bead myproj bd-123 status closed
|
||||
|
||||
## Description Quality
|
||||
|
||||
Enable cold completion. Include:
|
||||
- Imperative verb + file path + `` `funcName()` `` or Acme address (`file:123,125` not `file:123-125`)
|
||||
- The goal is to enable cold completion of the task, without additional research or code exploration
|
||||
- Imperative verb + file path + `` `funcName()` `` or Acme file address (`/path/to/file:123,125` not `/path/to/file:123-125`)
|
||||
- "How" signal (following X, same as Y) + acceptance criterion (must/should/returns)
|
||||
- Backticked identifiers + cross-ref for >150 chars
|
||||
|
||||
Bypass lint: `IDEA:` prefix.
|
||||
Bypass lint: title has `IDEA:` prefix.
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
---
|
||||
name: denote
|
||||
intent: notes, documentation
|
||||
intent: notes, documentation, knowledge
|
||||
description: Denote file format conventions for timestamped notes. Use when creating, naming, or linking structured note files in the ~/doc/ hierarchy.
|
||||
---
|
||||
|
||||
|
|
@ -17,7 +17,7 @@ YYYYMMDDThhmmss--title-in-lowercase-alphanumeric__tag1_tag2_tagN.ext
|
|||
Components:
|
||||
- **Timestamp**: `date +%Y%m%dT%H%M%S` — ISO 8601 compact, seconds precision
|
||||
- **Title**: lowercase, alphanumeric characters and hyphens only (no spaces, no underscores)
|
||||
- **Tags**: lowercase alphanumeric, underscore-separated, after double-underscore, no hyphens in individual tags
|
||||
- **Tags**: lowercase alphanumeric, underscore-separated, after double-underscore. **CRITICAL**: Never use hyphens, underscores, or special characters in tag frontmatter!
|
||||
|
||||
Examples:
|
||||
- `20260128T133522--example-flow__ref.md`
|
||||
|
|
|
|||
Reference in New Issue