writing-tests

writing-tests is a skill for Claude Code, Codex from amplifthq/opentag. It costs 211 tokens per session (4,572 once invoked), scanned A, original, MIT.

A test-writing procedure that decides whether added test coverage catches a specific regression worth keeping.

In plain words
What is it for?
It helps assess new assertions and fixtures in pytest, Jest, or Playwright tests before they are added.
Why use it?
It prevents low-value tests from bloating continuous integration, which is the automated process that runs tests on code changes.

Skill for Claude CodeCodex

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

Good fit It helps assess new assertions and fixtures in pytest, Jest, or Playwright tests before they are added.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/amplifthq/opentag/writing-tests
About the project

OpenTag connects Slack with coding agents running on a computer controlled by the user, so channel mentions can queue work and return status, decisions, and evidence in the same thread. It is for engineering teams that want to run agents such as Claude Code, Codex, or Cursor against local checkouts through the Agent Client Protocol.

amplifthq/opentag · 1,432 stars · on GitHub · openmeld.ai

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.

Any agent
npx skills add amplifthq/opentag --skill writing-tests
Clone the repo
git clone --depth 1 https://github.com/amplifthq/opentag

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/amplifthq/opentag/writing-tests/github.svg)](https://agentmods.dev/skills/amplifthq/opentag/writing-tests)
Your own site
<a href="https://agentmods.dev/skills/amplifthq/opentag/writing-tests"><img src="https://agentmods.dev/badge/skills/amplifthq/opentag/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/amplifthq/opentag/writing-tests"><img src="https://agentmods.dev/badge/skills/amplifthq/opentag/writing-tests.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 211 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 4,572 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.00211 $0.04572
Opus 5.5 $0.00084 $0.01829
Sonnet 5.5 $0.00042 $0.00914
Haiku 4.5 $0.00021 $0.00457

Measured 1mo ago against content hash e6005730691c, 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 1mo 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.

Origin

Copies of this mod

1 near-identical copy found in the catalogue:

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

How it starts

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

Writing tests worth keeping

The rationale and the same rules in human-facing form live in the handbook: Backend coding conventions › Testing (docs/published/handbook/engineering/conventions/backend-coding.md). This skill is the operational gate — run it before writing tests. It carries the decision procedure plus a catalog of the bug shapes we actually ship. The gate covers added coverage, not new test functions. One fixture and one assertion added to an existing block goes through the same two questions, because that is the shape this skill asks you to prefer.

The gate: two questions

Before writing any test, answer both in one sentence each.

1. Does it earn its place?

What realistic regression does this test catch that no existing test already catches?

If you can't answer it concretely — name the bug, the code path, the input that would break — do not write the test. "Increases coverage", "good practice", and "the function exists" are not answers.

A good answer sounds like: "if someone makes parse_filters drop the team_id clause, this fails" or "empty-cohort input used to 500; this locks in the 400." That is a test worth keeping.

Aim each test at a failure mode we actually hit, not a hypothetical. The bugs PostHog ships and reverts cluster into a handful of shapes — cataloged with the test that catches each, and the failure modes no unit test should, in references/mistakes-we-make.md. If your test doesn't map to one of them, be skeptical it's worth keeping.

2. Where does it go?

Passing the first question buys the coverage, not a new test function. Find the test that already covers the nearest behavior and answer:

Why can't this be a case in that test?

When your case is a variation of that behavior, extend it: a @parameterized case in Python, a test.each row in Jest. A new standalone test is what you write when extending doesn't work, and you should be able to say why in a sentence: the setup differs, the behavior belongs to a different unit, or no relevant test exists. "It's cleaner as its own test" isn't a reason on its own; name which of those three applies.

Read the full file on GitHub · 204 lines

Files

What ships with it

4 files 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. 1mo ago First seen · 204 lines · 211 tokens per session scan A e6005730691c

Subscribe to this mod's changes

writing-tests is a skill published in the GitHub repository amplifthq/opentag (1,432 stars, last pushed 11d ago), licensed MIT. It adds 211 tokens to every session and 4,572 once invoked, about $0.0008 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-10-15.

Related

writing-tests compared with skills from other repositories

writing-tests next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
writing-testsamplifthq/opentagSkill1.4k11d agoMITA211Claude Code, Codex
performance-optimizationcompozy/compozySkill2.9ktodayMITA59Claude Code, Codex
herdr-orchestrationcompozy/compozySkill2.9ktodayMITA37Claude Code, Codex
security-reviewcompozy/compozySkill2.9ktodayMITA61Claude Code
exa-searchcompozy/compozySkill2.9ktodayMITA60Claude Code, Codex
remotion-markupcompozy/compozySkill2.9ktodayMITA12Codex
herdrcompozy/compozySkill2.9ktodayMITA74Claude Code, Codex