tdd-tom-testing-rules

tdd-tom-testing-rules is a cursor rule for Cursor from drumnation/unsplash-smart-mcp-server. It costs 33 tokens per session (918 once invoked), scanned A, original, MIT.

A rule requiring new features to be developed with Test-Driven Development (TDD), where tests are written before the implementation. It also recommends reusable test structures called the Test Object Model.

In plain words
What is it for?
Use it when starting a new feature to choose an appropriate test type, write focused tests first, isolate complex logic when useful, and test interactions between components when necessary.
Why use it?
It encourages developers to define expected behavior early and helps prevent changes that work only in limited cases. The rule also guides the choice between unit tests and integration tests.

Cursor rule for Cursor

Written for Cursor: installed under .cursor/.

Good fit Use it when starting a new feature to choose an appropriate test type, write focused tests first, isolate complex logic when useful, and test interactions between components when necessary.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/drumnation/unsplash-smart-mcp-server/tdd-tom-testing-rules
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/drumnation/unsplash-smart-mcp-server

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 tdd-tom-testing-rules

README.md
[![agentmods](https://agentmods.dev/badge/rules/drumnation/unsplash-smart-mcp-server/tdd-tom-testing-rules.svg)](https://agentmods.dev/rules/drumnation/unsplash-smart-mcp-server/tdd-tom-testing-rules)
Your own site
<a href="https://agentmods.dev/rules/drumnation/unsplash-smart-mcp-server/tdd-tom-testing-rules"><img src="https://agentmods.dev/badge/rules/drumnation/unsplash-smart-mcp-server/tdd-tom-testing-rules.svg" alt="Measured on agentmods" height="20"></a>
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 918 The whole file, excluding the scripts and references it only reads on demand.
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.00033 $0.00918
Opus 5 $0.00016 $0.00459
Sonnet 5 $0.00007 $0.00184
Haiku 4.5 $0.00003 $0.00092

Measured 8d ago against content hash 17bbabafe04a, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

tdd-tom-testing-rules 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 8d 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/tdd-tom-testing-rules.mdc · 65 lines

How it starts

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

New Feature TDD Rule

Description:

Mandatory Rule: All new features MUST be implemented using Test-Driven Development (TDD) principles. Prioritize tests before code, ensuring comprehensive coverage and a robust design. Tests should be focused and efficient, employing either unit or integration tests as appropriate. All tests MUST adhere to the Test Object Model for improved maintainability and reusability where it makes sense.

Instructions:

  1. Choose the Right Testing Strategy:

    • BEFORE writing any tests, deeply consider whether a UNIT test or an INTEGRATION test is most effective for the feature or component being developed.
    • UNIT Tests: Focus on individual modules or functions in isolation, mocking dependencies. Ideal for testing complex logic within a single unit.
      • Consider using unit tests when:
        • The logic within a single function or class is complex and needs thorough testing.
        • Dependencies can be easily and realistically mocked.
        • You need to isolate a specific unit to verify its behavior in detail.
      • For guidance on writing unit tests, refer to the Unit Test Writing Guide: READ @.brain/knowledge/testing/vitest/vitest-unit-testing.rules.ts
    • INTEGRATION Tests: Test the interaction between multiple modules or systems. They verify that different parts of the application work together correctly.
      • Consider using integration tests when:
        • The functionality depends on the interaction between multiple components, services, or external systems (e.g., databases, APIs, CLIs).
        • Mocking is difficult, unrealistic, or overly complex.
        • You need to ensure that different parts of the system work together correctly in a realistic environment.
      • For guidance on writing integration tests, refer to the Integration Test Writing Guide: READ @.brain/knowledge/testing/vitest/vitest-integration-testing.rules.ts
    • Document the reasoning behind your choice of unit or integration testing in the code or test file.
  2. Start with tests: Before writing any implementation code, create a failing test case that defines the desired behavior of the new feature, based on the chosen testing strategy.

  3. Follow the Red-Green-Refactor cycle:

    • Red: Write a failing test (unit or integration).
    • Green: Write the minimal code to make the test pass.
    • Refactor: Improve code structure while keeping the test green. Be cautious about over-abstracting or introducing unnecessary complexity during refactoring. If tests get more complicated because of the refactoring, it is a code smell.
    • Repeat: Move to the next part of the feature
  4. Employ the Test Object Model (When Appropriate):

    • If the Test Object Model is deemed beneficial for organization and reusability (e.g., in complex integration tests or UI tests), create a *.to.ts file for each logical group of interactions or components being tested.

    • Encapsulate interaction logic within this test object.

    • Example:

      // user-registration.to.ts
      import { UserService } from './user-service';
      
      export class UserRegistrationTestObject {
          private userService: UserService;
      
          constructor() {
              this.userService = new UserService();
          }
      
          async registerUser(userData: any) {
              return await this.userService.register(userData);
          }
      }
      
    • Do not force the use of the Test Object Model if it adds unnecessary complexity or doesn't provide significant value in simpler scenarios.

  5. Consult the detailed guidelines for comprehensive instructions:

    • TDD: READ @.brain/knowledge/testing/vitest/vitest-tdd.rules.ts
    • Test Object Model: READ @.brain/knowledge/testing/vitest/vitest-test-object-model.rules.ts
    • Unit vs. Integration Testing: READ @.brain/knowledge/testing/unit-vs-integration-testing.rules.ts

Read the full file on GitHub · 65 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. 8d ago First seen · 65 lines · 33 tokens per session scan A 17bbabafe04a

Subscribe to this mod's changes

tdd-tom-testing-rules is a cursor rule published in the GitHub repository drumnation/unsplash-smart-mcp-server (63 stars, last pushed 7mo ago), licensed MIT. It adds 33 tokens to every session and 918 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.