writing-tests

writing-tests is a skill for Claude Code, Codex from kirodotdev/KiroCrew. It costs 123 tokens per session (5,770 once invoked), scanned A, original, Apache-2.0.

A guide for writing Kiro Crew backend tests with pytest, a Python testing tool, so they have no lasting side effects and produce repeatable results.

In plain words
What is it for?
Adding, editing, reviewing, or debugging backend tests, especially when temporary files, threads, child processes, or shared configuration are involved.
Why use it?
It helps prevent tests from changing shared files, processes, or settings and causing failures in other tests.

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/kirodotdev/kirocrew/writing-tests
Any agent
npx skills add kirodotdev/KiroCrew --skill writing-tests
Clone the repo
git clone --depth 1 https://github.com/kirodotdev/KiroCrew

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/kirodotdev/kirocrew/writing-tests.svg)](https://agentmods.dev/skills/kirodotdev/kirocrew/writing-tests)
Your own site
<a href="https://agentmods.dev/skills/kirodotdev/kirocrew/writing-tests"><img src="https://agentmods.dev/badge/skills/kirodotdev/kirocrew/writing-tests.svg" alt="Measured on agentmods" height="20"></a>
Per session 123 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 5,770 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.00123 $0.05770
Opus 5 $0.00062 $0.02885
Sonnet 5 $0.00025 $0.01154
Haiku 4.5 $0.00012 $0.00577

Measured 2d ago against content hash 238f5fede83b, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, 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 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.

src/kiro_crew/builtin_skills/kirocrew-dev/writing-tests/SKILL.md · 371 lines

How it starts

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

Writing a Kiro Crew test that does not leak and does not flake

Scope guard: this skill applies ONLY to the Kiro Crew source repository (or a worktree of it). Its rules are conventions of this repo's suite. In any other project, ignore it.

The canonical, longer reference is docs/system-specs/common/testing-conventions.md. If this skill and that document disagree, the document wins. What this skill adds is the decision order — what to check first, and what the failure looks like when you get it wrong.

Where this skill stops, and which sibling takes over

This skill owns authoring a test: isolation, determinism, cross-platform behaviour, diagnosing a residue failure, and suite speed. Three siblings own the neighbouring steps, and none of them restates what is here:

You are doing Skill
Writing, fixing, or speeding up a test this skill
Running the build gate in a worktree, and deciding whether a red is yours kirocrew-worktree-dev
Driving a branch to a review-ready PR and through CI prepare-pr
Polling that PR until it is green babysit

The line that matters most in practice: kirocrew-worktree-dev tells you whether a failure is yours (re-run it on origin/main, mine CI for what is genuinely flaky); once it is yours, the fix is here. Do not fix a flake from a summary of the five determinism classes — pick the class from the symptom, in Rule 2.

The two properties, and why they are one problem

A test must be hermetic (no effect that outlives it, anywhere but its own tmp dir) and deterministic (same verdict every run, on every platform, in any order). They are the same problem because the suite runs -n auto --dist loadgroup: a side effect is not just untidy, it is the input to another test on the same worker, and it surfaces as a flake in a file you never touched.

Rule 0 — Know which conftest is under your file BEFORE you isolate anything

Read the full file on GitHub · 371 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. 2d ago Changed · +18 lines 238f5fede83b
  2. 4d ago First seen · 353 lines · 123 tokens per session scan A 3f5503eebed3

Subscribe to this mod's changes

writing-tests is a skill published in the GitHub repository kirodotdev/KiroCrew (3,532 stars, last pushed 2d ago), licensed Apache-2.0. It adds 123 tokens to every session and 5,770 once invoked, about $0.0006 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

test-writing

Write comprehensive tests for code including unit tests, integration tests, and end-to-end tests. Use this to ensure code quality, catch bugs, and validate functionality.

KarmaloopAI/Jiva · 35 tokens

laravel-testing

Test strategy for a layered Laravel application — which test style fits each layer, hand-written fakes over mocks, real-database tests for Query Classes and Repositories, pure tests for Value Objects, and feature tests that assert authorization, payload shape and query counts. Use when writing or reviewing Laravel…

Foysal50x/skills · 83 tokens

testing-expert

Ultimate Kotlin testing skill. Use this whenever writing, reviewing, or debugging ANY Kotlin test — unit, integration, property-based, or coroutine. Covers TDD (RED/GREEN/REFACTOR), Kotest + MockK + Kover, anti-pattern detection, and four-pillar quality framework. Triggers on: write a test, add coverage, why is this…

JosephSanjaya/skills · 115 tokens

rust-testing

Rust testing patterns including unit tests, integration tests, async testing, property-based testing, mocking, and coverage. Follows TDD methodology.

bl1nk-bot/bl1nk-agents-manager · 31 tokens

extension-test

Set up and run unit, integration, and E2E tests for Chrome extensions. Covers Jest mocks for chrome. APIs and Puppeteer E2E with real Chrome.

quangpl/browser-extension-skills · 37 tokens

kodama-verification

Define measurable success criteria and collect targeted test, build, lint, type-check, or smoke-test evidence before claiming work is complete.

amergrgic/kodama · 31 tokens