testing-discipline

A set of rules for testing software, including Test-Driven Development (TDD), where tests are written before or alongside the code, and Behavior-Driven Development (BDD), where tests describe user-visible behavior.

In plain words
What is it for?
Use it when adding or changing business logic, writing unit tests, end-to-end tests, contract tests, or test automation. It guides the failing-test, passing-code, cleanup cycle and the Arrange–Act–Assert structure.
Why use it?
It reduces regressions and tests that pass for the wrong reasons. It also encourages deterministic tests that do not depend on the clock, network, or uncontrolled randomness.

Cursor rule

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/jterratsdev/ableton-live-mcp/testing-discipline
Clone the repo
git clone --depth 1 https://github.com/jterratsdev/ableton-live-mcp
Per session 1,558 This file is loaded in full into every session.
When invoked 1,558 The same file — it is already loaded in full.
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.01558 $0.01558
Opus 5 $0.00779 $0.00779
Sonnet 5 $0.00312 $0.00312
Haiku 4.5 $0.00156 $0.00156

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

Security

Grade A, and why

testing-discipline 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.

rules/testing-discipline.mdc · 68 lines

How it starts

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

Testing Discipline

Test-Driven Development (TDD)

  • Write the test before or alongside the implementation. At minimum, tests must exist before the PR.
  • Red → Green → Refactor. Start with a failing test, make it pass with minimal code, then clean up.
  • Every development task must include unit tests for new or changed business logic before it is handed to QA.

Behavior-Driven Development (BDD)

  • Test behavior, not implementation. Test what the function does, not how it does it.
  • Name tests as specifications: it('rejects orders with zero quantity'), not it('test1').
  • One assertion per test method. If you need multiple, it's multiple behaviors — split them.

Test Structure

  • Arrange → Act → Assert. Separate setup, execution, and verification with blank lines.
  • Use factory functions or builders for test data — never copy-paste fixtures across test files.
  • QA automation, E2E suites, contract tests, and test scripts that repeat fixture collections, selectors, expected outputs, or command matrices must load the collection-standards skill.
  • Tests must be deterministic. No reliance on system clock, network, or random values without seeding.

Sync Tests

  • If data is duplicated across packages (e.g., type definitions, config arrays), a test must assert both copies are identical.
  • Schema changes in a source of truth must break a test somewhere — if they don't, add one.

Coverage

  • Target 90%+ line coverage for business logic. Infrastructure/glue code can be lower.
  • Coverage is a floor, not a goal. 100% coverage with bad assertions is worse than 80% with good ones.

E2E / Integration

  • Prefer Playwright for browser-based E2E, smoke, and regression automation.
  • Use the Page Object pattern for UI tests. Selectors live in page objects, not test bodies.
  • Tag tests by speed/scope (@smoke, @regression) so CI can run fast feedback loops.
  • Capture evidence for E2E failures with traces, screenshots, or videos when supported by the framework.
  • E2E tests for any product surface must run against isolated disposable fixtures: web apps, mobile apps, desktop apps, CLI, APIs, integrations, workflows, runtimes, installers, file-system flows, data pipelines, and generated artifacts. Use the user/project-configured E2E fixture path, device farm, sandbox org, emulator, container, or test environment when one is explicitly provided; otherwise default local disposable fixtures to /tmp. Each test creates its own users/data/project/tasks/roles/acceptance criteria/expected artifacts as applicable; never rely on the developer's current repo state as the tested product state.
  • QA must choose fixture data that reproduces the risk being validated. If the acceptance criterion is about oversized stories, split decisions, phase returns, queueing, or specialist roles, the E2E must create an oversized/cross-cutting task with enough paths, roles, acceptance criteria, and risk signals to force that behavior.
  • Every E2E must assert the resulting state, not only that the action executed. Validate UI-visible state, navigation, accessibility, device/responsive behavior, API contracts, receiver-side integration state, database/mock records, files, events, handoff contents, stdout/stderr, exit code, push notifications, background jobs, generated artifacts, or release-readiness output as applicable.
  • For workflow automata, E2E must validate state transitions and loops: allowed transition, blocked transition, return-to-dev/architect/BA when findings fail, and resume behavior after the corrective state is satisfied.
  • Include negative and edge scenarios when they are the reason for the change. A happy-path smoke is insufficient for bugs involving guardrails, split detection, security boundaries, QA failback, or release blocking.
  • QA, SDET, Developer, BA, Architect, and Release work that produces or reviews evidence must load the qa-evidence-pack skill when it involves acceptance criteria coverage, Playwright/browser artifacts, CLI stdout/stderr, API contracts, integration side effects, screenshots, visual diffs, or annotated defect evidence.
  • Keep large screenshots, videos, traces, logs, API payloads, and visual diffs as files. Summarize them in a compact evidence report so agents do not consume context with raw artifacts.

Read the full file on GitHub · 68 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 · 68 lines · 1,558 tokens per session scan A d98d4409fb1e

Subscribe to this mod's changes

testing-discipline is a cursor rule published in the GitHub repository jterratsdev/ableton-live-mcp (0 stars, last pushed 8d ago), licensed MIT. It adds 1,558 tokens to every session, about $0.0078 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-31.