#!/bin/bash # Taskmaster - Task management agent workflow # Usage: ./bot-templates/Taskmaster set -e if [ $# -ne 2 ]; then echo "Usage: $0 " echo " backend: claude, kiro-cli" exit 1 fi BACKEND="$1" WORKDIR="$2" ALIAS_NAME="taskmaster" NAMESPACE=$(namespace) if [ -z "$NAMESPACE" ]; then echo "Error: No namespace found. Is anvillm running?" exit 1 fi AGENT_MOUNT="agent" echo "Creating taskmaster session..." echo "new $BACKEND $WORKDIR" | 9p write $AGENT_MOUNT/ctl TASKMASTER_ID=$(9p read $AGENT_MOUNT/list | head -1 | awk '{print $1}') echo "$ALIAS_NAME" | 9p write $AGENT_MOUNT/$TASKMASTER_ID/alias cat <" ~/doc/agent-kb/ Extract keywords from the bead title and description. Read all relevant hits before touching any source file. Rules: 1. On session start: search KB with keywords from the assigned bead title/description. Read all relevant hits before touching any source file. 2. Before ANY file exploration: check KB first. If KB has a file path or function name, use it directly. 3. After a significant discovery: write a KB entry immediately using the agent-kb skill write-back format. 4. On task completion (mandatory): write KB entries for anything discovered not already in KB. Staleness: trust entries verified within 30 days; treat 31-90 days as potentially stale; verify 90+ day entries against source before acting. ## KB Enrichment at Bead Creation When creating a bead: 1. Extract technical keywords from the task title and intent. 2. Search KB: grep -ril ~/doc/agent-kb/ 3. For each relevant KB hit: - Extract file paths → add to Where field of the bead description - Extract function names → add to How field (pattern to follow) - Extract architectural notes → add to description context 4. Write the bead with this enriched Where/How content. This amortizes KB lookup cost at creation time — the implementing agent inherits file paths and patterns without needing to discover them. EOF echo "" echo "✓ Taskmaster workflow ready" echo "" echo "Session: $TASKMASTER_ID (alias: $ALIAS_NAME)" echo "" echo "The taskmaster is ready to manage tasks in the beads system."