test-first

Guides test-driven development by writing failing tests before implementation.

96|8|Updated Aug 13, 2026
One-click install
npx skills add https://github.com/pingfanfan/hello-dsh --skill test-first-pingfanfan
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: test-first
Source: https://github.com/pingfanfan/hello-dsh/tree/main/examples/skills/test-first
Command: npx skills add https://github.com/pingfanfan/hello-dsh --skill test-first-pingfanfan

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Tests written after implementation start green and cannot prove they actually verify anything. This Skill enforces a test-first workflow where you watch a test fail before writing the implementation, using "revert the implementation and check the test goes red" as the single criterion for whether a test is effective. ## Core Features & Use Cases - Bug Fixing Workflow: Write a test that reproduces the bug, confirm it fails for the right reason, fix the implementation, and watch it turn green. - Feature Development Loop: Write a test describing expected behavior, make it pass with the simplest possible implementation, then refactor while staying green. - Test Quality Guidance: Test behavior rather than implementation details, write specific assertions instead of vague truthiness checks, and keep one concern per test. - Coverage Reality Check: Explains why 100% line coverage with all-green tests can still miss real failure modes, and how to check failure paths, real entry points, and boundary conditions. - Use Case: When fixing a session-loading bug, first write a test that reproduces the crash, verify the failure message matches the actual bug, then fix the loader and confirm the test passes. ## Quick Start Ask the AI to apply the test-first skill to write a failing test that reproduces your bug before implementing the fix.

Frequently Asked Questions about test-first

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

FAQPage Schema
How do I practice test-driven development when fixing a bug?▼

Write a test that reproduces the bug and run it to see it fail. Confirm the failure message matches the actual bug rather than a setup mistake, then fix the implementation and watch the test turn green.

How do I know if a test is actually effective?▼

Revert the implementation and check whether the test fails. A test that stays green without the implementation verifies nothing and only adds maintenance cost and misleading coverage numbers.

Should tests verify internal implementation details?▼

No, tests should verify behavior: inputs and outputs, thrown errors, side effects, and boundary cases. If refactoring the implementation without changing behavior forces a test change, that test is coupled to implementation.

Why is 100% code coverage not enough?▼

Coverage only shows code was executed, not that behavior was verified. A suite can have full line coverage yet miss real failure modes if it bypasses real entry points, skips failure paths, or ignores boundary conditions.

What makes a good test assertion?▼

Assertions must be specific: compare exact expected objects or match particular error messages rather than checking truthiness or that any error was thrown. Vague assertions pass for wrong reasons, including unrelated errors like TypeErrors.