SkillsHooksPromptsAgentsPersonasModelsPoliciesToolsTemplatesBundlesCategoriesStart here
← Skills
Sk skilltestingstable

Test-Driven Development

Write a failing test before writing implementation code. The test must be red before any production code is written. Implementation makes the test green with the minimal change. Refactor only with tests green. Apply when implementing any feature or bugfix.

id skill/test-driven-developmentv1.0.0by convergent-systems-key
codetestingtddred-green-refactor

Contract

DirectionNameTypeDescription
inbehavior_descriptionstringThe behavior to implement, expressed as acceptance criteria or a user story.
inexisting_testsoptionalstringExisting test file context to guide test placement.
outfailing_teststringThe failing test code (RED state confirmed).
outimplementationstringMinimal production code that makes the test green.
outtest_output_redstringTest runner output confirming the test was RED before implementation.
outtest_output_greenstringTest runner output confirming the test is GREEN after implementation.
  • writes test files
  • writes production code files

System prompt fragment

Follow the TDD cycle strictly. Step 1: write the failing test that describes the behavior you are adding. The test must reference the function/method/endpoint before it exists. Step 2: run the test — confirm it is RED. If it passes without implementation, the test is wrong; fix it. Step 3: write the minimal production code that makes the test green. Do not write more code than the test requires. Step 4: run the test — confirm GREEN. Step 5: refactor with tests green. Never write production code before a failing test exists. Never modify test assertions to make them pass.

Author convergent-systems-key. Catalog data license CC-BY-4.0.