Mallard Bay shared cursor rules
npm install @mallardbay/cursor-rulesA tool for managing Cursor IDE rules and Claude Code configuration across different environment types with shared base configurations.
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/.mdc files and .cursor/skills//SKILL.md files
- Claude Code: A combined CLAUDE.md file and .claude/skills/*/SKILL.md files
- Codex: A combined AGENTS.md file and .codex/skills/*/SKILL.md files
- 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 rules
- frontend-lib: Extended rules for frontend library development, inheriting from frontend rules
- backend: Backend development rules
``bash`
npm install @mallardbay/cursor-rules
To set up Cursor rules for your project, run:
`bash`
npx @mallardbay/cursor-rules
Where can be either:
- frontendfrontend-lib
- backend
-
`bashFor frontend development
npx @mallardbay/cursor-rules frontend
Project 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 rules
`Rule Inheritance
The rules follow an inheritance pattern:
- All environments include the shared base rules
-
frontend-lib inherits rules from both frontend and frontend-lib directoriesOutput
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
$3
1. Create
.mdc files in the appropriate rules directory
2. Rules will be automatically copied to .cursor/rules/ when running the setup script$3
1. Create a skill directory in
.cursor/shared/skills/your-skill-name/
2. Add a SKILL.md file with YAML frontmatter and instructions
3. Optionally add scripts/, references/, or assets/ directories
4. Skills will be automatically copied to .cursor/skills/, .claude/skills/, and .codex/skills/ when running the setup script for cross-platform compatibility
5. See SKILLS.md for detailed documentation$3
-
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 rulesThis 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
See SKILLS.md for complete documentation on:
- Creating new skills
- Installing skills from GitHub
- Skill structure and format
- Best practices
[Add your license information here]