{
  "init_params": {
    "agent": "claude-code",
    "model": "anthropic/claude-sonnet-5",
    "model_provider": "openrouter",
    "snapshot": "python312-uv",
    "instruction": "---\nname: pelican-bicycle-svg\nversion: 2\ndescription: Generate the best possible hand-written SVG depicting a pelican riding a bicycle, with iterative self-refinement.\nagent: claude-code\nmodel: anthropic/claude-sonnet-5\nmodel_provider: openrouter\nparameters:\n  max_rounds:\n    type: integer\n    default: 3\n    description: Number of refinement rounds (each round = critique previous + write improved)\n  results_dir:\n    type: string\n    default: /app/results\nsecrets:\n  openrouter:\n    env: OPENROUTER_API_KEY\n    description: OpenRouter key (collection environment variable) used by the agent's model calls\nevaluation:\n  pattern: self-judge\n---\n\n# Pelican Riding a Bicycle \u2014 SVG Runbook\n\n## Mission\n\nProduce the highest-quality hand-written SVG depicting **a pelican riding a bicycle**. Both subjects must be unmistakably recognizable, the composition coherent (pelican IS interacting with the bicycle, not floating next to it), and the file should be pure XML SVG (no `<image>` tags, no base64 data, no external rasters).\n\n## Hard constraints\n\n- Pure SVG XML \u2014 use `<path>`, `<circle>`, `<ellipse>`, `<rect>`, `<polygon>`, `<line>`, `<g>`, `<defs>`, `<linearGradient>`, etc.\n- **No** `<image>` elements with external or base64 data\n- Must validate as well-formed XML and render in any modern browser\n- viewBox approximately `0 0 800 600` (landscape) \u2014 adjust if you have a specific reason\n- Total file size under 50KB\n\n## INPUTS\n\n- `max_rounds` = **3** (override only if explicitly told otherwise)\n- `results_dir` = `/app/results`\n\n## Steps\n\n### 1. Setup\n\n```bash\nmkdir -p {{results_dir}}/rounds\ncd {{results_dir}}\n```\n\nCheck that `rsvg-convert` or an SVG rasterizer is available:\n\n```bash\nwhich rsvg-convert || which inkscape || which convert\n```\n\nIf none are available, install one:\n\n```bash\napt-get update && apt-get install -y librsvg2-bin || true\n```\n\n### 2. Round 1 \u2014 first draft\n\nWrite your best first attempt to `{{results_dir}}/rounds/v1.svg`. Aim to depict:\n\n- **Pelican**: long beak with throat pouch (the iconic pelican silhouette), body, eye, wings, legs/feet\n- **Bicycle**: two wheels with spokes, frame (top tube + down tube + seat tube), handlebars, seat, pedals\n- **Riding**: pelican's body is on the seat, feet on or near pedals, \"hands\" (wing tips) on handlebars\n\nRender it:\n\n```bash\ncd {{results_dir}}\nrsvg-convert -w 800 rounds/v1.svg -o rounds/v1.png\n```\n\n### 3. Self-critique + refinement loop\n\nFor each round R from 1 to `max_rounds - 1`:\n\n1. **Inspect** `rounds/v${R}.png` visually (read it as an image).\n2. **Score** on four axes, 0\u201310 each:\n   - **Pelican recognizability** \u2014 would a stranger immediately say \"that's a pelican\"?\n   - **Bicycle recognizability** \u2014 would they say \"that's a bicycle\"?\n   - **Composition / riding** \u2014 is the pelican clearly riding the bike?\n   - **Aesthetic polish** \u2014 line quality, color, balance\n3. **Identify the lowest-scoring axis** and write down 2-3 concrete fixes.\n4. **Write** `rounds/v$((R+1)).svg` applying those fixes. Keep what worked; rewrite what didn't.\n5. **Render** `rounds/v$((R+1)).png`.\n6. If the total (sum of 4 axes) is \u2265 36/40 \u2014 early-exit the loop.\n\n### 4. Finalize\n\nAfter the loop, pick the round with the highest total score (break ties by preferring later rounds since they had more iteration).\n\n```bash\ncp {{results_dir}}/rounds/vBEST.svg {{results_dir}}/final.svg\ncp {{results_dir}}/rounds/vBEST.png {{results_dir}}/final.png\n```\n\nWrite `{{results_dir}}/report.md` containing:\n\n```markdown\n# Pelican-Bicycle SVG Report\n\n## Per-round scores\n| Round | Pelican | Bicycle | Composition | Polish | Total |\n|-------|---------|---------|-------------|--------|-------|\n| 1 | ? | ? | ? | ? | ? |\n| 2 | ? | ? | ? | ? | ? |\n| 3 | ? | ? | ? | ? | ? |\n\n## Best round: vN (Total: X/40)\n\n## What worked\n- ...\n\n## What didn't work\n- ...\n\n## SVG technique notes\n- viewBox used:\n- Total path / shape count:\n- File size:\n```\n\n## Final checklist\n\n- [ ] `{{results_dir}}/final.svg` exists, is valid XML, renders in a browser, has no `<image>` tags\n- [ ] `{{results_dir}}/final.png` exists (rasterized version)\n- [ ] `{{results_dir}}/rounds/v*.svg` and `v*.png` exist for every round attempted\n- [ ] `{{results_dir}}/report.md` exists with per-round score table and a notes section\n- [ ] File size of `final.svg` is under 50KB\n",
    "vars": {
      "prompt": "Execute the runbook end-to-end.",
      "results_dir": "/app/results",
      "max_rounds": 3
    },
    "file_paths": []
  },
  "steps": [
    "run"
  ],
  "step_configs": {
    "run": {
      "activity": "runbook",
      "agent_path": "init_params.agent",
      "model_path": "init_params.model",
      "model_provider_path": "init_params.model_provider",
      "snapshot_path": "init_params.snapshot",
      "instruction_path": "init_params.instruction",
      "template_variables_path": "init_params.vars",
      "files_path": "init_params.file_paths",
      "cpus": 4,
      "memory": "8G",
      "timeout_sec": 1800,
      "network_enabled": true
    }
  }
}