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.
npx agentmods add rules/evilfreelancer/openapi-to-cli/code-stylegit clone --depth 1 https://github.com/EvilFreelancer/openapi-to-cliWhat 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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00658 | $0.00658 |
| Opus 5 | $0.00329 | $0.00329 |
| Sonnet 5 | $0.00132 | $0.00132 |
| Haiku 4.5 | $0.00066 | $0.00066 |
Grade A, and why
code-style 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 yesterday.
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.
How it starts
The opening of the file, as written. The whole thing — 56 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Code style (TypeScript)
Applies to every .ts file in src/ and tests/.
General
- All code comments and identifiers in English. Documentation files in English.
- New files end with a single trailing newline.
- Straight double quotes
"for string literals. Regular hyphen-, not em-dashes, in any English prose inside code or docs. - Default to no comments. Add a comment only when the why is non-obvious (workaround, hidden constraint, subtle invariant). Identifiers should carry intent.
TypeScript
strict: trueintsconfig.json. Do not weaken it locally.- Exported functions and public APIs declare explicit parameter and return types. Local variables may use inference.
- Use
interfacefor reusable object shapes,typefor unions, intersections, and mapped types. - Avoid
any. When unavoidable, scope it as narrowly as possible and annotate// eslint-disable-next-line @typescript-eslint/no-explicit-anywith a one-line reason (seecli.ts:HttpClientfor the canonical example). - Prefer
unknownoveranyat module boundaries; narrow with type guards.
File structure
- Imports first - Node built-ins (
path,fs), then third-party (axios,yargs,js-yaml,zod,ini), then local relative imports. - Types and interfaces.
- Module-level constants.
- Functions and classes.
exportlast when it improves readability;export class/export functioninline is also fine.
Naming
- Classes -
PascalCase(ProfileStore,OpenapiLoader,CommandSearch). - Functions and methods -
camelCase(loadSpec,buildCommands,selectProfile). - Interfaces and type aliases -
PascalCase(Profile,CliCommand,HttpClient). - Constants -
UPPER_SNAKE_CASEfor environment-style globals, otherwise meaningfulcamelCase. - Files -
kebab-case.tsmatching the dominant exported type (profile-store.tsexportsProfileStore).
Error handling
- Throw
Errorsubclasses with informative messages; never throw strings. - At the CLI boundary (
cli.ts), catch and translate to a user-friendly message + non-zero exit code. Inner layers should let exceptions propagate. - For external input (HTTP responses, parsed YAML/JSON), validate with
zodschemas before consuming.
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.
- yesterday First seen · 56 lines · 658 tokens per session scan A 205c2acd5e2e
code-style is a cursor rule published in the GitHub repository EvilFreelancer/openapi-to-cli (256 stars, last pushed 11d ago), licensed MIT. It adds 658 tokens to every session, about $0.0033 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.
Other cursor rules, from other repositories
deno
You MUST import @std dependencies from jsr You MUST use latest versions of libraries when adding imports You must use type keyword when importing types.
typescript-coding-rule
It allows a subset of JSDoc tags. Most tags must occupy their own line, with the tag at the beginning of the line.
errors
ALWAYS use custom errors from src/errors.ts.
files
File organization and structure rules.
_code-rules-TypeScript
Apply when creating or editing TypeScript (.ts) files or shared TypeScript modules. Enforces typed, modular, readable code with strict formatting, naming, imports, configuration, validation, error handling, async patterns, and separation of concerns.
typescript
// Bad const data: any = JSON.parse(content).