ptp-test-driven-development

Enforces a red-green-refactor test cycle with recorded evidence before writing implementation code.

Updated Jun 8, 2026
One-click install
npx skills add https://github.com/AlmogMaayan/ptp --skill ptp-test-driven-development-almogmaayan
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: ptp-test-driven-development
Source: https://github.com/AlmogMaayan/ptp/tree/main/skills/ptp-test-driven-development
Command: npx skills add https://github.com/AlmogMaayan/ptp --skill ptp-test-driven-development-almogmaayan

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? It prevents implementation code from being written before a failing test exists, eliminating retro-fitted tests, false-green results, and untested behavior changes in a development workflow. ## Core Features & Use Cases - Red-green-refactor discipline: Requires one failing test per behavior, verified to fail for the intended reason, followed by the smallest passing change and green-only refactoring. - Evidence recording: Each task records a tests entry in the apply stage record, either an executed { task, test, red, green } shape or an exempt { task, exempt, reader } shape for prose-only changes. - Render-affecting rules: CSS cascade, layout, and computed-style changes must be tested in a real browser engine (Playwright, vitest browser mode, headless Chromium) via a local-only lane guarded by PTP_BROWSER_TESTS=1; jsdom results are not accepted as evidence. - Use Case: When fixing a bug or adding a feature, invoke this skill so the agent writes the failing test first, implements minimally, and records the red/green runs even under an advisory gate. ## Quick Start Ask the agent to implement a bug fix using test-driven development and record the red and green test runs for each task.

Frequently Asked Questions about ptp-test-driven-development

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I enforce test-driven development with an AI coding agent?

Invoke this skill before writing implementation code so the agent writes one failing test per behavior, verifies it fails for the intended reason, then writes the smallest change to pass. Code written before its test is deleted and rewritten from the test.

What is the red-green-refactor cycle for bug fixes?

Write one test asserting the real behavior, run it to confirm it fails for the intended reason, make the smallest change that passes, verify the whole suite stays green, then refactor only while green. A test that passes immediately is testing something that already exists.

Can I skip tests for documentation-only changes?

Yes, under the prose-contract exemption you record `RED: not applicable — prose contract` and name the bound reader, but you must still run every available check such as `openspec validate --strict`. The exemption never applies when the change also touches executable code.

Why is a jsdom test not accepted for CSS changes?

jsdom implements no cascade and no layout engine, so it cannot fail for the reason a real browser would on render-affecting tasks. The RED test must run in a real browser engine such as Playwright or vitest browser mode and assert computed style via getComputedStyle.

Does advisory mode let me skip writing tests?

No. Advisory relaxes the blocking gate but not the discipline: the cycle is still followed and the `tests` evidence entry is recorded in the apply stage record. Advisory is not silence.