[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M75K3F33HE2YFN6PQA0ETNRF":3,"skill-same:01M75K3F33HE2YFN6PQA0ETNRF":53},{"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},"01M75K3F33HE2YFN6PQA0ETNRF","unit-test-coverage",null,"Select, write, and review meaningful tests of public functions and interfaces. Use when adding behavior, fixing a regression, reviewing test quality, or diagnosing failing tests. Every test must protect a critical behavior or flow; never add tests only to increase coverage.","yasik\u002Fskills","yasik","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F127702?v=4","01M75K27120Z0BWE7GMCBQ21M8","Andrii Yasinetsky","01M75K2722ZQ7HH0WKE61XDHD1",3,"MIT","https:\u002F\u002Fgithub.com\u002Fyasik\u002Fskills\u002Fblob\u002Fmain\u002Fplugins\u002Fengineering\u002Fskills\u002Funit-test-coverage\u002FSKILL.md",[],[],"2026-11-12 13:55:43",false,"---\nname: unit-test-coverage\ndescription: Select, write, and review meaningful tests of public functions and interfaces. Use when adding behavior, fixing a regression, reviewing test quality, or diagnosing failing tests. Every test must protect a critical behavior or flow; never add tests only to increase coverage.\n---\n\n# Unit test coverage\n\nEvery test must earn its maintenance cost. Protect public contracts, critical\nfunctionality, and important flows with the smallest convincing set of tests.\nCoverage is a diagnostic for missed behavior, never the goal or a reason to\nexercise every function.\n\n## Establish the contract first\n\nRead the request, public exports, documentation, relevant callers, existing\ntests, and the implementation. Identify what callers rely on before choosing\nassertions. A public function, method, endpoint, CLI operation, or documented\nextension interface is a test entry point. Do not directly test private helpers,\ninspect private state, export internals for tests, or widen production visibility\nto increase coverage. Reach internal behavior through its public owner.\n\nChoose tests using these questions; record the reasoning only for a non-obvious\ncoverage decision, not a worksheet per test:\n\n- Which meaningful public behavior, invariant, or failure does this protect?\n- What plausible regression would make it fail, and what would that cost users?\n- Why would an existing test or a static check not catch that regression?\n- What independent contract or observation supplies the expected result?\n\nIf those answers are weak, omit or consolidate the test. Small tests are useful\nwhen the risk is real; size alone does not decide value.\n\n## Choose valuable coverage\n\n- Cover the main supported flow and the failure boundaries changed by the work.\n  Prioritize data preservation, permissions, transaction effects, cancellation,\n  lifecycle settlement, ordering, and cross-component contracts where relevant.\n- For a bug, reproduce it through the public interface and preserve the\n  regression case. Check an adjacent boundary only when it represents a distinct\n  risk, not another line to cover.\n- Assert externally observable results, state, side effects, and errors. Do not\n  assert incidental helper calls, object construction, dependency wiring,\n  framework-generated accessors, or snapshots of an entire internal structure.\n- Prefer real local implementations and deterministic inputs. Replace external\n  services at their boundary only when needed. A mock should simulate the\n  dependency's contract, never replace the behavior being tested.\n- Use parameterized cases when they express meaningful equivalence classes or\n  boundary cases. Avoid many tiny tests that repeat one fact.\n- Retain important invariants and protocol parity checks. Test them through the\n  public contract using an independent oracle: explicit expected payloads,\n  a hand-auditable fixture, a documented ordering rule, or a separately owned\n  consumer\u002Fschema. Do not compute expected output with the same production\n  helper or copy its algorithm into the test. A round trip alone is insufficient\n  when encoder and decoder could share the same defect.\n- Use a property-based test (Hypothesis, fast-check) when a contract is a law\n  over many inputs: a parser and serializer round trip, an idempotent normalizer,\n  an ordering invariant. Properties are independent oracles; they complement a\n  few hand-written examples rather than replace them. Do not add the library\n  when the repository has no such risk.\n- Add a focused integration check when the risk is at a real component boundary\n  and unit tests cannot establish it. Do not label mocked behavior as verified\n  integration or call a unit suite an end-to-end result.\n- If testing a unit needs heavy mocking or long setup, report the design smell:\n  the unit probably owns too much. Less mocking usually means a cleaner boundary.\n\n## Prove the behavior outside the test suite\n\nUnit tests prove contracts, not that a feature is wired up for its user. For a\nuser-facing change, run it the way a user would: the CLI command, the endpoint,\nthe page, or the repository's runnable examples. When the repository keeps\nexamples, a new user-facing feature ships with a minimal example that runs and\nchecks its own result, and existing examples affected by the change are rerun.\nUse real services when the repository's examples do and credentials are\navailable; otherwise say which path ran against a double.\n\n## Use the established layout\n\nRead [Python, TypeScript, and Go layout](references\u002Ftest-layout.md) for concrete\npackage layout examples. Inspect the target's manifests before copying commands.\n\nFor Python, use the repository's existing runner; choose pytest only when none\nexists. With pytest, put fixtures, test doubles, and mock setup in the nearest\nsuitable `conftest.py`. Use named, typed fixtures; pass them to tests\nthrough pytest's fixture arguments. Keep tests focused on scenario and outcome.\nUse `pytest-asyncio` when that is the repository's async runner. Keep test\nmodules under the corresponding test tree and import the supported public API.\n\nFor TypeScript, preserve the existing test layout and runner. For new packages,\nprefer package-local `tests\u002F*.test.ts` or `*.test.tsx`. Keep reusable boundary\ndoubles and fixtures in that test tree. Exercise the explicit public exports,\nkeep tests type checked, and avoid unsafe casts or `any` that conceal contract\nerrors. Do not add a second test framework.\n\nFor Go, put `foo_test.go` next to `foo.go` in the external test package\n(`package foo_test`), so tests compile against exported identifiers only. Do not\nadd an `export_test.go` that exposes internals. Group one `TestMethod` function's\ncases into `Validation`, `Success`, and `Errors` subtests, compare whole structs,\nand use the repository's assertion and mock tooling. Use generated mocks at\ninterface boundaries with explicit arguments and call counts, and run the race\ndetector.\n\n## Diagnose failures before editing expectations\n\n1. Reproduce the failure and read the assertion, inputs, setup, and public\n   contract. Check for environmental or fixture failures as well as code bugs.\n2. Determine whether the implementation violates intended behavior. If it does,\n   fix the implementation and keep the assertion that protects the contract.\n3. Change a test only when independent evidence shows its expectation or setup\n   is wrong, or when an authorized behavior change makes the old expectation\n   obsolete. State that evidence. Current output alone is not evidence.\n4. Never weaken an assertion, add a skip, update snapshots, or change a mock\n   simply to match the implementation and obtain a pass. Investigate flaky tests\n   at their cause; retries are not a correctness fix.\n\n## Worked example\n\nA change adds `max_bytes` truncation to a public `read_file` tool. The candidate\ntests and the decisions:\n\n| Candidate | Decision |\n| --- | --- |\n| Output over `max_bytes` is cut and ends with a notice naming the full path | Keep: the visible truncation contract the model relies on |\n| Output under the limit is returned unchanged | Keep, as a second case in the same parameterized test |\n| A multibyte character at the boundary is not split | Keep: a distinct data-fidelity risk |\n| The private `_truncate` helper returns the expected slice | Omit: covered through `read_file` |\n| `max_bytes` is stored on the tool instance | Omit: wiring, not behavior |\n\nResult: one parameterized test plus one boundary test, both through `read_file`,\nwith expected outputs written by hand.\n\n## Verify and report\n\nRun the focused checks first, then the target repository's required gates. For a\nregression, confirm the new test fails for the intended reason on the old\nbehavior when feasible without disturbing other work, and passes with the fix.\nBroaden or rerun checks when a change, failure, dependency, or unresolved risk\nrequires it. Do not repeatedly run expensive suites after unchanged passing\nresults.\n\nReport what behavior is protected, commands and results, any uncovered risk,\nand why tests were omitted when that decision matters. A test count or coverage\npercentage alone does not establish correctness.\n","# Unit test coverage\n\nEvery test must earn its maintenance cost. Protect public contracts, critical\nfunctionality, and important flows with the smallest convincing set of tests.\nCoverage is a diagnostic for missed behavior, never the goal or a reason to\nexercise every function.\n\n## Establish the contract first\n\nRead the request, public exports, documentation, relevant callers, existing\ntests, and the implementation. Identify what callers rely on before choosing\nassertions. A public function, method, endpoint, CLI operation, or documented\nextension interface is a test entry point. Do not directly test private helpers,\ninspect private state, export internals for tests, or widen production visibility\nto increase coverage. Reach internal behavior through its public owner.\n\nChoose tests using these questions; record the reasoning only for a non-obvious\ncoverage decision, not a worksheet per test:\n\n- Which meaningful public behavior, invariant, or failure does this protect?\n- What plausible regression would make it fail, and what would that cost users?\n- Why would an existing test or a static check not catch that regression?\n- What independent contract or observation supplies the expected result?\n\nIf those answers are weak, omit or consolidate the test. Small tests are useful\nwhen the risk is real; size alone does not decide value.\n\n## Choose valuable coverage\n\n- Cover the main supported flow and the failure boundaries changed by the work.\n  Prioritize data preservation, permissions, transaction effects, cancellation,\n  lifecycle settlement, ordering, and cross-component contracts where relevant.\n- For a bug, reproduce it through the public interface and preserve the\n  regression case. Check an adjacent boundary only when it represents a distinct\n  risk, not another line to cover.\n- Assert externally observable results, state, side effects, and errors. Do not\n  assert incidental helper calls, object construction, dependency wiring,\n  framework-generated accessors, or snapshots of an entire internal structure.\n- Prefer real local implementations and deterministic inputs. Replace external\n  services at their boundary only when needed. A mock should simulate the\n  dependency's contract, never replace the behavior being tested.\n- Use parameterized cases when they express meaningful equivalence classes or\n  boundary cases. Avoid many tiny tests that repeat one fact.\n- Retain important invariants and protocol parity checks. Test them through the\n  public contract using an independent oracle: explicit expected payloads,\n  a hand-auditable fixture, a documented ordering rule, or a separately owned\n  consumer\u002Fschema. Do not compute expected output with the same production\n  helper or copy its algorithm into the test. A round trip alone is insufficient\n  when encoder and decoder could share the same defect.\n- Use a property-based test (Hypothesis, fast-check) when a contract is a law\n  over many inputs: a parser and serializer round trip, an idempotent normalizer,\n  an ordering invariant. Properties are independent oracles; they complement a\n  few hand-written examples rather than replace them. Do not add the library\n  when the repository has no such risk.\n- Add a focused integration check when the risk is at a real component boundary\n  and unit tests cannot establish it. Do not label mocked behavior as verified\n  integration or call a unit suite an end-to-end result.\n- If testing a unit needs heavy mocking or long setup, report the design smell:\n  the unit probably owns too much. Less mocking usually means a cleaner boundary.\n\n## Prove the behavior outside the test suite\n\nUnit tests prove contracts, not that a feature is wired up for its user. For a\nuser-facing change, run it the way a user would: the CLI command, the endpoint,\nthe page, or the repository's runnable examples. When the repository keeps\nexamples, a new user-facing feature ships with a minimal example that runs and\nchecks its own result, and existing examples affected by the change are rerun.\nUse real services when the repository's examples do and credentials are\navailable; otherwise say which path ran against a double.\n\n## Use the established layout\n\nRead [Python, TypeScript, and Go layout](references\u002Ftest-layout.md) for concrete\npackage layout examples. Inspect the target's manifests before copying commands.\n\nFor Python, use the repository's existing runner; choose pytest only when none\nexists. With pytest, put fixtures, test doubles, and mock setup in the nearest\nsuitable `conftest.py`. Use named, typed fixtures; pass them to tests\nthrough pytest's fixture arguments. Keep tests focused on scenario and outcome.\nUse `pytest-asyncio` when that is the repository's async runner. Keep test\nmodules under the corresponding test tree and import the supported public API.\n\nFor TypeScript, preserve the existing test layout and runner. For new packages,\nprefer package-local `tests\u002F*.test.ts` or `*.test.tsx`. Keep reusable boundary\ndoubles and fixtures in that test tree. Exercise the explicit public exports,\nkeep tests type checked, and avoid unsafe casts or `any` that conceal contract\nerrors. Do not add a second test framework.\n\nFor Go, put `foo_test.go` next to `foo.go` in the external test package\n(`package foo_test`), so tests compile against exported identifiers only. Do not\nadd an `export_test.go` that exposes internals. Group one `TestMethod` function's\ncases into `Validation`, `Success`, and `Errors` subtests, compare whole structs,\nand use the repository's assertion and mock tooling. Use generated mocks at\ninterface boundaries with explicit arguments and call counts, and run the race\ndetector.\n\n## Diagnose failures before editing expectations\n\n1. Reproduce the failure and read the assertion, inputs, setup, and public\n   contract. Check for environmental or fixture failures as well as code bugs.\n2. Determine whether the implementation violates intended behavior. If it does,\n   fix the implementation and keep the assertion that protects the contract.\n3. Change a test only when independent evidence shows its expectation or setup\n   is wrong, or when an authorized behavior change makes the old expectation\n   obsolete. State that evidence. Current output alone is not evidence.\n4. Never weaken an assertion, add a skip, update snapshots, or change a mock\n   simply to match the implementation and obtain a pass. Investigate flaky tests\n   at their cause; retries are not a correctness fix.\n\n## Worked example\n\nA change adds `max_bytes` truncation to a public `read_file` tool. The candidate\ntests and the decisions:\n\n| Candidate | Decision |\n| --- | --- |\n| Output over `max_bytes` is cut and ends with a notice naming the full path | Keep: the visible truncation contract the model relies on |\n| Output under the limit is returned unchanged | Keep, as a second case in the same parameterized test |\n| A multibyte character at the boundary is not split | Keep: a distinct data-fidelity risk |\n| The private `_truncate` helper returns the expected slice | Omit: covered through `read_file` |\n| `max_bytes` is stored on the tool instance | Omit: wiring, not behavior |\n\nResult: one parameterized test plus one boundary test, both through `read_file`,\nwith expected outputs written by hand.\n\n## Verify and report\n\nRun the focused checks first, then the target repository's required gates. For a\nregression, confirm the new test fails for the intended reason on the old\nbehavior when feasible without disturbing other work, and passes with the fix.\nBroaden or rerun checks when a change, failure, dependency, or unresolved risk\nrequires it. Do not repeatedly run expensive suites after unchanged passing\nresults.\n\nReport what behavior is protected, commands and results, any uncovered risk,\nand why tests were omitted when that decision matters. A test count or coverage\npercentage alone does not establish correctness.\n",{"name":5,"description":7},"main","befb9ad4042bc8bc52cff51625619434b95d5598","plugins\u002Fengineering\u002Fskills\u002Funit-test-coverage",1,"https:\u002F\u002Fgithub.com\u002Fyasik\u002Fskills","https:\u002F\u002Fgithub.com\u002Fyasik","http:\u002F\u002Fwww.yasik.org","CTO at @diadia-ai, also co-founder  @mnemonic-labs. Previously (self-driving, marketplace dynamics, ML) @uber eng @google; \r\n","2026-11-08 05:33:50",{"source":8,"skillName":5,"commands":34,"prompt":44,"zipAvailable":45},[35,38,41],{"tool":36,"command":37},"npx","npx skills add yasik\u002Fskills --skill unit-test-coverage",{"tool":39,"command":40},"bunx","bunx skills add yasik\u002Fskills --skill unit-test-coverage",{"tool":42,"command":43},"pnpm","pnpm dlx skills add yasik\u002Fskills --skill unit-test-coverage","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fyasik\u002Fskills\u002Fblob\u002Fmain\u002Fplugins\u002Fengineering\u002Fskills\u002Funit-test-coverage\u002FSKILL.md",true,[47],{"path":48,"resourceType":49,"resourceTypeDesc":50,"sizeBytes":51,"sourceHtmlUrl":52},"references\u002Ftest-layout.md","REFERENCE","参考文档",9421,"https:\u002F\u002Fgithub.com\u002Fyasik\u002Fskills\u002Fblob\u002Fmain\u002Fplugins\u002Fengineering\u002Fskills\u002Funit-test-coverage\u002Freferences\u002Ftest-layout.md",[54,61,68,75,82,89],{"skillNo":55,"name":56,"nameZh":6,"description":57,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":58,"categories":59,"keywords":60,"publishedAt":19},"01M75K4ANG19T1AX8WHCZ3DDJR","terminal-report","Produce beautiful, structured terminal output for a CLI or analysis tool — ANSI colors, aligned data tables, inline bar charts, diverging\u002Fcentered bars, tagged progress logs, sparklines, and section headers. Use this skill whenever you are building a command-line tool, analysis script, report generator, data dashboard, or status\u002Fprogress display that prints to a terminal, OR whenever the user wants output to look \"polished\", \"colored\", \"styled\", \"like a dashboard\", or shows a screenshot of a pretty terminal and asks how to make one. Applies even when the user just says \"print the results nicely\" or \"make a little CLI for this\" without naming colors or charts explicitly.","https:\u002F\u002Fgithub.com\u002Fyasik\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fterminal-report\u002FSKILL.md",[],[],{"skillNo":62,"name":63,"nameZh":6,"description":64,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":65,"categories":66,"keywords":67,"publishedAt":19},"01M75K47031HBRZBHX3KDWA4G4","technical-prose","Write and revise technical explanations, design docs, reviews, reports, and progress updates in clear, connected prose. Use when the reader needs to understand a mechanism or decision, or when a draft feels dense, choppy, jargon-heavy, or like compressed implementation notes. Preserve technical meaning while making the reasoning easy to follow.","https:\u002F\u002Fgithub.com\u002Fyasik\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Ftechnical-prose\u002FSKILL.md",[],[],{"skillNo":69,"name":70,"nameZh":6,"description":71,"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},"01M75K3Y1SYYF6DF7BW5P6EPQS","teach","Teach a complex topic as one complete, self-paced written lesson — chaptered sections the learner reads top to bottom, a deep-dive that slows down on the single hardest concept and breaks it into steps with worked examples, diagrams only where they actually clarify, and real citations for going deeper. Works from an explicit topic (\"teach me how Raft consensus works\") or from one or more links\u002Fpapers\u002Fdocs the user wants to be brought up to speed on — it fetches them, falling back to a browser when a page is paywalled, JavaScript-rendered, or only partially retrievable. Use this whenever the user wants to *understand* something rather than just get an answer: \"teach me X\", \"explain this \u003Clink>\", \"help me understand \u003Ctopic>\", \"I want to learn \u003Cthing>\", \"break this down for me\", \"ELI5 but properly \u002F but deep\", or when they drop a URL and ask to be walked through it like a class. Distinct from a quick factual lookup or a terse summary — reach for this when the goal is durable understanding, not a TL;DR.","https:\u002F\u002Fgithub.com\u002Fyasik\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fteach\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},"01M75K3RJR4Q8DWR819CYMQ6TZ","mermaid-render","Render a Mermaid diagram as a beautiful, optionally animated SVG (and PNG) in a calm editorial style, instead of stock Mermaid output. Supports flowchart, stateDiagram, and sequenceDiagram. Use whenever the user wants to render, draw, beautify, restyle, or \"make nice\" a Mermaid \u002F flowchart \u002F sequence \u002F state diagram, add animated data-flow to a diagram, or turn a described process or architecture into a polished diagram for a doc, README, or slide. All styling — colors, fonts, shapes, borders, animation — is configurable in one theme file.","https:\u002F\u002Fgithub.com\u002Fyasik\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fmermaid-render\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},"01M75K3K0XAQT3A9G6DA5SK0RT","dev-docs","Write, rewrite, or review developer documentation to a complete, packaged technical-writing style guide: tone, grammar, punctuation, formatting, procedures, code samples, placeholders, UI text, linking, naming, and a word list of about 700 terms, plus an index of every rule. Use whenever the user asks for developer docs, technical docs, a README, API reference, quickstart, how-to, tutorial, concept page, release notes, docstrings or reference comments, or a docs style review, or wants docs that read like a major platform's documentation. Also use to check a draft against the style guide or to look up a term in the word list.","https:\u002F\u002Fgithub.com\u002Fyasik\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fdev-docs\u002FSKILL.md",[],[],{"skillNo":90,"name":91,"nameZh":6,"description":92,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":93,"sourceHtmlUrl":94,"categories":95,"keywords":96,"publishedAt":19},"01M75K3CA3QD3JC6W9NDR6F4DG","simplify-code","Simplify settled code in a named diff or recent change for reuse, readability, and efficiency while preserving behavior. Use after implementation and before final review; not for a broad redesign or bug fix.","https:\u002F\u002Fgithub.com\u002Fyasik\u002Fskills\u002Fblob\u002Fmain\u002Fplugins\u002Fengineering\u002Fskills\u002Fsimplify-code\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fyasik\u002Fskills\u002Fblob\u002Fmain\u002Fplugins\u002Fengineering\u002Fskills\u002Fsimplify-code\u002FSKILL.md",[],[]]