cursorrules

A collection of Cursor IDE rules that guide AI-assisted coding in a Python project. Cursor is a code editor with built-in AI interactions.

In plain words
What is it for?
Applying coding, testing, linting, formatting, file-handling, security, and change-scope rules during every AI interaction in the project.
Why use it?
It sets project-specific expectations for reading files, making focused changes, testing, formatting, typing, and avoiding unsafe or out-of-scope edits.

Cursor rule for Cursor

Install

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.

agentmods
npx agentmods add rules/mikiships/agentmd/cursorrules
Clone the repo
git clone --depth 1 https://github.com/mikiships/agentmd

Made for: Cursor.

Per session 552 This file is loaded in full into every session.
When invoked 552 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5 $0.00552 $0.00552
Opus 5 $0.00276 $0.00276
Sonnet 5 $0.00110 $0.00110
Haiku 4.5 $0.00055 $0.00055

Measured yesterday against content hash d6dd9c33ccc0, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

cursorrules 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 yesterday.

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.

.cursorrules · 64 lines

How it starts

The opening of the file, as written. The whole thing — 64 lines — stays where its author put it; the contents beside it link to each section on GitHub.

.cursorrules

Cursor IDE rules. These rules are applied to every AI interaction in this project.

Always

  • Read the relevant source files before making changes.
  • Make minimal, targeted edits — avoid reformatting unrelated code.
  • Respect the existing code style (indentation, naming, import order).
  • Run python3 -m pytest tests/ -x after every non-trivial change.
  • Run ruff check . && ruff format --check . before finalizing changes.
  • Add type annotations to all new public functions.
  • Use pathlib.Path instead of os.path for file operations.

Never

  • Never commit API keys, tokens, or credentials.
  • Never delete tests to make the suite pass.
  • Never use TODO comments without a linked issue or explanation.
  • Never make changes outside the scope of the current task without flagging them.
  • Never use except: without specifying the exception type.
  • Never use eval() or exec() on untrusted input.

Project Overview

Primary languages: Python Package managers: pip CI: GitHub Actions

Build, Test, and Lint Commands

Install dependencies:

pip install -e '.[dev]'

Run tests:

python3 -m pytest tests/ -x

Lint / format:

ruff check . && ruff format --check .

Directory Structure

Top-level directories: .github, agentmd, tests Test roots: tests Most-changed directories: agentmd, tests, README.md, pyproject.toml, progress-log.md

File Patterns

Test files: tests/** Python source: **/*.py Python tests: **/test_*.py, **/*_test.py

Conventions Inferred from Codebase

Commit prefix style: feat, fix, chore, docs, feat(d3) (follow this pattern) Common file extensions: .pyc, .py, .md, .toml, .yml

  • Python: use type hints on all public functions
  • Python: snake_case for functions/variables, PascalCase for classes
  • Tests: files named test_*.py, functions named test_*

Context Preferences

When writing or reviewing code, prefer to include in context:

  • tests/ (primary code locations)
  • The file being edited and its direct imports.
  • Relevant test files alongside source files.
  • Configuration files when modifying build or tooling behavior.

Read the full file on GitHub · 64 lines

Changes

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.

  1. yesterday First seen · 64 lines · 552 tokens per session scan A d6dd9c33ccc0

Subscribe to this mod's changes

cursorrules is a cursor rule published in the GitHub repository mikiships/agentmd (12 stars, last pushed 5mo ago), licensed MIT. It adds 552 tokens to every session, about $0.0028 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-08-30.