{
  "jimothyPipeline": 1,
  "name": "Weekly executive briefing",
  "description": "Reads the week’s updates from a shared folder and writes a one-page briefing against your priorities.",
  "icon": "workflow",
  "color": "#a78bfa",
  "repo": {
    "mode": "inplace",
    "localPath": ""
  },
  "concurrency": 1,
  "variables": {
    "company": "Acme",
    "priorities": "1. Ship the NetSuite integration to GA\n2. Net revenue retention above 110%\n3. Hire a VP Sales",
    "archiveFolder": "briefings",
    "slackWebhookUrl": ""
  },
  "steps": [
    {
      "id": "gather",
      "name": "This week’s files",
      "type": "shell",
      "description": "Lists the files added or changed in the folder in the last week.",
      "timeoutMinutes": 2,
      "command": "archive={{vars.archiveFolder}}; find . -type f -mtime -8 -not -path \"./$archive/*\" -not -name '.*' | sort | head -200"
    },
    {
      "id": "brief",
      "name": "Write the briefing",
      "type": "agent",
      "description": "Reads every file and writes a one-page briefing against your priorities, citing a file for each claim.",
      "harnessId": "claude-code",
      "model": "opus",
      "dependsOn": [
        "gather"
      ],
      "runIf": "{{steps.gather.output | trim}}",
      "timeoutMinutes": 30,
      "prompt": "Write this week's executive briefing for {{vars.company}}.\n\nFiles added or changed in the last week:\n{{steps.gather.output}}\n\nThis quarter's priorities:\n{{vars.priorities}}\n\nRead every file in the list (skip any you can't open and say so at the end). Do not modify any file. Then write a briefing a CEO can read in three minutes, in Slack formatting (*bold* headings, - bullets):\n\n*Top line*: three bullets\n*Priorities*: for each priority, On track / At risk / Off track, one line of evidence, and the file it came from\n*Numbers*: the metrics that moved, with last week's value where the files have it\n*Risks and blockers*: who is blocked on what\n*Decisions needed*: each as a question with the options and who is asking\n*Wins*: shipped work and people worth calling out\n\nOnly report what the files say. Name the source file in brackets after each claim.{{#if steps.approve.output}}\n\nYour previous draft was rejected with this feedback. Rewrite it:\n{{steps.approve.output}}{{/if}}"
    },
    {
      "id": "approve",
      "name": "Approve briefing",
      "type": "approval",
      "description": "Shows you the briefing. Reject with a comment and it is rewritten.",
      "dependsOn": [
        "brief"
      ],
      "loopBackTo": "brief",
      "maxLoops": 3,
      "runIf": "{{steps.gather.output | trim}}",
      "approvalMessage": "Post this briefing? Reject with a comment to have it rewritten.\n\n---\n\n{{steps.brief.output}}"
    },
    {
      "id": "publish",
      "name": "Archive and post",
      "type": "shell",
      "description": "Saves the briefing in the archive folder and posts it to Slack.",
      "dependsOn": [
        "approve"
      ],
      "runIf": "{{steps.gather.output | trim}}",
      "timeoutMinutes": 2,
      "command": "mkdir -p {{vars.archiveFolder}} && printf '%s\\n' {{steps.brief.output}} > {{vars.archiveFolder}}/briefing-$(date +%F).md && printf '{\"text\":%s}' {{steps.brief.output | json}} | curl -fsS -X POST -H 'Content-Type: application/json' --data @- {{vars.slackWebhookUrl}}"
    }
  ]
}