name: ai_article_write
description: "Write one standalone article from a brief — draft, polish, deliver."
debug: true
system: agent_prompt

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

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

steps:
  - type: think
    max_tokens: 4000
    hint: |
      Your task message contains the article brief. Follow it exactly.

      Before writing, confirm: title, target reader, hook, promise, key points, call to action.

      Write the full article:
        - # Title as H1
        - One-line subhead
        - Opening hook: first sentence drops reader into a real scenario
        - 3-4 body sections with bold subheadings, short paragraphs
        - At least one concrete number (dollars, time, percentage) per section
        - "Try This Week" section: one specific, free or low-cost action
        - Memorable closing line

      Peer-to-peer tone. Not a pitch. Not a lecture.
      Word count: 800-1000 words.

  - type: think
    max_tokens: 4000
    model: power
    hint: |
      Read your draft as the target reader would on their phone.

      Cut warmup. Cut vague generalities. Cut brochure-speak.
      Every paragraph earns its place or it goes.
      Call to action must be doable this week.
      Word count 800-1000.

      Output ONLY the polished final article starting with # [Title]. No commentary.

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

  - type: close
    rag_update: true
adjudication:
  enabled: true
  pass_threshold: 80
  deliverable_type: consumer
  criteria:
    hook_strength:
      weight: 30
      description: "Opening immediately engages the target reader"
    prose_quality:
      weight: 25
      description: "Writing is clear, direct, and human — no brochure-speak"
    substance:
      weight: 25
      description: "Content is specific, accurate, and backed by real examples"
    structure:
      weight: 20
      description: "Logical flow with clear sections and strong closing"
