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/testing)<a href="https://agentmods.dev/rules/evilfreelancer/openapi-to-cli/testing"><img src="https://agentmods.dev/badge/rules/evilfreelancer/openapi-to-cli/testing/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/testing"><img src="https://agentmods.dev/badge/rules/evilfreelancer/openapi-to-cli/testing.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.00579 | $0.00579 |
| Opus 5.5 | $0.00232 | $0.00232 |
| Sonnet 5.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 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 — 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.
- 1mo ago Changed · -1 tokens per session cfd1ba0524b8
- 1mo ago 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 (265 stars, last pushed 26d ago), licensed MIT. It adds 579 tokens to every session, about $0.0023 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
test-file-organization
Test file organization and splitting guidelines.
running-tests
How to run tests, check for failures, and rerun specific failing tests — use the :agent variants of slow commands.
test-database-limitations
Test databases created via withDevDatabase() from @repo/test-utils use pglite (an in-memory PostgreSQL implementation via @prisma/dev). Pglite does not support PostgreSQL extensions like pgvector, pgtrgm, etc.
typed-contract-in-tests
Use typed Contract from fixtures in integration tests.
use-contract-ir-factories
Use factory functions for creating ContractIR objects instead of manual object creation.
sql-orm-client-whole-shape-assertions
Prefer whole-result-shape assertions with explicit select projections in sql-orm-client tests.