Skip to main content
T4 epic · founders / executives — the flagship. Three branches gather in parallel (web signal, repo pulse, the KPI sheet), jq does the revenue arithmetic, a thinking model writes the brief — and nika:inspect view: cost puts the run’s own bill in the ping. A workflow that reports what it cost you is a workflow you trust on a schedule.

The job

Monday needs one page: market, product, numbers, risks, the ONE decision. Assembling it eats an hour of founder time. This file assembles it before you wake — dated filename, summed revenue, and a webhook ping ending in run cost $0.14.

The shape

The file

t4-ceo-monday-brief.nika.yaml
nika: v1
workflow: ceo-monday-brief
description: "news + repo pulse + KPIs → thinking synthesis → dated brief + cost ping"

model: mistral/mistral-large

vars:
  watch_query: "AI workflow engines"
  kpi_csv: "./finance/kpis.csv"

secrets:
  founders_webhook:
    source: env
    key: FOUNDERS_WEBHOOK_URL
    egress:                       # sanction the one send · the secret IS the URL
      - to: "nika:notify"
        host_from_self: true

tasks:
  # ── branch 1 · market signal ──
  - id: news
    invoke:
      tool: "nika:fetch"
      args:
        url: "https://hn.algolia.com/api/v1/search?query=${{ vars.watch_query }}"
        mode: jq
        jq: ".hits[:10] | map(.title)"

  # ── branch 2 · engineering pulse ──
  - id: pulse
    exec:
      command: "git shortlog -sn --since='1 week ago'"

  # ── branch 3 · the numbers ──
  - id: kpi_raw
    invoke:
      tool: "nika:read"
      args: { path: "${{ vars.kpi_csv }}" }

  - id: kpis
    depends_on: [kpi_raw]
    invoke:
      tool: "nika:convert"
      args:
        input: "${{ tasks.kpi_raw.output }}"
        from: csv
        to: json
        has_header: true

  - id: revenue
    depends_on: [kpis]
    invoke:
      tool: "nika:jq"
      args:
        input: "${{ tasks.kpis.output }}"
        expression: "map(.weekly_revenue | tonumber) | add"

  # ── synthesis · with a thinking budget ──
  - id: brief
    depends_on: [news, pulse, kpis, revenue]
    infer:
      model: anthropic/claude-sonnet-4-6   # per-task override · thinking budget
      prompt: |
        Market signal · ${{ tasks.news.output }}
        Engineering pulse · ${{ tasks.pulse.output }}
        KPIs · ${{ tasks.kpis.output }}
        Revenue (summed) · ${{ tasks.revenue.output }}

        Write my Monday brief · 5 sections · market · product ·
        numbers · risks · the ONE decision this week needs.
      thinking:
        enabled: true
        budget_tokens: 10000

  - id: stamp
    invoke:
      tool: "nika:date"
      args: { op: now }
    output:
      day: ".iso[:10]"               # YYYY-MM-DD from the ISO timestamp

  - id: save
    depends_on: [brief, stamp]
    invoke:
      tool: "nika:write"
      args:
        path: "./briefs/${{ tasks.stamp.day }}-monday.md"
        content: "${{ tasks.brief.output }}"
        create_dirs: true

  # ── the run reports its own bill ──
  - id: bill
    depends_on: [save]
    invoke:
      tool: "nika:inspect"
      args: { view: cost }

  - id: ping
    depends_on: [bill, stamp]
    invoke:
      tool: "nika:notify"
      args:
        channel: webhook
        target: "${{ secrets.founders_webhook }}"
        message: "Monday brief ready · briefs/${{ tasks.stamp.day }}-monday.md · run cost $${{ tasks.bill.output.total_usd }}"
        severity: info
    on_finally:
      - invoke:
          tool: "nika:emit"
          args:
            event_type: "brief.monday.run"
            payload:
              day: "${{ tasks.stamp.day }}"

outputs:
  brief: ${{ tasks.brief.output }}
  cost_usd: ${{ tasks.bill.output.total_usd }}

How it works

1

Three branches, zero coordination code

News (HN API through mode: jq), engineering pulse (git shortlog) and the KPI sheet (read → convert → jq add) run concurrently. The revenue sum is jq arithmetic — deterministic, not model-guessed.
2

Dates come from a builtin

nika:date + the .iso[:10] binding stamp the filename briefs/2026-06-15-monday.md. Never let a model guess the date.
3

The run reports its own bill

nika:inspect view: cost returns {total_usd, by_task, by_provider} — the ping interpolates it. Cost-aware automation is automation you can leave running.

Constructs you just used

ConstructWhereReference
3-branch parallel gathernews · pulse · kpi_rawWorkflows
jq arithmetic (add)revenueBuiltins
nika:inspect view: costbillBuiltins
output: binding on a builtinstampBindings

Make it yours

  • Add a fourth branch: support sentiment from Support triage’s board file.
  • Keep a budget: follow bill with nika:assert on total_usd < 1 — the brief refuses to overspend.
  • Archive the history: the dated files under briefs/ are already your decision journal.

Back to all examples

You’ve climbed the whole ladder — starter to epic. Time to write yours.