author-test-stubs

A skill for writing Python interface stub files, which describe classes and methods without implementing them. The stubs act as the first precise statement of how the system should work.

In plain words
What is it for?
It is for defining integration and end-to-end test contracts in dependency order, including how parts of the system connect.
Why use it?
It turns requirements into clear contracts before implementation, reducing guesswork and keeping related parts compatible.

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

Made for: Claude Code, Codex.

Per session 30 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 675 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.00030 $0.00675
Opus 5 $0.00015 $0.00338
Sonnet 5 $0.00006 $0.00135
Haiku 4.5 $0.00003 $0.00068

Measured 2d ago against content hash 9f8241f74ad2, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

author-test-stubs 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.

.opencode/skills/author-test-stubs/SKILL.md · 18 lines

What it actually says

Author Test Stubs

  1. Load [[software-craft/test-stubs]], [[software-craft/test-design]] — stub conventions and what-to-test 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 (contract gaps) THEN rework the contracts it names first; (b) IF the interview notes flag findings that MODIFY an existing block (rework — modifies existing <block> from interview-building-blocks) THEN rework those contracts' .pyi signatures to match the changed requirement. Either source marks the affected contracts as rework; write-test-py re-applies the @pytest.mark.pending marker to the affected tests so select-build-target pulls them from the backlog. A finding with no rework flag is new work — author a fresh stub.
  3. Author integration and E2E test stubs only — no unit-test stubs. Author in build layer order so external-boundary contracts precede adapter, then internal-data, then internal contracts.
  4. Express the requirement in class and method signatures with type annotations: entity relationships, compositions, and the behaviour each test asserts. External-layer stubs assert against the captured cassettes — real shapes, not guesses.
  5. External-boundary replay rule. An HTTP (httpx) adapter test MUST use with vcr.use_cassette(cassette_path(NAME)): as a context manager around the adapter call — in-process replay against the captured exchange per [[software-craft/external-fixtures]]. pytester is reserved for CLI subprocess tests ONLY; never use it for vcrpy cassette replay (it spawns a child pytest process, breaks collection, and hides the cassette contract from the type surface). Exception: a library-boundary adapter vcrpy cannot intercept (e.g. ddgs/primp) uses monkeypatch on the adapter's transport, not pytester. The wrong-vs-right pattern and the kind-dispatch table are in [[software-craft/external-fixtures]].
  6. Make each stub a COMPLETE module surface: declare every module-level name the .py will expose (constants, fixtures, helper functions) plus the test class and its method signatures. The test .pyi must mirror the .py's full module surface per [[software-craft/test-stubs]].
  7. Import stdlib typing only. IF a third-party library is referenced THEN do not import it in the stub — third-party imports trip mypy import-untyped, and stubtest does not require them.
  8. Run ruff on the authored .pyi (ruff check); the PYI rules lint stubs. Fix every violation.
  9. IF authoring surfaces an important new domain concept THEN add it to the glossary.
  10. IF reworking an existing contract THEN change signatures here first; the body is re-marked at write-test-py.
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 First seen · 18 lines · 30 tokens per session scan A 9f8241f74ad2

Subscribe to this mod's changes

author-test-stubs is a skill published in the GitHub repository nullhack/temple8 (11 stars, last pushed 28d ago), licensed MIT. It adds 30 tokens to every session and 675 once invoked, about $0.0002 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.