implement-from-stub

implement-from-stub is a skill for OpenCode from nullhack/temple8. It costs 29 tokens per session (460 once invoked), scanned A, original, MIT.

An implementation helper that fills in a Python module from its type stub, a file describing the module's functions and classes, until its tests pass.

In plain words
What is it for?
Implement or re-implement Python modules, create database migrations for database models, and reproduce recorded requests for external-service adapters.
Why use it?
It gives an incomplete module a concrete implementation while keeping its code consistent with the declared interface and the tests.

Skill for OpenCode

Written for OpenCode: installed under .opencode/.

Good fit Implement or re-implement Python modules, create database migrations for database models, and reproduce recorded requests for external-service adapters.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/nullhack/temple8/implement-from-stub
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 nullhack/temple8 --skill implement-from-stub
Clone the repo
git clone --depth 1 https://github.com/nullhack/temple8

Made for: OpenCode.

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 implement-from-stub

README.md
[![agentmods](https://agentmods.dev/badge/skills/nullhack/temple8/implement-from-stub/github.svg)](https://agentmods.dev/skills/nullhack/temple8/implement-from-stub)
Your own site
<a href="https://agentmods.dev/skills/nullhack/temple8/implement-from-stub"><img src="https://agentmods.dev/badge/skills/nullhack/temple8/implement-from-stub/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 implement-from-stub

Your own site · 80×15
<a href="https://agentmods.dev/skills/nullhack/temple8/implement-from-stub"><img src="https://agentmods.dev/badge/skills/nullhack/temple8/implement-from-stub.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 29 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 460 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.00029 $0.00460
Opus 5.5 $0.00012 $0.00184
Sonnet 5.5 $0.00006 $0.00092
Haiku 4.5 $0.00003 $0.00046

Measured 1mo ago against content hash 7aa65238d79d, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

implement-from-stub 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.

.opencode/skills/implement-from-stub/SKILL.md · 14 lines

What it actually says

Implement From Stub

  1. Load [[software-craft/source-stubs]], [[software-craft/tdd]], [[software-craft/design-patterns]] — stub sync, the cycle, and implementation patterns.
  2. Implement — or, for rework, re-implement — the .py from its .pyi. The .pyi signature is the spec; fill or correct the body to satisfy it and pass the tests. Keep the .py consistent with its sibling .pyi.
  3. Emit the structural artifacts the module requires, keyed on what it is: IF an ORM model THEN emit an Alembic migration (the migration is the schema spec); IF an external adapter THEN reproduce the recorded request shape exactly (method, path, query parameters, headers from external-contracts.md) — vcr matches the request strictly, so the implementation conforms to the cassette, not the other way around. Config follows 12-factor per [[software-craft/secrets-and-config]]: non-secret config via load_dotenv() from the workspace .env; secrets via dotenv_values() from ~/.secrets/<project>.env — read once into a frozen typed Settings, never into os.environ. IF an auth-dependent test fails on credentials THEN stop and ask the user with suggestions — do not investigate the secret.
  4. IF the body cannot satisfy the .pyi without changing it THEN that is a contract gap — do not edit the stub; escalate at review.
  5. Run stubtest scoped to the modules built this cycle — the source module(s) and the test module(s) whose pending marks were removed. The whole-suite stubtest waits until every source .py exists, because unbuilt sibling stubs would false-fail per [[software-craft/source-stubs]], [[software-craft/tdd]].
  6. Stubtest imports the runtime module, so every transitive runtime dependency must be installed in the project venv. IF an import is used only for types THEN prefer if typing.TYPE_CHECKING: so stubtest does not pull heavy runtime deps for type-only references.
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 · 14 lines · 29 tokens per session scan A 7aa65238d79d

Subscribe to this mod's changes

implement-from-stub is a skill published in the GitHub repository nullhack/temple8 (11 stars, last pushed 29d ago), licensed MIT. It adds 29 tokens to every session and 460 once invoked, about $0.0001 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-08-30.