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.
git clone --depth 1 https://github.com/EvilFreelancer/openapi-to-cliWrote 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.
[](https://agentmods.dev/rules/evilfreelancer/openapi-to-cli/code-style)<a href="https://agentmods.dev/rules/evilfreelancer/openapi-to-cli/code-style"><img src="https://agentmods.dev/badge/rules/evilfreelancer/openapi-to-cli/code-style/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.
<a href="https://agentmods.dev/rules/evilfreelancer/openapi-to-cli/code-style"><img src="https://agentmods.dev/badge/rules/evilfreelancer/openapi-to-cli/code-style.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00658 | $0.00658 |
| Opus 5.5 | $0.00263 | $0.00263 |
| Sonnet 5.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 1mo 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.
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.
- 1mo ago Changed e7d01768087a
- 1mo ago 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 (265 stars, last pushed 26d ago), licensed MIT. It adds 658 tokens to every session, about $0.0026 per session on Opus 5.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
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.
chassis
Chassis conventions — decorator-driven Express 5 + TypeScript.
typescript-standards
// Good: Typed error handling function loadConfig(): Config { try { // ... loading logic } catch (error) { if (error instanceof yaml.YAMLException) { throw new Error(Invalid YAML in configuration file: ${error.message}); } throw error; } }.
no-bare-casts
No bare as casts in production TypeScript. Use blindCast (value) from @internal/utils/casts as the auditable escape hatch, castAs (value) for declarative-only assertions, or rewrite to eliminate the cast. as const is exempt. Test files are exempt.
sql-types-imports
Canonical import paths for SQL types.
use-ast-factories
Use factory functions for creating AST nodes instead of manual object creation.