Platform
Cursor
Rules, skills, and instructions for Cursor. Copy them directly or export in the platform's native format.
75 published items · Filter in browse
Suggesting Cursor Rules
Skill that notices repeated corrections and offers to encode the convention as a .cursor/rules/*.mdc file.
Zustand
Zustand v5 rule for React + TypeScript: typed curried stores, slice composition, functional updates, useShallow selectors, persist/devtools/immer middleware, and async actions.
SQLAlchemy
SQLAlchemy 2.x rules for Python: typed DeclarativeBase models with Mapped, sessions as context managers, select() over Query, selectinload against N+1, bulk ORM inserts, and Alembic migrations.
scikit-learn
scikit-learn rules: pipelines for every preprocessing step, API-compliant custom estimators with validate_data and check_is_fitted, split-before-fit to stop leakage, random_state everywhere, GridSearchCV on the pipeline, check_estimator tests.
pytest
Rules for fast, reliable pytest suites: src layout, test naming, fixture scopes and teardown, parametrize, skip/xfail markers, pytest-mock, pytest-cov, and typed fixtures.
NumPy
NumPy 2.x rules: vectorize and broadcast instead of looping, set dtype explicitly, know views from copies, pre-allocate, type signatures with np.ndarray, pin numpy>=2.0, and compare arrays with numpy.testing.assert_allclose.
TypeScript
Concise TypeScript rule: strict config, unknown over any, satisfies and as const, discriminated unions, type guards, Result types, and explicit null handling.
Tailwind CSS
Tailwind CSS v4 rule: CSS-first @theme tokens over arbitrary values, clsx/cva component abstraction, prettier class ordering, mobile-first and container queries, accessible focus styles, and dark mode via @custom-variant.
Solana / Anchor (Rust)
Rust rule for Solana programs built with Anchor 0.30+: program layout, account constraints, PDA and signer checks, checked math, error codes, zero-copy accounts, testing, and deploy workflow.
Python
Python 3.10+ rules: PEP 8 layout and naming, grouped imports, one docstring style, builtin generic type hints, uv or Poetry environments, src layout with editable installs, pytest with parametrize, and idioms like context managers and enums.
PostgreSQL
PostgreSQL SQL rule with BAD/GOOD examples: identity columns and data types, timestamptz, NOT IN and BETWEEN pitfalls, explicit joins and CTEs, indexing, safe migrations, least-privilege roles, and transactional tests.
Next.js
Next.js App Router rule: Server Components by default, async request APIs, Server Actions with Zod validation, caching and revalidation, next/image and next/font.
Go (extended)
Extended Go rule with BAD/GOOD examples: package layout, error wrapping and errors.Join, allocation-aware performance, context and errgroup concurrency, API design, table-driven tests, and govulncheck.
FastAPI
Guidelines for building maintainable, secure FastAPI services: domain-module layout, Annotated dependencies, pydantic-settings, thread-pool offloading, and structured logging.
Writing Tests
Write unit and integration tests for existing code in the project's own ecosystem. Detects the test runner, identifies untested paths, and writes tests with proper mocking, edge cases, and assertio...
Writing Commit Messages
Write clear, conventional commit messages with proper type prefixes, scopes, and body content. Use when the user asks to commit, write a commit message, or review staged changes for a commit.
Visual Qa Testing
Visually QA a web application in the harness's browser tool: screenshot the changed page, read console errors, and check for failed network requests. Use after making UI changes to verify they look...
Verification Before Completion (superpowers skill)
Jesse Vincent's skill that forbids claiming success without running the verification command and reading its output first; evidence before assertions.
Test-Driven Development (superpowers skill)
Jesse Vincent's TDD skill: the iron law (watch the test fail first), red-green-refactor steps, rationalization red flags and a guide to writing good tests.
TDD red/green/refactor loop
Strict red/green/refactor loop with a behavior list, one failing test at a time, and explicit stop points for user confirmation.
Systematic Debugging (superpowers skill)
Jesse Vincent's debugging skill: four-phase root-cause process, root-cause tracing, defense in depth, condition-based waiting, and a test-polluter finder script.
Suggesting Skills
When the user struggles with a task that a known skill could handle, suggest installing or using a skill from the project's `.agents/skills/` directory.
SQL query explainer and optimizer
Explains a SQL query clause by clause, reads EXPLAIN output for scans, misestimates, loops and spills, and proposes verified index and rewrite fixes per engine.
OWASP-oriented security review of a diff
Boundary-tagged diff review that traces inputs to sinks, applies a 13-section OWASP checklist from references/, and reports severity-rated findings with fixes.