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/testinggit 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.00580 | $0.00580 |
| Opus 5 | $0.00290 | $0.00290 |
| Sonnet 5 | $0.00116 | $0.00116 |
| Haiku 4.5 | $0.00058 | $0.00058 |
Grade A, and why
testing 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 — 53 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Test conventions (Jest)
Applies when editing or adding files under tests/.
Layout
- All tests live in
tests/alongside the matchingsrc/module. - Test files:
tests/<module>.test.ts(one persrc/<module>.ts). - Shared inputs in
tests/fixtures/(OpenAPI/Swagger documents, sample profiles). Recorded outputs intests/results/. github-api.test.tsandbox-api-yaml.test.tsare large real-spec regression tests - do not hand-edit their fixtures.
Structure
- Group with
describe(<moduleName>, ...); one nesteddescribeper public method or scenario. - Test names:
it("does X when Y", ...)- describe behavior, not implementation. - Arrange / Act / Assert order inside each
it. Blank lines between the three sections are encouraged.
Isolation
- Each
itis independent. UsebeforeEach/afterEachfor setup and teardown, not module-level mutable state. - Mock
fsandaxios(HttpClient) through the constructor options the modules expose. Do not monkey-patch the realfs/axiosmodules in tests. - For
.ocli/fixtures, usefs.mkdtempSync(os.tmpdir() + "/...")and clean up inafterEach.
Running
npm test # full Jest suite
npx jest tests/<file>.test.ts # one file
npx jest tests/<file>.test.ts -t "X" # one test by name
What to assert
- Public behavior visible at the module boundary - return values, written files, requests issued via the mocked
HttpClient, capturedstdout. - For BM25 /
command-search- assert ranking order and matched commands, not internal scores. - For
openapi-to-commands- assert the resultingCliCommand[]structure (names, options, body schema), not intermediate spec normalization.
What not to assert
- Internal helper signatures, private state, exact log strings - those are implementation details.
- Floating-point BM25 scores beyond ranking order.
Fixtures
- Add new spec fixtures only when an existing one cannot reproduce the case. Keep them minimal: one path, one operation, only the fields needed for the test.
- For tests covering spec features (OAS 3
requestBody, Swagger 2formData, multi-file$ref, header/cookie params), name the fixture after the feature, e.g.tests/fixtures/swagger2-formdata.yaml.
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 · 53 lines · 580 tokens per session scan A 7b9f08e1f77a
testing is a cursor rule published in the GitHub repository EvilFreelancer/openapi-to-cli (256 stars, last pushed 11d ago), licensed MIT. It adds 580 tokens to every session, about $0.0029 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).