writing-tests

writing-tests is a skill for Claude Code, Codex from kirodotdev/KiroCrew. It costs 72 tokens per session (14,975 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

Written for no agent in particular: nothing here depends on one.

Needs its repository: it reads a path above its own folder, which exists only inside the repository. The line is [`docs/system-specs/common/testing-conventions.md`](../../../../../docs/system-specs/common/testing-conventions.md)..

Good fit Adding, editing, reviewing, or debugging backend tests, especially when temporary files, threads, child processes, or shared configuration are involved.

Compare 6 skills from other repositories ↓
About the project

Kiro Crew is a persistent development workspace where agents continue multi-step software work across sessions, schedules, and connected interfaces. Developers use it locally or remotely through a desktop app, web dashboard, CLI, Slack, or Discord, with unattended tasks and recurring jobs. The catalogue contains skills and instructions for working with this workspace.

kirodotdev/KiroCrew · 4,518 stars · on GitHub · kiro.dev

Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/kirodotdev/KiroCrew
agentmods
npx agentmods add skills/kirodotdev/kirocrew/writing-tests

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/github.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/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/kirodotdev/kirocrew/writing-tests"><img src="https://agentmods.dev/badge/skills/kirodotdev/kirocrew/writing-tests.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 72 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 14,975 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 2 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 2 findings, up to medium

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • medium Rogue Agent · line 3
    Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.
    Fix: Remove any persistence mechanisms (cron jobs, startup scripts, state files). Skills should not maintain state across sessions without explicit user consent.
  • medium Rogue Agent · line 128
    Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.
    Fix: Remove any persistence mechanisms (cron jobs, startup scripts, state files). Skills should not maintain state across sessions without explicit user consent.
How audits are shown
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.00072 $0.14975
Opus 5.5 $0.00029 $0.05990
Sonnet 5.5 $0.00014 $0.02995
Haiku 4.5 $0.00007 $0.01498

Measured yesterday against content hash 6dcbfbde3dc0, 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 2 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 yesterday.

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.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

the host may lack (`jq` beside the `gh` and `curl` it already stubs) as a shell

Runs shell commandslowCapability

Expected in a hook, worth knowing in a rule or an instructions file.

- [ ] A fake `subprocess.run` routes on whole argv tokens, never on a substring of the
src/kiro_crew/builtin_skills/kirocrew-dev/writing-tests/SKILL.md · 828 lines

How it starts

The opening of the file, as written. The whole thing — 828 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 kirocrew-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 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 · 828 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. yesterday Changed · +2 lines 6dcbfbde3dc0
  2. 4d ago Changed 30d232bd3238
  3. 13d ago Changed · +2 lines fa4c06ed44a0
  4. 14d ago Changed · +54 lines 155443067409
  5. 15d ago Changed 40c3ff81058a
  6. 16d ago Changed · -1 lines · -2 tokens per session cdc6c11eba23
  7. 18d ago Changed · +1 lines 501947a5806a
  8. 19d ago Changed · +3 lines 5a6b92e22bc8
  9. 20d ago Changed · +55 lines 892e8a6de15e
  10. 23d ago First seen · 712 lines · 74 tokens per session scan A 7853874be040

Subscribe to this mod's changes

writing-tests is a skill published in the GitHub repository kirodotdev/KiroCrew (4,518 stars, last pushed today), licensed Apache-2.0. It adds 72 tokens to every session and 14,975 once invoked, about $0.0003 per session on Opus 5.5. A static security scan graded it A with 2 findings (makes network calls, runs shell commands). 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

python-testing

Guidelines for writing and running tests in the Agent Framework Python codebase. Use this when creating, modifying, or running tests.

microsoft/agent-framework · 29 tokens

relay-80-100-workflow

Use when writing agent-relay workflows that must fully validate features end-to-end before merging. Covers the 80-to-100 pattern - going beyond "code compiles" to "feature works, tested E2E locally." Includes repair-before-failure validation gates, review-depth fresh-eyes review/fix loops with test hardening, PGlite…

AgentWorkforce/relay · 115 tokens

adk-verify-snippets

Checks that every Python code block in a Markdown file actually compiles and runs, by extracting each block to a temporary file, executing it in an isolated subprocess, and writing a pass/fail report with per-snippet coverage. Use when the user asks to verify, test, or validate the code samples in a README, a guide…

google/adk-python · 149 tokens

browser-testing-with-screenshots

Use when testing web applications with visual verification - automates Chrome browser interactions, element selection, and screenshot capture for confirming UI functionality.

AgentWorkforce/relay · 32 tokens

adk-setup

Sets up a local ADK Python development environment in a git clone of the open-source adk-python repository: a uv virtual environment, all dependency extras, pre-commit hooks, and a first unit-test run. Runs only when explicitly requested, never on its own. Use when asked to set up, bootstrap, or repair a development…

google/adk-python · 146 tokens

flutter-bloc-state-management

Implement BLoC/Cubit state, events, transitions, and async concurrency in Flutter. Use for BLoC/Cubit feature logic, debounced/cancellable events, state rendering, or bloc tests—not generic widget-only work.

HoangNguyen0403/agent-skills-standard · 52 tokens