dpf-tdd

A test-first development workflow for DPF projects. TDD, or test-driven development, means writing a test for the expected behavior, making it pass, and then improving the code.

In plain words
What is it for?
Use it for new behavior, bug fixes, regressions, and stable contracts such as schemas, APIs, or enumerated values, while running each test in the environment it requires.
Why use it?
It makes a test evidence that a new behavior or bug fix works and prevents anyone from claiming success when the required test did not actually run.

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/opendigitalproductfactory/opendigitalproductfactory/dpf-tdd
Any agent
npx skills add OpenDigitalProductFactory/opendigitalproductfactory --skill dpf-tdd
Clone the repo
git clone --depth 1 https://github.com/OpenDigitalProductFactory/opendigitalproductfactory

Made for: Claude Code, Codex.

Per session 41 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,258 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.00041 $0.01258
Opus 5 $0.00020 $0.00629
Sonnet 5 $0.00008 $0.00252
Haiku 4.5 $0.00004 $0.00126

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

Security

Grade A, and why

dpf-tdd 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 today.

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.

packages/dpf-skill-pack/skills/dpf-tdd/SKILL.md · 74 lines

How it starts

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

DPF Test-Driven Development

Red-green-refactor is assumed, not taught. The DPF layer is that a test is evidence: the build gate enforces it at merge, and the kernel forbids claiming a green you did not observe.

When to use

  • New behavior whose expected output is specifiable up front.
  • Fixing a bug or regression — the highest-value case. The first-failing test is what proves the fix closed the symptom.
  • Hardening a contract (schema, API shape, enum) against drift.

Skip it for a spike where the interface is still unknown, or a throwaway diagnostic with no merge path.

Run the test against the runtime it needs

  • Source-local (targeted Vitest specs, typechecks, pure functions) — run in the thread worktree.
  • Runtime-bound (needs the portal up, dev DB seeded, MCP reachable, Prisma generated, Build Studio executing) — run against the canonical local install or a governed shared nonprod environment (dpf-use-shared-nonprod-environment).

This is AGENTS.md §4 "Where each gate runs" applied to TDD. Do not turn the worktree into a full DPF runtime so a runtime-bound test will run there — that is harness work, not test work.

A suite that did not execute because the worktree could not host its runtime is an unrun gate, not a red gate. Say which one you have.

The DPF-gated loop

  1. Impact before Red. Consume the changeImpactContract returned when the Workroom claimed its edit paths (or read verificationState.changeImpactContract). Resolve every testImpact entry with find_related_tests and pull every guardObligation into the loop now. If find_related_tests returns Code graph unavailable, an unavailable graph, or low-trust/qualify advice, do not retry it blindly: record the lookup as unavailable/unrun, then use a bounded Grep/Glob sweep plus colocated tests and the repository's explicit test commands. status: unresolved, stale graph advice, or an unmapped source path expands verification — it never means "no tests." The fallback is evidence of the search you performed, not a claim that the graph found nothing.

Read the full file on GitHub · 74 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. today Changed 321127993179
  2. yesterday First seen · 74 lines · 41 tokens per session scan A d2964680dab4

Subscribe to this mod's changes

dpf-tdd is a skill published in the GitHub repository OpenDigitalProductFactory/opendigitalproductfactory (14 stars, last pushed today), licensed Apache-2.0. It adds 41 tokens to every session and 1,258 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.