#!/bin/bash # DevReview - Developer-Reviewer Workflow # Usage: ./scripts/DevReview set -e if [ $# -ne 2 ]; then echo "Usage: $0 " echo " backend: claude, kiro-cli" exit 1 fi BACKEND="$1" PROJECT_PATH="$2" PROJECT_NAME=$(basename "$PROJECT_PATH") # Generate a random short identifier 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}" echo "Setting up Developer-Reviewer workflow for: $PROJECT_NAME" echo "Project path: $PROJECT_PATH" echo "Session alias: $ALIAS_NAME" NAMESPACE=$(namespace) if [ -z "$NAMESPACE" ]; then echo "Error: No namespace found. Is anvillm running?" exit 1 fi AGENT_MOUNT="agent" echo "Creating developer session..." before=$(9p read $AGENT_MOUNT/list | awk '{print $1}' | sort) echo "new $BACKEND $PROJECT_PATH role=developer tasks=git,editor,go,rust,python,nodejs,docker,podman,maven,gradle,plan9,gpg,github-cli" | 9p write $AGENT_MOUNT/ctl after=$(9p read $AGENT_MOUNT/list | awk '{print $1}' | sort) DEV_ID=$(comm -13 <(echo "$before") <(echo "$after") | head -1) echo "Developer session ID: $DEV_ID" echo "Creating reviewer session..." before=$(9p read $AGENT_MOUNT/list | awk '{print $1}' | sort) echo "new $BACKEND $PROJECT_PATH role=reviewer tasks=git,github-cli,plan9" | 9p write $AGENT_MOUNT/ctl after=$(9p read $AGENT_MOUNT/list | awk '{print $1}' | sort) REVIEWER_ID=$(comm -13 <(echo "$before") <(echo "$after") | head -1) echo "Reviewer session ID: $REVIEWER_ID" # Set aliases echo "Setting aliases..." echo "${ALIAS_NAME}-dev" | 9p write $AGENT_MOUNT/$DEV_ID/alias echo "${ALIAS_NAME}-reviewer" | 9p write $AGENT_MOUNT/$REVIEWER_ID/alias # Set developer context cat < /tmp/msg.json <<'ENDMSG' {"to":"abc123","type":"REVIEW_REQUEST","subject":"Code review","body":"Please review the staged changes"} ENDMSG Then: 9p write agent/xyz789/outbox/msg-$(date +%s).json < /tmp/msg.json 5. Wait for the reviewer's response 6. If you receive "LGTM" from the reviewer, you're done 7. If you receive suggested changes, implement them and repeat from step 2 ## Communication Protocol: - Use the peer-bot skill to discover peer agents AND to send messages - Follow the peer-bot skill instructions for sending messages via the mailbox system (outbox/inbox) - DO NOT write directly to agent/{id}/in - use the mailbox system as documented in peer-bot skill - You will receive messages from the reviewer in your input stream Stop working and wait for the reviewer's response after sending the review request. Remember: You are working collaboratively with the reviewer to ensure code quality. EOF # Set reviewer context cat < /tmp/msg.json < /tmp/msg.json <