prpm / rules
Cursor rule122 starsChanged 9 months agoMITView on GitHub
Guidelines for creating Kiro steering files and hooks with inclusion modes, foundational files, and event-driven automation
Where files are headingNew Cursor rule files have more rules about planning and tracking tasks, and fewer about code style.
Of the Cursor rule files we read, the 1,533 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository64 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- beanstalk-deployCursor rule
- .cursor/rules/core-principles.mdcCursor rule
- .cursor/rules/creating-agents-md.mdcCursor rule
- .cursor/rules/creating-claude-agents.mdCursor rule
- .cursor/rules/creating-claude-commands.mdCursor rule
- .cursor/rules/creating-claude-hooks.mdCursor rule
- .cursor/rules/creating-continue-packages.mdCursor rule
- .cursor/rules/creating-copilot-packages.mdCursor rule
- .cursor/rules/creating-cursor-commands.mdCursor rule
- .cursor/rules/creating-cursor-rules.mdcCursor rule
- .cursor/rules/creating-kiro-agents.mdcCursor rule
- .cursor/rules/creating-skills.mdcCursor rule
- .cursor/rules/creating-windsurf-packages.mdCursor rule
- .cursor/rules/elastic-beanstalk-deployment.mdCursor rule
- .cursor/rules/format-conversion.mdcCursor rule
- .cursor/rules/github-actions-testing.mdcCursor rule
- .cursor/rules/karen-repo-reviewer.mdcCursor rule
- .cursor/rules/prpm-json-best-practices.mdcCursor rule
- .cursor/rules/self-improve-cursor.mdcCursor rule
- .cursor/rules/testing-patterns.mdcCursor rule
- .cursor/rules/typescript-type-safety.mdcCursor rule
- .cursor/rules/typescript-type-specialist.mdcCursor rule
- creating-agent-skillsSkill
- adding-new-ai-formatSkill
- agent-builderSkill
- aws-beanstalk-expertSkill
- beanstalk-deploySkill
- claude-hook-writerSkill
- creating-agents-mdSkill
- creating-claude-agentsSkill
- creating-claude-commandsSkill
- creating-claude-hooksSkill
- creating-claude-rulesSkill
- creating-continue-packagesSkill
- creating-copilot-packagesSkill
- creating-cursor-commandsSkill
- creating-cursor-rules-skillSkill
- creating-kiro-agentsSkill
- creating-kiro-packagesSkill
- creating-opencode-agentsSkill
- creating-opencode-pluginsSkill
- creating-skillsSkill
- creating-windsurf-packagesSkill
- creating-zed-extensionsSkill
- documentation-standardsSkill
- elastic-beanstalk-deploymentSkill
- github-actions-testingSkill
- human-writingSkill
- integrating-stripe-webhooksSkill
- karen-repo-reviewerSkill
- npm-trusted-publishingSkill
- osgrepSkill
- postgres-migrationsSkill
- prpm-developmentSkill
- prpm-json-best-practicesSkill
- pulumi-troubleshootingSkill
- self-improvingSkill
- slash-command-builderSkill
- The first 60 shown.
The file
We split this creating-kiro-packages.md into the rules it gives an agent
3 rules. About 0 are common, 3 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 280
Start with foundational files: product.md, tech.md, structure.md
- Distinctive: line 281
Use always for core patterns: Code style, architecture principles
- Distinctive: line 282
Use fileMatch for specific contexts: Component rules, API patterns
≈ “Common” is an estimate: at least 1 in 5 of the 3,030 Cursor rule files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Creating Kiro Packages
Quick reference for creating Kiro steering files and hooks with context-aware inclusion and event handling.
Package Types
| Type | Location | Format | Purpose |
| Steering Files | .kiro/steering/*.md | Markdown + YAML | Context-aware instructions |
| Hooks | .kiro/hooks/*.json | JSON | Event-driven automation |
Steering Files
Inclusion Modes
| Mode | Frontmatter | When Applied |
| always (default) | inclusion: always | All contexts |
| fileMatch | inclusion: fileMatch + fileMatchPattern | Files matching pattern |
| manual | inclusion: manual | User manually triggers |
Frontmatter Reference
---
inclusion: always # always, fileMatch, or manual
fileMatchPattern: "components/**/*.tsx" # REQUIRED for fileMatch
domain: testing # Optional: for organization
---Always Included (Default)
Workspace-wide standards applied to all contexts.
---
inclusion: always
---
# Core Technology Stack
## Stack
- Frontend: React 18 + TypeScript + Vite
- Backend: Node.js + Express + Prisma
- Database: PostgreSQL
## Universal Principles
- Write self-documenting code
- Keep functions under 50 linesFileMatch (Conditional)
Applied when working with files matching the pattern.
---
inclusion: fileMatch
fileMatchPattern: "components/**/*.tsx"
domain: frontend
---
# React Component Guidelines
## Component Standards
- Use functional components with hooks
- Keep components under 200 lines
- Extract logic into custom hooksManual (On-Demand)
User explicitly activates when needed.
---
inclusion: manual
domain: performance
---
# Performance Optimization Guide
## Profiling First
- Always measure before optimizing
- Use Chrome DevTools
- Identify actual bottlenecksCommon FileMatch Patterns
# React components
fileMatchPattern: "*.tsx"
fileMatchPattern: "components/**/*.tsx"
# API routes
fileMatchPattern: "app/api/**/*"
# Tests
fileMatchPattern: "**/*.test.*"
# Documentation
fileMatchPattern: "*.md"Foundational Files
Special steering files with reserved names:
product.md
---
inclusion: always
foundationalType: product
---
# Product Context
## Mission
Build the best task management app for remote teams.
## Key Features
1. Real-time collaboration
2. Offline-first architecture
3. Natural language task input
## User Personas
- Project Manager: Needs overview and reporting
- Team Member: Needs task details and updatestech.md
---
inclusion: always
foundationalType: tech
---
# Technical Architecture
## Stack
- Frontend: React 18 + TypeScript + Vite
- Backend: Node.js + Express + Prisma
- Database: PostgreSQL
- Cache: Redis
## Architecture Patterns
- Clean architecture (domain/application/infrastructure)
- CQRS for complex operations
- Repository pattern for data accessstructure.md
---
inclusion: always
foundationalType: structure
---
# Project Structure
## Directory Layoutsrc/ api/ # API routes and controllers domain/ # Business logic and entities services/ # Application services repositories/ # Data access layer
## File Naming Conventions
- Components: PascalCase (e.g., `UserProfile.tsx`)
- Services: camelCase with Service suffix (e.g., `userService.ts`)
- Types: PascalCase (e.g., `User.ts`)Hooks
JSON configuration files for event-driven automation.
Hook Structure
{
"name": "Hook Name",
"description": "What this hook does",
"version": "1",
"when": {
"type": "eventType",
"patterns": ["glob", "patterns"]
},
"then": {
"type": "actionType",
"prompt": "Instructions for agent"
}
}Event Types
| Event | Triggers When |
fileCreated | New files created matching patterns |
fileModified | Files modified matching patterns |
fileDeleted | Files deleted matching patterns |
Action Types
| Action | Behavior |
askAgent | Asks Kiro agent to perform task |
runCommand | Executes shell command |
Example: Auto Test Files
.kiro/hooks/auto-test-files.json:
{
"name": "Auto Test Files",
"description": "Creates test files for new components",
"version": "1",
"when": {
"type": "fileCreated",
"patterns": ["src/components/**/*.tsx"]
},
"then": {
"type": "askAgent",
"prompt": "A new component was created. Create a corresponding test file following our testing patterns. Use React Testing Library and include tests for rendering and key interactions."
}
}Example: Dependency Checker
.kiro/hooks/dependency-checker.json:
{
"name": "Dependency Update Checker",
"description": "Checks for breaking changes in package.json",
"version": "1",
"when": {
"type": "fileModified",
"patterns": ["package.json"]
},
"then": {
"type": "askAgent",
"prompt": "package.json was modified. Check if any dependencies were updated and review the changelog for breaking changes. Suggest any code updates needed."
}
}Common Mistakes
| Mistake | Fix |
| Missing fileMatchPattern with fileMatch | fileMatchPattern is REQUIRED when inclusion is fileMatch |
| Missing inclusion field | Defaults to always if omitted |
| Using regex in fileMatchPattern | Globs only, no regex support |
| Multiple patterns in fileMatchPattern | Use single pattern string only |
| Forgetting domain field | Use domain for organization and discovery |
Validation
Schema: https://github.com/pr-pm/prpm/blob/main/packages/converters/schemas/kiro-steering.schema.json
Best Practices
Steering Files
- Start with foundational files: product.md, tech.md, structure.md
- Use always for core patterns: Code style, architecture principles
- Use fileMatch for specific contexts: Component rules, API patterns
- Group by domain: Consistent naming helps discovery
- Manual for workflows: Special procedures, optimization guides
Hooks
- Specific patterns: Use precise globs to avoid unnecessary triggers
- Clear prompts: Write detailed agent prompts with context
- Idempotent actions: Ensure hooks can run multiple times safely
- Performance: Avoid hooks on frequently modified files
- Testing: Test hooks in isolation before deploying
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

