unit-test-architect

unit-test-architect is a cursor rule for Cursor from GktuOktay/ai-skills. It costs 0 tokens per session (1,033 once invoked), scanned A, original, MIT.

A guide for writing unit tests, which check small, individual pieces of code in isolation. It covers mocks and stubs, edge cases, and the Arrange-Act-Assert structure for clear tests.

In plain words
What is it for?
Use it to design unit-test suites, isolate dependencies, cover unusual inputs, and verify return values, state changes, or interactions.
Why use it?
It helps tests detect defects without depending on networks, files, clocks, or other changing systems. Clear isolated tests also make failures easier to diagnose.

Cursor rule for Cursor

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

Good fit Use it to design unit-test suites, isolate dependencies, cover unusual inputs, and verify return values, state changes, or interactions.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/gktuoktay/ai-skills/unit-test-architect
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/GktuOktay/ai-skills

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 unit-test-architect

README.md
[![agentmods](https://agentmods.dev/badge/rules/gktuoktay/ai-skills/unit-test-architect/github.svg)](https://agentmods.dev/rules/gktuoktay/ai-skills/unit-test-architect)
Your own site
<a href="https://agentmods.dev/rules/gktuoktay/ai-skills/unit-test-architect"><img src="https://agentmods.dev/badge/rules/gktuoktay/ai-skills/unit-test-architect/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 unit-test-architect

Your own site · 80×15
<a href="https://agentmods.dev/rules/gktuoktay/ai-skills/unit-test-architect"><img src="https://agentmods.dev/badge/rules/gktuoktay/ai-skills/unit-test-architect.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Nothing until a file matches its globs; then the whole rule loads.
When invoked 1,033 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.00000 $0.01033
Opus 5 $0.00000 $0.00517
Sonnet 5 $0.00000 $0.00207
Haiku 4.5 $0.00000 $0.00103

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

Security

Grade A, and why

unit-test-architect 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.

agents/cursor/rules/unit-test-architect.mdc · 110 lines

How it starts

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

Unit Test Architect Guidelines

As a Unit Test Architect, your goal is to ensure the reliability, maintainability, and correctness of individual code units by applying rigorous testing methodologies. You focus on isolated behavior, minimizing side effects, and ensuring edge cases are fully covered.

Core Philosophy

  1. Isolation: A unit test must isolate the tested unit from its dependencies.
  2. Determinism: Tests must consistently pass or fail based purely on the code's behavior, not external factors like time, network, or filesystem.
  3. Speed: Unit tests should execute rapidly to provide immediate developer feedback.
  4. Clarity: Test failures must immediately point to the exact issue.

The AAA Pattern (Arrange, Act, Assert)

Every unit test should be structured logically using the AAA pattern:

  • Arrange: Set up the environment, initialize objects, establish mocks/stubs, and prepare data.
  • Act: Invoke the method or behavior being tested.
  • Assert: Verify that the expected outcome occurred (return values, state changes, or interactions).

Code Example: AAA Pattern

// Example using Jest
describe('ShoppingCart', () => {
  it('should calculate the total price with tax correctly', () => {
    // Arrange
    const cart = new ShoppingCart();
    const item = new Item('Laptop', 1000);
    cart.addItem(item);
    const taxRate = 0.10; // 10%

    // Act
    const total = cart.calculateTotal(taxRate);

    // Assert
    expect(total).toBe(1100);
  });
});

Mocking vs. Stubbing

Understanding the distinction is critical for writing meaningful tests without over-mocking.

Concept Definition When to Use
Stub An object that holds predefined data and uses it to answer calls during tests. It does not fail the test. When your unit needs data from an external dependency to execute a path.
Mock An object that registers calls they receive. In test assertion we can verify that all expected actions were performed. When you want to verify that an external dependency was called correctly (e.g., saving to DB, sending an email).
Spy A wrapper around a real function that tracks calls, arguments, and return values without necessarily altering behavior. When you need real behavior but also want to track interactions.

Read the full file on GitHub · 110 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 · 110 lines · 1,033 tokens per session scan A e6b60a8aeb3b

Subscribe to this mod's changes

unit-test-architect is a cursor rule published in the GitHub repository GktuOktay/ai-skills (2 stars, last pushed 8d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,033 tokens. 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-03.