shift: Skill for Claude Code

.agents/skills/writing-tests/SKILL.md

writing-tests is a skill for Claude Code, Codex from shift-editor/shift. It costs 70 tokens per session (4,130 once invoked), scanned A, original, Apache-2.0.

A set of project-specific rules for writing tests in TypeScript files. It also defines how to handle mocks, stubs, and spies in the Shift codebase.

In plain words
What is it for?
Guide the addition, rewriting, or review of `.test.ts` files and decisions about mocking, stubbing, or spying.
Why use it?
It keeps tests consistent with the repository's stated policy, including its decision to avoid mock-based testing.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: installed under .agents/ (shared by several agents).

This is shift-editor/shift's own configuration. It tells Claude Code and Codex how to work on shift itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything shift configures →

Reuse

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.

Copy the file
curl -O https://raw.githubusercontent.com/shift-editor/shift/main/.agents/skills/writing-tests/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/shift-editor/shift

Made for: Claude Code, Codex.

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 writing-tests

README.md
[![agentmods](https://agentmods.dev/badge/skills/shift-editor/shift/writing-tests/github.svg)](https://agentmods.dev/skills/shift-editor/shift/writing-tests)
Your own site
<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.

agentmods 80×15 button for writing-tests

Your own site · 80×15
<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>
Per session 70 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 4,130 The whole file, excluding the scripts and references it only reads on demand.
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.00070 $0.04130
Opus 5.5 $0.00028 $0.01652
Sonnet 5.5 $0.00014 $0.00826
Haiku 4.5 $0.00007 $0.00413

Measured today against content hash a675d164212c, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

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.

.agents/skills/writing-tests/SKILL.md · 268 lines

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.

Read the full file on GitHub · 268 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. today Changed a675d164212c
  2. yesterday Changed · +2 lines a2bf63455239
  3. 1mo ago Changed · +2 lines 6743241d723c
  4. 1mo ago Changed · +34 lines · +2 tokens per session 12bd116c5397
  5. 1mo ago Changed · +9 lines 81effc68d7e5
  6. 1mo ago First seen · 221 lines · 68 tokens per session scan A 6ecbc9626d6d

Subscribe to this mod's changes

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.