Skip to content
Trending 2026→One of the top-searched agent skills of 2026.

// Generate .cursorrules / .cursor/rules.mdc files that actually teach Cursor your codebase conventions.

Cursor Rules Generator

skill --stat
  • last update

    May 27, 2026

  • license

    MITv1.0.0

  • format

    SKILL.md

quickstart.sh
3 steps
  1. Install

    // Downloads SKILL.md into ~/.claude/skills/cursor-rules-generator/

    $ curl -fsSL --create-dirs -o ~/.claude/skills/cursor-rules-generator/SKILL.md https://claudeskil.com/skills/cursor-rules-generator/SKILL.md
  2. Invoke

    // Inside Claude Code, type the skill name as a slash command

    > /cursor-rules-generator wire up a GitHub Actions deploy
  3. Or just ask

    // Claude loads the skill by itself when a request matches its description

    > wire up a GitHub Actions deploy
cursor-rules-generator/
references
SKILL.md
readonly
name:
Cursor Rules Generator
slug:
cursor-rules-generator
version:
v1.0.0
license:
MIT
author:
@chiragthummar16
categories:
tags:
#cursor#cursor-rules#ai-coding#ide#conventions
description:

Generate .cursorrules / .cursor/rules.mdc files that actually teach Cursor your codebase conventions.

README.md

cursor-rules-generator/README.md
7 sections

Cursor Rules Generator

Cursor's AI is only as good as the context it has about your codebase. Without explicit rules it guesses at your conventions — and keeps reaching for the wrong import style, the wrong test framework, or a folder layout you abandoned months ago. This skill scans your repo and writes a .cursorrules (legacy) or .cursor/rules/*.mdc (current Project Rules) file grounded in how your code is actually written, so Cursor stops guessing.

When to use it

  • You just adopted Cursor on an existing project and want it productive on day one.
  • Cursor keeps generating code in a style your team doesn't use (default exports vs. named, axios vs. fetch, class components vs. hooks).
  • You're migrating from the deprecated root .cursorrules to the newer .cursor/rules directory format.
  • A new monorepo package needs its own scoped rules separate from the rest.

How it works

The skill reads representative source files, config (package.json, tsconfig.json, eslint/prettier configs, vitest/jest setup), and folder structure, then infers and documents:

  • Naming & layout — file casing, component/hook/util locations, barrel-file usage.
  • Imports — path aliases (e.g. @/), import ordering, named vs. default.
  • Framework rules — React Server vs. Client components, Next.js App Router conventions, data-fetching patterns.
  • Testing — which runner, where specs live, naming (*.test.ts vs. *.spec.ts).
  • Error handling — Result types, custom error classes, logging conventions.

It emits MDC files with proper frontmatter (description, globs, alwaysApply) so rules attach to the right files. alwaysApply: true rules load on every request; globs-scoped rules activate only when matching files are in context.

Example

bash
curl -fsSL --create-dirs -o ~/.claude/skills/cursor-rules-generator/SKILL.md https://claudeskil.com/skills/cursor-rules-generator/SKILL.md

# then, in your project:
"Generate Cursor rules for this repo using the .mdc format"

Produces .cursor/rules/general.mdc:

mdc
---
description: Project-wide conventions
globs: ["**/*.ts", "**/*.tsx"]
alwaysApply: true
---
- Use named exports; no default exports except Next.js pages.
- Import internal modules via the `@/` alias, never relative `../../`.
- Co-locate tests as `Component.test.tsx` and run with Vitest.
- Server Components by default; add `"use client"` only when hooks/events are needed.

Tips & gotchas

  • Prefer the .cursor/rules directory over a single root .cursorrules — the latter is deprecated and harder to scope. Multiple focused .mdc files beat one giant rule.
  • Keep alwaysApply rules short. Everything marked always-apply consumes context on every prompt; reserve globs for the rest.
  • In monorepos, place package-specific .mdc files inside each package's .cursor/rules/ rather than cramming everything at the root.
  • Regenerate after big refactors — stale rules actively mislead Cursor.

FAQ

Does this replace my ESLint/Prettier config? No. Those enforce style mechanically; this teaches the AI before it writes code, reducing churn the linter would otherwise catch.

Legacy .cursorrules or new .mdc? Both are supported. The skill defaults to .cursor/rules/*.mdc since Cursor is phasing out the single-file format; ask for .cursorrules if you need it.

Will it overwrite my existing rules? It reads what you have and merges rather than clobbering, but review the diff before committing.

$ cat reviews/

Reviews

// No reviews yet. Be the first.
Loading review form…

$ ls related/

explore all →