write-test-py

A test-writing step that turns reviewed test stubs into executable test code. Test-driven development (TDD) uses tests as the expected behavior before or alongside implementation.

In plain words
What is it for?
Use it to implement Python test bodies, including reworking tests when earlier build findings or interview notes changed their contracts.
Why use it?
It replaces empty test structures with checks that describe how the program's objects and data should work together. It also catches design and code-quality problems during test creation.

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/nullhack/temple8/write-test-py
Any agent
npx skills add nullhack/temple8 --skill write-test-py
Clone the repo
git clone --depth 1 https://github.com/nullhack/temple8

Made for: Claude Code, Codex.

Per session 24 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 562 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.00024 $0.00562
Opus 5 $0.00012 $0.00281
Sonnet 5 $0.00005 $0.00112
Haiku 4.5 $0.00002 $0.00056

Measured yesterday against content hash 792ae0d79c05, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

write-test-py 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 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.

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.

.opencode/skills/write-test-py/SKILL.md · 18 lines

What it actually says

Write Test Py

  1. Load [[software-craft/solid]], [[software-craft/object-calisthenics]], [[software-craft/smell-catalogue]], [[software-craft/test-design]] — the quality criteria and body patterns.
  2. Read .cache/<session_id>/journal.md (always present — bootstrapped at plan entry by model-data-schema) and .cache/<session_id>/interview-notes.md. Two rework trigger sources feed the backlog: (a) IF the journal carries escalation findings from build THEN edit the bodies of the contracts it names to match the reworked stubs; (b) IF the interview notes flag findings that MODIFY an existing block THEN edit the bodies of those contracts to match the reworked .pyi. Either source is rework — step 9 re-applies the pending marker. Skip both if neither carries rework.
  3. Write the test bodies — no docstrings, no comments; the body is the spec. Bodies define how entities relate, compose, and collaborate: wire classes, data, and objects following best practices.
  4. Apply the code-quality gate here: SOLID, DRY, KISS, YAGNI, Object Calisthenics per [[software-craft/solid]], [[software-craft/object-calisthenics]]. IF a smell is present THEN reject it per [[software-craft/smell-catalogue]].
  5. Mark each test with the pending marker; the conftest hook skips pending tests so the suite stays green-with-skips until source is built.
  6. Defer the system-under-test import into each test body so an unbuilt module collects cleanly and its pending tests skip rather than error at collection. Keep third-party and test-only imports at module top.
  7. Keep the .py's module-level names and method signatures in exact agreement with its .pyi — stubtest checks the pair strictly.
  8. Run the dev ruff check (ruff check .) on the authored test files; fix every violation so build receives bug-clean tests. Restructure lint (SIM, RUF) and ruff format are merge-time per [[software-craft/docstring-lifecycle]] — do not format here.
  9. Strip docstrings from the test .py you just wrote: uv run python scripts/strip_docstrings.py <authored *_test.py files>.
  10. IF reworking an existing contract THEN edit the body to match the changed .pyi and re-apply the pending marker to the affected tests so they skip until build re-selects them.
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 First seen · 18 lines · 24 tokens per session scan A 792ae0d79c05

Subscribe to this mod's changes

write-test-py is a skill published in the GitHub repository nullhack/temple8 (11 stars, last pushed 27d ago), licensed MIT. It adds 24 tokens to every session and 562 once invoked, about $0.0001 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.