test-budget

test-budget is a cursor rule for Cursor from paperclipai/paperclip. It costs 942 tokens per session, scanned A, original, MIT.

A set of rules for keeping pull-request tests fast and useful in database, server, user-interface, and end-to-end test files. It covers long real-time waits, repeated database migration tests, fragile text checks, and small embedded-database test files.

In plain words
What is it for?
Use it when adding or reviewing Vitest or Playwright tests, especially tests involving timers, database migrations, embedded PostgreSQL, or checks based on exact prose.
Why use it?
It prevents slow or brittle tests from delaying ordinary code changes. Tests that genuinely need long waits or heavier system checks are directed to a separate nightly test group.

Cursor rule for Cursor

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

Good fit Use it when adding or reviewing Vitest or Playwright tests, especially tests involving timers, database migrations, embedded PostgreSQL, or checks based on exact prose.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/paperclipai/paperclip/test-budget
About the project

Paperclip is a Node.js server and React application for coordinating AI agents as a business team, with goals, organizational roles, budgets, governance, and work tracking in one interface. It is used by people managing multiple agents or autonomous agent organizations across tools such as OpenClaw, Claude Code, Codex, and Cursor. The catalogue includes skills, agents, an MCP add-on, and an instruction for working with Paperclip.

paperclipai/paperclip · 118,214 stars · on GitHub · paperclip.ing

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/paperclipai/paperclip

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 test-budget

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

Your own site · 80×15
<a href="https://agentmods.dev/rules/paperclipai/paperclip/test-budget"><img src="https://agentmods.dev/badge/rules/paperclipai/paperclip/test-budget.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 942 This file is loaded in full into every session.
When invoked 942 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.00942 $0.00942
Opus 5.5 $0.00377 $0.00377
Sonnet 5.5 $0.00188 $0.00188
Haiku 4.5 $0.00094 $0.00094

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

Security

Grade A, and why

test-budget 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 5d 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.

rules/test-budget.mdc · 43 lines

How it starts

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

CI test budget

This rule applies to Vitest and Playwright test files across packages/db, server, ui, and tests/e2e.

Required behavior

  1. No unbudgeted real-clock sleeps over 1 second in PR tests.

    • Use fake timers (vi.useFakeTimers()), deterministic event/condition waits, or direct service calls instead of setTimeout(..., >1000), delay(>1000), or page.waitForTimeout(>1000).
    • True real-clock soak, lease-expiry, restart, crash-recovery, retention-sweep, and load/benchmark suites must be registered in scripts/ci/nightly-only-suites.json so they run on master, release-verify, cloud-readiness, local pnpm test:run, and PAPERCLIP_CI_FULL=1 without blocking ordinary PRs.
    • If a PR test genuinely requires a real-clock wait over 1s (for example testing a real idle-timeout or socket deadline), annotate the line with // test-budget:allow-sleep: <reason>.
  2. No historical one-time SQL migration replay sprawl.

    • Do not add standalone *-migration.test.ts files that tear down schema and replay already-shipped SQL migrations against embedded Postgres.
    • Test ongoing migration-runner invariants, safety rules, and schema/snapshot integrity in the core owner suites: packages/db/src/client.test.ts, packages/db/src/check-migration-safety.test.ts, packages/db/src/migration-compatibility.test.ts, and packages/db/src/migration-snapshot-drift.test.ts.
    • Active runtime migration services (not historical SQL replay) are exempt, and long-running migration soaks belong in scripts/ci/nightly-only-suites.json.
  3. No brittle static prose-grep tests.

    • Do not add *-guidance.test.ts suites that readFileSync / readFile markdown docs, skill prose, or ui/src/*.tsx solely to assert exact wording or copy strings.
    • Security, authz, and safety static guards (such as cli-invocation-safety.test.ts, authz-existence-oracle-guard.test.ts, and app-private-hostname-gate.test.ts) are explicit exceptions.
  4. Extend existing owner suites instead of adding tiny standalone embedded-Postgres files.

    • Each standalone server/DB test file pays isolated Vitest worker import, transform, and disposable-database setup cost.
    • Do not create a new <= 80 LOC test file that boots embedded Postgres (startEmbeddedPostgresTestDatabase / createTestPostgres) for one narrow regression case; add the test case to the owning service or route suite instead.
    • If a standalone file is required for process or environment isolation, annotate the file with // test-budget:allow-standalone-db: <reason>.

Read the full file on GitHub · 43 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. 5d ago First seen · 43 lines · 942 tokens per session scan A 039e20ba76ad

Subscribe to this mod's changes

test-budget is a cursor rule published in the GitHub repository paperclipai/paperclip (118,214 stars, last pushed yesterday), licensed MIT. It adds 942 tokens to every session, about $0.0038 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-11-25.

Related

test-budget compared with cursor rules from other repositories

test-budget next to 6 cursor rules from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
test-budgetpaperclipai/paperclipCursor rule118kyesterdayMITA942Cursor
ponytailDietrichGebert/ponytailCursor rule201k8d agoMITA604Cursor
angular-20angular/angularCursor rule102k4d agoMITA0Cursor
dev-standardapache/supersetCursor rule76ktodayApache-2.0A1,147Cursor
prefer-assertions-over-defensive-checksprisma/ormCursor rule48ktodayApache-2.0A0Cursor
prefer-direct-imports-over-module-mocksprisma/ormCursor rule48ktodayApache-2.0A0Cursor
shared-plane-packagesprisma/ormCursor rule48ktodayApache-2.0A0Cursor