rule-updater
Skill for programmatically reading, updating, and creating Cursor rules based on patterns and lessons learned
Install
mkdir -p .claude/skills/rule-updater && curl -L -o skill.zip "https://mcp.directory/api/skills/download/1483" && unzip -o skill.zip -d .claude/skills/rule-updater && rm skill.zipInstalls to .claude/skills/rule-updater
About this skill
Rule Updater Skill
This skill enables programmatic reading, updating, and creation of Cursor rules based on patterns extracted from PRs, issues, and user interactions.
When to Use
Use this skill when:
- Updating existing rules with new examples or patterns
- Creating new rules for emerging patterns
- Identifying when rules need updating
- Testing rule effectiveness
- Organizing and maintaining rules
Key Capabilities
1. Read Existing Rules
Read and parse rule files:
- Read
.cursor/rules/*.mdcfiles - Parse frontmatter (description, alwaysApply, references)
- Extract content sections
- Understand rule structure
Example:
# Read a rule file
rule_content = read_file(".cursor/rules/common-mistakes.mdc")
# Parse frontmatter
# Extract sections
# Understand structure
2. Identify When Rules Need Updating
Detect update opportunities:
- New patterns that fit existing rules
- Examples that should be added
- Clarifications needed
- Outdated information
Signals:
- Multiple PRs/issues showing same pattern
- User corrections revealing gaps
- Review feedback indicating missing guidance
- Emerging patterns not covered
3. Update Existing Rules
Process for updating:
- Read the rule file
- Identify where to add new content
- Add examples or sections
- Maintain organization
- Update references if needed
- Write updated rule
Update types:
- Add examples: Add new examples to existing sections
- Enhance sections: Expand existing sections with more detail
- Add sections: Add new sections for new patterns
- Update references: Add links to related rules/PRs/issues
Example update:
### Using Deprecated Functions
**Problem**: Using functions that have been deprecated or removed.
**Examples from PR #3567**:
- ❌ Used `postprocess_conversation()` which was deprecated
- ❌ Assumed functions exist without checking current codebase state
**NEW EXAMPLE from PR #3621**:
- ❌ Used `old_function()` which was removed in PR #3400
4. Create New Rules
Process for creating:
- Identify the pattern category
- Collect 2-3 examples from PRs/issues/interactions
- Determine rule file name and location
- Write rule following format
- Add frontmatter with appropriate metadata
- Link from related rules
Rule structure:
---
description: "Brief description"
alwaysApply: true/false
references:
- related-file.md
---
# Rule Title
## Section 1
Content...
## Section 2
Content...
## Related Rules
- Link to related rules
Example new rule:
---
description: "Guidelines for handling background operations"
alwaysApply: true
---
# Background Operations
Features should work when app is closed/backgrounded.
## Common Mistakes
- Features that only work when app is open (#4355)
- Features that require specific screen to be active
## How to Avoid
- Design features to work in background
- Test with app closed/backgrounded
- Use background services where appropriate
5. Test Rule Effectiveness
Verify updates don't break guidance:
- Check rule syntax is valid
- Verify frontmatter is correct
- Ensure links work
- Test rule readability
Metrics to track:
- How often rule prevents mistakes
- Reduction in related issues after rule creation
- Rule coverage (scenarios covered)
- User feedback on rule usefulness
Rule File Format
Frontmatter
---
description: "Brief description of what the rule covers"
alwaysApply: true # or false
references:
- related-file.md
- docs/doc/example.mdx
globs:
- "backend/**/*.py" # Optional: file patterns
---
Content Structure
# Rule Title
Brief introduction explaining the rule.
## Section 1
Content with examples, code snippets, etc.
## Section 2
More content...
## Related Rules
- `.cursor/rules/related-rule.mdc` - Description
## Related Cursor Resources
### Skills
- `.cursor/skills/related-skill/SKILL.md` - Description
### Commands
- `/related-command` - Description
Update Patterns
Adding Examples
When: New examples of existing patterns emerge
How:
- Find relevant section
- Add example with source (PR/issue number)
- Maintain formatting consistency
- Keep examples organized
Example:
### Common Mistake
**Example from PR #3567**:
- ❌ Description of mistake
**Example from Issue #4394**:
- ❌ Description of mistake
Enhancing Sections
When: Section needs more detail or clarification
How:
- Expand existing content
- Add more specific guidance
- Include more examples
- Add "How to avoid" subsections
Adding Sections
When: New pattern category emerges
How:
- Add new section with appropriate heading
- Follow existing section format
- Include examples
- Add to table of contents if applicable
Rule Organization
Rule Categories
Common categories:
- Common mistakes
- Architecture patterns
- Implementation checklists
- Verification guidelines
- Communication best practices
- Domain-specific patterns (Omi, backend, Flutter, etc.)
Naming Conventions
Rule file names:
- Use kebab-case:
common-mistakes.mdc - Be descriptive:
pre-implementation-checklist.mdc - Group related:
backend-architecture.mdc,backend-api-patterns.mdc
Linking Rules
Cross-references:
- Link related rules in "Related Rules" section
- Reference from other rules when relevant
- Keep links updated when rules are renamed
Best Practices
- Be specific: Include concrete examples, not vague patterns
- Reference sources: Always note which PR/issue/interaction the lesson came from
- Maintain organization: Keep rules well-organized and easy to navigate
- Test updates: Verify rule updates don't break existing guidance
- Prioritize: Focus on patterns that cause the most problems
- Iterate: Rules should improve over time as more data is collected
Example Workflow
Updating a rule with new pattern:
- Identify pattern: "Multiple PRs show missing context issue"
- Read rule: Read
.cursor/rules/context-communication.mdc - Find section: Find "PR Description Requirements" section
- Add example: Add example from recent PR
- Enhance guidance: Expand "What to Include" subsection
- Update references: Add link to new PR if relevant
- Write rule: Save updated rule file
- Verify: Check syntax and links
Creating new rule:
- Identify pattern: "New pattern: Background operation issues"
- Collect examples: Gather 2-3 examples from issues/PRs
- Determine name:
background-operations.mdc - Write rule: Create rule following format
- Add frontmatter: Include description, alwaysApply, references
- Link from related: Add link from
common-mistakes.mdc - Test: Verify rule is valid and readable
Related Cursor Resources
Rules
.cursor/rules/common-mistakes.mdc- Common mistakes rule.cursor/rules/context-communication.mdc- Communication rule.cursor/rules/pre-implementation-checklist.mdc- Checklist rule
Skills
.cursor/skills/self-improvement/SKILL.md- Self-improvement meta-skill
Commands
/learn-from-pr- Analyze PR for lessons/self-improve- Analyze patterns and update rules
More by BasedHardware
View all →You might also like
flutter-development
aj-geddes
Build beautiful cross-platform mobile apps with Flutter and Dart. Covers widgets, state management with Provider/BLoC, navigation, API integration, and material design.
drawio-diagrams-enhanced
jgtolentino
Create professional draw.io (diagrams.net) diagrams in XML format (.drawio files) with integrated PMP/PMBOK methodologies, extensive visual asset libraries, and industry-standard professional templates. Use this skill when users ask to create flowcharts, swimlane diagrams, cross-functional flowcharts, org charts, network diagrams, UML diagrams, BPMN, project management diagrams (WBS, Gantt, PERT, RACI), risk matrices, stakeholder maps, or any other visual diagram in draw.io format. This skill includes access to custom shape libraries for icons, clipart, and professional symbols.
godot
bfollington
This skill should be used when working on Godot Engine projects. It provides specialized knowledge of Godot's file formats (.gd, .tscn, .tres), architecture patterns (component-based, signal-driven, resource-based), common pitfalls, validation tools, code templates, and CLI workflows. The `godot` command is available for running the game, validating scripts, importing resources, and exporting builds. Use this skill for tasks involving Godot game development, debugging scene/resource files, implementing game systems, or creating new Godot components.
nano-banana-pro
garg-aayush
Generate and edit images using Google's Nano Banana Pro (Gemini 3 Pro Image) API. Use when the user asks to generate, create, edit, modify, change, alter, or update images. Also use when user references an existing image file and asks to modify it in any way (e.g., "modify this image", "change the background", "replace X with Y"). Supports both text-to-image generation and image-to-image editing with configurable resolution (1K default, 2K, or 4K for high resolution). DO NOT read the image file first - use this skill directly with the --input-image parameter.
ui-ux-pro-max
nextlevelbuilder
"UI/UX design intelligence. 50 styles, 21 palettes, 50 font pairings, 20 charts, 8 stacks (React, Next.js, Vue, Svelte, SwiftUI, React Native, Flutter, Tailwind). Actions: plan, build, create, design, implement, review, fix, improve, optimize, enhance, refactor, check UI/UX code. Projects: website, landing page, dashboard, admin panel, e-commerce, SaaS, portfolio, blog, mobile app, .html, .tsx, .vue, .svelte. Elements: button, modal, navbar, sidebar, card, table, form, chart. Styles: glassmorphism, claymorphism, minimalism, brutalism, neumorphism, bento grid, dark mode, responsive, skeuomorphism, flat design. Topics: color palette, accessibility, animation, layout, typography, font pairing, spacing, hover, shadow, gradient."
rust-coding-skill
UtakataKyosui
Guides Claude in writing idiomatic, efficient, well-structured Rust code using proper data modeling, traits, impl organization, macros, and build-speed best practices.
Stay ahead of the MCP ecosystem
Get weekly updates on new skills and servers.