optimize-dry-solid-principles-cursorrules-prompt-f — Cursor rule
A Cursor rule that steers the assistant toward DRY and SOLID edits, respect for the existing architecture and questions before coding.
.cursor/rules/optimize-dry-solid-principles-cursorrules-prompt-f.mdcWhat optimize-dry-solid-principles-cursorrules-prompt-f does
You drop the file into .cursor/rules and it covers **/*, yet alwaysApply: false means it won't switch itself on — attach it by hand or through the globs. The text is split into sections: communication and problem-solving, code quality, paradigms and principles, semantic naming, platform thinking, response format and handling uncertainty.
The response-format section carries the concrete instruction. Every code block comes with a file name as a # or // comment, plus a couple of lines before and after the change, so you can see where the edit lands. The rule also tells the assistant to keep the architecture recorded in pyproject.toml unless you ask for a new module or method. Ambiguous tasks should be clarified first, not guessed at.
That keeps a request from spilling into neighbouring files. The weak spot is the architecture reference: if pyproject.toml says little about structure, there is not much to anchor to, and a vague answer is likely.
What it helps with
- keep edits inside the architecture the project already uses
- see a file path and surrounding lines next to every code block
- make the assistant ask about unclear tasks before writing code
- apply one set of DRY and SOLID expectations across a repo
Example prompts for the agent
- Add validation to
api/users.py, following our project rules - Refactor this class for SOLID, leave the setup in
pyproject.tomlalone - Ask me questions before you change anything if the task is unclear
How to install optimize-dry-solid-principles-cursorrules-prompt-f
Manually: put the files in place
.cursor/rules/optimize-dry-solid-principles-cursorrules-prompt-f.mdcFrontmatter: description, globs, alwaysApply
Manually: put the files in place
.claude/rules/optimize-dry-solid-principles-cursorrules-prompt-f.mdThe paths frontmatter field limits the files: move globs from the source into paths
AGENTS.md
Codex reads AGENTS.md: paste the rule text there
Manually: put the files in place
.github/instructions/optimize-dry-solid-principles-cursorrules-prompt-f.instructions.mdThe applyTo field sets which files it applies to: move globs from the source into applyTo
Manually: put the files in place
.devin/rules/optimize-dry-solid-principles-cursorrules-prompt-f.mdManually: put the files in place
.clinerules/optimize-dry-solid-principles-cursorrules-prompt-f.mdStep by step, with commands for each platform: Cursor rules: .mdc files, four modes and what replaced .cursorrules
Questions about optimize-dry-solid-principles-cursorrules-prompt-f
How to install optimize-dry-solid-principles-cursorrules-prompt-f in Cursor?
Create .cursor/rules/optimize-dry-solid-principles-cursorrules-prompt-f.mdc and paste the rule text into it.
What does optimize-dry-solid-principles-cursorrules-prompt-f do?
It gives the Cursor assistant standing instructions on DRY and SOLID, semantic naming, sticking to the architecture in pyproject.toml and asking for clarification first.
Does the rule apply to every file on its own?
The **/* glob matches the whole project, but alwaysApply is set to false, so it stays off until you attach it.
Source text
optimize-dry-solid-principles-cursorrules-prompt-f.mdc · CC0-1.0
--- description: "Cursor rules for optimization development with DRY and SOLID principles integration." globs: **/* alwaysApply: false --- Communication and Problem-Solving: Code Quality and Best Practices: Paradigms and Principles: Semantic Naming and Abstractions: Platform Thinking: Response Format: Handling Uncertainty and Limitations: When outputting code blocks, include a # or // file name comment prior to the block, with a few lines before and after the modification. This helps the user identify where to make changes. Stick to the current architecture choices located in pyproject.toml unless the user suggests a new method or module. If you need clarification on any part of the task, ask for more information before proceeding with the implementation.
© PatrickJS · CC0-1.0 · PatrickJS/awesome-cursorrules