testing-standards

Project-specific standards for writing and reviewing Vitest tests, a JavaScript and TypeScript testing tool.

In plain words
What is it for?
Use them when adding tests, reviewing test quality, or setting up test infrastructure in this project.
Why use it?
They help tests check real behavior, include failure cases, and avoid passing without proving anything.

Skill for Claude CodeCodex

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 skills/anatomia-dev/anatomia/testing-standards
Any agent
npx skills add anatomia-dev/anatomia --skill testing-standards
Clone the repo
git clone --depth 1 https://github.com/anatomia-dev/anatomia

Made for: Claude Code, Codex.

Per session 34 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 880 The whole file, excluding the scripts and references it only reads on demand.
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.00034 $0.00880
Opus 5 $0.00017 $0.00440
Sonnet 5 $0.00007 $0.00176
Haiku 4.5 $0.00003 $0.00088

Measured 2d ago against content hash 1f93113d780e, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

testing-standards 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 2d 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.

.ana/skills/testing-standards/SKILL.md · 38 lines

How it starts

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

Testing Standards

Detected

  • Framework: Vitest (199 test files)
  • Test command: pnpm run test -- --run
  • Testing patterns: vitest
  • Test location: dedicated test directory

Library Rules

  • Always pass --run flag when invoking Vitest in CI or non-interactive contexts. Vitest defaults to watch mode, which hangs pipelines waiting for input.

Rules

  • Test behavior, not implementation. Assert on what the code returns or produces — not which internal functions it calls. Tests should survive refactoring when behavior is unchanged.

  • Prefer real implementations over mocks. Mock only what you can't control: network calls, time, randomness. Every mock is a lie about how the system actually behaves.

  • Cover the error path, not just the happy path. For each feature test, write at least one test for invalid input, missing data, or service failure.

  • Assert on specific expected values from real inputs. expect(status).toBe(200) not expect(status).toBeDefined(). A test that passes regardless of whether the feature works catches nothing. Never write tautological tests — expect(true).toBe(true) proves nothing. The same applies to range matchers — toBe(2) not toBeGreaterThan(0) when the test fixture has a known count. If you can't determine the specific expected value, read the contract's matcher/value fields before falling back to a weak assertion. When a test assertion matches the contract's matcher and value, the test is contract-aligned — not weak.

  • Never weaken a test to make it pass. If a test fails, fix the code or fix the expectation — never broaden assertions or catch exceptions to force green.

  • When overriding EngineResult fields in tests, spread at each nesting level: { ...base, commands: { ...base.commands, test: 'vitest' } }. Never reconstruct the full object manually — the factory provides all required defaults and the type has 40+ fields.

  • Never assert on source code content as a proxy for testing behavior — mock the trigger and assert on the output. Source-content assertions are acceptable as enforcement tests: verifying template content, security constraints, or structural invariants where the file content itself is what's being enforced.

  • Run the relevant test file after each change for fast feedback: pnpm vitest run tests/{file}. Run the full suite before the build report to catch cross-file regressions.

  • Scan integration tests run against the compiled dist/index.js, not source. The pre-commit hook runs (cd packages/cli && pnpm run build) to keep the artifact fresh. If running tests manually outside the hook, run (cd packages/cli && pnpm run build) first — stale dist will give false passes on terminal output tests.

  • Tests that create git repositories must force the branch name with git init -b main or git branch -M main after first commit. CI runners have different init.defaultBranch settings — never assume the default. This has caused CI failures 3 times.

  • Use inline fixture data for scanner and parser tests — write files to temp directories at test time. Standalone manifest files with real package names (requirements.txt, package.json) trigger GitHub security advisory false positives.

  • Functions exported solely for test access (imported only by test files) are intentional — TypeScript has no internal keyword. Only flag exports with zero imports anywhere.

  • When a test searches for expected output (find, findIndex, match on stdout or result arrays), assert the search succeeded — don't gate assertions behind a truthy check. if (line) { expect(line).toContain(x); } silently passes when the output is missing. Write expect(line).toBeDefined() first, then assert the value. For optional detection results where absence is a valid test outcome, conditional checks are correct.

Read the full file on GitHub · 38 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 2d ago First seen · 38 lines · 34 tokens per session scan A 1f93113d780e

Subscribe to this mod's changes

testing-standards is a skill published in the GitHub repository anatomia-dev/anatomia (32 stars, last pushed 29d ago), licensed MIT. It adds 34 tokens to every session and 880 once invoked, about $0.0002 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-30.

Related

Other skills, from other repositories

agent-browser

Drive a real browser to inspect or interact with a web page or app — navigate, take screenshots, read console and network, fill simple forms — for verification tasks, not unattended automation.

paperclipai/paperclip · 40 tokens

rational-buddhism

当用户问某主张/玄学/灵修该不该信、想建立自己的验证标准、或寻找科学与精神的结合点时调用。 核心理念: 尝试一切, 亲自测试, 保持怀疑, 保留有用的, 舍弃没用的; 不可证伪的主张不进入基本真理; 冥想/接纳等内在技术可保留。 不适用于: 需要信仰安慰的临终/哀伤场景(尊重个体选择)。 Triggers: 该不该信/玄学/灵修/冥想/可证伪/验证/理性/rational buddhism/verify/belief.

kangarooking/cangjie-skill · 166 tokens

requesting-code-review

Pre-commit review: security scan, quality gates, auto-fix.

mateaix/mateclaw · 20 tokens

workflow

Use when a task is too large for turn-by-turn orchestration and should run through the big-task workflow lane: system-wide changes, large migrations, repo-wide audits, high-confidence verification, or tasks explicitly asking to run a workflow. Claude Code uses native dynamic workflows; Codex, OpenCode, and Grok use…

jeremylongshore/tons-of-skills-marketplace · 101 tokens

verification-strategy

Thorough verification of completed work before declaring done.

vstorm-co/pydantic-deepagents · 13 tokens

gsd-verifier

Verifies phase goal achievement through goal-backward analysis. Checks codebase delivers what phase promised, not just that tasks completed.

allgpt-co/QuickVoice · 30 tokens