functional-test-principals.rules

functional-test-principals.rules is a cursor rule for Cursor from drumnation/unsplash-smart-mcp-server. It costs 1,105 tokens per session, scanned A, original, MIT.

Testing rules for checking real user-visible behavior across common test tools such as Jest, Vitest, Playwright, and Cypress. TDD means test-driven development: using tests to guide and verify changes.

In plain words
What is it for?
Use them when writing or reviewing tests for user interfaces, APIs, and complete workflows, while limiting mocks to external services or uncontrollable system behavior.
Why use it?
They reduce false confidence from tests that only inspect internal code or rely heavily on mocks. A passing test should show that the feature works in realistic use.

Cursor rule for Cursor

Written for Cursor: installed under .cursor/.

Good fit Use them when writing or reviewing tests for user interfaces, APIs, and complete workflows, while limiting mocks to external services or uncontrollable system behavior.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/drumnation/unsplash-smart-mcp-server/functional-test-principals.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 functional-test-principals.rules

README.md
[![agentmods](https://agentmods.dev/badge/rules/drumnation/unsplash-smart-mcp-server/functional-test-principals.rules.svg)](https://agentmods.dev/rules/drumnation/unsplash-smart-mcp-server/functional-test-principals.rules)
Your own site
<a href="https://agentmods.dev/rules/drumnation/unsplash-smart-mcp-server/functional-test-principals.rules"><img src="https://agentmods.dev/badge/rules/drumnation/unsplash-smart-mcp-server/functional-test-principals.rules.svg" alt="Measured on agentmods" height="20"></a>
Per session 1,105 This file is loaded in full into every session.
When invoked 1,105 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.01105 $0.01105
Opus 5 $0.00553 $0.00553
Sonnet 5 $0.00221 $0.00221
Haiku 4.5 $0.00111 $0.00111

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

Security

Grade A, and why

functional-test-principals.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/functional-test-principals.rules.mdc · 124 lines

How it starts

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

Rule: Functional Test Principles

Purpose: Ensure all test suites — regardless of test framework — validate real, end-to-end or integration-level functionality. Tests must act as a backstop for the app. If they pass, the app works. If they fail, something meaningful is broken. This allows the agent to self-validate and iterate safely.

Frameworks: Mocha, Vitest, Jest, Playwright, Cypress, Storybook, etc.
The principles apply across all test environments.

Agent Behavior:

  1. Test Real Use, Not Implementation

    • Simulate real usage, not internals
    • Validate user-visible outputs or API responses
    • Never test internal method calls, hook behavior, or prop structures directly
  2. Avoid Mocking

    • Mock only:
      • External APIs (e.g., HTTP requests)
      • Uncontrollable globals (e.g., time, environment)
    • Never mock internal app logic or structure just to make a test work
    • Avoid testing .mock.calls or spyOn() unless testing infrastructure-level effects
  3. One-to-One Principle

    • If the test passes → the feature works
    • If the test fails → the feature is broken, misaligned, or needs to be updated with intention
  4. Tests Should Be Lightweight and Runnable Often

    • Run them after every meaningful code change
    • Favor a small number of high-signal tests over hundreds of shallow coverage tests
  5. Use for Self-Validation

    • The agent should use tests as the basis for confirming its changes are correct
    • No agent-generated code should be considered complete until the relevant tests pass
  6. Do Not Over-Isolate

    • Avoid deep mocking that isolates a function from its context
    • Prefer integration and functional tests for most features
    • Unit tests should be used only for pure functions or small reusable utilities
  7. Include Test Planning in Feature Design

    • When writing a plan for any task or feature, include:
      • What needs to be tested
      • How it can be tested without mocks
      • What defines success/failure
  8. Failure ≠ Delete

    • If a test fails, investigate
    • Fix the code if it’s a regression
    • Update the test only after understanding the cause
    • Never delete or bypass a test just to make the suite green

ruleType: always

Read the full file on GitHub · 124 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 · 124 lines · 1,105 tokens per session scan A 547d26fc37a6

Subscribe to this mod's changes

functional-test-principals.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 1,105 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-30.

Related

Other cursor rules, from other repositories

manual-review

The main set of rules for manual review during an active project change. It defines different kinds of checks, who performs them, how results are recorded, and when supporting evidence is required.

YuDefine/nuxt-supabase-starter · 0 tokens

testing-anti-patterns

Guidelines for avoiding misleading or weak tests. They say tests should check real application behavior, use mocks only when needed for isolation, and avoid adding code to production solely for testing.

YuDefine/nuxt-supabase-starter · 9,901 tokens

manual-review.backend

A set of rules for verifying backend-only changes and changes that use different verification channels. It separates evidence the agent can collect from checks that require a person, a production authorization, or a business decision.

YuDefine/nuxt-supabase-starter · 0 tokens

screenshot-strategy

A decision guide for choosing browser tools for screenshots, exploration and repeatable checks. It explains when to use an interactive browser session and when to use Playwright, a tool for scripted browser tests.

YuDefine/nuxt-supabase-starter · 0 tokens

playwright-webserver

A rule for configuring Playwright, a browser-testing tool, so its end-to-end tests can start a web server reliably in continuous integration (CI), where local environment files and tunnels may not exist.

YuDefine/nuxt-supabase-starter · 0 tokens

dev-login

Dev-login routes must stay local-only while giving screenshot review and E2E a canonical way to mint test sessions.

YuDefine/nuxt-supabase-starter · 0 tokens