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.
npx agentmods add rules/yudefine/nuxt-supabase-starter/test-scriptsgit clone --depth 1 https://github.com/YuDefine/nuxt-supabase-starterWrote 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.
[](https://agentmods.dev/rules/yudefine/nuxt-supabase-starter/test-scripts)<a href="https://agentmods.dev/rules/yudefine/nuxt-supabase-starter/test-scripts"><img src="https://agentmods.dev/badge/rules/yudefine/nuxt-supabase-starter/test-scripts.svg" alt="Measured on agentmods" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00000 | $0.02357 |
| Opus 5 | $0.00000 | $0.01179 |
| Sonnet 5 | $0.00000 | $0.00471 |
| Haiku 4.5 | $0.00000 | $0.00236 |
Grade A, and why
test-scripts 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.
How it starts
The opening of the file, as written. The whole thing — 170 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Test Scripts
核心命題:vitest multi-project 配置(projects: [...] 或 test.workspace)下,package.json 的 test:* script 若寫死路徑當 path filter(例如 vp test run test/unit),會把不在該路徑下的 project 整個排除。開發者跑 pnpm test:unit -- <該 project 範圍外的單檔> 時 vitest 靜默不跑(無錯誤、無警告、回 0 fail),開發者誤以為通過但實際根本沒執行。
此規則優先於個別 consumer 既有的 script 命名習慣。
適用範圍
- 觸發條件:
vitest.config.ts含projects: [...](或test.workspace)且 ≥ 2 個 project - 不適用:單一 project 配置(一個
include),或非 vitest 測試框架(jest、bun:test 等)
MUST
用 --project=<name> 取代寫死路徑
每個 vitest project MUST 在 package.json 有對應 test:<project> script,使用 --project=<name> flag:
{
"scripts": {
"test": "vp test run --coverage",
"test:file": "vp test run",
"test:unit": "vp test run --project=unit",
"test:nuxt": "vp test run --project=nuxt",
"test:integration": "vp test run --project=integration"
}
}
test:跑全部 projects(CI 預設)test:<project>:嚴格只跑單一 project,不限 pathtest:file:無 filter 的 escape hatch,跑單檔時 vitest 自動匹配對應 project(MUST 提供)
跑單檔的標準作法
跑單檔測試時,MUST 使用以下任一形式:
pnpm test:file <path> # 推薦:明確走 escape hatch
pnpm vp test run <path> # 等價:直接呼叫 vp
vitest 會依 vitest.config.ts 內各 project 的 include / exclude 自動把該 path 路由到對應 project。
NEVER
禁止把路徑寫進 test:<project> script
// ❌ 錯誤——把路徑當 filter 寫死,跨 project 單檔測試會靜默跳過
{
"scripts": {
"test:unit": "vp test run test/unit",
"test:nuxt": "vp test run app"
}
}
寫死路徑的問題:
pnpm test:unit -- app/pages/foo.test.ts經 npm script 展開為vp test run test/unit app/pages/foo.test.ts- vitest 把兩者都當 path filter,行為不一致(依版本可能 0 file matched 或部分匹配)
- 開發者無法明確知道 test 是否真的跑了該檔
禁止以 pnpm test:<project> -- <path> 形式跑單檔
即使 script 本身正確(--project=<name>),加了 -- <path> 等於把 path filter 限到那個 project 的 include 範圍。MUST 改用 pnpm test:file <path>。
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.
- yesterday First seen · 170 lines · 0 tokens per session scan A 1d5dfb80bcd7
test-scripts is a cursor rule published in the GitHub repository YuDefine/nuxt-supabase-starter (45 stars, last pushed today), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 2,357 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.
Other cursor rules, from other repositories
testing
Rules for writing Jest tests in TypeScript.
every-error-regression-test
Mandatory regression test for every discovered defect or failure (non-negotiable).
tdd-patterns
Rigorous Test-Driven Development (TDD) with DUnitX, naming and dependency injection for isolation with fakes and mocks.
android_unit_testing_bdd
Unit testing best practices with BDD style.
auto-test
Guidelines for automated testing.
testing
Testing conventions and patterns.