Playground · client-only · nothing leaves the tab
Write Nika, checked live.
Real Nika, validated as you type: the same NIKA codes the engine raises, with their fixes. Everything runs in this tab; nothing is sent anywhere.
Workflow editor, validator and plan
Templates
Showcase
nika: chain-template # SLOT: kebab-case workflow id
# This skeleton keeps its authored mock model. Creating a workflow does
# not select a paid provider from ambient credentials. Choose a different
# model explicitly for a real run; `--model mock/echo` rehearses on the mock
# model: zero keys, no model call; a fetch step still reaches its host.
model: mock/echo
const:
source: "./README.md" # SLOT: your input · README.md exists in most repos
destination: "./output.md" # SLOT: where the result lands
permits: # the blast radius · default-deny once present
tools: ["nika:read", "nika:write"]
# Two literal paths, one each way. `check` can read these (they come from
# `const:`) and proves them against the boundary before anything runs — keep
# them in step with the two `const:` entries above.
fs:
read: ["./README.md"] # SLOT: same path as const.source
write: ["./output.md"] # SLOT: same path as const.destination
tasks:
gather:
invoke: # SLOT: the fact source · nika:read / nika:fetch / exec
tool: "nika:read"
args: { path: "${{ const.source }}" }
on_error:
# Offline rehearsal. A freshly scaffolded directory has no README, and a
# skeleton that dies on its first run teaches nothing — so a not-found
# recovers into a literal standing in for the real document. `on_codes:`
# keeps that narrow: ONLY not-found is forgiven, a permission error
# still fails loudly. Delete this block once the source really exists.
# In an EMPTY directory check prints one [inputs] hint that this read
# would fail — the run does not: this recover carries it (measured ·
# rc=0 · « 1 recovered »). The hint retires once your source exists.
on_codes: [NIKA-BUILTIN-READ-001]
recover: "REHEARSAL · no source document here yet."
think:
with:
gather: ${{ tasks.gather.output }}
infer:
# a reasoning model needs 16384 here, or a documented run.reasoning.effort: low
max_tokens: 800 # SLOT: the spend ceiling · sized for the SEAT, not the answer
# The marker below is a VALUE, not a comment. The parser drops
# comments, so a `# SLOT:` line could never make `check` refuse —
# which is how an unfilled scaffold ran green and left a file that
# read like a result (#1066). Replace the line, keep the binding.
prompt: |
<SLOT: what should the model do with the gathered text?>
${{ with.gather }}
persist:
with:
think: ${{ tasks.think.output }}
invoke:
tool: "nika:write"
args:
path: "${{ const.destination }}" # SLOT: destination · same path as permits.fs.write
content: "${{ with.think }}" # ALWAYS pass content · a write without it writes nothing
on_error:
# Golden rehearsal. Under `nika test` the mock plane simulates the
# MODEL, not effects — this write is refused (NIKA-452) so the pin
# lane needs this recover to walk its own scaffold. `nika run` never
# fires it on success (a recover only runs on failure). Delete this
# block once pointed at real data, so a genuine write failure is loud.
recover: "REHEARSAL · write refused under nika test — the real run persists to the destination"
outputs:
result: ${{ tasks.think.output }} # SLOT: the callable contract
Tab indents. Press Esc, then Tab, to leave the editor.
Validator
validThis file passes the playground's static checks: envelope, verbs, edges, namespaces, providers, expressions. The engine's nika check runs the full audit. Ship it with nika run chain.nika.
a with binding IS an edge · its target must be a declared task, and a typo dies at check
The plan
3 tasks · 3 wavesThe blast radius
- fs read
./README.md- fs write
./output.md- tools
nika:readnika:write- exec
- denied
- net.http
- no hosts
Everything not listed is denied, before it runs.
The four verbs
- infer
- exec
- invoke
- agent
Fill the # SLOT: lines: structure is instantiated, never invented. The protocol and the patterns guide are the long form.
Runs locally
Run the same file on your machine.
The playground runs the static checks in your browser. Install the engine, save the file as chain.nika, and nika check runs the full audit before you run it.
❯brew install supernovae-st/tap/nika❯nika run chain.nika