{
  "id": "feedback_loop",
  "name": "Quality Feedback",
  "description": "Rating scale with open feedback. Agent generates something (content, code, analysis) and asks a human to rate it and provide improvement suggestions.",
  "pattern": "feedback_loop",
  "fields": [
    {
      "name": "rating",
      "label": "Overall quality",
      "type": "select",
      "required": true,
      "options": ["5 — Excellent", "4 — Good", "3 — Acceptable", "2 — Needs work", "1 — Poor"]
    },
    {
      "name": "strengths",
      "label": "What worked well",
      "type": "textarea",
      "required": false,
      "placeholder": "What should be kept or repeated..."
    },
    {
      "name": "improvements",
      "label": "What to improve",
      "type": "textarea",
      "required": false,
      "placeholder": "Specific suggestions for improvement..."
    },
    {
      "name": "proceed",
      "label": "Next step",
      "type": "select",
      "required": true,
      "options": ["Use as-is", "Revise based on feedback", "Try a different approach"]
    }
  ],
  "metadata": {
    "agent_context": "Include what the agent generated and what aspect is being evaluated",
    "webhook_handler": "Rating >= 4 + 'Use as-is' → accept output. 'Revise based on feedback' → loop with improvements field. 'Try different approach' → reset and regenerate."
  },
  "example_payload": {
    "rating": "4 — Good",
    "strengths": "Clear structure, good examples",
    "improvements": "Add more detail to the implementation section",
    "proceed": "Revise based on feedback"
  }
}
