giuseppeve/agentic-engineering-skills/test-driven-development

Claude Code and agent skill by giuseppeve/agentic-engineering-skills

Trust tier 2
  • community
LLM review pending
Source check pending

Checking that the SKILL.md file is still in the repository.

Use when implementing features, fixing bugs, changing behavior, or refactoring tested code.

Install

npx vskill@latest install giuseppeve/agentic-engineering-skills/test-driven-development

SKILL.md

The same SKILL.md was published earlier as giuseppeve/agentic-engineering-skills/test-driven-development.

Test-Driven Development (TDD)

Adaptation: obra/superpowers condensed cross-host TDD guidance with behavioral coverage-gap assessment.

Write a behavioral test, observe its expected failure, implement the smallest change, then refactor while green. A passing test alone does not prove it can detect the bug.

Scope

Use this cycle for new behavior and bug fixes. For refactoring, establish existing tests are green; add coverage for unprotected behavior before restructuring.

Follow applicable project and task instructions when choosing verification. Prototypes, generated code, configuration, and trivial edits need appropriate validation, not automatic test scaffolding or a separate permission request. Time pressure and manual checks do not replace a meaningful regression test for changed behavior.

When delegating TDD work, start each subagent with a fresh context window and provide the objective, relevant references, constraints, and expected output explicitly.

Coverage gaps

Map changed behavior and acceptance criteria to existing behavioral tests, using the request and available specifications. Check relevant success, boundary, and failure paths; assess whether tests exercise production behavior and detect realistic defects. Prioritize material gaps by impact, reuse existing coverage, and add focused tests when warranted. For existing correct behavior, use safe regression sensitivity evidence when needed; report missing evidence and unresolved gaps.

RED → GREEN → REFACTOR

  1. Specify. Identify the observable contract and the realistic production defect the test should catch. Derive expected values independently of implementation helpers or constants.
  2. RED. Write one focused test with a behavior-based name. Exercise real code; use doubles at external boundaries when necessary. Read writing-good-tests.md for test design and testing-anti-patterns.md when writing or changing tests, especially when using mocks or test utilities.
  3. Verify RED. Run the smallest relevant test command from the project. Observe the assertion fail because behavior is missing or wrong. A syntax, import, fixture, dependency, or infrastructure error is not behavioral RED: repair the harness and rerun. A test passing immediately needs a relevant missing case or verified regression sensitivity; do not count it as observed RED.
  4. GREEN. Implement only what the failing test requires. Run it again; fix production code rather than weakening a valid expectation. Run affected existing checks and resolve failures introduced by the change. Disclose unrelated failures and blockers.
  5. REFACTOR. Improve structure without changing behavior. Rerun affected checks; add the next behavior through another verified RED.

Meaningful test example

Contract: at most three total attempts; stop after success.

typescript
test('succeeds on third attempt without another call', async () => {
let attempts = 0;
const result = await retryOperation(async () => {
attempts++;
if (attempts < 3) throw new Error('temporary');
return 'saved';
});
expect(result).toBe('saved');
expect(attempts).toBe(3);
});

Also cover exhaustion separately. Assert outcomes and contract-relevant side effects, not mock existence or private structure. Keep test-only utilities outside production APIs.

Recovery when implementation already exists

Preserve existing and user work. Establish requirements independently; add the missing behavioral tests. In an isolated copy or narrowly reversible change, reproduce pre-fix behavior or disable only the relevant change; observe expected failures, restore, and rerun green. Never delete unrelated work or apply a blanket reset to recover process order.

Report this as regression verification, not a claim that the original implementation followed test-first order. Resume verified RED before further behavior changes. If safe reproduction is unavailable, report the missing evidence.

Common mistakes

TemptationRequired response
Tests afterward or manual checks prove TDDEstablish regression sensitivity; report actual sequence.
Any failing command counts as REDReach the intended behavioral assertion.
Assert the imported constant or mock outputUse independently specified observable behavior.
Test every method for coverageCover meaningful contracts and boundary cases; reuse existing coverage.

Completion evidence

Report relevant contracts, observed RED failures, GREEN commands/results, affected checks, and remaining gaps. Classify observed RED as process evidence and identify its pre-fix revision or reproducible state, command, expected behavioral failure and observation time. Classify GREEN and affected acceptance checks as final_state evidence, rerun them after the last relevant fix, and bind them to the final reviewed commit or exact uncommitted diff. Do not rerun RED on the fixed commit merely to make its revision current. Tests should detect realistic wrong branches, missing side effects, boundary violations, and error outcomes. Distinguish passed, failed, and not run; never label missing verification complete.

When reviewing a plan task, verify its criteria and requirements against the specification, plan, diff, and evidence; fix findings within the authorized task scope. Return findings and the shared result contract, including the final commit SHA when authorized and created. The plan orchestrator decides acceptance; a review thread ending does not establish completion.

Security

  • Security scanPassed, 100 of 100Pattern checks on the skill's files.
  • Model reviewNot runA model review is scheduled for the next rescan.

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

7-day trend score
0

Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/giuseppeve/agentic-engineering-skills/test-driven-development/badge)](https://verified-skill.com/skills/giuseppeve/agentic-engineering-skills/test-driven-development)

Something wrong with this skill or its page? Tell us.