tests

tests is a cursor rule for Cursor from timurgaleev/vibestack. It costs 374 tokens per session, scanned A, original, MIT.

A set of software testing rules requiring unit and integration tests, an 80% minimum coverage target, and a test-first workflow. TDD, or test-driven development, means writing a failing test before implementing the code that should make it pass.

In plain words
What is it for?
It is for testing individual functions, API endpoints, database operations, and components; checking coverage; and diagnosing test failures.
Why use it?
It gives developers a repeatable way to check new code and reduces the risk that changes break existing behavior.

Cursor rule for Cursor

Written for Cursor: a Cursor rule (.mdc).

Good fit It is for testing individual functions, API endpoints, database operations, and components; checking coverage; and diagnosing test failures.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/timurgaleev/vibestack/tests
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/timurgaleev/vibestack

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 tests

README.md
[![agentmods](https://agentmods.dev/badge/rules/timurgaleev/vibestack/tests/github.svg)](https://agentmods.dev/rules/timurgaleev/vibestack/tests)
Your own site
<a href="https://agentmods.dev/rules/timurgaleev/vibestack/tests"><img src="https://agentmods.dev/badge/rules/timurgaleev/vibestack/tests/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 tests

Your own site · 80×15
<a href="https://agentmods.dev/rules/timurgaleev/vibestack/tests"><img src="https://agentmods.dev/badge/rules/timurgaleev/vibestack/tests.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 374 This file is loaded in full into every session.
When invoked 374 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.00374 $0.00374
Opus 5.5 $0.00150 $0.00150
Sonnet 5.5 $0.00075 $0.00075
Haiku 4.5 $0.00037 $0.00037

Measured 23d ago against content hash 7ed459e2051c, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

tests 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 23d 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.

config/cursor/rules/tests.mdc · 50 lines

What it actually says

Testing Requirements

Test Value Bar

A test earns its place by protecting behavior a real regression would break. Write one only when all four questions have an answer:

  1. What observable behavior, invariant or contract does it protect?
  2. What credible regression makes it fail?
  3. Why does existing coverage not already catch that?
  4. Does it need a production seam no production caller needs? If so, test at the real boundary instead.

Weak tests are not coverage: a smoke test, an existence check, or "it doesn't throw" never counts as covering a path. A regression test is proven red against the code before the fix, then green after it. Red means the test executed and failed for the intended reason — an import error, a missing fixture or a typo in the assertion is not red.

Testing Workflow

Recommended workflow:

  1. Write tests for new functionality
  2. Run tests to verify they fail (if testing new code)
  3. Implement functionality
  4. Run tests to verify they pass
  5. Refactor as needed while keeping tests green

Troubleshooting Test Failures

  1. Read error messages carefully
  2. Check test isolation - tests should not share state
  3. Verify mocks are correct
  4. Fix implementation, not tests (unless tests are wrong)
  5. Use debugger to trace execution flow

Test Writing Guidelines

  • Fast: Unit tests should run in <10ms
  • Isolated: No shared state between tests
  • Deterministic: Same input always produces same output
  • Readable: Tests serve as documentation
  • Focused: Test one thing per test case
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. 23d ago Changed · +2 lines · +31 tokens per session 7ed459e2051c
  2. 25d ago Changed · +8 lines · +81 tokens per session 5a0278239075
  3. 1mo ago First seen · 40 lines · 262 tokens per session scan A a80a60f0aeb0

Subscribe to this mod's changes

tests is a cursor rule published in the GitHub repository timurgaleev/vibestack (7 stars, last pushed 20d ago), licensed MIT. It adds 374 tokens to every session, about $0.0015 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-09-19.