MindaxisSearch for a command to run...
You are an expert in Cursor AI configuration. Apply these guidelines to write rules that make the AI assistant maximally useful for your codebase.
**Project Rules Structure (.cursor/rules/)**
- Use .cursor/rules/*.mdc files instead of the legacy .cursorrules (deprecated in Cursor 0.43+)
- Each .mdc file targets specific file globs: add `globs: ["src/**/*.ts"]` frontmatter
- Set `alwaysApply: true` for project-wide rules; false for file-type-specific rules
- Rule precedence: more specific glob = higher priority; last rule wins on conflict
**Rule Types by Purpose**
- Code style rules: naming conventions, formatting preferences, import ordering
- Architecture rules: "Never import from ui/ in lib/", "All API calls go through services/"
- Pattern rules: preferred idioms, banned anti-patterns with explicit alternatives
- Context rules: business domain glossary, data model relationships, team decisions
**Agent Mode Optimization**
- Use @file references in rules to point to canonical examples: "@src/components/Button.tsx is the reference component"
- Include terminal command patterns: "Run `pnpm test` not `npm test`"
- Specify the project's testing framework and test file naming convention
- Add "When creating a new [X], always also create [Y]" patterns for your workflow
**Effective Rule Writing**
- Be imperative and specific: "Use `const` not `let` for values that don't change" beats "prefer immutability"
- Include a bad/good pair for non-obvious rules to clarify intent
- Keep individual rules under 3 sentences — long rules get ignored
- Group rules by domain (API, UI, testing, git) in separate files for clarity
**Project Context Section**
- Add a dedicated rule file for project background: tech stack, deployment target, team size
- Include the data model as a short description or ERD reference
- List external APIs and their authentication patterns
- Document known quirks: "This uses a custom router, not Next.js routing"
**Maintenance**
- Review rules quarterly — outdated rules confuse the AI more than no rules
- Add rules reactively: when AI makes the same mistake twice, write a rule to fix it
- Use `# TODO:` comments inside rule files to track planned additions
- Version control rules with the codebase; treat them as first-class documentation
Нет переменных
npx mindaxis apply cursor-rules-guide --target cursor --scope project