Borrowing it
Nothing to install: this file belongs to shift-editor/shift. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/shift-editor/shift/main/.agents/skills/writing-tests/SKILL.mdgit clone --depth 1 https://github.com/shift-editor/shiftWrote 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/skills/shift-editor/shift/writing-tests)<a href="https://agentmods.dev/skills/shift-editor/shift/writing-tests"><img src="https://agentmods.dev/badge/skills/shift-editor/shift/writing-tests/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.
<a href="https://agentmods.dev/skills/shift-editor/shift/writing-tests"><img src="https://agentmods.dev/badge/skills/shift-editor/shift/writing-tests.svg" alt="Reviewed on agentmods" width="80" 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.1 | $0.00070 | $0.04130 |
| Opus 5.5 | $0.00028 | $0.01652 |
| Sonnet 5.5 | $0.00014 | $0.00826 |
| Haiku 4.5 | $0.00007 | $0.00413 |
Grade A, and why
writing-tests 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 today.
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 — 268 lines — stays where its author put it; the contents beside it link to each section on GitHub.
/writing-tests — How tests are written in this codebase
The goal is tests that survive a full rewrite of the implementation, as long as the behavior stays the same. If your test breaks when a private method is renamed or a call count changes, you're testing the wrong thing.
The rule
Assert on observable state, not on mock calls.
Drive the code through its user-facing surface (editor.copy(), editor.click(), toolManager.handleKeyDown(...)) and assert on what a user would see — glyph contours, selection, viewport pan, tool state, command history, returned values. Never on "was method X called N times."
Everything else here is a consequence of that rule.
When not to add a test
Do not treat line coverage or "every changed file needs a test" as the goal. Add a test only when it protects an observable behavior, domain invariant, or public boundary that could regress independently of the implementation.
Skip a new test when it would only:
- repeat declarative framework wiring, dependency setup, or static configuration;
- snapshot private query keys, option objects, CSS classes, component structure, or other implementation choices;
- exercise a trivial delegation whose behavior is already covered at the owning boundary;
- justify extracting a tiny helper solely so the implementation has something easy to unit-test;
- assert behavior already guaranteed by TypeScript, Rust's type system, or the library being configured;
- require mocks, spies, a parallel harness, or broad DOM/IPC infrastructure for code that is better verified by focused manual QA.
Examples: do not test that a QueryClientProvider is mounted, that a query key contains a particular string, or that a fixed-size chunk helper calls slice() correctly. Do test stable batching if it is exposed as a reusable contract with edge cases, or test the user-visible result through a real integration boundary when one exists.
When no worthwhile automated test exists, say so explicitly in the handoff and record the focused manual verification performed. Do not create a low-value test to make the diff look complete.
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.
- today Changed a675d164212c
- yesterday Changed · +2 lines a2bf63455239
- 1mo ago Changed · +2 lines 6743241d723c
- 1mo ago Changed · +34 lines · +2 tokens per session 12bd116c5397
- 1mo ago Changed · +9 lines 81effc68d7e5
- 1mo ago First seen · 221 lines · 68 tokens per session scan A 6ecbc9626d6d
writing-tests is a skill published in the GitHub repository shift-editor/shift (379 stars, last pushed today), licensed Apache-2.0. It adds 70 tokens to every session and 4,130 once invoked, about $0.0003 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-09-01.
Other skills, from other repositories
testing-patterns
Testing patterns and principles. Unit, integration, mocking strategies, Arrange-Act-Assert (AAA), and multi-ecosystem test runners.
github-copilot-upgrader
Use this to update the Github Copilot CLI/SDK.
typescript
TypeScript strict mode with eslint and jest.
authoring-data-quality-checks
Adds and runs data quality checks (dbt-test style assertions) on a project's warehouse tables and saved-query views, and HogQL catalog metrics: not-null, uniqueness, accepted values, referential integrity, row-count bounds, freshness, and custom HogQL. Metrics support custom SQL checks only. Use when asked to test a…
jest-unit
Unit testing skill using Jest for TypeScript and JavaScript, covering mocking, spies, snapshots, coverage, async testing, and custom matchers.
Jasmine Testing
BDD-style JavaScript testing with Jasmine covering spies, async patterns, custom matchers, clock manipulation, and comprehensive test organization for frontend and Node.js applications.