cursor-rules

A set of rules for creating and organizing Cursor rules, which are instruction files that guide the Cursor coding assistant in a project. It defines their metadata, Markdown structure, location, filenames, and content expectations.

In plain words
What is it for?
Use it when adding or reviewing .mdc rule files under a project's .cursor/rules/ directory.
Why use it?
It keeps Cursor rule files consistent and discoverable, so project-specific instructions follow the required format and location.

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/nirarad/playwright-ai-qa-agent/cursor-rules
Clone the repo
git clone --depth 1 https://github.com/nirarad/playwright-ai-qa-agent

Made for: Cursor.

Per session 760 This file is loaded in full into every session.
When invoked 760 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.00760 $0.00760
Opus 5 $0.00380 $0.00380
Sonnet 5 $0.00152 $0.00152
Haiku 4.5 $0.00076 $0.00076

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

Security

Grade A, and why

cursor-rules 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 2d 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.

.cursor/rules/cursor-rules.mdc · 133 lines

How it starts

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

Cursor Rules Management Guide

Rule Structure Format

Every cursor rule must follow this exact metadata and content structure:

---
description: Short description of the rule's purpose
globs: optional/path/pattern/**/*
alwaysApply: false
---
# Rule Title

Main content explaining the rule with markdown formatting.

1. Step-by-step instructions
2. Code examples
3. Guidelines

Example:
```typescript
// Good
function goodExample() {
  // Correct implementation
}

// Bad example
function badExample() {
  // Incorrect implementation
}
```

File Organization

Required Location

All cursor rule files must be placed in:

PROJECT_ROOT/.cursor/rules/

Directory Structure

PROJECT_ROOT/
├── .cursor/
│   └── rules/
│       ├── your-rule-name.mdc
│       ├── another-rule.mdc
│       └── cursor-rules.mdc
└── ...

Naming Conventions

  • Use kebab-case for all filenames
  • Always use .mdc extension
  • Make names descriptive of the rule's purpose
  • Examples: typescript-style.mdc, tailwind-styling.mdc, mdx-documentation.mdc

Content Guidelines

Writing Effective Rules

  1. Be specific and actionable - Provide clear instructions
  2. Include code examples - Show both good and bad practices
  3. Reference existing files - Use @filename.ext format
  4. Keep it focused - One rule per concern/pattern
  5. Add context - Explain why the rule exists

Code Examples Format

// ✅ Good: Clear and follows conventions
function processUser({ id, name }: { id: string; name: string }) {
  return { id, displayName: name };
}

// ❌ Bad: Unclear parameter passing
function processUser(id: string, name: string) {
  return { id, displayName: name };
}

File References

When referencing project files in rules, use this pattern to mention other files:

[file.tsx](mdc:path/to/file.tsx)

Forbidden Locations

Never place rule files in:

  • Project root directory
  • Any subdirectory outside .cursor/rules/
  • Component directories
  • Source code folders
  • Documentation folders

Read the full file on GitHub · 133 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. 2d ago First seen · 133 lines · 760 tokens per session scan A e9794b2bb908

Subscribe to this mod's changes

cursor-rules is a cursor rule published in the GitHub repository nirarad/playwright-ai-qa-agent (5 stars, last pushed 4mo ago), licensed MIT. It adds 760 tokens to every session, about $0.0038 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-31.