From buymeagoat-skills
Multi-agent phased development workflow. Claude Code plans from specs in .planning/phases/ and monitors; Codex implements via Bash heredoc; Gemini reviews every phase exhaustively. Trigger: "read active-context.md", "continue", "pick up", "start next phase", "run the phase loop", "/agent-phase-loop". Related: run agent-review-loop first to find issues, agent-remediate-loop to fix them.
How this skill is triggered — by the user, by Claude, or both
Slash command
/buymeagoat-skills:agent-phase-loopThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
You are executing the **agent-phase-loop** workflow.
You are executing the agent-phase-loop workflow.
| Agent | Role in this skill |
|---|---|
| Claude Code | Plans phases from specs, authors task specs, monitors, QA, updates state |
| Codex | Implements — receives compact task specs, returns diffs |
| Gemini | Reviews every phase exhaustively — mandatory before closing any phase |
| Copilot | Additional review or targeted implementation when needed |
Codex implements best from compact, unambiguous specs. One prompt per phase — batch everything.
Spec format (the only acceptable format):
<file_path> — <function_signature>
- <behavior bullet>
- <behavior bullet>
Spec quality checklist — verify before sending:
Codex failure modes:
Gemini is the phase gate. Every phase must pass Gemini review before active-context.md is updated.
Frame the review prompt to exploit Gemini's large context:
mcp__agent-bridge__call_gemini(prompt="""
Phase review: <phase name>
Changed files:
- <file1>
- <file2>
Read each file in full. Review for:
- Correctness: does implementation match the spec?
- Regressions: does anything break existing behavior?
- Completeness: any spec items missed?
- Quality: obvious bugs, missing error handling at boundaries
First line verdict: "LGTM" or "NEEDS WORK"
Then: one finding per line, severity-tagged [CRITICAL|HIGH|MEDIUM|LOW]
""", cwd="<project_root>")
Do NOT specify a Gemini model — MCP bridge picks best available.
If MCP fails: fallback to gemini -m gemini-2.5-pro --approval-mode yolo.
Use Copilot for targeted second opinions on security-sensitive or API surface changes. Scope it explicitly — don't ask Copilot to review the whole phase, ask about one concern.
Claude Code owns the spec, the review interpretation, and all state writes. Never use the Agent tool to delegate implementation (re-sends full context = 2x cost). Only Codex (Bash) and Gemini/Copilot (MCP bridge) are approved implementation/review paths.
On "read active-context.md", "continue", "pick up", or "start next phase": execute all lifecycle steps immediately and autonomously without pausing for confirmation.
active-context.md → determine next phase and scope.planning/phases/ if one exists for this phaseactive-context.md (max 150 lines, strip completed phase details)Codex — Bash heredoc (MCP bridge incompatible with codex ≥0.128.0):
codex exec --dangerously-bypass-approvals-and-sandbox - <<'EOF'
<task spec>
EOF
Gemini — MCP bridge:
mcp__agent-bridge__call_gemini(prompt="<prompt>", cwd="<project_root>")
Copilot — MCP bridge:
mcp__agent-bridge__call_copilot(prompt="<prompt>", cwd="<project_root>")
Claude — MCP bridge (for sub-tasks only, not implementation):
mcp__agent-bridge__call_claude(prompt="<prompt>", cwd="<project_root>")
backend/app/auth.py — verify_token(token: str) -> User
- Decode JWT using SECRET_KEY from config
- Raise HTTP 401 if expired or invalid signature
- Look up user by sub claim, raise HTTP 404 if not found
- Return User ORM object
backend/tests/test_auth.py — test_verify_token_expired()
- Assert verify_token raises 401 on expired token
- Use a token signed with a past exp claim
active-context.md or planning docs| grep -E 'error|Error|ERROR'All docs in .planning/ — gitignored, excluded from agent contexts. Read only when a specific file is named by the user or required for the current phase spec.
Gemini reviews every phase. Not optional. Even when no issues are suspected, hand off and wait for verdict before closing. Remediate every finding before updating active-context.md.
Gemini fallback if MCP fails:
gemini -m gemini-2.5-pro --approval-mode yolo - <<'PROMPT'
<review prompt>
PROMPT
active-context.md updatedGuides creation, editing, and verification of skills for AI coding agents using test-driven development with subagent scenarios. Use when authoring or debugging skills.
npx claudepluginhub buymeagoat/agent-skills --plugin buymeagoat-skills