{"product_id":"tests-first","title":"tests-first","description":"\u003cp\u003eAfter this, the AI writes a failing test that reproduces the desired behaviour BEFORE writing any production code — bugs caught at write-time, regression coverage as a by-product.\u003c\/p\u003e\n\n\u003cp\u003eFor developers who agree TDD is correct but can't get the AI to do it without reminding it.\u003c\/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eBefore:\u003c\/strong\u003e \"Add validation: password must be 8+ chars with one number\"\u003c\/p\u003e\n\u003cpre\u003e\u003ccode\u003e[Writes the validation function directly. Looks fine. Three weeks later you discover passwords with only numbers and no letters pass. No test, no signal.]\u003c\/code\u003e\u003c\/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003eAfter:\u003c\/strong\u003e \"Add validation: password must be 8+ chars with one number\"\u003c\/p\u003e\n\u003cpre\u003e\u003ccode\u003eTest first:\n  expect(validate(\"pass\")).toBe(false)        \/\/ too short\n  expect(validate(\"password\")).toBe(false)    \/\/ no number\n  expect(validate(\"password1\")).toBe(true)    \/\/ valid\n  expect(validate(\"12345678\")).toBe(false)    \/\/ numbers only — the gotcha\n\nRuns tests — three pass, one fails (the gotcha catches it).\nNOW writes the production code to make all four pass.\u003c\/code\u003e\u003c\/pre\u003e\n\n\u003cp\u003e\u003cstrong\u003eUse when\u003c\/strong\u003e\u003c\/p\u003e\n\u003cul\u003e\n\u003cli\u003estarting a new feature or bug fix\u003c\/li\u003e\n\u003cli\u003e\"TDD this\"\u003c\/li\u003e\n\u003cli\u003ean existing change has no test covering it\u003c\/li\u003e\n\u003c\/ul\u003e\n\n\u003ch3\u003eThree ways to use this\u003c\/h3\u003e\n\u003col\u003e\n\u003cli\u003e\n\u003cstrong\u003ePaste it (any AI, 30 seconds, no install)\u003c\/strong\u003e\u003cbr\u003eOpen the .md file, copy contents, paste into Claude \/ ChatGPT \/ Cursor \/ Perplexity with: \"Read this and apply it whenever the task it describes comes up in our conversation.\" Done.\u003c\/li\u003e\n\u003cli\u003e\n\u003cstrong\u003eInstall it (Claude Code \/ Cursor users)\u003c\/strong\u003e\u003cbr\u003eDrop the unzipped folder into \u003ccode\u003e~\/.claude\/skills\/\u003c\/code\u003e (Claude Code), \u003ccode\u003e.cursor\/skills\/\u003c\/code\u003e (Cursor), or your IDE's equivalent. Auto-loads next session.\u003c\/li\u003e\n\u003cli\u003e\n\u003cstrong\u003eNew to AI assistants?\u003c\/strong\u003e Get Claude free at claude.ai, then use Option 1.\u003c\/li\u003e\n\u003c\/ol\u003e\n\n\u003cp\u003e€7\u003c\/p\u003e","brand":"SkillKeep","offers":[{"title":"Default Title","offer_id":57712244851023,"sku":null,"price":7.0,"currency_code":"EUR","in_stock":true}],"thumbnail_url":"\/\/cdn.shopify.com\/s\/files\/1\/1017\/4621\/3199\/files\/tests-first.png?v=1779017333","url":"https:\/\/www.skillkeep.io\/products\/tests-first","provider":"SkillKeep","version":"1.0","type":"link"}