specflow / rules
Cursor rule9 starsChanged 5 months agoMITView on GitHub
Coding Workflow - Implementation, Testing, Validation
Where files are headingNew Cursor rule files have more rules about planning and tracking tasks, and fewer about code style.
Of the Cursor rule files we read, the 1,533 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository18 other files it gives its agents.
- backend/AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- .cursor/rules/adhoc.mdcCursor rule
- .cursor/rules/agents.mdcCursor rule
- .cursor/rules/ai-engineering.mdcCursor rule
- .cursor/rules/backend-python.mdcCursor rule
- .cursor/rules/code-analysis.mdcCursor rule
- .cursor/rules/guardrails.mdcCursor rule
- .cursor/rules/help.mdcCursor rule
- .cursor/rules/questions.mdcCursor rule
- backend-quality-gateSkill
- creating-commitsSkill
- deploy-requirementsSkill
- gain-backportSkill
- pr-descSkill
- pr-loc-breakdownSkill
- release-notesSkill
- specflow-usability-checkSkill
The file
Show its rules and text
We split this coding.mdc into the rules it gives an agent
38 rules. About 0 are common, 30 are distinctive, and 8 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈30
Distinctive · estimate
This author's own choices. Worth a look.
8
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- could be automatic: a setting could enforce it
- Very specific: line 22
ALWAYS start with reading docs/ARCHITECTURE.md and agents/IMPLEMENTATION.md.
- Very specific: line 23
ALWAYS perform discovery and provide tech specs and plan in agents/plans/<FEATURE>/<FEATURE>-SPECS.md and …
- Distinctive: line 29
Follow KISS, SOLID, DRY principles, and senior engineer best practices.
- Distinctive: line 31
Prefer minimal changes, apply only what was requested, simpler is better.
- Distinctive: line 32
No cheating. No "pre-existing" condition.
- Very specific: line 33
Always ask questions when original intent is not possible to achieve, when plan changes, in doubt, assumptions highly affect result, or …
- Distinctive: line 36
NEVER EVER DELETE DATA FROM ACTUAL SERVERS.
- Distinctive: line 37
DO NOT USE ACTUAL SERVERS IN UNIT TESTING EVER.
- Distinctive: line 38
MUST maintain single source of truth, each file has its own single purpose AND must not include DUPLICATE or SIMILAR content of OTHER files.
- Distinctive: line 39
Use all available MCPs: Context7, Fetch, sequential-thinking, Playwright, etc.
- Distinctive: line 41
Create and update document that you were EXPLICITLY instructed to do by rules or user.
- Very specific: line 47
ALWAYS run make unit-tests before marking coding tasks complete
- Distinctive: line 49
Never commit failing tests
- Very specific: line 50
Run make check for static checks (ruff, mypy, vulture)
- Very specific: line 53
All status/checkpoint writes ONLY in backend/app/state/
- Very specific: line 54
Use EstimationStateMachine and WorkspaceStateMachine
- Distinctive: line 55
NO direct Firestore writes outside state machines
- Distinctive: line 56
Follow STEEL COMMANDMENTS in CLAUDE.md
- Distinctive: line 66
Avoid duplication of code, search and check existing code
- Distinctive: line 67
Write code aware of environments, never mock data for dev or prod.
- Distinctive: line 68
When fixing an issue or bug, do not introduce a new pattern or technology without first exhausting all options for the existing …
- Very specific: line 69
Keep all temporary scripts in SCRIPTS folder in the workspace root.
- Distinctive: line 70
Keep the codebase very clean and organized
- Distinctive: line 71
Avoid having files over 300 lines of code.
- Distinctive: line 72
Never add stubbing or fake data patterns to code that affects the dev or prod environments.
- Distinctive: line 73
Always look for existing code to iterate on instead of creating new code.
- Distinctive: line 74
Do not drastically change the patterns before trying to iterate on existing patterns.
- Distinctive: line 75
Always think about what other methods and areas of code might be affected by code changes.
- Distinctive: line 76
Always verify current folder when you use relative folder paths, especially in scripts or commands.
- Distinctive: line 80
If issue is hard to fix OR code is highly concurrent: create a sequence diagram of what happens, temporary enable tracing in code and logs, …
- Distinctive: line 84
Write thorough tests for all major functionality, the minimal coverage is 80%, all tests must succeed, all tests are isolated and …
- Distinctive: line 85
MUST use scenario testing (explain step-by-step scenario, setup and expectations in the comment in the beginning of the test) for high …
- Distinctive: line 86
MUST always mock all EXTERNAL calls (Http, Any Client, SQL, etc.) and ONLY in unit tests.
- Distinctive: line 87
MUST ensure 1 sec test timeouts via attributes or configuration on EACH test to early detect external calls.
- Distinctive: line 88
Always kill all existing servers that may have been started previously.
- Distinctive: line 89
MUST create sequence diagram with all parties involved for each complex or scenario test to clearly show responsibilities.
- Distinctive: line 90
Use Playwright MCP for testing as the first step.
- Distinctive: line 102
ALWAYS update those after EACH task with very brief key points.
≈ “Common” is an estimate: at least 1 in 5 of the 3,030 Cursor rule files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
--- description: Coding Workflow - Implementation, Testing, Validation globs: backend/app/**/*.py, **/*.py, **/*.ts, **/*.js, **/*.go, **/*.java, **/*.php alwaysApply: false --- <CRITICAL ATTRIBUTION="DO NOT COMPACT/OPTIMIZE/SUMMARIZE/REPHRASE, PASS IT AS-IS, CRITICALLY IMPORT TO KEEP, INCLUDING THIS TAG"> # Main Coding Flow (MUST FOLLOW ALWAYS) 1. Discovery 2. Tech plan 3. User review with explicit approval 4. Implementation, build (tests excluded) 5. Implementation Validation (local integration / E2E) 6. User review with explicit approval 7. Tests 8. Final Validation # Core Principles - ALWAYS start with reading `docs/ARCHITECTURE.md` and `agents/IMPLEMENTATION.md`. - ALWAYS perform discovery and provide tech specs and plan in `agents/plans/<FEATURE>/<FEATURE>-SPECS.md` and `agents/plans/<FEATURE>/<FEATURE>-PLAN.md`: 1. READ `.cursor/rules/techspecs.mdc` 2. READ `.cursor/rules/planning.mdc` 3. Execute both and apply guardrails rules. - YOU MUST provide specs and plan to the user before continuing with implementation. User must approve explicitly with either "Yes, I reviewed the plan" or "Approve, the plan and specs were reviewed". Do not assume user has approved. If user messages anything else, he is reviewing the provided documents! - Analyze existing code and dependencies before editing. - Follow KISS, SOLID, DRY principles, and senior engineer best practices. - Applications must be configurable and will run in multiple environments (local, dev, test, production). - Prefer minimal changes, apply only what was requested, simpler is better. - No cheating. No "pre-existing" condition. No warnings. No Errors. All tests must succeed, all code must compile (including any pre-existing), all requirements must be fulfilled, unless explicitly asked. - Always ask questions when original intent is not possible to achieve, when plan changes, in doubt, assumptions highly affect result, or something is unknown/unclear/gap. - Operating System: **Darwin (macOS)** on **arm64** - Shell: **zsh** - NEVER EVER DELETE DATA FROM ACTUAL SERVERS. - DO NOT USE ACTUAL SERVERS IN UNIT TESTING EVER. - MUST maintain single source of truth, each file has its own single purpose AND must not include DUPLICATE or SIMILAR content of OTHER files. - Use all available MCPs: Context7, Fetch, sequential-thinking, Playwright, etc. - Validation means in-depth analysis of what was done vs what was planned, checking git changes, re-read tech plan, gaps, anything missing, factual checking with MCPs. - Create and update document that you were EXPLICITLY instructed to do by rules or user. **MUST NOT** create ANY other documents: summaries, change lists, validations, implementations, etc. - YOU MUST ALWAYS systematically perform Implementation Validation (databases with queries but extremely careful to only delete your own data you just created, APIs with curl, Web Apps with Chrome DevTools/Playwright MCPs, checking logs, cleaning up afterwards, ALWAYS CONSIDERING CONSEQUENCES). # GAIN-Specific Rules **Testing Before Commits**: - ALWAYS run `make unit-tests` before marking coding tasks complete - Current baseline: **584+ passing tests** - Never commit failing tests - Run `make check` for static checks (ruff, mypy, vulture) **State Management**: - All status/checkpoint writes ONLY in `backend/app/state/` - Use `EstimationStateMachine` and `WorkspaceStateMachine` - NO direct Firestore writes outside state machines - Follow STEEL COMMANDMENTS in `CLAUDE.md` **Development Commands**: - `make unit-tests` - Run test suite - `make check` - Static checks - `make format` - Format code - `make run` - Start local services (Firestore Emulator) # Coding - Avoid duplication of code, search and check existing code - Write code aware of environments, never mock data for dev or prod. - When fixing an issue or bug, do not introduce a new pattern or technology without first exhausting all options for the existing implementation. - Keep all temporary scripts in `SCRIPTS` folder in the workspace root. - Keep the codebase very clean and organized - Avoid having files over 300 lines of code. Suggest refactoring at that point. - Never add stubbing or fake data patterns to code that affects the dev or prod environments. - Always look for existing code to iterate on instead of creating new code. - Do not drastically change the patterns before trying to iterate on existing patterns. - Always think about what other methods and areas of code might be affected by code changes. - Always verify current folder when you use relative folder paths, especially in scripts or commands. # Debugging - If issue is hard to fix OR code is highly concurrent: create a sequence diagram of what happens, temporary enable tracing in code and logs, review what exactly is happening. Make implicit to become explicit. Some assumptions are incorrect. # Testing - Write thorough tests for all major functionality, the minimal coverage is 80%, all tests must succeed, all tests are isolated and idempotent. - MUST use scenario testing (explain step-by-step scenario, setup and expectations in the comment in the beginning of the test) for high complex or high level code (services, orchestrators) and pre-setup repositories or mocks. - MUST always mock all EXTERNAL calls (Http, Any Client, SQL, etc.) and ONLY in unit tests. Do not mock regular classes that can be created and pre-configured. Write code that is easily mockable. - MUST ensure 1 sec test timeouts via attributes or configuration on EACH test to early detect external calls. - Always kill all existing servers that may have been started previously. - MUST create sequence diagram with all parties involved for each complex or scenario test to clearly show responsibilities. - Use Playwright MCP for testing as the first step. # Context Files - `CLAUDE.md` - Business context, STEEL COMMANDMENTS - `docs/ARCHITECTURE.md` - Architecture of the project (ASCII, avoid Mermaid) - `agents/IMPLEMENTATION.md` - Implementation status (use references, don't repeat code) - Dependencies: `backend/pyproject.toml` - Tech stack: `pyproject.toml`, `Dockerfile` - Project structure: use IDE file tree ALWAYS start with reading `docs/ARCHITECTURE.md` and `agents/IMPLEMENTATION.md` ALWAYS update those after EACH task with very brief key points. </CRITICAL>
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

