Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions rules/nika-workflow-language.mdc
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
description: Nika workflow language rules for AI assistance
globs: ["**/*.nika.yaml", "**/*.nika.yml"]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Restrict the glob to the PR’s stated target.

The rule currently also applies to **/*.nika.yml, while the objective and line 9 specify .nika.yaml files only. Remove the .nika.yml pattern or update the contract consistently.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@rules/nika-workflow-language.mdc` at line 3, Restrict the frontmatter glob to
the PR’s stated target by removing the **/*.nika.yml pattern, keeping only
**/*.nika.yaml so it matches the contract described in the rule.

alwaysApply: false
---

# Nika Workflow Language

Envelope: `nika: v1` (always · frozen forever). Extensions: `.nika.yaml` (canonical) and `.nika.yml`.

## 4 Verbs (locked forever)
- `infer:` LLM call (`prompt`, `system?`, `temperature?`, `schema?`, `max_tokens?`, `model?`)
- `exec:` subprocess (`command`, `cwd?`, `capture: text|structured`)
- `invoke:` builtin/MCP tool (`tool`, `args`) — HTTP fetch = `tool: nika:fetch` (a tool, not a verb)
- `agent:` multi-turn loop (`prompt`, `tools`, `max_turns`, `max_tokens_total`)

## Authoring Discipline
- Interpolation uses `${{ vars.x }}` · `${{ tasks.id.output }}` · `${{ env.KEY }}` · `${{ with.alias }}`.
- Bindings use `with: { alias: ${{ tasks.id.output }} }` then `${{ with.alias }}`.
- Models use the combined form `provider/name` (for example `mock/echo`, `ollama/qwen3.5:4b`, `mistral/mistral-small`).
- `depends_on` is always an array: `depends_on: [task_id]`.
- Secrets are declared in a top-level `secrets:` block (e.g. `source: env`, `key: MY_KEY`) and referenced as `${{ secrets.name }}` — never inline literal keys; `${{ env.* }}` is for non-sensitive configuration.
- After every edit, run `nika check <file>` and repair from diagnostics.
- Unknown code? Run `nika explain NIKA-XXXX`.
Loading