@mallardbay/cursor-rules
v1.0.28
Published
Mallard Bay shared cursor rules
Downloads
20,368
Readme
Cursor Rules
A tool for managing Cursor IDE rules and Claude Code configuration across different environment types with shared base configurations.
Overview
This project provides a structured way to manage AI agent rules and skills for different development environments while maintaining a shared base configuration. It generates:
- Cursor IDE:
.cursor/rules/*.mdcfiles and.cursor/skills/*/SKILL.mdfiles - Claude Code: A combined
CLAUDE.mdfile and.claude/skills/*/SKILL.mdfiles - Codex: A combined
AGENTS.mdfile and.codex/skills/*/SKILL.mdfiles - Cross-platform Skills: Skills are automatically copied to all three platform directories for maximum compatibility
It supports three main environment types:
frontend: Basic frontend development rulesfrontend-lib: Extended rules for frontend library development, inheriting from frontend rulesbackend: Backend development rules
Installation
npm install @mallardbay/cursor-rulesUsage
To set up Cursor rules for your project, run:
npx @mallardbay/cursor-rules <env-type>Where <env-type> can be either:
frontendfrontend-libbackend
Example
# For frontend development
npx @mallardbay/cursor-rules frontend
# For frontend library development
npx @mallardbay/cursor-rules frontend-lib
# For backend development
npx @mallardbay/cursor-rules backendProject Structure
The rules and skills are organized in the following directory structure:
.cursor/
├── shared/
│ ├── rules/ # Shared base rules
│ └── skills/ # Shared skills (installable workflows)
├── frontend/
│ └── rules/ # Frontend-specific rules
├── frontend-lib/
│ └── rules/ # Frontend library-specific rules
└── backend/
└── rules/ # Backend-specific rulesRule Inheritance
The rules follow an inheritance pattern:
- All environments include the shared base rules
frontend-libinherits rules from bothfrontendandfrontend-libdirectories
Output
Running the setup script generates:
your-project/
├── .cursor/
│ ├── rules/ # Cursor IDE rules (*.mdc files)
│ │ ├── code-quality.mdc
│ │ ├── testing.mdc
│ │ └── ...
│ └── skills/ # Cursor Skills (installable workflows)
│ ├── prep-for-pr/
│ │ └── SKILL.md
│ ├── review-pr/
│ │ └── SKILL.md
│ └── address-pr-feedback/
│ └── SKILL.md
├── .claude/
│ └── skills/ # Claude Code Skills (same skills)
│ ├── prep-for-pr/
│ │ └── SKILL.md
│ ├── review-pr/
│ │ └── SKILL.md
│ └── address-pr-feedback/
│ └── SKILL.md
├── .codex/
│ └── skills/ # Codex Skills (same skills)
│ ├── prep-for-pr/
│ │ └── SKILL.md
│ ├── review-pr/
│ │ └── SKILL.md
│ └── address-pr-feedback/
│ └── SKILL.md
├── CLAUDE.md # Claude Code configuration (combined rules)
└── AGENTS.md # Codex IDE configuration (combined rules)Both CLAUDE.md and AGENTS.md combine all applicable rules into single files, with YAML frontmatter stripped for compatibility. Each file includes header comments explaining its purpose and which tool uses it.
Skills are automatically discovered by Cursor, Claude Code, and Codex, and can be invoked with /skill-name in chat. The setup script copies skills to all three platform directories for cross-platform compatibility.
Development
Adding New Rules
- Create
.mdcfiles in the appropriate rules directory - Rules will be automatically copied to
.cursor/rules/when running the setup script
Adding New Skills
- Create a skill directory in
.cursor/shared/skills/your-skill-name/ - Add a
SKILL.mdfile with YAML frontmatter and instructions - Optionally add
scripts/,references/, orassets/directories - Skills will be automatically copied to
.cursor/skills/,.claude/skills/, and.codex/skills/when running the setup script for cross-platform compatibility - See SKILLS.md for detailed documentation
Directory Structure
bin/setup-cursor.sh: Main setup script.cursor/shared/rules/: Shared base rules.cursor/shared/skills/: Shared skills (installable workflows).cursor/frontend/rules/: Frontend-specific rules.cursor/frontend-lib/rules/: Frontend library-specific rules.cursor/backend/rules/: Backend-specific rules
Skills
This repository includes example Cursor Skills that can be installed:
- prep-for-pr: Prepare your branch for a PR by checking and fixing code quality issues
- review-pr: Systematically review someone else's PR with code quality, security, and standards checks
- address-pr-feedback: Find PR by branch, review feedback, create plan, implement fixes, and resolve GitHub conversations
- check-and-fix-ci: Find PR for current branch, check CI status, fix non-transient failures, and push (invoke with
/check-and-fix-ci)
See SKILLS.md for complete documentation on:
- Creating new skills
- Installing skills from GitHub
- Skill structure and format
- Best practices
License
[Add your license information here]
