pn-tdd

pn-tdd is a skill for Cursor from perniemann/pnCore. It costs 44 tokens per session (706 once invoked), scanned A, original, MIT.

A guide to test-driven development, a method where you write a failing test, make it pass with the smallest change, and then improve the code.

In plain words
What is it for?
Use it when building features or fixing bugs with the RED-GREEN-REFACTOR cycle, one behavior at a time.
Why use it?
It prevents speculative production code and keeps each implementation tied to a clearly defined behavior. Running tests after each change helps catch regressions early.

Skill for Cursor

Written for Cursor: shipped in a Cursor plugin.

Part of the pn-core plugin — 150 skills, 19 commands, 9 agents, 1 MCP server shipped together

Good fit Use it when building features or fixing bugs with the RED-GREEN-REFACTOR cycle, one behavior at a time.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/perniemann/pncore/pn-tdd
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 perniemann/pnCore --skill pn-tdd
Clone the repo
git clone --depth 1 https://github.com/perniemann/pnCore

Made for: Cursor.

Or install pn-core, the plugin that ships this one along with the rest of its 150 skills, 19 commands, 9 agents, 1 MCP server.

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 pn-tdd

README.md
[![agentmods](https://agentmods.dev/badge/skills/perniemann/pncore/pn-tdd/github.svg)](https://agentmods.dev/skills/perniemann/pncore/pn-tdd)
Your own site
<a href="https://agentmods.dev/skills/perniemann/pncore/pn-tdd"><img src="https://agentmods.dev/badge/skills/perniemann/pncore/pn-tdd/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 pn-tdd

Your own site · 80×15
<a href="https://agentmods.dev/skills/perniemann/pncore/pn-tdd"><img src="https://agentmods.dev/badge/skills/perniemann/pncore/pn-tdd.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 44 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 706 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.00044 $0.00706
Opus 5.5 $0.00018 $0.00282
Sonnet 5.5 $0.00009 $0.00141
Haiku 4.5 $0.00004 $0.00071

Measured 14d ago against content hash 7526c1fc7b56, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

pn-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 14d 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.

packages/pn-core-mcp/content/skills/discipline/pn-tdd/SKILL.md · 68 lines

How it starts

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

TDD (Test-Driven Development)

When to use

  • Implementing a new feature or bug fix with test-first discipline (RED-GREEN-REFACTOR).
  • Production code was written before a failing test and needs to be reset to follow TDD correctly.
  • You want to enforce one-behavior-at-a-time discipline and prevent speculative code.

Iron rule

Do not write production code before a failing test. If production code was written before a failing test, delete that production code and restart with a failing test first.

Workflow (RED-GREEN-REFACTOR)

  1. RED: Write the smallest failing test that defines the desired behavior. Run it; it must fail.
  2. GREEN: Write the minimal production code to make the test pass. No extra behavior.
  3. REFACTOR: Improve the code (naming, duplication, structure) while keeping tests green.
  4. Repeat for the next behavior.

Guardrails

  • One behavior at a time; small test, minimal code.
  • Run tests after every change.
  • If you wrote production code first, remove it and write the failing test first.

Output

  • Failing test (RED), then passing (GREEN), then refactor summary.
  • Clear link between each test and the production code that satisfies it.

Test generation

When to use

  • Adding test coverage to a module or function that has none.
  • Scaffolding tests from acceptance criteria, specs, or existing code before implementing (TDD setup).
  • Backfilling unit or integration tests for code that was written without them.
  • Detecting and matching the project's test framework (Vitest, Jest, Playwright, pytest, etc.).

Workflow

  1. Identify scope: Module, function, or feature to test. If specs or acceptance criteria exist, use them as the contract.
  2. Match framework: Detect or ask which test framework the project uses (Vitest, Jest, Playwright, Cypress, Mocha, pytest, etc.).
  3. Generate tests:
    • Unit: one describe/test block per function or behavior; arrange-act-assert structure.
    • Integration: cover interactions between modules, APIs, or DB; use real or mocked dependencies per project convention.
  4. Run tests: Execute the generated tests and fix failures (assertions, mocks, setup).
  5. Iterate: Adjust coverage or add edge cases if the user requests more.

Read the full file on GitHub · 68 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 14d ago Changed · +33 lines · +8 tokens per session 7526c1fc7b56
  2. 3mo ago First seen · 35 lines · 36 tokens per session scan A e730df6058bd

Subscribe to this mod's changes

pn-tdd is a skill published in the GitHub repository perniemann/pnCore (0 stars, last pushed 5d ago), licensed MIT. It adds 44 tokens to every session and 706 once invoked, about $0.0002 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-09-03.

Related

pn-tdd compared with skills from other repositories

pn-tdd next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
pn-tddperniemann/pnCoreSkill05d agoMITA44Cursor
typescriptgenkit-ai/genkitSkill6.7ktodayApache-2.0A20Claude Code, Codex
resolve-author-fixomnigent-ai/omnigentSkill12ktodayApache-2.0A24Claude Code, Codex
taiyi-devDong90/oh-my-taiyiforgeSkill85520d agoMITA21Claude Code, Codex
maestro-workReinaMacCredy/maestroSkill2405d agoMITA51Claude Code, Codex
test-driven-developmentdamianvtran/local-operatorSkill235todayMITA48Claude Code, Codex
typescript-developmentsammcj/agentic-codingSkill174todayApache-2.0A17Claude Code, Codex