mainrules

mainrules is a cursor rule for Cursor from Saml1211/rubberduck-mcp. It costs 1,109 tokens per session, scanned A, original, MIT.

A set of Cursor coding rules for building Rubberduck-MCP, which connects the MCP protocol to Rubberduck through COM, a Windows software-integration system.

In plain words
What is it for?
Guiding MCP, TypeScript, COM-integration, error-handling, resource-management, and version-compatibility work.
Why use it?
It helps keep the integration separated, handles failures consistently, and reduces resource leaks and compatibility problems.

Cursor rule for Cursor

Written for Cursor: installed under .cursor/.

Good fit Guiding MCP, TypeScript, COM-integration, error-handling, resource-management, and version-compatibility work.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/saml1211/rubberduck-mcp/mainrules
Install

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.

Clone the repo
git clone --depth 1 https://github.com/Saml1211/rubberduck-mcp

Made for: Cursor.

Wrote 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.

agentmods badge for mainrules

README.md
[![agentmods](https://agentmods.dev/badge/rules/saml1211/rubberduck-mcp/mainrules/github.svg)](https://agentmods.dev/rules/saml1211/rubberduck-mcp/mainrules)
Your own site
<a href="https://agentmods.dev/rules/saml1211/rubberduck-mcp/mainrules"><img src="https://agentmods.dev/badge/rules/saml1211/rubberduck-mcp/mainrules/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for mainrules

Your own site · 80×15
<a href="https://agentmods.dev/rules/saml1211/rubberduck-mcp/mainrules"><img src="https://agentmods.dev/badge/rules/saml1211/rubberduck-mcp/mainrules.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 1,109 This file is loaded in full into every session.
When invoked 1,109 The same file — it is already loaded in full.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5.1 $0.01109 $0.01109
Opus 5.5 $0.00444 $0.00444
Sonnet 5.5 $0.00222 $0.00222
Haiku 4.5 $0.00111 $0.00111

Measured 2mo ago against content hash 6815a2ff283d, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

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 2mo 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.

.cursor/rules/mainrules.mdc · 160 lines

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

  1. 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
  2. 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
  3. 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

  1. 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
  2. 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
  3. 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

  1. 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
  2. Resource Freshness

    • Implement proper caching with TTL for expensive resources
    • Provide resource update notifications when underlying data changes
    • Include timestamps in all resource responses

Read the full file on GitHub · 160 lines

Changes

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.

  1. 2mo ago First seen · 160 lines · 1,109 tokens per session scan A 6815a2ff283d

Subscribe to this mod's changes

mainrules is a cursor rule published in the GitHub repository Saml1211/rubberduck-mcp (2 stars, last pushed 7mo ago), licensed MIT. It adds 1,109 tokens to every session, about $0.0044 per session on Opus 5.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.