Nika

From davepoon/buildwithclaude · View interactive version

Nika is an AI agent skill from the GitHub repository davepoon/buildwithclaude. Runs repeatable AI work as checked, budgeted workflow files. The agent captures a repeated task as a .nika.yaml DAG, audits cost/permits/schema before a single token is spent, and runs it with tamper-evident traces.

How to use this skill

Skill file

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.

The loop (always)

  1. Start from a template or example, never from scratch:

nika examples list · nika examples show <slug> ·

nika new --from <template> <file>.nika.yaml

  1. Write the file. Envelope is always nika: v1 +

workflow: <kebab-id> + tasks:. Pick models and builtins from

the embedded catalogs — nika catalog (providers · models ·

capabilities · which env var each needs) and nika tools (the

nika:* builtins an invoke reaches without MCP); before a run,

nika inspect <file> shows the anatomy: tasks · waves · the cost

floor.

  1. Check it: nika check <file> (exit 0 = clean · 2 = findings),

then nika check --native-strict <file> — it fails on any

native-first hint (an exec: a builtin covers).

  1. Repair from the diagnostics — they name the exact task, reference

and fix. Unknown code? nika explain NIKA-XXXX.

  1. Repeat 3–4 until clean. **Never hand a file to the human that does

not pass nika check** — and pass --native-strict too, unless

every remaining exec: is in the exec ledger (below).

  1. The human (or CI) runs it: nika run <file>. Preview offline with

--model mock/echo; run locally with --model ollama/<model>.

Inputs ride --var key=value (repeatable · unknown keys refused);

a run paused on a nika:prompt resumes with

nika run <file> --resume <trace> --answer <task>=<value>

(confirm gates take booleans: --answer approve=true).

  1. Pin it for CI: nika test <file> --update writes

<file>.golden.json from an offline mock run; nika test <file>

replays and compares — deterministic, zero keys.

  1. Prove a run that mattered: every run writes a hash-chained

journal to .nika/traces/ — nika trace verify <trace> checks the

chain (tamper-evidence), nika trace show <trace> reads the card.

Cite the trace, never a memory of the run.

Cost honesty (never hide unknown spend)

ceiling · ≥ $X FLOOR means at least one task is unbounded — name

the reason (a missing max_tokens, an uncataloged model, an

expression fan-out), never round it to $0.

say "unpriced", never "$0" or "free".

blocks BEFORE the call that would cross the cap.

how to run) — use it before handing a workflow to a human.

The four verbs (exactly one per task)

max_tokens?)

last resort: run the native-first interrogation first (below)

tool: "nika:fetch", a tool, not a verb

max_turns, max_tokens_total)

Native-first (the law)

The order is invoke: nika:* → invoke: mcp:<server>/<tool> →

exec:. Before writing ANY exec:, answer in your head:

  1. Which builtin replaces it? nika tools --json is the catalog.

HTTP (curl/wget/helper fetch) → nika:fetch · uploads →

multipart: · site crawls → traverse: · file plumbing

(cat/tee/cp/mkdir) → nika:read/nika:write (create_dirs: true) ·

JSON shaping (jq/sed) → nika:jq (or an output: binding) ·

in-place edits → nika:edit · image/speech provider calls →

nika:image_generate/nika:tts_generate · image styling

(ImageMagick convert / PIL filters / dither scripts) →

nika:image_fx (deterministic — same input+args = same bytes,

the artifact sha256 joins the trace chain).

  1. Which MCP tool replaces it? A product API deserves an MCP

server, never a helper script.

  1. Neither? Name the exact gap — then exec: is legitimate

(build tools · git · a product CLI with no MCP surface yet) and

goes in the ledger.

Never write a helper script (node bin/helper.mjs …) that wraps

HTTP/files/JSON — that is native-first/005, the exact failure class

this law exists for.

Exec ledger (mandatory when any exec remains)

Every surviving exec: gets a row in the workflow's header comment:

# EXEC LEDGER ·
# | task | command | why no native path | unlock that removes it |

--native-strict + a complete ledger = a reviewable workflow.

Discipline

${{ env.KEY }} · ${{ secrets.X }} (never inline a credential).

depends_on: [<id>].

mock/echo offline preview).

providers ≥300s: thinking models routinely think past 30s.

the tightest permits: block — paste it in (default-deny from then on).

additionalProperties: false for a deterministic shape.

declared in secrets: with its egress: sink) — never exec: curl

for the sake of a header.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.