[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M788T1ZAFHBBE8VHS57TX776":3,"skill-same:01M788T1ZAFHBBE8VHS57TX776":47},{"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":27,"repositoryHtmlUrl":28,"repositoryHomepageUrl":6,"ownerHtmlUrl":29,"ownerBlogUrl":30,"ownerDescription":31,"updatedAt":32,"install":33,"resources":46},"01M788T1ZAFHBBE8VHS57TX776","test-coverage-analysis",null,"Read and act on test-coverage reports and CI test-run results — interpret line\u002Fbranch and new-code coverage, understand coverage gates\u002Fregressions, root-cause a failed CI run, and prioritize which gaps actually matter by risk. Use when given a coverage report or CI test-run URL, when a coverage gate fails, when tests are red in CI, or when asked \"what should I test\" \u002F \"why did this run fail\".","jingchaodev\u002Fskills-lab","jingchaodev","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F8307474?v=4","01M788N3PES0P1DGEKSE9ZYDSD","chao","01M788N3QH1AYYGWKFG9XTX3WF",1,"MIT","https:\u002F\u002Fgithub.com\u002Fjingchaodev\u002Fskills-lab\u002Fblob\u002Fmain\u002Fskills\u002Ftest-coverage-analysis\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: test-coverage-analysis\ndescription: Read and act on test-coverage reports and CI test-run results — interpret line\u002Fbranch and new-code coverage, understand coverage gates\u002Fregressions, root-cause a failed CI run, and prioritize which gaps actually matter by risk. Use when given a coverage report or CI test-run URL, when a coverage gate fails, when tests are red in CI, or when asked \"what should I test\" \u002F \"why did this run fail\".\n---\n\n# Coverage and Test Reports\n\nTwo related jobs: **reading a coverage report to decide where to add tests**, and\n**reading a failed CI test run to find the root cause**. The unifying principle\nfor both: **chase risk, not a percentage.** 100% coverage of trivial code and a\ngreen-after-retry flaky suite are both illusions of safety.\n\n## Part 1: Reading Coverage Reports\n\n### Metrics — what they actually tell you\n\n| Metric | Means | Watch out for |\n|--------|-------|---------------|\n| **Line coverage** | % of lines executed by tests | A line can run without its behavior being asserted |\n| **Branch coverage** | % of decision paths (if\u002Felse, switch) taken | Far more honest than line coverage for logic |\n| **New-code \u002F diff coverage** | Coverage of lines *changed in this PR* | The metric most gates enforce — it stops fresh gaps |\n| **Method\u002Ffunction coverage** | % of functions entered at all | Coarse; a called-once function reads as \"covered\" |\n\n**Coverage proves code *ran*, not that it was *checked*.** A test that exercises\na line but asserts nothing still counts. Read coverage as \"where are we\ndefinitely blind,\" not \"where are we safe.\"\n\n### Gates and regressions\n\n- A **coverage gate** blocks a change when a metric falls below a threshold —\n  most commonly **new-line coverage on the diff** (e.g. \"90% of changed lines\n  must be covered\"). This is usually the actionable failure.\n- A **regression** = overall coverage dropped vs. the baseline. Often it's not\n  new untested code but *deleted tests* or *moved code* — check the diff before\n  writing new tests.\n- **Exclusions** matter: generated code, DTOs\u002Fmodels, error classes, and DI\n  wiring are commonly excluded and don't count toward the gate. Confirm what's\n  excluded before chasing a number.\n\n### Workflow: a gate failed on new-code coverage\n\n1. **Read the summary** — which metric failed, threshold vs. actual.\n2. **List the exact uncovered new lines** — the report should name files and\n   line numbers on the diff. That's your precise to-do list.\n3. **Open each uncovered file** and read the uncovered lines *in context* — is it\n   real logic (needs a test) or a trivial\u002Fguard line (candidate for exclusion)?\n4. **Write tests for the logic**, targeting branches, not just line hits.\n5. Re-run and confirm the gate clears.\n\n### Workflow: improving overall coverage (no gate)\n\n1. **Summary** → overall line\u002Fbranch numbers.\n2. **Worst files by missed lines** → but re-rank by *risk*, not raw count.\n3. **Drill into the highest-risk files** and add branch-covering tests.\n\n### Prioritize by risk, not by chasing 100%\n\nRank coverage gaps by **impact × likelihood of a bug**, not by line count:\n\n| Prioritize (test these first) | Deprioritize |\n|-------------------------------|--------------|\n| Core business logic, money\u002Fauth\u002Fdata-integrity paths | Getters\u002Fsetters, `toString`, boilerplate |\n| Complex branching, error handling, edge cases | Auto-generated code, simple DTOs |\n| Code that changed recently \u002F churns often | Stable code untouched for years |\n| Public API \u002F integration boundaries | Trivial one-line delegators |\n\nA well-tested 75% on the critical paths beats 95% padded with trivial-getter\ntests. Stop when the *remaining* gaps are low-risk.\n\n## Part 2: Reading a Failed CI Test Run\n\n### Triage order\n\n1. **Summary first** — status (`SUCCEEDED`\u002F`FAILED`\u002F`TIMED_OUT`\u002F`CANCELLED`),\n   total vs. failed count, duration.\n   - 1 failure in hundreds → suspect flaky, but still investigate.\n   - Many unrelated failures → suspect infrastructure, not your code.\n   - Unusually long \u002F timed out → resource contention or a hung dependency, not necessarily a logic bug.\n2. **Find the first failure.** Search logs for `FAILED|ERROR|Exception|AssertionError`.\n   Later failures are often cascades of the first.\n3. **Read the top stack frame in your own code** — not the framework internals.\n4. **Check artifacts** (JUnit XML, result files, screenshots) for the precise\n   assertion and expected-vs-actual.\n\n### Failure-pattern cheat sheet\n\n| Signal in logs | Likely cause |\n|----------------|--------------|\n| `AssertionError` \u002F comparison failure | Real logic bug, or a stale test expectation |\n| `SocketTimeout` \u002F connection refused | Downstream service or network — often not your code |\n| `OutOfMemoryError` | Resource leak or test data too large |\n| Dependency\u002Fversion errors (`NoSuchMethod`, `ClassNotFound`, resolution failures) | Build\u002Fversion mismatch, not a test bug |\n| Passes on retry \u002F only fails in CI | Flaky: timing, shared state, test ordering, real network, timezone\u002Flocale |\n| Many unrelated suites fail at once | Infrastructure\u002Fenv problem |\n\n### Deterministic vs. flaky\n\n- **Deterministic:** reproduce locally with the *same* runtime version; bisect if\n  unsure which commit broke it. Fix the root cause.\n- **Flaky:** passes on retry or only fails in CI. **Re-running is a deferral, not\n  a fix.** Quarantine it and file a follow-up; don't let it mask the next real\n  break. Common roots: timing\u002Fsleep assumptions, shared state between tests, test\n  ordering, real network calls, timezone\u002Flocale.\n\n## Tips\n\n- **Coverage measures execution, not verification.** A line that ran with no assertion is still a blind spot — read the tests, not just the number.\n- **New-code \u002F diff coverage is the gate that matters most** — it stops fresh gaps and is the most actionable failure to fix.\n- **Chase risk, not 100%.** Test money\u002Fauth\u002Fdata-integrity and complex branches; skip getters and generated code. Well-covered critical paths beat a padded overall number.\n- **A coverage regression is often deleted\u002Fmoved tests**, not new untested code — check the diff before writing anything.\n- **First failure, in your own code.** Read from the top of the stack in your code; later failures are usually cascades.\n- **Re-running a flaky test is not a fix.** Quarantine and file a follow-up so it can't hide the next real failure.\n- **Many unrelated failures ≈ infrastructure.** Don't debug your logic when the whole suite fell over.\n","# Coverage and Test Reports\n\nTwo related jobs: **reading a coverage report to decide where to add tests**, and\n**reading a failed CI test run to find the root cause**. The unifying principle\nfor both: **chase risk, not a percentage.** 100% coverage of trivial code and a\ngreen-after-retry flaky suite are both illusions of safety.\n\n## Part 1: Reading Coverage Reports\n\n### Metrics — what they actually tell you\n\n| Metric | Means | Watch out for |\n|--------|-------|---------------|\n| **Line coverage** | % of lines executed by tests | A line can run without its behavior being asserted |\n| **Branch coverage** | % of decision paths (if\u002Felse, switch) taken | Far more honest than line coverage for logic |\n| **New-code \u002F diff coverage** | Coverage of lines *changed in this PR* | The metric most gates enforce — it stops fresh gaps |\n| **Method\u002Ffunction coverage** | % of functions entered at all | Coarse; a called-once function reads as \"covered\" |\n\n**Coverage proves code *ran*, not that it was *checked*.** A test that exercises\na line but asserts nothing still counts. Read coverage as \"where are we\ndefinitely blind,\" not \"where are we safe.\"\n\n### Gates and regressions\n\n- A **coverage gate** blocks a change when a metric falls below a threshold —\n  most commonly **new-line coverage on the diff** (e.g. \"90% of changed lines\n  must be covered\"). This is usually the actionable failure.\n- A **regression** = overall coverage dropped vs. the baseline. Often it's not\n  new untested code but *deleted tests* or *moved code* — check the diff before\n  writing new tests.\n- **Exclusions** matter: generated code, DTOs\u002Fmodels, error classes, and DI\n  wiring are commonly excluded and don't count toward the gate. Confirm what's\n  excluded before chasing a number.\n\n### Workflow: a gate failed on new-code coverage\n\n1. **Read the summary** — which metric failed, threshold vs. actual.\n2. **List the exact uncovered new lines** — the report should name files and\n   line numbers on the diff. That's your precise to-do list.\n3. **Open each uncovered file** and read the uncovered lines *in context* — is it\n   real logic (needs a test) or a trivial\u002Fguard line (candidate for exclusion)?\n4. **Write tests for the logic**, targeting branches, not just line hits.\n5. Re-run and confirm the gate clears.\n\n### Workflow: improving overall coverage (no gate)\n\n1. **Summary** → overall line\u002Fbranch numbers.\n2. **Worst files by missed lines** → but re-rank by *risk*, not raw count.\n3. **Drill into the highest-risk files** and add branch-covering tests.\n\n### Prioritize by risk, not by chasing 100%\n\nRank coverage gaps by **impact × likelihood of a bug**, not by line count:\n\n| Prioritize (test these first) | Deprioritize |\n|-------------------------------|--------------|\n| Core business logic, money\u002Fauth\u002Fdata-integrity paths | Getters\u002Fsetters, `toString`, boilerplate |\n| Complex branching, error handling, edge cases | Auto-generated code, simple DTOs |\n| Code that changed recently \u002F churns often | Stable code untouched for years |\n| Public API \u002F integration boundaries | Trivial one-line delegators |\n\nA well-tested 75% on the critical paths beats 95% padded with trivial-getter\ntests. Stop when the *remaining* gaps are low-risk.\n\n## Part 2: Reading a Failed CI Test Run\n\n### Triage order\n\n1. **Summary first** — status (`SUCCEEDED`\u002F`FAILED`\u002F`TIMED_OUT`\u002F`CANCELLED`),\n   total vs. failed count, duration.\n   - 1 failure in hundreds → suspect flaky, but still investigate.\n   - Many unrelated failures → suspect infrastructure, not your code.\n   - Unusually long \u002F timed out → resource contention or a hung dependency, not necessarily a logic bug.\n2. **Find the first failure.** Search logs for `FAILED|ERROR|Exception|AssertionError`.\n   Later failures are often cascades of the first.\n3. **Read the top stack frame in your own code** — not the framework internals.\n4. **Check artifacts** (JUnit XML, result files, screenshots) for the precise\n   assertion and expected-vs-actual.\n\n### Failure-pattern cheat sheet\n\n| Signal in logs | Likely cause |\n|----------------|--------------|\n| `AssertionError` \u002F comparison failure | Real logic bug, or a stale test expectation |\n| `SocketTimeout` \u002F connection refused | Downstream service or network — often not your code |\n| `OutOfMemoryError` | Resource leak or test data too large |\n| Dependency\u002Fversion errors (`NoSuchMethod`, `ClassNotFound`, resolution failures) | Build\u002Fversion mismatch, not a test bug |\n| Passes on retry \u002F only fails in CI | Flaky: timing, shared state, test ordering, real network, timezone\u002Flocale |\n| Many unrelated suites fail at once | Infrastructure\u002Fenv problem |\n\n### Deterministic vs. flaky\n\n- **Deterministic:** reproduce locally with the *same* runtime version; bisect if\n  unsure which commit broke it. Fix the root cause.\n- **Flaky:** passes on retry or only fails in CI. **Re-running is a deferral, not\n  a fix.** Quarantine it and file a follow-up; don't let it mask the next real\n  break. Common roots: timing\u002Fsleep assumptions, shared state between tests, test\n  ordering, real network calls, timezone\u002Flocale.\n\n## Tips\n\n- **Coverage measures execution, not verification.** A line that ran with no assertion is still a blind spot — read the tests, not just the number.\n- **New-code \u002F diff coverage is the gate that matters most** — it stops fresh gaps and is the most actionable failure to fix.\n- **Chase risk, not 100%.** Test money\u002Fauth\u002Fdata-integrity and complex branches; skip getters and generated code. Well-covered critical paths beat a padded overall number.\n- **A coverage regression is often deleted\u002Fmoved tests**, not new untested code — check the diff before writing anything.\n- **First failure, in your own code.** Read from the top of the stack in your code; later failures are usually cascades.\n- **Re-running a flaky test is not a fix.** Quarantine and file a follow-up so it can't hide the next real failure.\n- **Many unrelated failures ≈ infrastructure.** Don't debug your logic when the whole suite fell over.\n",{"name":5,"description":7},"main","44b1acb2c22ab1e94663691dda7d7739f1b83cf6","skills\u002Ftest-coverage-analysis",0,"https:\u002F\u002Fgithub.com\u002Fjingchaodev\u002Fskills-lab","https:\u002F\u002Fgithub.com\u002Fjingchaodev","https:\u002F\u002Fx.com\u002Fcifra1902","Developer","2026-07-13 09:03:55",{"source":8,"skillName":5,"commands":34,"prompt":44,"zipAvailable":45},[35,38,41],{"tool":36,"command":37},"npx","npx skills add jingchaodev\u002Fskills-lab --skill test-coverage-analysis",{"tool":39,"command":40},"bunx","bunx skills add jingchaodev\u002Fskills-lab --skill test-coverage-analysis",{"tool":42,"command":43},"pnpm","pnpm dlx skills add jingchaodev\u002Fskills-lab --skill test-coverage-analysis","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fjingchaodev\u002Fskills-lab\u002Fblob\u002Fmain\u002Fskills\u002Ftest-coverage-analysis\u002FSKILL.md",true,[],[48,55,62,69,75,82],{"skillNo":49,"name":50,"nameZh":6,"description":51,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":52,"categories":53,"keywords":54,"publishedAt":19},"01M788VYAVHEH5QAV7T1Z8QFV9","default-skill","Valid default cwd skill.","https:\u002F\u002Fgithub.com\u002Fjingchaodev\u002Fskills-lab\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fdefault_cwd\u002Fskills\u002Fdefault-skill\u002FSKILL.md",[],[],{"skillNo":56,"name":57,"nameZh":6,"description":58,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":59,"categories":60,"keywords":61,"publishedAt":19},"01M788VVHF3TC2RY65NVPR26DN","clean-two","Another valid skill with a quoted trigger phrase \"specific action\".","https:\u002F\u002Fgithub.com\u002Fjingchaodev\u002Fskills-lab\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fclean_skills\u002Fclean-two\u002FSKILL.md",[],[],{"skillNo":63,"name":64,"nameZh":6,"description":65,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":66,"categories":67,"keywords":68,"publishedAt":19},"01M788VRPGJXZ09X9AM1ZPNAHA","clean-one","Use when the user needs a clean example.","https:\u002F\u002Fgithub.com\u002Fjingchaodev\u002Fskills-lab\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fclean_skills\u002Fclean-one\u002FSKILL.md",[],[],{"skillNo":70,"name":71,"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":72,"categories":73,"keywords":74,"publishedAt":19},"01M788VPP8BFKCBXDFRHMP67WH","wrong-frontmatter","https:\u002F\u002Fgithub.com\u002Fjingchaodev\u002Fskills-lab\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fbad_skills\u002Fwrong-frontmatter\u002FSKILL.md",[],[],{"skillNo":76,"name":77,"nameZh":6,"description":78,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":79,"categories":80,"keywords":81,"publishedAt":19},"01M788VKP781ZRGKXVMHZFR062","trigger-two","Use for the exact phrase \"panic button\".","https:\u002F\u002Fgithub.com\u002Fjingchaodev\u002Fskills-lab\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fbad_skills\u002Ftrigger-two\u002FSKILL.md",[],[],{"skillNo":83,"name":84,"nameZh":6,"description":85,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":86,"categories":87,"keywords":88,"publishedAt":19},"01M788VJBR5Q14W6MJB2DWRSVE","trigger-one","Use when someone says \"panic button\".","https:\u002F\u002Fgithub.com\u002Fjingchaodev\u002Fskills-lab\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fbad_skills\u002Ftrigger-one\u002FSKILL.md",[],[]]