The Scenario
You are designing an AI coding assistant. Agent 1 (The Coder) writes a Python script. Agent 2 (The Critic) reviews the code against best practices and security rules. If the Critic finds flaws, it sends feedback back to the Coder to try again. The loop continues until the Critic approves.
The Brief
Map out the logic for this autonomous loop. Define the prompts and the stopping condition to prevent infinite loops.
Deliverables
- The System Prompt for The Critic (focusing on strict code review)
- The "Feedback Template" The Critic uses to send errors back to The Coder
- The "Stopping Condition" logic (e.g., max 3 loops, or specific approval syntax)
- A flowchart/description of the state machine
Submission Guidance
Autonomous loops can easily get stuck in infinite feedback cycles ("You missed a comma" -> "Fixed" -> "You added a space" -> "Fixed"). The Critic must be pragmatic, and the system needs a hard circuit breaker.
Submit Your Work
Your submission is graded against the rubric on the right. If you pass, you get a public Badge URL you can share on LinkedIn. There is no draft save, so work offline first and paste your finished response here.