executing-plans
executing-plans
Use when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available
create-ruleCreate Cursor rules for persistent AI guidance. Use when user wants to create a rule, add coding standards, project conventions, file-specific patterns, or mentions ".cursor/rules", "AGENTS.md", "cursor rule", "coding standard", "convention", or "AI guidance".
Independent GitHub snapshot · Automated classification · Original documentation governs
Create project rules in .cursor/rules/ to provide persistent context for the AI agent.
For one plain-Markdown file that always applies, AGENTS.md at the project root does the same job as an alwaysApply rule and needs no frontmatter.
Before creating a rule, check:
ls -la .cursor/rules/*.mdc 2>/dev/null
cat .cursor/rules/*.mdc 2>/dev/null | head -100
cat CONTRIBUTING.md .editorconfig .eslintrc* 2>/dev/null | head -50
Why: Rules should complement, not conflict with, existing project conventions.
Before creating a rule, determine:
If you have previous conversation context, infer rules from what was discussed. You can create multiple rules if the conversation covers distinct topics or patterns. Don't ask redundant questions if the context already provides the answers.
If the user hasn't specified scope, ask:
If they mentioned specific files and haven't provided concrete patterns, ask:
**/*.ts, backend/**/*.py)Get the file patterns right: a wrong glob means the rule never loads, or loads for every file.
Use the AskQuestion tool when available to gather this efficiently.
Rules are .mdc files in .cursor/rules/ with YAML frontmatter:
.cursor/rules/
typescript-standards.mdc
react-patterns.mdc
api-conventions.mdc
---
description: Brief description of what this rule does
globs: **/*.ts # File pattern for file-specific rules
alwaysApply: false # Set to true if rule should always apply
---
# Rule Title
Your rule content here...
| Field | Type | Description |
|---|---|---|
description | string | What the rule does (shown in rule picker) |
globs | string | File pattern - rule applies when matching files are open |
alwaysApply | boolean | If true, applies to every session |
For universal standards that should apply to every conversation:
---
description: Core coding standards for the project
alwaysApply: true
---
For rules that apply when working with certain file types:
---
description: TypeScript conventions for this project
globs: **/*.ts
alwaysApply: false
---
alwaysApply rule rides in every request inside the cached prefix. Keep those few, short, and byte-stable (no dates, counters, or generated timestamps); scope the rest with globs---
description: TypeScript coding standards
globs: **/*.ts
alwaysApply: false
---
# Error Handling
\`\`\`typescript
// ❌ BAD
try {
await fetchData();
} catch (e) {}
// ✅ GOOD
try {
await fetchData();
} catch (e) {
logger.error('Failed to fetch', { error: e });
throw new DataFetchError('Unable to retrieve data', { cause: e });
}
\`\`\`
---
description: React component patterns
globs: **/*.tsx
alwaysApply: false
---
# React Patterns
- Use functional components
- Extract custom hooks for reusable logic
- Colocate styles with components
.mdc format in .cursor/rules/