DevTools Logo

AI Editor Rules Generator

AI Editor Rules Generator

Write one spec, then emit correctly placed rules files for Cursor, Claude, AGENTS.md and Copilot.

Runs in your browser
Try an example

Rules spec

TypeScript / React · TypeScript / React · 3 style · 3 testing · 3 git · 2 do · 2 don't · 0 file(s)
Output targets

Rules are generated live as you edit. Download each file into the shown path.

Generated files

155 lines · 3,865 chars

.cursor/rules/style.mdc

11 lines
---
description: "Code style and structure conventions"
globs: "**/*.{ts,tsx}"
alwaysApply: false
---
## Style

- Use TypeScript strict mode; avoid `any` and untyped third-party wrappers.
- Prefer named exports and small function components with explicit prop types.
- Colocate component styles and keep shared UI in the component library.

.cursor/rules/testing.mdc

17 lines
---
description: "Testing conventions and commands"
globs: "**/*.test.*"
alwaysApply: false
---
## Testing

- Test behavior through public APIs, not implementation details.
- Use Testing Library queries by role or label before falling back to test ids.
- Keep unit tests fast and deterministic; avoid real timers and network calls.

## Commands

- Test: `pnpm test`
- Lint: `pnpm lint`
- Build: `pnpm build`

.cursor/rules/git.mdc

10 lines
---
description: "Commit and version-control conventions"
alwaysApply: true
---
## Git and commits

- Use conventional commit subjects: feat, fix, docs, refactor, test, chore.
- Keep each commit focused; do not mix formatting with behavior changes.
- Never commit secrets, generated artifacts or local environment files.

.cursor/rules/conventions.mdc

14 lines
---
description: "Project dos and donts"
alwaysApply: true
---
## Do

- Run the test and type checks before opening a pull request.
- Write original code with clear names and small, reviewable diffs.

## Do not

- Do not suppress lint or type errors without an explanatory comment.
- Do not introduce a dependency for a one-line helper.

CLAUDE.md

38 lines
# CLAUDE.md

Instructions for Claude Code working in this repository.

## Style

- Use TypeScript strict mode; avoid `any` and untyped third-party wrappers.
- Prefer named exports and small function components with explicit prop types.
- Colocate component styles and keep shared UI in the component library.

## Testing

- Test behavior through public APIs, not implementation details.
- Use Testing Library queries by role or label before falling back to test ids.
- Keep unit tests fast and deterministic; avoid real timers and network calls.

## Git and commits

- Use conventional commit subjects: feat, fix, docs, refactor, test, chore.
- Keep each commit focused; do not mix formatting with behavior changes.
- Never commit secrets, generated artifacts or local environment files.

## Do

- Run the test and type checks before opening a pull request.
- Write original code with clear names and small, reviewable diffs.

## Do not

- Do not suppress lint or type errors without an explanatory comment.
- Do not introduce a dependency for a one-line helper.

## Commands

- Test: `pnpm test`
- Lint: `pnpm lint`
- Build: `pnpm build`

AGENTS.md

38 lines
# AGENTS.md

Instructions for human and AI contributors to this repository.

## Style

- Use TypeScript strict mode; avoid `any` and untyped third-party wrappers.
- Prefer named exports and small function components with explicit prop types.
- Colocate component styles and keep shared UI in the component library.

## Testing

- Test behavior through public APIs, not implementation details.
- Use Testing Library queries by role or label before falling back to test ids.
- Keep unit tests fast and deterministic; avoid real timers and network calls.

## Git and commits

- Use conventional commit subjects: feat, fix, docs, refactor, test, chore.
- Keep each commit focused; do not mix formatting with behavior changes.
- Never commit secrets, generated artifacts or local environment files.

## Do

- Run the test and type checks before opening a pull request.
- Write original code with clear names and small, reviewable diffs.

## Do not

- Do not suppress lint or type errors without an explanatory comment.
- Do not introduce a dependency for a one-line helper.

## Commands

- Test: `pnpm test`
- Lint: `pnpm lint`
- Build: `pnpm build`

Save each download in the path shown in its header. Review generated instructions before committing them to a repository.

Examples

One spec, four assistants

Input
TypeScript/React template · targets: Cursor, Claude, AGENTS.md
Output
.cursor/rules/style.mdc, .cursor/rules/testing.mdc, .cursor/rules/git.mdc, .cursor/rules/conventions.mdc, CLAUDE.md, AGENTS.md

Each Cursor section becomes its own scoped file; the markdown targets receive the same rules in a single document.

Import a CLAUDE.md

Input
# CLAUDE.md
## Style
- Keep functions small
## Do
- Run checks
Output
style: [Keep functions small] · dos: [Run checks]

Heading heuristics map style, testing, git, do, do-not and command sections; unmatched headings are preserved in Additional notes.

Catch a glob typo

