#!/bin/bash
cd /Users/dorian/Projects/archy

# Default to the pentest fix plan; override with $1
PLAN="${1:-.claude/plans/reflective-meandering-castle.md}"

while true; do
  claude -p "Read $PLAN — execute the next task not marked [DONE]. After completing, deploy with ./scripts/deploy-to-target.sh --live, mark it [DONE] in the plan file, commit and push. If all tasks are [DONE], run ./scripts/verify-pentest-fixes.sh to validate, write a summary report and exit." \
    --max-turns 50 \
    --allowedTools "Edit,Write,Bash,Read,Glob,Grep,Agent,WebFetch,WebSearch"

  echo "--- Loop iteration complete, restarting in 10s ---"
  sleep 10
done
