awesome-cursor-rules-mdc is a generator that creates Cursor MDC rule files from structured library information, using semantic search and language models to gather and organize guidance. Developers use it to produce reusable rules for libraries in Cursor, and the catalogue includes 200 of those rules.
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/sanjeed5/awesome-cursor-rules-mdcWrote 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/sanjeed5/awesome-cursor-rules-mdc/jest)<a href="https://agentmods.dev/rules/sanjeed5/awesome-cursor-rules-mdc/jest"><img src="https://agentmods.dev/badge/rules/sanjeed5/awesome-cursor-rules-mdc/jest.svg" alt="Measured on agentmods" 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.02543 | $0.02543 |
| Opus 5 | $0.01272 | $0.01272 |
| Sonnet 5 | $0.00509 | $0.00509 |
| Haiku 4.5 | $0.00254 | $0.00254 |
Grade A, and why
jest 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 4d 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 — 371 lines — stays where its author put it; the contents beside it link to each section on GitHub.
jest Best Practices
This guide outlines our team's definitive Jest best practices. Adhere to these rules for consistent, reliable, and efficient testing.
1. Configuration (jest.config.ts)
Always use a jest.config.ts file for type safety and explicit configuration.
// jest.config.ts
import type { Config } from 'jest';
import { defaults } from 'jest-config';
const config: Config = {
// Use ts-jest for TypeScript files
preset: 'ts-jest',
// Automatically clear mock calls and instances between tests
clearMocks: true,
// Reset mocks between tests to prevent state leakage
resetMocks: true,
// Detailed test output
verbose: true,
// Collect coverage from specific files, exclude common boilerplate
collectCoverageFrom: [
'src/**/*.{js,jsx,ts,tsx}',
'!src/**/*.d.ts',
'!src/index.tsx', // Exclude entry points
'!src/reportWebVitals.ts',
],
// Ignore coverage for specific paths
coveragePathIgnorePatterns: [
'/node_modules/',
'src/setupTests.ts',
],
// Setup file for global test environment configurations (e.g., @testing-library/jest-dom)
setupFilesAfterEnv: ['<rootDir>/src/setupTests.ts'],
// Map module paths for aliases or specific packages
moduleNameMapper: {
'^@/(.*)$': '<rootDir>/src/$1', // Example: for absolute imports
},
// Test environment for browser-like DOM APIs
testEnvironment: 'jsdom',
// Match test files ending with .test.ts(x) or .spec.ts(x)
testMatch: [...defaults.testMatch, '**/?(*.)+(spec|test).[tj]s?(x)'],
};
export default config;
2. Test Organization
Colocate test files with the code they test. This improves discoverability and maintainability.
❌ BAD: Separate tests/ directory
src/
components/
Button.tsx
tests/
components/
Button.test.tsx
✅ GOOD: Colocated __tests__/ or .test.ts
src/
components/
Button/
index.tsx
__tests__/
Button.test.tsx
utils/
formatDate.ts
formatDate.test.ts
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.
- 4d ago First seen · 371 lines · 2,543 tokens per session scan A 38701ecda85f
jest is a cursor rule published in the GitHub repository sanjeed5/awesome-cursor-rules-mdc (3,571 stars, last pushed 3mo ago), licensed CC0-1.0. It adds 2,543 tokens to every session, about $0.0127 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-09-03.
Other cursor rules, from other repositories
use-ast-factories
Use factory functions for creating AST nodes instead of manual object creation.
test-mocking-patterns
Test-only type assertions and mocking patterns (avoid brittle mocks).
tsdown-dist-layout-in-tests
Use tsdown dist root paths in TS test mappings.
jest-unit-testing-cursorrules-prompt-file
Cursor rules for Jest development with unit testing.
mocking-dependencies-in-tests
Cursor rule "mocking-dependencies-in-tests" from PaulJPhilp/EffectPatterns, covering mocking dependencies in tests and example.
rule-01
This is test rule number in the large package scalability test.