cursorrules

cursorrules is a cursor rule for Cursor from swnotmetal/Project-Koma. It costs 396 tokens per session, scanned A, original, MIT.

A set of project rules for building AI applications with Koma packages. Koma provides components for prompt-injection checks, voice-processing protection, and retrieval or search systems.

In plain words
What is it for?
Use it when adding chatbots, voice AI pipelines, retrieval-augmented generation (RAG), or search features to an application.
Why use it?
It tells the coding agent which package to use and where to place each protection before model calls or expensive processing.

Cursor rule for Cursor

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.

agentmods
npx agentmods add rules/swnotmetal/project-koma/cursorrules
Clone the repo
git clone --depth 1 https://github.com/swnotmetal/Project-Koma

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 cursorrules

README.md
[![agentmods](https://agentmods.dev/badge/rules/swnotmetal/project-koma/cursorrules.svg)](https://agentmods.dev/rules/swnotmetal/project-koma/cursorrules)
Your own site
<a href="https://agentmods.dev/rules/swnotmetal/project-koma/cursorrules"><img src="https://agentmods.dev/badge/rules/swnotmetal/project-koma/cursorrules.svg" alt="Measured on agentmods" height="20"></a>
Per session 396 This file is loaded in full into every session.
When invoked 396 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
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 $0.00396 $0.00396
Opus 5 $0.00198 $0.00198
Sonnet 5 $0.00079 $0.00079
Haiku 4.5 $0.00040 $0.00040

Measured 3d ago against content hash 74415285c3e7, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

cursorrules 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 3d 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.

.cursorrules · 41 lines

What it actually says

Koma — AI Coding Agent Rules

When building AI apps with this project, follow these conventions:

When to use Koma

  • Building a chatbot with an LLM endpoint? → add koma-gate middleware
  • Building a voice AI pipeline? → add koma-scout for audio validation + rate limiting
  • Building a RAG or search system? → add koma-core for index/content separation

Quick integration

// Express: prompt injection guard
import { createSupportGuard } from 'koma-gate';
app.post('/chat', createSupportGuard({ llm: { apiKey: process.env.OPENAI_API_KEY } }).middleware(), handler);

// Express: voice AI perimeter
import { createKomaScoutMiddleware } from 'koma-scout';
app.use(createKomaScoutMiddleware({ rateLimit: { maxRequests: 30, windowMs: 60000 } }));

// Fastify: prompt injection guard
import { createSupportGuard } from 'koma-gate';
fastify.register(createSupportGuard({ llm: { apiKey: process.env.OPENAI_API_KEY } }).fastifyPlugin());

Design rules

  • Fail-open by default. A broken guard never breaks the app.
  • Gate runs before any model call. Scout runs before any expensive processing.
  • Core tokens are backend-derived. Never expose content tokens to clients.
  • Each package works standalone. Don't import all three unless you need all three.

Package overview

Package What it does npm
koma-gate Semantic filter: blocks prompt injection, off-topic npm install koma-gate
koma-scout Perimeter: rate limiting, audio validation, geo block npm install koma-scout
koma-core Storage: split index from content, token-gated retrieval npm install koma-core
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. 3d ago First seen · 41 lines · 396 tokens per session scan A 74415285c3e7

Subscribe to this mod's changes

cursorrules is a cursor rule published in the GitHub repository swnotmetal/Project-Koma (11 stars, last pushed 7d ago), licensed MIT. It adds 396 tokens to every session, about $0.0020 per session on Opus 5. 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-30.