Input
Style glob: **.tsx
Output
Warning: use **/*.tsx instead.

Inline lint explains the correction before a rule file with a broken glob is downloaded.

About this tool

AI Editor Rules Generator turns a single declarative spec into the rules files that different coding assistants actually read. Select a stack, edit style, testing and git conventions, add do/don't lists and commands, then choose the targets you need: Cursor's modern .cursor/rules/*.mdc files, legacy .cursorrules, CLAUDE.md, AGENTS.md or .github/copilot-instructions.md.

Each target has its own format dialect and placement. Cursor rules get quoted YAML frontmatter, stack-aware globs and one file per section; markdown targets get plain headings and bullets; the Copilot file is a single repository-wide document. Rules are never silently dropped when switching targets, and inline validation warns about malformed globs, conflicting do/don't entries and over-long files.

Import accepts an existing CLAUDE.md, AGENTS.md or generated MDC file, parses its headings into the editable model and lets you re-emit other formats from it. All emission and parsing happen in your browser tab: no spec content is uploaded, and generated files are downloaded with their repository paths shown in each card header.

What this tool does not do

  • The import parser uses heading heuristics: unusual bespoke rules files may place more content in Additional notes than expected.
  • Generated files instruct assistants but cannot guarantee any particular model behavior; review them before committing.
  • Downloading several files saves individual downloads with path-aware names — place each in the directory shown on its card.
  • Frontmatter is quoted for YAML safety but is not validated against a full YAML implementation.

How to use this tool

  1. Pick a stack template

    Choose TypeScript/React, Python, Go or Rust. The template seeds original, editable rules and matching default globs.

  2. Edit the rule sections

    Use the Style, Testing, Git, Do and Do not tabs; enter one rule per line and adjust commands and globs underneath.

  3. Choose output targets

    Check any combination of Cursor modern, Cursor legacy, Claude, AGENTS.md and Copilot. Cards update immediately.

  4. Review and download

    Read the validation notes, copy individual files or download each one into the path printed in its header.

Use cases

Standardize a team

Keep one canonical spec and emit rules for teammates using different editors, avoiding hand-maintained near-duplicates.

Open-source onboarding

Generate AGENTS.md for contributors and CLAUDE.md for Claude Code users from the same conventions.

Audit a client repository

Import existing rules files, normalize them into the spec and re-emit clean, consistently placed files.

Teach rules-file formats

Switch targets side by side to show how the same rule becomes frontmatter, plain text or markdown.

Where each assistant reads rules

TargetFile path
Cursor (modern).cursor/rules/*.mdc
Cursor (legacy).cursorrules
Claude CodeCLAUDE.md
Generic agentsAGENTS.md
GitHub Copilot.github/copilot-instructions.md

Globs are derived from the selected stack: TypeScript **/*.{ts,tsx}, Python **/*.py, Go **/*.go, Rust **/*.rs, with matching test patterns.

Common mistakes

Mistake:Shipping both .cursorrules and .cursor/rules and wondering why edits have no effect.

Fix:The tool warns when both targets are selected; choose the modern rules folder for current Cursor versions.

Mistake:Using TypeScript globs for a Python or Go repository.

Fix:Pick the matching stack chip so the MDC frontmatter uses **/*.py, test_*.py or *_test.go.

Mistake:Writing enormous instruction files that crowd the model's context.

Fix:Watch the line-count and Copilot single-file warnings; keep rules short and concrete.

Mistake:Listing a rule as both a do and a don't.

Fix:Resolve the conflict warning in the validation panel before exporting.

Frequently asked questions

Where does each AI tool read rules from?

Cursor reads .cursor/rules/*.mdc files (and legacy .cursorrules in older versions), Claude Code reads CLAUDE.md at the project root, vendor-neutral agents look for AGENTS.md, and GitHub Copilot reads .github/copilot-instructions.md. The generator emits each path with its correct format so you do not have to remember the conventions.

What's the difference between .cursorrules and .cursor/rules?

.cursorrules is one plain-text file used by older Cursor versions. .cursor/rules is a folder of .mdc files with YAML frontmatter describing a purpose, globs and whether the rule always applies. Current Cursor versions prefer the folder; the tool warns if both formats are selected together.

Should rules live in CLAUDE.md or AGENTS.md?

CLAUDE.md is read by Claude Code; AGENTS.md is a cross-tool convention many agents understand. Many teams keep the full instructions in AGENTS.md and put a short pointer in CLAUDE.md. This tool emits either or both from the same spec so the wording cannot drift.

How do globs work in Cursor rules?

The globs frontmatter field decides which files a rule applies to: **/*.{ts,tsx} targets TypeScript sources, **/*.test.* targets tests. Rules with alwaysApply: true need no glob because they apply everywhere. Defaults come from the chosen stack, and the inline lint flags common typos like **.tsx with the corrected form.

How long should rules files be?

Keep them short and concrete: a few dozen focused rules beat a wall of prose that consumes model context on every request. The validation panel warns past roughly 500 lines per file and specifically flags Copilot's single file past 300 lines, suggesting scoped instruction files instead.

Does the tool upload my rules or conventions?

No. Emission, import parsing and validation are pure browser-side operations. Files are generated locally and copied or downloaded through your browser; nothing is sent to a server and no spec content is stored in a remote service.

References & standards