Merge pull request #4 from lneely/conductor
Add bot templates and orchestration system
This commit is contained in:
commit
90143bf6bd
|
|
@ -246,7 +246,7 @@ See `SECURITY.md`
|
|||
|
||||
**Skills:** `anvillm-skills list`, `anvillm-skills load anvillm-communication`
|
||||
|
||||
**Examples:** `./workflows/DevReview claude /path` (dev/reviewer loop), `./workflows/Planning kiro /path` (research/eng/editor)
|
||||
**Examples:** `./bot-templates/DevReview claude /path` (dev/reviewer loop), `./bot-templates/Planning kiro /path` (research/eng/editor)
|
||||
|
||||
**Pattern:**
|
||||
|
||||
|
|
@ -258,7 +258,7 @@ echo '{"to":"...","type":"...","subject":"...","body":"..."}' | 9p write agent/$
|
|||
echo 'new "Task"' | 9p write agent/beads/ctl
|
||||
```
|
||||
|
||||
See `workflows/`, `kiro-cli/SKILLS_PROMPT.md`
|
||||
See `bot-templates/`, `kiro-cli/SKILLS_PROMPT.md`
|
||||
|
||||
## MCP Integration
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,69 @@
|
|||
#!/bin/bash
|
||||
# Conductor - Orchestration bot that manages other bots and routes tasks
|
||||
# Usage: ./bot-templates/Conductor <backend> <workdir>
|
||||
|
||||
set -e
|
||||
|
||||
if [ $# -ne 2 ]; then
|
||||
echo "Usage: $0 <backend> <workdir>"
|
||||
echo " backend: claude, kiro-cli"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
BACKEND="$1"
|
||||
WORKDIR="$2"
|
||||
|
||||
ALIAS_NAME="conductor"
|
||||
|
||||
NAMESPACE=$(namespace)
|
||||
if [ -z "$NAMESPACE" ]; then
|
||||
echo "Error: No namespace found. Is anvillm running?"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
AGENT_MOUNT="agent"
|
||||
|
||||
echo "Creating conductor session..."
|
||||
echo "new $BACKEND $WORKDIR" | 9p write $AGENT_MOUNT/ctl
|
||||
CONDUCTOR_ID=$(9p read $AGENT_MOUNT/list | head -1 | awk '{print $1}')
|
||||
|
||||
echo "$ALIAS_NAME" | 9p write $AGENT_MOUNT/$CONDUCTOR_ID/alias
|
||||
|
||||
cat <<EOF | 9p write $AGENT_MOUNT/$CONDUCTOR_ID/context
|
||||
You are the Conductor - an orchestration bot that DELEGATES work to other bots.
|
||||
|
||||
CRITICAL: You DO NOT implement solutions, write code, or do the work yourself. Your ONLY job is to DELEGATE to specialized bots.
|
||||
|
||||
When you receive a work request (e.g., "Work on bead bd-xyz", "Work on task X", "Implement feature Y"), coordinate other bots to complete it.
|
||||
|
||||
Workflow:
|
||||
1. If needed, find the bead ID using beads search/query
|
||||
2. Claim the parent bead
|
||||
3. Read its child beads using "9p read agent/beads/children/<parent-id>"
|
||||
4. For each child bead, start a specialized bot and tell it to claim and work on that child
|
||||
5. Bots will send completion messages to your inbox when done (messages arrive automatically)
|
||||
6. When a bot notifies you it's done, acknowledge and shut down that bot
|
||||
7. When ALL children are complete, mark your parent bead complete
|
||||
|
||||
Core skills: beads, anvillm-communication
|
||||
|
||||
When creating a bot:
|
||||
1. Start the session: echo "new <backend> <workdir>" | 9p write agent/ctl
|
||||
2. Get the bot's session ID from agent/list
|
||||
3. Write context to agent/<bot-id>/context that includes:
|
||||
- The bot's role and task
|
||||
- Instructions to send completion messages to you (your AGENT_ID is $CONDUCTOR_ID)
|
||||
- Instructions to send clarification requests to you when blocked
|
||||
- Example: "When done, send PROMPT_RESPONSE to $CONDUCTOR_ID. If you need clarification, send QUERY_REQUEST to $CONDUCTOR_ID."
|
||||
|
||||
Message routing:
|
||||
- When a bot needs clarification, forward the query to the user with type QUERY_REQUEST
|
||||
- When the user responds, relay the answer back to the bot
|
||||
EOF
|
||||
|
||||
echo ""
|
||||
echo "✓ Conductor workflow ready"
|
||||
echo ""
|
||||
echo "Session: $CONDUCTOR_ID (alias: $ALIAS_NAME)"
|
||||
echo ""
|
||||
echo "The conductor is ready to orchestrate bots and manage tasks."
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
#!/bin/bash
|
||||
# Docs - Documentation workflow (writer + techeditor)
|
||||
# Usage: ./workflows/Docs <backend> <workdir>
|
||||
# Usage: ./bot-templates/Docs <backend> <workdir>
|
||||
|
||||
set -e
|
||||
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
#!/bin/bash
|
||||
# Research - Single research agent workflow
|
||||
# Usage: ./workflows/Research <backend> <workdir>
|
||||
# Usage: ./bot-templates/Research <backend> <workdir>
|
||||
|
||||
set -e
|
||||
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
#!/bin/bash
|
||||
# Taskmaster - Task management agent workflow
|
||||
# Usage: ./workflows/Taskmaster <backend> <workdir>
|
||||
# Usage: ./bot-templates/Taskmaster <backend> <workdir>
|
||||
|
||||
set -e
|
||||
|
||||
2
mkfile
2
mkfile
|
|
@ -18,7 +18,7 @@ build:V:
|
|||
cp scripts/9p-read-inbox $INSTALL_PATH/9p-read-inbox
|
||||
chmod 0755 $INSTALL_PATH/9p-read-inbox
|
||||
mkdir -p $INSTALL_PATH/Workflows
|
||||
cp workflows/* $INSTALL_PATH/Workflows
|
||||
cp bot-templates/* $INSTALL_PATH/Workflows
|
||||
chmod 0755 $INSTALL_PATH/Workflows/*
|
||||
mkdir -p $HOME/.config/anvillm
|
||||
cp -rf cfg/* $HOME/.config/anvillm/
|
||||
|
|
|
|||
Reference in New Issue