Instruction file imported from YahyaElghobashy/cursor-template (
.cursor/rules/cursor_operating_model.mdc). Copyright stays with the author.
Cursor Operating Model
This file defines the standard development lifecycle, execution behavior, and system protocols that every Cursor agent must follow when working within this project structure.
🧠 Agent Behavioral Rules
- Always read this file before executing or planning tasks.
- Always read all
.mdcfiles relevant to the current task or feature. - Always complete these stages in sequence before starting another task:
- Read relevant
.mdcfiles - Plan the solution
- Suggest or generate required tests
- Execute implementation
- Run tests with MCP
- Summarize changes
- Update
.mdcfiles (first), then ask to update.md - Get user approval to continue
- Read relevant
- Always use
.mdcfiles for implementation context, not.mdfiles. - Always suggest tests even if not asked explicitly.
- Never scaffold new components without checking structure in
tech_stack_document.mdc,frontend_guidelines_document.mdc, orbackend_structure_document.mdc. - If tests fail or visual/UI bugs are detected, use Browser MCP to:
- Take screenshots
- Capture console logs
- Retry or suggest a fix
🧩 Required Files & Roles
| File | Role |
|---|---|
project_requirements_document.mdc |
High-level product requirements (mirrors PRD) |
app_flow_document.mdc |
Step-by-step UX / UI app flow (screen or state transitions) |
tech_stack_document.mdc |
Tech stack & key libraries used |
frontend_guidelines_document.mdc |
Component structure, naming, styling rules |
backend_structure_document.mdc |
Backend architecture, folder structure, API conventions |
implementation_plan.mdc |
Checklist of upcoming or completed tasks |
security_guideline.mdc |
Auth, RLS, encryption, and threat model specs |
testing_guideline_document.mdc |
Unit vs integration, when to use each, and thresholds |
🔁 Task Execution Protocol
Every task must follow this flow:
-
Plan
Read.mdccontext → suggest full approach.
Prompt:
“Explain the full approach you’d take to implement this. Just tell, don’t code.” -
Testify
If tests don’t exist → ask to write them first
If tests exist → run them before and after execution -
Execute
Write or update code; follow existing folder structures & stack definitions -
Validate
- Run all tests
- Use Browser MCP for front-end visuals if UI changes were made
- Log test output or errors
-
Document
- Update
.mdcfiles first (include purpose, location, logic notes) - Ask if user wants to sync
.mdcounterparts (human-readable)
- Update
-
Control
- Do not begin another task unless this one is fully tested, validated, and documented
🛠 Cursor Setup Instructions
- Add Browser MCP and Supabase MCP in Settings.
- Ensure
.cursor/rules/is indexed — this enables rule awareness. - Use Gemini for reading and Sonnet/O1 for executing.
- Hard-cap retries to 3. If still failing → stop and ask user for manual inspection.
- When visual diffs are detected → auto-trigger Browser MCP for screenshots & logs.
🔄 Enhancement Tasks
- Treat every enhancement request like a scoped feature.
- Before execution, update:
implementation_plan.mdcto add enhancement entry- Any
.mdcfile that the enhancement touches
- After execution:
- Run tests
- Regenerate
.mdcand optionally.md - Update CHANGELOG.md with summary
✅ Commit & Release Protocol
-
All commits must include:
- Updated
.mdcfile - Optional updated
.mdfile - Tests if applicable
- CHANGELOG.md entry
- Updated
-
A release is complete only when:
- Code, tests,
.mdc, and.mdare in sync - CHANGELOG.md reflects all changes
- Code, tests,
