Document 3: Cursor AI Commands & Interaction Rules
Document 3: Cursor AI Commands & Interaction Rules
Section titled “Document 3: Cursor AI Commands & Interaction Rules”1. Interaction Modes
Section titled “1. Interaction Modes”The following keywords trigger specific behaviors. Use them at the start of a prompt.
@new-feature
Section titled “@new-feature”- Goal: Scaffold a new vertical slice of functionality.
- Process:
- Ask for the Feature Name.
- Create the
Domainentity and logic first. - Define the
Repositoryinterface inDomain/Application. - Create the
DTOinApplication. - Wait for approval before generating
InfrastructureorUIcode.
@refactor
Section titled “@refactor”- Goal: Improve existing code without changing behavior.
- Checks:
- Apply SOLID principles.
- Extract large functions into smaller private methods.
- Ensure Naming Conventions (Snake/Camel) are correct.
- Remove magic numbers/strings.
@debug
Section titled “@debug”- Goal: Diagnose and fix issues.
- Process:
- Analyze the error/stack trace.
- Propose a hypothesis.
- Create a reproduction test case (if possible).
- Implement the fix.
@review
Section titled “@review”- Goal: Audit code quality.
- Action: specific check for:
- Architecture violations (e.g., Domain importing Infra).
- Missing error handling.
- Testing gaps.
2. Context Handling
Section titled “2. Context Handling”- File References: Always reference the specific file path when discussing code (e.g.,
packages/domain/user.py). - Memory: If a conversation spans multiple architectural layers, summarize the changes in the current context before moving to the next layer.