Skip to content

feat: add Nika workflow language rule (.nika.yaml authoring)#332

Open
ThibautMelen wants to merge 2 commits into
PatrickJS:mainfrom
ThibautMelen:add-nika-rule
Open

feat: add Nika workflow language rule (.nika.yaml authoring)#332
ThibautMelen wants to merge 2 commits into
PatrickJS:mainfrom
ThibautMelen:add-nika-rule

Conversation

@ThibautMelen

@ThibautMelen ThibautMelen commented Jul 10, 2026

Copy link
Copy Markdown

Adds a rule for the Nika workflow language (.nika.yaml files — AI workflows as reviewable DAGs).

The rule teaches Cursor the envelope, the four verbs, the interpolation/binding forms, and the authoring discipline (run nika check after every edit, repair from diagnostics). Scoped by globs to **/*.nika.yaml only, alwaysApply: false.

Provenance note: this is exactly the rule the nika init command generates (engine v0.99.0) — contributed here so Cursor users get it without installing anything first. I'll refresh it if the language surface ever changes (the envelope and verbs are frozen).

Disclosure: I'm the author of Nika (AGPL-3.0 Rust engine).

Summary by CodeRabbit

  • Documentation
    • Added authoring guidance for Nika workflow files.
    • Documented supported workflow verbs, syntax conventions, bindings, model naming format, and dependency declarations.
    • Added secret handling rules (including prohibited inline literal secret keys) and required reference format.
    • Included validation and troubleshooting guidance using the appropriate Nika commands.

@coderabbitai

coderabbitai Bot commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 84373a7c-10e9-4aff-bfb3-b362419b9c5b

📥 Commits

Reviewing files that changed from the base of the PR and between 439a218 and 311c522.

📒 Files selected for processing (1)
  • rules/nika-workflow-language.mdc
✅ Files skipped from review due to trivial changes (1)
  • rules/nika-workflow-language.mdc

📝 Walkthrough

Walkthrough

Adds a Nika workflow language rules document covering file targeting, the nika: v1 envelope, supported verbs, authoring constraints, secret sourcing, validation, and troubleshooting.

Changes

Nika workflow rules

Layer / File(s) Summary
Define Nika workflow authoring rules
rules/nika-workflow-language.mdc
Documents target file globs, the immutable nika: v1 envelope, supported verbs, interpolation and binding patterns, model naming, depends_on structure, secret handling, nika check, and nika explain NIKA-XXXX.

Estimated code review effort: 1 (Trivial) | ~3 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly states the new Nika workflow language rule and matches the change set.
Description check ✅ Passed The description covers the summary, value, file scope, and provenance, but it does not use the repository's template sections verbatim.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

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.

Actionable comments posted: 3

🤖 Prompt for all review comments with 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.

Inline comments:
In `@rules/nika-workflow-language.mdc`:
- 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.
- Around line 18-22: The workflow language guidance incorrectly directs secrets
through the env namespace. Update the rule in the interpolation and secrets
guidance to document `${{ secrets.KEY }}` for credentials, distinguish it from
non-sensitive `${{ env.KEY }}` configuration, and retain the prohibition on
inline literal keys.
- Line 12: Update the documented `infer` signature in the workflow language rule
to include the optional `max_tokens` parameter alongside `prompt`, `system?`,
`temperature?`, and `schema?`, matching the supported examples.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 2b799d9e-0d70-41ac-9a48-ba95eeda24b7

📥 Commits

Reviewing files that changed from the base of the PR and between b044f95 and 439a218.

📒 Files selected for processing (1)
  • rules/nika-workflow-language.mdc

@@ -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.

Comment thread rules/nika-workflow-language.mdc Outdated
Comment thread rules/nika-workflow-language.mdc Outdated
@ThibautMelen

Copy link
Copy Markdown
Author

All three findings verified against the shipped binary (v0.99.0) and fixed:

  1. max_tokens — real gap: the engine's schema lists max_tokens (and model) on infer; added to the signature line.
  2. secrets — real: the actual form is a declared secrets: block referenced as ${{ secrets.name }}; the line now says exactly that and scopes env.* to non-sensitive config.
  3. globs — the engine intentionally matches both .nika.yaml and .nika.yml (the globs come from nika init itself); the prose now names both instead of dropping the pattern.

Also filed upstream so the generator emits the same fixes (the rule stays in sync with the binary).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant