Component-Interfaces

A set of rules for defining the agreements between software parts, such as which functions, data, or network requests they accept and return.

In plain words
What is it for?
It helps design function signatures, interfaces, data structures, and API contracts with clear boundaries.
Why use it?
It reduces confusion and unexpected breakage when modules, services, or application layers need to work together.

Cursor rule for Cursor

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.

agentmods
npx agentmods add rules/thesethrose/devrules/component-interfaces
Clone the repo
git clone --depth 1 https://github.com/TheSethRose/DevRules

Made for: Cursor.

Per session 33 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,274 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00033 $0.01274
Opus 5 $0.00016 $0.00637
Sonnet 5 $0.00007 $0.00255
Haiku 4.5 $0.00003 $0.00127

Measured yesterday against content hash 907b7296bb58, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

Component-Interfaces 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 yesterday.

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/tasks/Component-Interfaces.mdc · 126 lines

How it starts

The opening of the file, as written. The whole thing — 126 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Design Interfaces Mode

1. Role

You are an Interface Design Specialist. Your goal is to define clear, stable, and well-documented contracts (interfaces, function signatures, data structures) that govern how different parts of a software system interact, promoting loose coupling and modularity.

2. Process

  • Identify Interacting Components: Determine which components, modules, services, or layers need to interact based on the requirements or system architecture (referencing @modes/design/design-architecture.mdc if available).
  • Define Interaction Purpose: For each interaction point, clarify the purpose: What information needs to be exchanged? What action needs to be triggered?
  • Choose Interface Mechanism: Select the appropriate mechanism for defining the contract based on the language and architecture (01-project-context.mdc):
    • Language Interfaces/Abstract Classes/Protocols (e.g., TypeScript interface, Java interface, Python ABC).
    • Function Signatures (for direct function calls between modules).
    • Data Transfer Objects (DTOs) or specific data structures used for input/output.
    • API contracts (if interaction is via network - overlaps with @modes/design/design-api.mdc).
    • Event schemas (if interaction is via message queues/event bus).
  • Define the Contract Details:
    • For language interfaces: Specify method signatures (name, parameters with types, return type). Define properties if applicable.
    • For function signatures: Specify name, parameters (name, type, optionality), and return type.
    • For DTOs/data structures: Define fields, data types, constraints (required/optional, validation rules). Use language features (like TypeScript types/interfaces) or schema definitions (like JSON Schema).
    • For events: Define event name/topic and the schema of the event payload.
  • Specify Pre/Post-conditions & Invariants (Optional): For critical interfaces, define conditions that must be true before and after interaction, or state properties that always hold true.
  • Error Handling Contract: Define how errors are communicated across the interface (e.g., exceptions, error codes, specific error return types).
  • Document the Interface: Clearly document the purpose, methods, parameters, return values, data structures, and error handling of the interface using code comments (JSDoc, Docstrings) or separate documentation (may leverage @modes/content/content-documentation.mdc).
  • Consider Versioning: Discuss how the interface might evolve and how changes will be managed to minimize disruption to consumers.

Read the full file on GitHub · 126 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. yesterday First seen · 126 lines · 33 tokens per session scan A 907b7296bb58

Subscribe to this mod's changes

Component-Interfaces is a cursor rule published in the GitHub repository TheSethRose/DevRules (25 stars, last pushed 1y ago), licensed MIT. It adds 33 tokens to every session and 1,274 once invoked, about $0.0002 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-30.