openapi-to-cli / rules
Cursor rule263 starsChanged 3 months agoMITView on GitHub
Implementation order for openapi-to-cli (one unit at a time)
Where files are headingNew Cursor rule files have more rules about planning and tracking tasks, and fewer about code style.
Of the Cursor rule files we read, the 1,533 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository7 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- .cursor/rules/architecture.mdcCursor rule
- .cursor/rules/code-style.mdcCursor rule
- .cursor/rules/testing.mdcCursor rule
- .cursor/rules/workflow.mdcCursor rule
- ocli-apiSkill
The file
We split this implementation-order.mdc into the rules it gives an agent
4 rules. About 0 are common, 0 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 25
Write a failing test in tests/<module>.test.ts that describes the smallest useful behavior (see @testing.mdc and @workflow.mdc).
- Very specific: line 26
Add the minimum implementation in src/<module>.ts.
- Very specific: line 28
Run npm test to confirm no regressions, then npm run build to confirm tsc is clean.
- Very specific: line 29
Only then integrate the new module into the layer above (typically cli.ts), guarded by its own test.
≈ “Common” is an estimate: at least 1 in 5 of the 3,030 Cursor rule files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
--- description: Implementation order for openapi-to-cli (one unit at a time) globs: src/**/*.ts alwaysApply: false --- # Implementation order (one unit at a time) Applies when adding or extending modules under `src/`. ## Layer order (lower first) The architecture in @architecture.mdc defines four layers. New behavior should be added at the lowest layer it can live in, then composed upward: 1. **Layer 0 - pure** (`bm25.ts`, type-only files): no I/O, no Node built-ins beyond `Buffer`/`URL`/etc. 2. **Layer 1 - I/O wrappers** (`config.ts`, `profile-store.ts`, `openapi-loader.ts`): touch `fs`, network, or env. 3. **Layer 2 - transform** (`openapi-to-commands.ts`, `command-search.ts`): combine Layer 0 + Layer 1 outputs into the CLI command model. 4. **Layer 3 - entry** (`cli.ts`): wire everything together for yargs and axios. Forbidden: Layer N importing from Layer M when M > N. If a Layer 1 module suddenly needs a Layer 2 type, that is a sign the type belongs lower. ## Steps for a new module or class 1. Decide the layer using @architecture.mdc. 2. Write a failing test in `tests/<module>.test.ts` that describes the smallest useful behavior (see @testing.mdc and @workflow.mdc). 3. Add the minimum implementation in `src/<module>.ts`. Follow @code-style.mdc for types, naming, and constructor-injected I/O. 4. Make the test pass. 5. Run `npm test` to confirm no regressions, then `npm run build` to confirm `tsc` is clean. 6. Only **then** integrate the new module into the layer above (typically `cli.ts`), guarded by its own test. ## Forbidden - Implementing two unrelated modules in one step before either has tests. - Wiring a new module into `cli.ts` before its own tests pass. - Adding optional fields to `Profile`, `CliCommand`, or `CliCommandOption` without a test that exercises the new field. - Editing real-spec fixtures (`github-api.*`, `box-api-yaml.*`) to "make tests pass" - those represent contracts. ## Allowed - Stub or fake dependencies (mock `HttpClient`, in-memory `fs`) while a lower layer is incomplete, provided the stub matches the documented contract. - Refactor a passing module to a cleaner shape after the test suite stays green. - Extending an existing Layer 2 module with a new transformation, as long as it is covered by a new test and does not import upward.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

