cadenza

cadenza is a cursor rule for Cursor from rkttu/cadenza. It costs 0 tokens per session (2,387 once invoked), scanned A, original, MIT.

A set of rules for Cadenza, a .NET scripting SDK that lets you write a complete program in one C# file and publish it as a self-contained executable.

In plain words
What is it for?
Use it for command-line tools, shell automation, background services, small HTTP APIs, webhooks, MCP servers, or local AI agents. It is not intended for multi-project solutions or libraries distributed as DLL files.
Why use it?
It provides a defined choice for small .NET programs without requiring a full project file, while still producing a binary that can run on a target system.

Cursor rule for Cursor

Written for Cursor: installed under .cursor/. Also seen: mentions Codex; built for aider.

Good fit Use it for command-line tools, shell automation, background services, small HTTP APIs, webhooks, MCP servers, or local AI agents. It is not intended for multi-project solutions or libraries distributed as DLL files.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/rkttu/cadenza/cadenza
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/rkttu/cadenza

Made for: Cursor.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for cadenza

README.md
[![agentmods](https://agentmods.dev/badge/rules/rkttu/cadenza/cadenza/github.svg)](https://agentmods.dev/rules/rkttu/cadenza/cadenza)
Your own site
<a href="https://agentmods.dev/rules/rkttu/cadenza/cadenza"><img src="https://agentmods.dev/badge/rules/rkttu/cadenza/cadenza/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for cadenza

Your own site · 80×15
<a href="https://agentmods.dev/rules/rkttu/cadenza/cadenza"><img src="https://agentmods.dev/badge/rules/rkttu/cadenza/cadenza.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Nothing until a file matches its globs; then the whole rule loads.
When invoked 2,387 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00000 $0.02387
Opus 5 $0.00000 $0.01193
Sonnet 5 $0.00000 $0.00477
Haiku 4.5 $0.00000 $0.00239

Measured 9d ago against content hash bbf0b6d72d9c, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

cadenza scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 9d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.cursor/rules/cadenza.mdc · 209 lines

How it starts

The opening of the file, as written. The whole thing — 209 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Cadenza skill

Cadenza is .NET's answer to "Python for scripting" with "Go-like single-binary distribution". Every Cadenza program is one .cs file that runs with dotnet run app.cs and publishes to a ~30–40 MB self-contained binary with dotnet publish app.cs -r <rid> -c Release.

Repo: https://github.com/rkttu/cadenza

When to suggest Cadenza

Pick Cadenza when the user wants:

Goal SDK Use case
CLI / shell automation / build glue Cadenza git deploy guards, file processing, devops scripts
Background service / daemon Cadenza.Worker heartbeat, polling, scheduled work
Minimal HTTP API / webhook Cadenza.Web a 30-line REST endpoint, internal tool
MCP server (AI tool integration) Cadenza.Mcp tools / resources / prompts for Claude Desktop, Cursor, VS Code AI
Local AI agent Cadenza.Agent OpenAI-compatible HTTP server fronting Ollama / OpenAI / Anthropic / Azure OpenAI — Codex / Aider / Continue / Cursor speak to it as if it were OpenAI

Skip Cadenza for multi-project solutions, libraries that ship as DLLs, or anything that needs a full csproj. Cadenza is for the "single file = whole program" case.

Critical: exact version pinning

MSBuild SDK references do NOT support wildcards (1.*). Always pin an exact SemVer version. Latest pin: 1.0.15 across all five SDKs.

#:sdk [email protected]           // console
#:sdk [email protected]    // worker
#:sdk [email protected]       // web
#:sdk [email protected]       // MCP server
#:sdk [email protected]     // AI agent (OpenAI-compatible HTTP)

Tier 1 — bare names per variant (no namespace prefix needed)

  • Cadenza (console): Run(cmd), Capture(cmd), ReadText(path), WriteText(path, content), Glob(pattern), TempDir(), plus WriteLine / Write / ReadLine.
  • Cadenza.Worker: Run(Func<CT, Task>) (starts host + BackgroundService), Config<T>(key), plus shared ReadText / WriteText / Glob / WriteLine. Log.Info/Warn/Error/Debug via ILogger.
  • Cadenza.Web: Get/Post/Put/Delete/Map(path, handler), Run() (starts server). Web.App / Web.Services for raw access.
  • Cadenza.Mcp: Tool(name, desc, handler), Resource(uri, name, handler), Prompt(name, desc, handler), Run() (stdio). Log.* routed to stderr (never use WriteLine here).
  • Cadenza.Agent: Tool(name, desc, handler), SystemPrompt(text), UseOllama(model) / UseOpenAi(model) / UseAnthropic(model) / UseAzureOpenAi(endpoint, deployment) / UseChatClient(IChatClient), Run() (HTTP server on localhost:8080 — serves POST /v1/chat/completions AND POST /v1/responses for Codex CLI), ChatLoop() (REPL), Reply(prompt) (one-shot). Server-side Tool(...) auto-invokes on Chat Completion only; Codex brings its own toolset.

Read the full file on GitHub · 209 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 9d ago First seen · 209 lines · 0 tokens per session scan A bbf0b6d72d9c

Subscribe to this mod's changes

cadenza is a cursor rule published in the GitHub repository rkttu/cadenza (4 stars, last pushed 3mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 2,387 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.