name: blog_research
description: "Research a blog topic — live web search + synthesis + spawn a blog_write task."
debug: true
system: agent_prompt

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

sections:
  - agent
  - project
  - history
  - rag
  - prior_results
  - message
  - instructions

builders:
  prior_results: |
    *** WEB SEARCH RESULTS ***
    {steps[1].text}

    (If the above is empty, use your expert training knowledge to answer this question.)

steps:
  - type: think
    hint: |
      You are researching a blog topic for the project described above.

      Read the project description and current message carefully.
      Identify the single best search query to find current, real-world information
      or recent discussion on this topic.

      State your reasoning, then on the last line write:
      SEARCH QUERY: [your query here]

      Query rules: 3–8 words. Specific. Current year preferred.

  - type: tool
    capability: Tool_WebSearcher
    input_from: last_text

  - type: think
    hint: |
      Using the search results above (or your training knowledge if unavailable),
      write a CONTENT BRIEF for this blog post.

      Structure the brief as:
        TOPIC: [clear one-line topic statement]
        TARGET READER: [who is this for — one sentence]
        THE HOOK: [the real problem or curiosity that opens the article]
        THE PROMISE: [the one thing the reader walks away knowing or able to do]
        KEY POINTS: [3–5 specific, concrete points to cover]
        TONE: [voice and register — e.g. "conversational, peer-to-peer", "authoritative and warm"]
        WORD COUNT TARGET: [800–2000 words depending on depth]
        CALL TO ACTION: [one concrete thing the reader can do this week]
        SOURCES: [any key URLs or references from the search results]

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

  - type: spawn
    task_type: blog_write
    task_name: "Write Blog: {project.name}"
    agent: Iris
    prompt_from: last_text

  - type: close
    rag_update: true

adjudication:
  enabled: true
  pass_threshold: 65
  deliverable_type: coordination
  criteria:
    accuracy:
      weight: 35
      description: "Facts are correct and verifiable"
    thoroughness:
      weight: 30
      description: "Topic covered with sufficient depth and specificity"
    source_quality:
      weight: 20
      description: "Sources are credible and relevant"
    organization:
      weight: 15
      description: "Brief is well-structured and actionable"
