[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M74HHPZCJM1SJFPMAT28GZ1S":3,"skill-same:01M74HHPZCJM1SJFPMAT28GZ1S":45},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":24,"commitSha":25,"skillDirectory":26,"forksCount":14,"repositoryHtmlUrl":27,"repositoryHomepageUrl":6,"ownerHtmlUrl":28,"ownerBlogUrl":29,"ownerDescription":6,"updatedAt":30,"install":31,"resources":44},"01M74HHPZCJM1SJFPMAT28GZ1S","test-first-extract",null,"Use when the user asks to EXTRACT or RELOCATE existing code into its own file, module, or component (\"extract X\", \"split out Y\", \"pull Z into its own file\", \"decompose god-file\"). NOT for net-new features (use tdd-feature-build) or behavior changes (use fix-bug). Enforces the 9-step extraction with isolated unit tests + integration regression tests as a two-tier safety net.","drumfiend21\u002Fclaude-tdd-pro","drumfiend21","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F10619389?v=4","01M74HCNYY9VCB2B7FNCSPQSZN","Siddharth Joshi","01M74HCNZHQP883HA9WSN1G6TR",0,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Fdrumfiend21\u002Fclaude-tdd-pro\u002Fblob\u002Fmain\u002Fskills\u002Ftest-first-extract\u002FSKILL.md",[],[],"2026-11-11 15:11:14",false,"---\nname: test-first-extract\ndescription: Use when the user asks to EXTRACT or RELOCATE existing code into its own file, module, or component (\"extract X\", \"split out Y\", \"pull Z into its own file\", \"decompose god-file\"). NOT for net-new features (use tdd-feature-build) or behavior changes (use fix-bug). Enforces the 9-step extraction with isolated unit tests + integration regression tests as a two-tier safety net.\n---\n\n# Test-First Extraction\n\nYou are extracting code from one location into a new, focused file.\nThe risk is silent regression — props dropped, callbacks rewired wrong,\nstate coupling broken. The discipline below makes that risk catchable.\n\n## Pre-flight\n\n1. **Read `QUALITY-BAR.md`** for the strictness rules and refactor\n   discipline.\n2. **Identify the parent file** the code is being extracted FROM and\n   the **target path** it's being extracted TO.\n3. **Detect \u002F create the test infrastructure** at the target path's\n   sibling (`Foo.jsx` ↔ `Foo.test.jsx`). If the project uses a\n   different convention (e.g. `__tests__\u002F` mirror), match it.\n4. **Read the integration regression test file** at the parent's level\n   (or create one if absent). This is where you'll add the cross-cutting\n   tests that catch wiring breaks.\n\n## The 9-step extraction\n\n### Step 1: Survey the target\n\nRead the inline code being extracted. Build a complete inventory:\n\n- **Props** the new component will receive (with types if known).\n- **State** owned by the new component vs. owned by the parent.\n- **Callbacks** the new component will fire upward.\n- **Module-level dependencies** (constants, utility functions, other\n  components, context). Will the new file import these, or will the\n  parent pass them as props?\n- **Side effects** (effects, refs, API calls). Where do they belong\n  after extraction?\n\nIf anything in the inventory is itself inline in the parent (e.g., a\n1,600-line component the wrapper depends on) — STOP. Either extract\nthat dependency first, or pivot to a different extraction. Never use\nrender-props or import-circularity hacks to work around blocking\ninline dependencies.\n\n### Step 2: Write strict isolated unit tests FIRST\n\nCreate `\u003CTarget>.test.{jsx,ts,py}` at the target path's sibling.\nImport from the target file path (which doesn't exist yet — that's\nintentional).\n\nCover EVERY meaningful prop \u002F arg \u002F branch \u002F edge case from your survey:\n\n- Default props → renders correctly?\n- Each prop variation → behaves correctly?\n- Each callback → fires with the right args?\n- Each conditional branch → both sides covered?\n- Edge cases: empty arrays, null\u002Fundefined, large inputs?\n\nApply the strictness rules from QUALITY-BAR.md:\n- `getByRole` over `queryAllByText`.\n- Exact counts where uniqueness is expected.\n- jest-dom matchers (`toBeInTheDocument`, `toBeDisabled`,\n  `toHaveAttribute`).\n- `userEvent` over `fireEvent` for interactions.\n\n### Step 3: Confirm tests fail with file-not-found\n\nRun just the new test file. They MUST fail with file-not-found (or\nimport error). That's the correct \"red\" state.\n\nIf they pass somehow → you imported from the wrong path; fix.\nIf they fail for any other reason → fix the test, don't proceed.\n\n### Step 4: Add 1–3 integration regression tests in the parent's test file\n\nOpen the parent's integration test file (e.g.,\n`ScriptureEngineV2.regression.test.jsx`). Add tests that exercise the\nabout-to-be-extracted UI\u002Fbehavior THROUGH the live parent.\n\nThese tests:\n- Render the parent with the harness mocks.\n- Assert observable behavior (text on screen, fetch URL fired,\n  click → callback) — NOT implementation details.\n- Will survive the move from inline JSX → child component without\n  modification.\n\n### Step 5: Confirm regression tests pass against current code\n\nRun the integration tests. They MUST pass against the current (still-\ninline) code. This establishes the baseline.\n\nIf they fail → your test is wrong; fix until green. The baseline must\nbe solid before you touch the code.\n\n### Step 6: Create the target file with the extracted code\n\nNow (and only now) create `\u003CTarget>.{jsx,ts,py}` and copy the inline\ncode into it, transformed into a function\u002Fclass accepting the props\nyou defined in step 1.\n\nKeep behavior IDENTICAL. This is a relocation, not an improvement\nopportunity. Resist the urge to \"clean up while you're here\" — that\nexpands scope and undermines the test net.\n\n### Step 7: Run isolated tests — confirm pass\n\nRun just the new test file. All tests should pass. If any fail, the\nextraction has a real bug — fix the implementation (not the test).\n\n### Step 8: Remove inline copy from parent + add import\n\nOpen the parent. Remove the inline code. Add:\n```js\nimport { Target } from '.\u002Fpath\u002Fto\u002FTarget.jsx';\n```\nReplace the inline JSX with `\u003CTarget {...props} \u002F>`.\n\nFor React: pass props the parent owns; wire callbacks to parent's\nstate setters.\n\n### Step 9: Run the FULL suite — confirm green; commit\n\nRun every test in the project — unit + integration + regression. All\nmust pass.\n\nIf anything is red → revert the parent edit (step 8), debug, retry.\n\nIf green → commit using QUALITY-BAR.md commit format:\n```\nrefactor(scope): extract \u003CTarget> from \u003CParent>\n\nProcess: tests-first (10 strict unit tests for the target + 2\nregression tests in the parent suite); confirmed file-not-found\nfailure; created target; verified isolated 10\u002F10; replaced inline\n~N lines with \u003CTarget …>; full suite NN\u002FNN green.\n\nBehavior: no behavior change — pure relocation.\n\nNumbers: parent file XXX → YYY lines (-N). Tests: AA → BB (+N).\n\nAssisted-by: Claude (claude-tdd-pro 0.3.0)\n```\n\n## Common pitfalls\n\n- **Skipping step 3 (confirm red)**: if you don't confirm the new tests\n  fail with file-not-found, you might write tests that accidentally\n  pass against some other code path. The red is the proof you're\n  testing the right thing.\n- **Skipping step 5 (confirm regression baseline)**: if you don't run\n  the regression tests against the CURRENT code first, you don't know\n  whether the test itself works. After extraction it could pass for\n  the wrong reason.\n- **Cleaning up during the move**: combine extraction with refactoring\n  → you can't tell which change broke things if the suite goes red.\n  Pure relocation first, refactor in a follow-up commit.\n- **Render-prop \u002F import-circularity hacks**: if the target depends on\n  something also inline in the parent, extracting the wrapper is just\n  papering over the problem. Extract the dependency first.\n\n## Sub-extraction strategy for huge targets\n\nIf the \"target\" is a 1,000+ line block:\n\n1. Identify SUB-boundaries within it (the next-smaller cohesive units).\n2. Extract the smallest, most-self-contained sub-piece first.\n3. Repeat until the parent block has shrunk to something reasonable.\n4. Then extract the now-smaller block as a coherent component.\n\nThis is the \"wave\" pattern — each wave is its own commit, each commit\nruns through the full 9 steps.\n","# Test-First Extraction\n\nYou are extracting code from one location into a new, focused file.\nThe risk is silent regression — props dropped, callbacks rewired wrong,\nstate coupling broken. The discipline below makes that risk catchable.\n\n## Pre-flight\n\n1. **Read `QUALITY-BAR.md`** for the strictness rules and refactor\n   discipline.\n2. **Identify the parent file** the code is being extracted FROM and\n   the **target path** it's being extracted TO.\n3. **Detect \u002F create the test infrastructure** at the target path's\n   sibling (`Foo.jsx` ↔ `Foo.test.jsx`). If the project uses a\n   different convention (e.g. `__tests__\u002F` mirror), match it.\n4. **Read the integration regression test file** at the parent's level\n   (or create one if absent). This is where you'll add the cross-cutting\n   tests that catch wiring breaks.\n\n## The 9-step extraction\n\n### Step 1: Survey the target\n\nRead the inline code being extracted. Build a complete inventory:\n\n- **Props** the new component will receive (with types if known).\n- **State** owned by the new component vs. owned by the parent.\n- **Callbacks** the new component will fire upward.\n- **Module-level dependencies** (constants, utility functions, other\n  components, context). Will the new file import these, or will the\n  parent pass them as props?\n- **Side effects** (effects, refs, API calls). Where do they belong\n  after extraction?\n\nIf anything in the inventory is itself inline in the parent (e.g., a\n1,600-line component the wrapper depends on) — STOP. Either extract\nthat dependency first, or pivot to a different extraction. Never use\nrender-props or import-circularity hacks to work around blocking\ninline dependencies.\n\n### Step 2: Write strict isolated unit tests FIRST\n\nCreate `\u003CTarget>.test.{jsx,ts,py}` at the target path's sibling.\nImport from the target file path (which doesn't exist yet — that's\nintentional).\n\nCover EVERY meaningful prop \u002F arg \u002F branch \u002F edge case from your survey:\n\n- Default props → renders correctly?\n- Each prop variation → behaves correctly?\n- Each callback → fires with the right args?\n- Each conditional branch → both sides covered?\n- Edge cases: empty arrays, null\u002Fundefined, large inputs?\n\nApply the strictness rules from QUALITY-BAR.md:\n- `getByRole` over `queryAllByText`.\n- Exact counts where uniqueness is expected.\n- jest-dom matchers (`toBeInTheDocument`, `toBeDisabled`,\n  `toHaveAttribute`).\n- `userEvent` over `fireEvent` for interactions.\n\n### Step 3: Confirm tests fail with file-not-found\n\nRun just the new test file. They MUST fail with file-not-found (or\nimport error). That's the correct \"red\" state.\n\nIf they pass somehow → you imported from the wrong path; fix.\nIf they fail for any other reason → fix the test, don't proceed.\n\n### Step 4: Add 1–3 integration regression tests in the parent's test file\n\nOpen the parent's integration test file (e.g.,\n`ScriptureEngineV2.regression.test.jsx`). Add tests that exercise the\nabout-to-be-extracted UI\u002Fbehavior THROUGH the live parent.\n\nThese tests:\n- Render the parent with the harness mocks.\n- Assert observable behavior (text on screen, fetch URL fired,\n  click → callback) — NOT implementation details.\n- Will survive the move from inline JSX → child component without\n  modification.\n\n### Step 5: Confirm regression tests pass against current code\n\nRun the integration tests. They MUST pass against the current (still-\ninline) code. This establishes the baseline.\n\nIf they fail → your test is wrong; fix until green. The baseline must\nbe solid before you touch the code.\n\n### Step 6: Create the target file with the extracted code\n\nNow (and only now) create `\u003CTarget>.{jsx,ts,py}` and copy the inline\ncode into it, transformed into a function\u002Fclass accepting the props\nyou defined in step 1.\n\nKeep behavior IDENTICAL. This is a relocation, not an improvement\nopportunity. Resist the urge to \"clean up while you're here\" — that\nexpands scope and undermines the test net.\n\n### Step 7: Run isolated tests — confirm pass\n\nRun just the new test file. All tests should pass. If any fail, the\nextraction has a real bug — fix the implementation (not the test).\n\n### Step 8: Remove inline copy from parent + add import\n\nOpen the parent. Remove the inline code. Add:\n```js\nimport { Target } from '.\u002Fpath\u002Fto\u002FTarget.jsx';\n```\nReplace the inline JSX with `\u003CTarget {...props} \u002F>`.\n\nFor React: pass props the parent owns; wire callbacks to parent's\nstate setters.\n\n### Step 9: Run the FULL suite — confirm green; commit\n\nRun every test in the project — unit + integration + regression. All\nmust pass.\n\nIf anything is red → revert the parent edit (step 8), debug, retry.\n\nIf green → commit using QUALITY-BAR.md commit format:\n```\nrefactor(scope): extract \u003CTarget> from \u003CParent>\n\nProcess: tests-first (10 strict unit tests for the target + 2\nregression tests in the parent suite); confirmed file-not-found\nfailure; created target; verified isolated 10\u002F10; replaced inline\n~N lines with \u003CTarget …>; full suite NN\u002FNN green.\n\nBehavior: no behavior change — pure relocation.\n\nNumbers: parent file XXX → YYY lines (-N). Tests: AA → BB (+N).\n\nAssisted-by: Claude (claude-tdd-pro 0.3.0)\n```\n\n## Common pitfalls\n\n- **Skipping step 3 (confirm red)**: if you don't confirm the new tests\n  fail with file-not-found, you might write tests that accidentally\n  pass against some other code path. The red is the proof you're\n  testing the right thing.\n- **Skipping step 5 (confirm regression baseline)**: if you don't run\n  the regression tests against the CURRENT code first, you don't know\n  whether the test itself works. After extraction it could pass for\n  the wrong reason.\n- **Cleaning up during the move**: combine extraction with refactoring\n  → you can't tell which change broke things if the suite goes red.\n  Pure relocation first, refactor in a follow-up commit.\n- **Render-prop \u002F import-circularity hacks**: if the target depends on\n  something also inline in the parent, extracting the wrapper is just\n  papering over the problem. Extract the dependency first.\n\n## Sub-extraction strategy for huge targets\n\nIf the \"target\" is a 1,000+ line block:\n\n1. Identify SUB-boundaries within it (the next-smaller cohesive units).\n2. Extract the smallest, most-self-contained sub-piece first.\n3. Repeat until the parent block has shrunk to something reasonable.\n4. Then extract the now-smaller block as a coherent component.\n\nThis is the \"wave\" pattern — each wave is its own commit, each commit\nruns through the full 9 steps.\n",{"name":5,"description":7},"main","41c38db9b8cf2d5b7743093654a12fdd9cd59c03","skills\u002Ftest-first-extract","https:\u002F\u002Fgithub.com\u002Fdrumfiend21\u002Fclaude-tdd-pro","https:\u002F\u002Fgithub.com\u002Fdrumfiend21","http:\u002F\u002Fjungleej.wordpress.com","2026-11-09 20:29:03",{"source":8,"skillName":5,"commands":32,"prompt":42,"zipAvailable":43},[33,36,39],{"tool":34,"command":35},"npx","npx skills add drumfiend21\u002Fclaude-tdd-pro --skill test-first-extract",{"tool":37,"command":38},"bunx","bunx skills add drumfiend21\u002Fclaude-tdd-pro --skill test-first-extract",{"tool":40,"command":41},"pnpm","pnpm dlx skills add drumfiend21\u002Fclaude-tdd-pro --skill test-first-extract","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fdrumfiend21\u002Fclaude-tdd-pro\u002Fblob\u002Fmain\u002Fskills\u002Ftest-first-extract\u002FSKILL.md",true,[],[46,53,60,67,73,80],{"skillNo":47,"name":48,"nameZh":6,"description":49,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":50,"categories":51,"keywords":52,"publishedAt":19},"01M74HHK1QJ5APDRM7WWMC90X9","tdd-feature-build","Use when the user describes a NEW feature to add (\"add X to Y\", \"implement Z\", \"build a feature that…\", \"make it possible to…\"). Enforces TDD — failing test first, minimum code to pass, refactor. Refuses to ship code without a test that demonstrably catches its absence. Does NOT trigger on bug fixes (use bug-fix-discipline) or refactors (use test-first-extract). Will ask 1-3 clarifying questions before writing any code; safe to delegate from \u002Ffeature command.","https:\u002F\u002Fgithub.com\u002Fdrumfiend21\u002Fclaude-tdd-pro\u002Fblob\u002Fmain\u002Fskills\u002Ftdd-feature-build\u002FSKILL.md",[],[],{"skillNo":54,"name":55,"nameZh":6,"description":56,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":57,"categories":58,"keywords":59,"publishedAt":19},"01M74HHEXN1MK9SK9JDGN52YDJ","sync","Multi-machine git-backed sync of local TDD Pro state via the `tdd-pro-sync` branch. Use when operators run claude-tdd-pro on more than one machine and want their FAILURE-LOG, decisions, audit checkpoints, workflow state, operator-curated URL registries, operator\u002Fcommunity trees, and paywalled attestations to follow them between hosts.","https:\u002F\u002Fgithub.com\u002Fdrumfiend21\u002Fclaude-tdd-pro\u002Fblob\u002Fmain\u002Fskills\u002Fsync\u002FSKILL.md",[],[],{"skillNo":61,"name":62,"nameZh":6,"description":63,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":64,"categories":65,"keywords":66,"publishedAt":19},"01M74HHBQ8K1FNZ5AXTEGGF8RW","strict-component-tests","Use when writing or reviewing test files. Enforces strict assertions that actually catch regressions (getByRole, exact counts, jest-dom matchers) in contrast to permissive tests (queryAllByText length > 0) that pass against broken UIs. References QUALITY-BAR.md for the canonical strictness rules.","https:\u002F\u002Fgithub.com\u002Fdrumfiend21\u002Fclaude-tdd-pro\u002Fblob\u002Fmain\u002Fskills\u002Fstrict-component-tests\u002FSKILL.md",[],[],{"skillNo":68,"name":69,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":70,"categories":71,"keywords":72,"publishedAt":19},"01M74HHA5W00JK570KTA68MRZD","spec","https:\u002F\u002Fgithub.com\u002Fdrumfiend21\u002Fclaude-tdd-pro\u002Fblob\u002Fmain\u002Fskills\u002Fspec\u002FSKILL.md",[],[],{"skillNo":74,"name":75,"nameZh":6,"description":76,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":77,"categories":78,"keywords":79,"publishedAt":19},"01M74HH5HR9S2Q6HRAW0GTXATA","spec-first","Use when the user describes a non-trivial feature or system that should be specified in writing before any code is written. Pattern from Geoffrey Huntley's \"Ralph\" loop, OpenSpec, intent-driven.dev, and Kent Beck's \"augmented coding\" framing — specs+tests are the durable artifact, code is the disposable one. Produces a Markdown spec document that the user reviews; only after approval does any code get written (typically via tdd-feature-build or \u002Ffeature).","https:\u002F\u002Fgithub.com\u002Fdrumfiend21\u002Fclaude-tdd-pro\u002Fblob\u002Fmain\u002Fskills\u002Fspec-first\u002FSKILL.md",[],[],{"skillNo":81,"name":82,"nameZh":6,"description":83,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":84,"categories":85,"keywords":86,"publishedAt":19},"01M74HH0441BWHPTQSDWRPX3ZH","reject-bad-tooling","Use whenever the conversation involves dependency suggestions, CI\u002FCD design, \"automated code improvement,\" lint\u002Fsecurity fixes, or \"tools to make my code better.\" Refuses specific anti-patterns from a prior session that produced more harm than help — and explains why, with the better alternative. Triggers on suggestions of force-fix flags, auto-commit CI workflows, jscodeshift codemods on untested code, fake package names, and similar.","https:\u002F\u002Fgithub.com\u002Fdrumfiend21\u002Fclaude-tdd-pro\u002Fblob\u002Fmain\u002Fskills\u002Freject-bad-tooling\u002FSKILL.md",[],[]]