> ## Documentation Index
> Fetch the complete documentation index at: https://docs.nika.sh/llms.txt
> Use this file to discover all available pages before exploring further.

# Agents

> Claude Code, Cursor, Codex, Windsurf: your agent does the work once, Nika keeps the workflow. Two commands wire any of them.

export const STATUS = {
  head: "95962d5cd",
  branch: "main",
  version: "0.91.0",
  cratesWorkspace: 39,
  cratesAdmitted: 39,
  cratesTarget: "42",
  wipCrates: [],
  libTests: 2989,
  clippyWarnings: 0,
  adrs: 62,
  adrsAccepted: 42,
  adrsProposed: 18,
  providers: 32,
  capabilityRules: 49,
  hygieneVectors: 38,
  hygieneGreen: 28,
  hygieneYellow: 3,
  hygieneRed: 0,
  lastUpdated: "2026-06-25"
};

Your agent already does the work: a PR review in Claude Code, a research
brief in Codex, a triage pass in Cursor. Then the chat scrolls away and the
procedure is gone. Nika's job is to keep it: the agent writes the workflow
**as a `.nika.yaml` file**, you review it, the runtime enforces it, and it
runs again next week without re-prompting.

Two commands wire any agent:

```sh theme={"system"}
nika init            # writes AGENTS.md + .vscode/settings.json (schema wiring)
nika wire <client>   # adds Nika's read-only MCP oracle to your agent client
```

## `nika init`: teach the repo

`nika init` drops three files at the repo root (idempotent: existing files are
skipped, `--force` overwrites):

* **`AGENTS.md`**, the agent operating guide: the four verbs, the authoring
  loop (`nika new --from <template>` → fill → `nika check` → repair from the
  error), and the rules that keep generated workflows valid. Read natively by
  **Codex**, **Claude Code**, **Cursor**, **Jules** and every AGENTS.md-aware
  tool.
* **`.vscode/settings.json`**: maps `*.nika.yaml` to the canonical JSON
  schema, so completions and validation work in any YAML-aware editor.
* **`.cursor/rules/nika.mdc`**, the Cursor rules file (globs `*.nika.yaml`):
  the syntax floor + the check loop, auto-attached whenever the agent touches
  a workflow file.

## `nika wire`: give the agent the real oracle

`nika wire` patches your client's MCP config to add Nika's **read-only**
oracle: the agent can *check* and *explain*, never execute (`nika run`
stays in your hands):

| Client      | Command              | What it patches                       |
| ----------- | -------------------- | ------------------------------------- |
| Claude Code | `nika wire claude`   | `~/.claude.json` → `mcpServers.nika`  |
| Cursor      | `nika wire cursor`   | `~/.cursor/mcp.json`                  |
| Windsurf    | `nika wire windsurf` | `~/.codeium/windsurf/mcp_config.json` |
| VS Code     | `nika wire vscode`   | `.vscode/mcp.json` (project-local)    |
| Everything  | `nika wire all`      | all of the above                      |

The server exposes two tools:

* **`nika_check`**: the full static audit (plan · cost ceiling · secret
  flows · types · tool args · schema) as structured JSON. The agent fixes
  its own file before you ever see it.
* **`nika_explain`**: any `NIKA-XXX` error code, explained.

<Note>
  Codex has no `wire` target yet. It doesn't need one to author well:
  it reads `AGENTS.md` natively, and any MCP-capable client can add the
  oracle manually (`command: nika`, `args: ["mcp"]`, stdio).
</Note>

## The loop

```text theme={"system"}
agent writes review.nika.yaml        (from AGENTS.md + a template)
  → nika check review.nika.yaml      (agent self-repairs from the findings)
  → you read the file                (it's YAML, review it like code)
  → nika run review.nika.yaml        (you, or your CI, not the agent)
```

The division of labor is the point: the **agent authors**, the **file is
the contract**, the **human approves**, the **runtime enforces**.

## Editor surface

The [VS Code / Cursor / Windsurf extension](https://marketplace.visualstudio.com/items?itemName=supernovae.nika-lang)
adds check-as-you-type, cost inlay hints, DAG visualization and trace replay
on top. See [Editors](/getting-started/editors).

## Read next

<CardGroup cols={2}>
  <Card title="Agent authoring protocol" icon="robot" href="/guides/agent-authoring">
    The deterministic path: template → fill → check → repair.
  </Card>

  <Card title="Templates" icon="clone" href="/guides/templates">
    Six valid skeletons `nika new --from` instantiates.
  </Card>
</CardGroup>
