updates to workflows and roles

This commit is contained in:
Levi Neely 2026-02-16 08:48:04 +01:00
parent 2a6e2f7ce9
commit 9936792d6b
4 changed files with 138 additions and 6 deletions

View File

@ -1,6 +1,7 @@
# Architect role: access to knowledge base and planning documents
filesystem:
ro:
- "{CWD}"
- "{XDG_DOCUMENTS_DIR}/agent-kb"
- "{HOME}/doc/agent-kb"
rw:

8
mkfile
View File

@ -10,12 +10,8 @@ build:V:
cp scripts/Alog $INSTALL_PATH/Alog
chmod 0755 $INSTALL_PATH/Alog
mkdir -p $INSTALL_PATH/Workflows
cp workflows/DevReview $INSTALL_PATH/Workflows/DevReview
chmod 0755 $INSTALL_PATH/Workflows/DevReview
cp workflows/DevReviewQA $INSTALL_PATH/Workflows/DevReviewQA
chmod 0755 $INSTALL_PATH/Workflows/DevReviewQA
cp workflows/Planning $INSTALL_PATH/Workflows/Planning
chmod 0755 $INSTALL_PATH/Workflows/Planning
cp workflows/* $INSTALL_PATH/Workflows
chmod 0755 $INSTALL_PATH/Workflows/*
mkdir -p $HOME/.config/anvillm
cp -rf cfg/* $HOME/.config/anvillm/

82
workflows/Docs Executable file
View File

@ -0,0 +1,82 @@
#!/bin/bash
# Docs - Documentation workflow (writer + techeditor)
# Usage: ./workflows/Docs <backend> <workdir>
set -e
if [ $# -ne 2 ]; then
echo "Usage: $0 <backend> <workdir>"
echo " backend: claude, kiro-cli"
exit 1
fi
BACKEND="$1"
DOC_PATH="$2"
RANDOM_WORD=$(shuf -n1 -e alpha beta gamma delta zeta theta kappa sigma omega lambda)
RANDOM_NUM=$(printf "%02d" $((RANDOM % 100)))
ALIAS_PREFIX="${RANDOM_WORD}${RANDOM_NUM}"
NAMESPACE=$(namespace)
if [ -z "$NAMESPACE" ]; then
echo "Error: No namespace found. Is anvillm running?"
exit 1
fi
AGENT_MOUNT="agent"
echo "Creating writer session..."
before=$(9p read $AGENT_MOUNT/list | awk '{print $1}' | sort)
echo "new $BACKEND $DOC_PATH role=writer tasks=git,plan9" | 9p write $AGENT_MOUNT/ctl
after=$(9p read $AGENT_MOUNT/list | awk '{print $1}' | sort)
WRITER_ID=$(comm -13 <(echo "$before") <(echo "$after") | head -1)
echo "Creating techeditor session..."
before=$(9p read $AGENT_MOUNT/list | awk '{print $1}' | sort)
echo "new $BACKEND $DOC_PATH role=techeditor tasks=git,plan9" | 9p write $AGENT_MOUNT/ctl
after=$(9p read $AGENT_MOUNT/list | awk '{print $1}' | sort)
EDITOR_ID=$(comm -13 <(echo "$before") <(echo "$after") | head -1)
echo "${ALIAS_PREFIX}-writer" | 9p write $AGENT_MOUNT/$WRITER_ID/alias
echo "${ALIAS_PREFIX}-techeditor" | 9p write $AGENT_MOUNT/$EDITOR_ID/alias
cat <<EOF | 9p write $AGENT_MOUNT/$WRITER_ID/context
Your job is to write and update documentation in $DOC_PATH.
You will receive review feedback from the techeditor. Apply changes and send acknowledgment using shell tool:
cat > /tmp/msg.json <<'ENDMSG'
{"to":"$EDITOR_ID","type":"STATUS_UPDATE","subject":"Changes applied","body":"YOUR_ACKNOWLEDGMENT"}
ENDMSG
9p write agent/$WRITER_ID/outbox/msg-\$(date +%s).json < /tmp/msg.json
Replace YOUR_ACKNOWLEDGMENT with actual acknowledgment
Do not actively await responses, but stop working until you receive an explicit request.
EOF
cat <<EOF | 9p write $AGENT_MOUNT/$EDITOR_ID/context
You are a professional technical editor. Ensure documentation in $DOC_PATH is high quality, readable, and at the right detail level.
Do not edit documents directly. Send recommended changes to the writer using shell tool:
cat > /tmp/msg.json <<'ENDMSG'
{"to":"$WRITER_ID","type":"REVIEW_REQUEST","subject":"Documentation review","body":"YOUR_RECOMMENDATIONS"}
ENDMSG
9p write agent/$EDITOR_ID/outbox/msg-\$(date +%s).json < /tmp/msg.json
Replace YOUR_RECOMMENDATIONS with actual recommendations
When the writer acknowledges, proofread again. Iterate until satisfied.
Do not actively await responses, but stop working until you receive an explicit request.
EOF
echo ""
echo "✓ Documentation workflow ready ($ALIAS_PREFIX)"
echo ""
echo "Sessions:"
echo " ${ALIAS_PREFIX}-writer: $WRITER_ID"
echo " ${ALIAS_PREFIX}-techeditor: $EDITOR_ID"
echo ""
echo "Give the writer a documentation task, or techeditor a document to review."

53
workflows/Research Executable file
View File

@ -0,0 +1,53 @@
#!/bin/bash
# Research - Single research agent workflow
# Usage: ./workflows/Research <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"
RANDOM_WORD=$(shuf -n1 -e alpha beta gamma delta zeta theta kappa sigma omega lambda)
RANDOM_NUM=$(printf "%02d" $((RANDOM % 100)))
ALIAS_NAME="${RANDOM_WORD}${RANDOM_NUM}-research"
NAMESPACE=$(namespace)
if [ -z "$NAMESPACE" ]; then
echo "Error: No namespace found. Is anvillm running?"
exit 1
fi
AGENT_MOUNT="agent"
echo "Creating research session..."
before=$(9p read $AGENT_MOUNT/list | awk '{print $1}' | sort)
echo "new $BACKEND $WORKDIR role=research tasks=plan9" | 9p write $AGENT_MOUNT/ctl
after=$(9p read $AGENT_MOUNT/list | awk '{print $1}' | sort)
RESEARCH_ID=$(comm -13 <(echo "$before") <(echo "$after") | head -1)
echo "$ALIAS_NAME" | 9p write $AGENT_MOUNT/$RESEARCH_ID/alias
cat <<EOF | 9p write $AGENT_MOUNT/$RESEARCH_ID/context
Your job is to research system architecture and code. Use the agent-kb skill to query and update the knowledge base.
- Search existing knowledge base documents for relevant information
- Analyze code and documentation in $WORKDIR
- Create or update KB documents with your findings
- Prefer updating existing documents over creating new ones
- Only create new KB documents for significant, reusable knowledge
Focus on providing concrete, actionable information that helps understand the system.
EOF
echo ""
echo "✓ Research workflow ready"
echo ""
echo "Session: $RESEARCH_ID (alias: $ALIAS_NAME)"
echo ""
echo "Give the research agent a topic to investigate."