swagger-navigator-mcp / rules
Cursor rule2 starsChanged 17 months agoMITView on GitHub
- Reads credentials
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 repository2 other files it gives its agents.
- .cursor/rules/project-structure.mdcCursor rule
- .cursor/rules/typescript-standards.mdcCursor rule
The file
Show its rules and text
We split this testing-standards.mdc into the rules it gives an agent
15 rules. About 0 are common, 11 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈11
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 9
All tests should be placed in the tests/ directory, mirroring the src/ structure
- Very specific: line 10
Test files must use .test.ts extension
- Very specific: line 11
Use descriptive describe and it blocks that clearly explain what is being tested
- Distinctive: line 16
All exported functions must have comprehensive test coverage
- Distinctive: line 17
Test both happy path and error scenarios
- Very specific: line 50
Use typed mocks: const mockFunction = fn as jest.MockedFunction<typeof fn>
- Distinctive: line 51
Always restore original environment variables and mocks between tests
- Distinctive: line 52
Test integration flows by mocking at appropriate boundaries
- Distinctive: line 56
Unit Tests: Test individual functions in isolation
- Distinctive: line 57
Integration Tests: Test function interactions
- Distinctive: line 58
Error Handling: Test all error paths and edge cases
- Distinctive: line 59
Environment Variable Tests: Test env var substitution and validation
- Distinctive: line 60
Path Resolution Tests: Test relative/absolute path handling
- Distinctive: line 64
Use descriptive test names that explain the scenario
- Distinctive: line 65
Follow pattern: "should [expected behavior] when [condition]"
≈ “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
---
alwaysApply: true
---
# Testing Standards
## Test Structure
- All tests should be placed in the `tests/` directory, mirroring the `src/` structure
- Test files must use `.test.ts` extension
- Use descriptive `describe` and `it` blocks that clearly explain what is being tested
## Coverage Requirements
- Aim for 100% code coverage on utility modules like [env-substitution.ts](mdc:src/utils/env-substitution.ts)
- All exported functions must have comprehensive test coverage
- Test both happy path and error scenarios
## Test Organization
```typescript
describe("moduleName", () => {
const originalEnv = process.env;
beforeEach(() => {
jest.resetModules();
jest.clearAllMocks();
process.env = { ...originalEnv };
});
afterAll(() => {
process.env = originalEnv;
});
describe("functionName", () => {
it("should handle expected behavior", () => {
// Test implementation
});
it("should handle error cases", () => {
// Error test implementation
});
});
});
```
## Mocking Guidelines
- Mock external dependencies (fs, yaml, etc.) using Jest mocks
- Use typed mocks: `const mockFunction = fn as jest.MockedFunction<typeof fn>`
- Always restore original environment variables and mocks between tests
- Test integration flows by mocking at appropriate boundaries
## Required Test Types
1. **Unit Tests**: Test individual functions in isolation
2. **Integration Tests**: Test function interactions
3. **Error Handling**: Test all error paths and edge cases
4. **Environment Variable Tests**: Test env var substitution and validation
5. **Path Resolution Tests**: Test relative/absolute path handling
## Test Naming Conventions
- Use descriptive test names that explain the scenario
- Follow pattern: "should [expected behavior] when [condition]"
- Group related tests using nested `describe` blocks
---
# Testing Standards
## Test Structure
- All tests should be placed in the `tests/` directory, mirroring the `src/` structure
- Test files must use `.test.ts` extension
- Use descriptive `describe` and `it` blocks that clearly explain what is being tested
## Coverage Requirements
- Aim for 100% code coverage on utility modules like [env-substitution.ts](mdc:src/utils/env-substitution.ts)
- All exported functions must have comprehensive test coverage
- Test both happy path and error scenarios
## Test Organization
```typescript
describe("moduleName", () => {
const originalEnv = process.env;
beforeEach(() => {
jest.resetModules();
jest.clearAllMocks();
process.env = { ...originalEnv };
});
afterAll(() => {
process.env = originalEnv;
});
describe("functionName", () => {
it("should handle expected behavior", () => {
// Test implementation
});
it("should handle error cases", () => {
// Error test implementation
});
});
});
```
## Mocking Guidelines
- Mock external dependencies (fs, yaml, etc.) using Jest mocks
- Use typed mocks: `const mockFunction = fn as jest.MockedFunction<typeof fn>`
- Always restore original environment variables and mocks between tests
- Test integration flows by mocking at appropriate boundaries
## Required Test Types
1. **Unit Tests**: Test individual functions in isolation
2. **Integration Tests**: Test function interactions
3. **Error Handling**: Test all error paths and edge cases
4. **Environment Variable Tests**: Test env var substitution and validation
5. **Path Resolution Tests**: Test relative/absolute path handling
## Test Naming Conventions
- Use descriptive test names that explain the scenario
- Follow pattern: "should [expected behavior] when [condition]"
- Group related tests using nested `describe` blocks
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.

