Instruction file imported from schuttpj/next15-template-pjs (
.github/instructions/guidelines-management.instructions.md). Copyright stays with the author.
Cursor Guidelines Management Guide
This rule explains how to manage guidelines in your project.
Guideline Structure Format
Every instruction file should have:
---
applyTo: 'pattern/**/*'
---
# Rule Title
Main content explaining the rule with markdown formatting.
1. Step-by-step instructions
2. Code examples
3. Guidelines
File Organization
Required Location
All instruction files must be placed in:
PROJECT_ROOT/.github/instructions/
Naming Conventions
- Use kebab-case for all filenames
- Always use .instructions.md extension
- Make names descriptive of the rule's purpose
- Examples:
typescript-style.instructions.md,tailwind-styling.instructions.md
Content Guidelines
Writing Effective Instructions
- Be specific and actionable - Provide clear instructions
- Include code examples - Show both good and bad practices
- Reference existing files - Use meaningful file references
- Keep it focused - One instruction per concern/pattern
- Add context - Explain why the instruction exists
Code Examples Format
// ✅ Good: Clear and follows conventions
function processUser({ id, name }: { id: string; name: string }) {
return { id, displayName: name };
}
// ❌ Bad: Unclear parameter passing
function processUser(id: string, name: string) {
return { id, displayName: name };
}
Instruction Categories
Organize instructions by purpose:
- Code Style:
typescript-style.instructions.md,css-conventions.instructions.md - Architecture:
component-patterns.instructions.md,folder-structure.instructions.md - Tools:
testing-patterns.instructions.md,build-config.instructions.md
Best Practices
Instruction Creation Checklist
- File placed in
.github/instructions/directory - Filename uses kebab-case with
.instructions.mdextension - Includes proper metadata section with
applyTo - Contains clear title and sections
- Provides both good and bad examples
- Follows consistent formatting
Maintenance
- Review regularly - Keep instructions up to date with codebase changes
- Update examples - Ensure code samples reflect current patterns
- Monitor feedback - Update based on code review comments