name: recipe_develop
description: "Develop one recipe — concept, headnote, ingredients, method, and variations."
debug: true
system: agent_prompt

skills:
  - guides/RecipeWritingGuide.md

agent_prompt:
  - "= identity.md"
  - "agent.rag.json"

sections:
  - agent
  - project
  - rag
  - skills
  - deliverables
  - message
  - rejection_feedback
  - instructions

steps:
  - type: think
    max_tokens: 4000
    hint: |
      Your task message describes the recipe to develop.

      Develop the complete recipe in this exact structure:

      # [Recipe Title]
      *[One-line descriptor — e.g. "A cozy weeknight pasta with crispy capers and lemon."]

      ## Headnote
      2–4 sentences that tell the story: why this recipe exists, what makes it special,
      and one practical tip the cook should know before they start. Sound like a friend
      who has made this dish many times. Personal, warm, specific.

      **Prep time:** [X] minutes
      **Cook time:** [X] minutes
      **Total time:** [X] minutes
      **Yield:** [X servings]
      **Difficulty:** Easy / Medium / Hard

      ## Ingredients
      List in order of use. Use standard measurements (cups, tbsp, tsp, oz, g).
      Group into sections (e.g., For the sauce, For the base) if needed.
      - [quantity] [ingredient], [preparation note if needed]

      ## Method
      Numbered steps. Each step is one distinct action. Short sentences.
      No step should contain more than two actions. Include temperature, timing,
      and sensory cues (e.g., "until golden and fragrant, about 3 minutes").

      ## Variations
      Provide 2–3 variations:
        - **Make it vegan/vegetarian**: ...
        - **Make it gluten-free**: ...
        - **Swap for [seasonal/budget alternative]**: ...

      ## Storage & Reheating
      One short paragraph.

      ## Pairing Suggestion (optional)
      One sentence if appropriate (wine, side dish, occasion).

  - type: think
    model: power
    hint: |
      Review the recipe critically as a professional recipe developer and editor:

        - Is the headnote specific and personal, not generic?
        - Are the ingredient quantities realistic and consistent throughout?
        - Are the method steps truly one-action-per-step?
        - Do the sensory cues (color, smell, texture) help a home cook know when to proceed?
        - Are the variations genuinely useful and clearly explained?
        - Is the title specific and appetizing (not "Easy Pasta" — be evocative)?
        - Is the format clean and scannable?

      Rewrite the COMPLETE final recipe incorporating all improvements.
      Output ONLY the polished recipe starting with # [Recipe Title]. No commentary.

  - type: document
    filename: "{{task_name_slug}}"

  - type: close
    rag_update: true

adjudication:
  enabled: true
  pass_threshold: 80
  deliverable_type: consumer
  criteria:
    completeness:
      weight: 30
      description: "All required sections present: headnote, ingredients, method, variations"
    clarity:
      weight: 30
      description: "Instructions are unambiguous and executable by a home cook"
    voice:
      weight: 25
      description: "Headnote is warm, personal, and specific — not generic"
    precision:
      weight: 15
      description: "Measurements, times, and sensory cues are accurate and consistent"
