The Complete Guide to AI Coding Rules in 2026
Every AI coding tool has its own rules format. This guide covers all of them — SKILL.md, .cursorrules, .windsurfrules, Copilot instructions, GEMINI.md, and Kiro rules.
Quick Reference: Rules File by Tool
Claude Code
SKILL.md
Cursor
.cursorrules
Windsurf
.windsurfrules
VS Code Copilot
copilot-instructions.md
Gemini CLI
GEMINI.md
Amazon Kiro
.kiro/rules/*.md
All Formats in Detail
Claude Code
GuideRule Files
- SKILL.md (in .claude/skills/)
- CLAUDE.md (project root)
Scope
Project or global, per-skill modular
Setup: Create .claude/skills/skill-name.md with frontmatter
--- name: typescript-expert description: TypeScript strict patterns --- Always use strict TypeScript...
Cursor
GuideRule Files
- .cursorrules (project root)
- .cursor/rules/*.md (named rules)
Scope
Project-level, applies to all Cursor AI interactions
Setup: Create .cursorrules in project root
You are a TypeScript expert. Always use strict mode...
Windsurf
GuideRule Files
- .windsurfrules (project root)
- Global Rules (Settings UI)
Scope
Project or global, hierarchical directories
Setup: Create .windsurfrules in project root
TypeScript strict mode required. No any types...
VS Code + GitHub Copilot
GuideRule Files
- .github/copilot-instructions.md
- Settings → Copilot instructions
Scope
Repository-level
Setup: Create .github/copilot-instructions.md
## Project Instructions This is a Next.js 15 App Router project...
Gemini CLI
GuideRule Files
- GEMINI.md (project root or ~/.gemini/GEMINI.md for global)
Scope
Project or global
Setup: Create GEMINI.md in project root
# Project Overview TypeScript Next.js project. Always use App Router patterns...
Amazon Kiro
GuideRule Files
- .kiro/rules/*.md
Scope
Project-level rule modules
Setup: Create .kiro/rules/ directory with rule files
--- name: security-rules --- All API routes must authenticate...
Universal Principles for Writing Good AI Rules
Regardless of which tool you use, these principles make rules more effective:
Be specific, not aspirational
✓ Good
Use parameterized queries for all SQL
✗ Avoid
Write secure code
Use imperatives
✓ Good
Always add error handling for async functions
✗ Avoid
Error handling is important
Include anti-patterns
✓ Good
Never use any in TypeScript
✗ Avoid
Use TypeScript correctly
Reference your stack
✓ Good
Use shadcn/ui components from /components/ui/
✗ Avoid
Use a component library
Keep it scannable
✓ Good
Bullet points, headers, grouped by topic
✗ Avoid
Dense paragraphs of instructions
The Multi-Tool Strategy
Many developers use multiple AI tools. Here's how to maintain rules across all of them without duplicating work:
- Write your rules once in Markdown format
- Create tool-specific wrapper files that reference the same content
- Use a shared
AI_RULES.mdat the project root and import/reference it in each tool's config - Or maintain separate files per tool — they're small and tool-specific tweaks are often needed anyway
What Goes in Rules vs CLAUDE.md / README?
| Content | Goes in |
|---|---|
| What the project is, tech stack, architecture | CLAUDE.md / README |
| Coding conventions and patterns to follow | Rules files (SKILL.md / .cursorrules) |
| Anti-patterns to avoid | Rules files |
| How to run the project | README |
| Team standards for code quality | Rules files (committed to git) |
| API keys and configuration | .env files (never in rules) |
Frequently Asked Questions
Which AI tool has the best rules support?
Claude Code's SKILL.md system is the most flexible — modular, named skills that you can mix and match. Cursor's .cursorrules is the most widely adopted due to Cursor's popularity. Both are excellent in practice.
Should I create different rules for different team members?
Project rules (committed to git) should apply to everyone. Personal preferences go in global rules (in your tool's settings, not committed). This separation gives consistency where it matters and flexibility where it doesn't.
Start with the Must-Have Skills
Get the complete starter set of AI Skills covering every part of your stack.