--- name: nika-authoring description: Author, check and repair Nika workflows (.nika.yaml files — the workflow language for AI). Use when writing or editing a *.nika.yaml file, converting a repeated AI task or prompt chain into a workflow, or when nika check reports NIKA-XXXX findings to fix. --- # Authoring Nika workflows Nika turns repeatable AI work into files: one `.nika.yaml`, four verbs, audited **before** it runs. You author the file; `nika check` is the oracle; the human runs it. ## Read two examples before you write (measured: 8 rounds → 0) **This file is the map. The examples are the territory.** A map this detailed is exactly why authors skip the ground, and the ground is where the shapes live. Nothing below replaces reading two real files. The cost of skipping it was measured on 2026-07-28. Six authors each wrote one workflow from a real intention with this skill loaded and nothing else. **None reached a green check one-shot: 45 check→fix rounds between them, 7.5 on average, 11 at worst.** One of those authors spent **eight** rounds on their file, then read two example files, and wrote their NEXT workflow **one-shot green. Zero rounds.** Eight to zero, and the delta was two reads; the measured alternative is 7.5 check→fix rounds. Reading them is not diligence, it is the cheapest move on the board. **The order, every time. Never write first and look second:** ``` nika try # the shelf · the path, then the jobs nika new # take the one matching your intent (table below) — read it nika new # take the one covering what the first did not — read it # only now open your file ``` Read for SHAPE, not for prose. Four things, in this order: which verb each task carries · where the `with:` edges are · what the `permits:` block ended up containing · how the last task lands the artifact. Those four are the decisions that cost rounds when guessed instead of copied. ### Which example answers which intent | Your intent | Read this | |---|---| | one model call, nothing around it | `01-hello` | | independent steps, then a merge | `02-parallel-fanout` | | shell out to a real binary (git · docker) | `03-exec-pipeline` | | a model must return JSON fitting a shape | `04-schema-retry` | | fetch a URL and shape what comes back | `05-fetch-chain` | | open-ended work, step count unknown up front | `06-code-review` | | the same task for every item of a collection | `07-for-each-locales` | | land a typed artifact on disk | `t1-meeting-actions` | | poll something, act only when a condition holds | `t1-price-watch` | | rows in, chart and report out, zero model calls | `t2-csv-chart-report` | | a batch where bad items must not kill the run | `t2-etl-quarantine` | | a folder of files, one job per file | `t3-localization-factory` | | a human signs before an irreversible step | `t4-release-train` | | a job too big for one file | §Composition below, then `01-hello` for the child | Second column verified against `nika try` on 2026-07-28. Any slug works with or without its `showcase/` prefix and with or without the `.nika.yaml` extension. `nika new ` makes one yours; `nika new ` does the same from the template side (`nika new '?'` prints that set). ## The loop (always) 1. **Start from the example you just read**, never from a blank file. The section above is not advice, it is step zero: `nika try` · `nika new ` (take the lesson — the file is the read) · `nika new