cursorrules / rules
Cursor rule88 starsChanged 13 months agoMITView on GitHub
AI Query Efficiency & Auto-Optimization
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 repository70 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- .cursor/rules/accessibility-standards.mdcCursor rule
- .cursor/rules/api-standards.mdcCursor rule
- .cursor/rules/behat-ai-guide.mdcCursor rule
- .cursor/rules/behat-steps.mdcCursor rule
- .cursor/rules/build-optimization.mdcCursor rule
- .cursor/rules/code-generation-standards.mdcCursor rule
- .cursor/rules/confluence-editing-standards.mdcCursor rule
- .cursor/rules/cursor-rules.mdcCursor rule
- .cursor/rules/debugging-standards.mdcCursor rule
- .cursor/rules/docker-compose-standards.mdcCursor rule
- .cursor/rules/drupal-authentication-failures.mdcCursor rule
- .cursor/rules/drupal-broken-access-control.mdcCursor rule
- .cursor/rules/drupal-cryptographic-failures.mdcCursor rule
- .cursor/rules/drupal-database-standards.mdcCursor rule
- .cursor/rules/drupal-file-permissions.mdcCursor rule
- .cursor/rules/drupal-injection.mdcCursor rule
- .cursor/rules/drupal-insecure-design.mdcCursor rule
- .cursor/rules/drupal-integrity-failures.mdcCursor rule
- .cursor/rules/drupal-logging-failures.mdcCursor rule
- .cursor/rules/drupal-security-misconfiguration.mdcCursor rule
- .cursor/rules/drupal-ssrf.mdcCursor rule
- .cursor/rules/drupal-vulnerable-components.mdcCursor rule
- .cursor/rules/generic_bash_style.mdcCursor rule
- .cursor/rules/git-commit-standards.mdcCursor rule
- .cursor/rules/github-actions-standards.mdcCursor rule
- .cursor/rules/javascript-broken-access-control.mdcCursor rule
- .cursor/rules/javascript-cryptographic-failures.mdcCursor rule
- .cursor/rules/javascript-identification-authentication-failures.mdcCursor rule
- .cursor/rules/javascript-injection.mdcCursor rule
- .cursor/rules/javascript-insecure-design.mdcCursor rule
- .cursor/rules/javascript-performance.mdcCursor rule
- .cursor/rules/javascript-security-logging-monitoring-failures.mdcCursor rule
- .cursor/rules/javascript-security-misconfiguration.mdcCursor rule
- .cursor/rules/javascript-server-side-request-forgery.mdcCursor rule
- .cursor/rules/javascript-software-data-integrity-failures.mdcCursor rule
- .cursor/rules/javascript-standards.mdcCursor rule
- .cursor/rules/javascript-vulnerable-outdated-components.mdcCursor rule
- .cursor/rules/lagoon-docker-compose-standards.mdcCursor rule
- .cursor/rules/lagoon-yml-standards.mdcCursor rule
- .cursor/rules/multi-agent-coordination.mdcCursor rule
- .cursor/rules/new-pull-request.mdcCursor rule
- .cursor/rules/node-dependencies.mdcCursor rule
- .cursor/rules/php-drupal-best-practices.mdcCursor rule
- .cursor/rules/php-drupal-development-standards.mdcCursor rule
- .cursor/rules/php-memory-optimisation.mdcCursor rule
- .cursor/rules/project-definition-template.mdcCursor rule
- .cursor/rules/pull-request-changelist-instructions.mdcCursor rule
- .cursor/rules/python-authentication-failures.mdcCursor rule
- .cursor/rules/python-broken-access-control.mdcCursor rule
- .cursor/rules/python-cryptographic-failures.mdcCursor rule
- .cursor/rules/python-injection.mdcCursor rule
- .cursor/rules/python-insecure-design.mdcCursor rule
- .cursor/rules/python-integrity-failures.mdcCursor rule
- .cursor/rules/python-logging-monitoring-failures.mdcCursor rule
- .cursor/rules/python-security-misconfiguration.mdcCursor rule
- .cursor/rules/python-ssrf.mdcCursor rule
- .cursor/rules/python-vulnerable-outdated-components.mdcCursor rule
- .cursor/rules/react-patterns.mdcCursor rule
- The first 60 shown.
The file
We split this improve-cursorrules-efficiency.mdc into the rules it gives an agent
7 rules. About 0 are common, 7 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈7
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 28
Use more specific or detailed prompts.
- Distinctive: line 32
Use specific technical terminology for clearer communication.
- Distinctive: line 36
Update rule suggestions to guide users towards more effective interactions.
- Distinctive: line 37
Create new rules for frequently encountered patterns.
- Distinctive: line 53
Ask for step-by-step approaches for complex problems
- Distinctive: line 62
Use precise technical terms for your domain (Drupal, Lagoon, etc.)
- Distinctive: line 67
Use file references when discussing specific code
≈ “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: AI Query Efficiency & Auto-Optimization
globs: *.mdc
---
# AI Query Efficiency & Auto-Optimization
Ensures Cursor analyzes AI query efficiency, detects repeated requests, and automatically updates relevant rules to improve response quality and reduce redundancy.
<rule>
name: ai_query_efficiency_optimization
description: Analyze AI query efficiency, optimize rules, and prevent repeated requests.
filters:
# Match AI query interactions in supported files
- type: file_extension
pattern: "\\.(md|mdc|txt|json|py|js|ts|php|yaml|yml|cursorrules)$"
# Match AI communication patterns indicating inefficiency or repetition
- type: content
pattern: "(?i)(retry|again|didn't work|not what I expected|try another way|improve|fix this|optimize|rewrite|regenerate)"
actions:
- type: analyze
conditions:
- pattern: "(?i)(retry|again|fix this|not what I expected|didn't work|rewrite|regenerate)"
message: "Detected inefficiencies or repeated requests. Initiating efficiency analysis..."
execute: |
- **Identify inefficiencies** in AI responses by comparing previous queries and results.
- **Suggest improvements** in query structure or Cursor usage based on analysis:
- Use more specific or detailed prompts.
- Implement structured queries for complex tasks.
- Provide feedback on past responses for better contextual understanding.
- Break down complex tasks into smaller, more manageable steps.
- Use specific technical terminology for clearer communication.
- **Automatically update** relevant Cursor rules:
- Enhance pattern recognition for similar future queries.
- Adjust rule priorities or conditions to prevent repeat inefficiencies.
- Update rule suggestions to guide users towards more effective interactions.
- Create new rules for frequently encountered patterns.
- type: suggest
message: |
## Query Optimization Recommendations
I notice you're making multiple requests for similar tasks. Here's how to optimize your AI interactions:
### 1. Refine Your Prompts
- **Be more specific:** Include technical details, file paths, and exact requirements
- **Use structured formats:** For complex requests, use bullet points or numbered lists
- **Include context:** Mention relevant technologies, frameworks, or standards
- **Set clear expectations:** Specify the format and level of detail you need
### 2. Break Down Complex Tasks
- Split large tasks into smaller, focused requests
- Ask for step-by-step approaches for complex problems
- Request specific examples for unclear concepts
### 3. Provide Feedback
- Tell the AI what worked and what didn't in previous responses
- Clarify misunderstandings explicitly
- Highlight successful parts of previous responses
### 4. Use Technical Terminology
- Use precise technical terms for your domain (Drupal, Lagoon, etc.)
- Reference specific functions, methods, or patterns
- Mention relevant standards or best practices
### 5. Leverage Cursor Features
- Use file references when discussing specific code
- Reference line numbers for targeted changes
- Utilize code blocks for examples
The system will now optimize rules based on this interaction pattern to improve future responses.
- type: auto_update
target: ".cursor/rules/ai-optimization.mdc"
conditions:
- pattern: "(?i)(retry|again|fix this|not what I expected|not what I meant|didn't work|rewrite|regenerate)"
message: "Updating AI efficiency rules based on detected inefficiencies or repeated queries."
- type: log
message: "AI Query Efficiency Analysis: [{{query_count}} queries in {{time_period}} detected inefficiency.]"
conditions:
- pattern: "(?i)(retry|again|fix this|not what I expected|didn't work|rewrite|regenerate)"
examples:
- input: |
"This Drupal module is not working, let's try again."
"That didn't work, let's refine the approach."
"Please rewrite this code to be more efficient."
output: |
Cursor detects inefficiency in queries and suggests:
"I notice you're making multiple attempts. To get better results:
1. Specify which part of the module isn't working
2. Include any error messages you're seeing
3. Mention the Drupal version and relevant modules
4. Describe what you've already tried"
- input: |
"Generate a Lagoon configuration file."
"This doesn't look right, regenerate it."
"Try again with better practices."
output: |
Cursor detects repetition and suggests:
"For better Lagoon configuration results:
1. Specify which services you need (nginx, php, mariadb, etc.)
2. Mention your project type (Drupal, WordPress, etc.)
3. Include any specific environment requirements
4. Reference any existing configuration you want to maintain"
metadata:
priority: critical
version: 1.2
</rule>
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.

