Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add rules/saml1211/rubberduck-mcp/mainrulesgit clone --depth 1 https://github.com/Saml1211/rubberduck-mcpWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/rules/saml1211/rubberduck-mcp/mainrules)<a href="https://agentmods.dev/rules/saml1211/rubberduck-mcp/mainrules"><img src="https://agentmods.dev/badge/rules/saml1211/rubberduck-mcp/mainrules.svg" alt="Measured on agentmods" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.01109 | $0.01109 |
| Opus 5 | $0.00554 | $0.00554 |
| Sonnet 5 | $0.00222 | $0.00222 |
| Haiku 4.5 | $0.00111 | $0.00111 |
Grade A, and why
mainrules scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 160 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Rubberduck-MCP Implementation Rules & Guidelines
Architecture Rules
-
Separation of Concerns
- Maintain distinct layers for MCP protocol handling, COM interop, and business logic
- Create clear boundaries between Rubberduck API integration and MCP interface exposure
- Implement an adapter pattern to isolate COM dependency from core logic
-
Error Propagation
- Never expose raw COM exceptions to MCP clients
- Transform all errors into standardized MCP error codes with contextual messages
- Implement global error boundaries at transport interfaces
-
Resource Management
- Release COM objects immediately after use to prevent memory leaks
- Implement reference counting for shared COM objects
- Use disposal patterns with try/finally blocks for all COM interactions
COM Interoperability Rules
-
Interface Stability
- Create resilient wrappers around Rubberduck COM interfaces to handle version differences
- Implement feature detection for optional Rubberduck capabilities
- Provide fallback implementations where possible for missing features
-
State Management
- Maintain minimal state between operations
- Reconnect to COM objects when needed rather than maintaining long-lived references
- Validate COM object state before performing operations
-
Process Isolation
- Run COM operations in a separate process when possible to prevent crashes affecting the MCP server
- Implement timeouts for all COM operations
- Provide retry mechanisms for transient COM failures
MCP Protocol Implementation
-
Schema Validation
- Validate all inputs against published schemas before processing
- Return clear validation errors with specific field references
- Maintain schema version compatibility with the MCP specification
-
Resource Freshness
- Implement proper caching with TTL for expensive resources
- Provide resource update notifications when underlying data changes
- Include timestamps in all resource responses
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 4d ago First seen · 160 lines · 1,109 tokens per session scan A 6815a2ff283d
mainrules is a cursor rule published in the GitHub repository Saml1211/rubberduck-mcp (2 stars, last pushed 5mo ago), licensed MIT. It adds 1,109 tokens to every session, about $0.0055 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other cursor rules, from other repositories
testing
VBA testing framework - how to write, discover, and run tests using the VCS test runner.
vba-source-files
VBA source file editing rules - encoding, structure, and safe modification guidelines.
project-guide
MSAccess VCS Add-in project guidance - architecture, coding standards, and development workflow.
angular-20
This rule provides comprehensive best practices and coding standards for Angular development, focusing on modern TypeScript, standalone components, signals, and performance optimizations.
dev-standard
Apache Superset development standards and guidelines for Cursor IDE.
cli-error-handling
CLI command error handling patterns.