{"data":{"slug":"discovered-052e1ddf49b77b85d9433edd563b7e8a7f7f1f97c3731725","title":"Writing Accurate Defect Reports","summary":"Verify a defect at the user-visible layer before publishing it, and ensure the report accurately reflects what actually reproduces. This includes checking if the code is reachable, confirming the defect is not already addressed in project records, and avoiding overstated claims.","url":"https:\/\/skillshunter.net\/skills\/discovered-052e1ddf49b77b85d9433edd563b7e8a7f7f1f97c3731725","json_url":"https:\/\/skillshunter.net\/api\/public\/v1\/skills\/discovered-052e1ddf49b77b85d9433edd563b7e8a7f7f1f97c3731725","markdown_url":"https:\/\/skillshunter.net\/skills\/discovered-052e1ddf49b77b85d9433edd563b7e8a7f7f1f97c3731725.md","download_url":"https:\/\/skillshunter.net\/skills\/discovered-052e1ddf49b77b85d9433edd563b7e8a7f7f1f97c3731725\/download","category":{"slug":"software-development","name":"Software & Development"},"editor_note":"Before writing a defect report, run the reproduction at the outermost layer the title names. Verify that the code is reachable by confirming liveness, and search the project's records for existing definitions or closed issues that may already address the reported anomaly.","instructions":"---\nname: writing-defect-reports\ndescription: Establish a finding before you publish it, and correct it after \u2014 headlines that overstate what actually reproduces at the layer a user sees, reporting code that no entry point can reach or that is already dead, filing a caveat the project's own records already answered, re-verifying your prior notes against the tree instead of against the note, choosing the narrowest injection point that reproduces a failure without breaking the run first, capturing probe output a harness swallows, and withdrawing a published claim in the thread where you published it. Use when filing an issue, writing the body of a PR or code review that asserts a defect, triaging someone else's report, or deciding whether a suspicious observation is reportable at all.\n---\n\n# Writing Defect Reports\n\nA report is a claim, and it is read by people who will not re-derive it. The cost\nof an overstated one is not embarrassment \u2014 it is a maintainer spending an\nafternoon on a premise that does not hold, or a \"fix\" landing for a failure mode\nthat never occurred. The techniques for *finding* a defect live in\n**verifying-external-behavior** (also in this repo's `.claude\/skills\/`). This\nskill is about the step between finding one and publishing it.\n\nThe rule underneath all of it: **publish the claim you actually measured, at the\nlayer you measured it.**\n\n## The anomaly is real; the headline may not be\n\nThe common failure is not a fabricated bug. It is a genuine internal oddity\npromoted one layer too far.\n\nYou notice that a helper returns a degenerate value for a small sample, trace it\ninto a scoring path, and write the report as *\"short inputs are wrongly flagged.\"*\nThen you run real short inputs through the public entry point and the flag never\nsets \u2014 a downstream threshold absorbs the degenerate value, and the only visible\neffect is noise in a secondary per-feature list. The internal oddity is worth\nfixing; the headline was false, and a reviewer who tests it will say so.\n\n**Before writing the title, run the reproduction at the outermost layer the title\nnames.** Then choose one of three honest framings:\n\n| what you measured                          | how to file it                              |\n| ------------------------------------------ | ------------------------------------------- |\n| reproduces end to end                      | file it as the user-visible symptom         |\n| reproduces internally, absorbed downstream | file the internal defect, state the absorption |\n| does not reproduce at all                  | do not file; record the probe and move on   |\n\nThe second row is a good report, not a weak one. \"This helper returns a value it\nshould not; today a threshold happens to mask it, so there is no user-visible\nsymptom yet\" tells a maintainer exactly how to prioritize. Silently keeping the\ndramatic title because the underlying issue is real is what burns credibility.\n\n## Check the code is reachable before calling it broken\n\nThree shapes look like defects and are not \u2014 or are, but not the one you were\nabout to describe:\n\n**A branch that cannot execute.** An early return guarding a lookup that already\nreturns the same value on the missing case; a condition a preceding gate already\nimplies. This is dead code, and \"dead code\" is the accurate report. Filing it as a\ncorrectness bug, or naming a test as though it exercises that branch, misleads\neveryone downstream \u2014 confirm liveness by deleting the line and watching the\nsuite, not by reading it.\n\n**A guard whose pattern only matches your fixture.** A validity check written\nagainst a hand-typed sample can be structurally unable to fire against the real\ninput: a single-line pattern against a generator that wraps its output across\nindented lines, an exact-string check against a source that varies whitespace.\nVerify the guard against a captured real input, not the fixture. The consequence\nmatters for the fix, too: replacing synthetic fixtures with real captures deletes\nthat guard's only coverage, so the fix and the fixture change belong in one\nchange, not two.\n\n**A file nothing invokes.** Repos accumulate scripts that reference paths the\nrepo does not contain and toolchains it does not depend on. Before reporting one\nas broken, find the caller \u2014 the task runner, the workflow, the entry point. If\nthere is none, the report is \"this is dead, delete it,\" which is cheap and\nuncontroversial, rather than \"the build is broken,\" which is wrong.\n\n## Search the project's own records before filing a caveat\n\nThe most avoidable report is the one the project already answered. Two measured\nfigures that look inconsistent are usually inconsistent *definitions*, and the\ndefinition is usually written down: a claim ledger row, a docstring, a design\nnote, a closed issue.\n\nGrep for the term before writing \"these two numbers do not appear to compute the\nsame quantity.\" If a record pins the definition, cite it \u2014 the caveat you were\nabout to publish reads as an open question the project already closed, and a\nmaintainer has to re-close it.\n\nThe same discipline applies to numbers you are *quoting*. Figures in an older\nissue may not reproduce, because a dependency the value depends on is unpinned\nand the installed version has changed. Re-measure before restating, and record it\nwith the command, output, and date \u2014 see **verifying-external-behavior** for why\nan undated measurement cannot be re-checked, and **cross-surface-changes** for\nchoosing between two records that cover the same fact.\n\n**Quote the protocol next to the figure**, not only in whatever artifact produced\nit: the split, the warmup, the seed, the version. Two documents quoting the same\nmetric under different protocols read as a regression to anyone comparing them,\nand the reader has no way to tell that they are not comparable.\n\n## Your earlier note is a claim, not evidence\n\nWorking notes, scratch findings, and a prior comment on the same issue are\nsecondary sources \u2014 including your own. They were true about a tree that has\nsince moved, or they were wrong when written.\n\nWhen a note and the code disagree, the code settles it. Re-derive from the\nintegration branch directly rather than from a checkout that may be behind:\n\n```bash\ngit show origin\/main:path\/to\/file.py | grep -n 'the_symbol'\n```\n\nIf two notes contradict each other, do not average them and do not pick the more\nrecent \u2014 re-check the tree and then correct the wrong note in place, saying that\nit was wrong. A knowledge base that records both readings without resolving them\nis worse than one that records neither, because the next reader will pick one at\nrandom.\n\n## Pick the narrowest injection point that reproduces the failure\n\nTo exercise a failure path by hand you need to break something. Break the\nsmallest possible thing, or the run dies before reaching the path you care about.\n\nThe classic miss is a blanket hook or a global monkeypatch:\n\n```bash\n# Too broad \u2014 rejects EVERY commit, including the unrelated bookkeeping commit\n# the process makes first. The run fails earlier than the path under test, and\n# you have reproduced a different bug.\necho 'exit 1' > .git\/hooks\/pre-commit\n\n# Narrow \u2014 fails exactly the operation whose failure you want to observe.\ncat > .git\/hooks\/commit-msg <<'EOF'\ngrep -q 'sync from source-b' \"$1\" && exit 1\nexit 0\nEOF\n```\n\nThe same rule holds elsewhere: fail one HTTP host rather than the network; make\none file unreadable rather than the directory; raise from one call rather than\npatching the module. **After the run, confirm it failed where you intended** \u2014\notherwise you have measured your instrumentation.\n\n**Check where your probe's output actually goes.** Test harnesses commonly\nreplace the global logger or console object at setup, and verbosity flags do not\nundo that. If a probe prints nothing, append to a file outside the harness's\nreach and read it afterwards, rather than concluding the code path did not run.\n\n## Report the checks that model a real regression\n\nWhen you back a report with mutation evidence, include only mutations that (a)\nplausibly model how an implementation would actually regress and (b) demonstrably\nturn a named test red. A mutation that nothing catches is worth reporting as a\ncoverage gap; a mutation nobody would ever write is noise that makes the rest of\nthe report look padded.\n\nState which test each mutation trips, and which assertion inside it \u2014 a guard\noften turns out to be load-bearing at a different layer than the report assumed,\nand the assertion name is what reveals it.\n\n## A red gate is not an aside\n\nWhether a red check is pre-existing is answered by running it on the base commit\n\u2014 see **reproducing-ci-locally** (also in this repo's `.claude\/skills\/`). What\nbelongs here is where that answer goes in the write-up. A red check is never a\nparenthetical under a \"done\" claim: give it its own statement naming what is red,\nwhat makes it red, and whether you fixed it. And **confirm green after the run\nfinishes** rather than writing \"should be green\" \u2014 a prediction stated as an\noutcome is the same defect as an overstated headline, one artifact over.\n\n## Withdraw published claims where you published them\n\nA wrong claim that has been read does not become unwritten when you stop\nrepeating it. If a caveat, a number, or a framing you published turns out to be\nwrong or already-answered:\n\n- Say so in the same thread, naming what was wrong and what is true instead.\n- Do not quietly delete it and re-file a corrected version elsewhere; readers who\n  saw the first one are never routed to the second.\n- Keep it to the correction. A retraction is one or two sentences \u2014 what you\n  claimed, what is actually the case, what changes as a result.\n\nThe same applies to a claim you inherited. If you repeat someone else's figure and\nit fails to reproduce, correcting it is part of your report, not a separate errand.\n\n## Checklist\n\n```\nBefore publishing a defect report:\n- [ ] Reproduction run at the outermost layer the title names; title matches\n      what reproduced there, not what you found internally\n- [ ] Absorbed-downstream findings filed as internal defects, with the absorption\n      stated \u2014 not promoted to a user-visible symptom\n- [ ] The code is reachable: an entry point calls it, and the branch is live\n      (checked by deletion, not by reading)\n- [ ] Guards verified against a captured real input, not the fixture that was\n      written alongside them\n- [ ] Project records (ledger, docstrings, design notes, closed issues) searched\n      for a definition that already resolves the discrepancy\n- [ ] Every quoted number re-measured, with version, command, and date; protocol\n      stated next to the figure\n- [ ] Prior notes re-verified against the integration branch, and any wrong note\n      corrected in place\n- [ ] Failure injected at the narrowest point; run confirmed to have failed where\n      intended\n- [ ] Mutation evidence limited to plausible regressions, each attributed to a\n      named test and assertion\n- [ ] No red check described as pre-existing under a \"done\" claim; green\n      confirmed after the run finished, not predicted\n- [ ] Any earlier wrong claim withdrawn in the thread where it was published\n```\n\n## Note for this repository (ffmpeg-skill)\n\nThis is the same discipline behind this repo's 0.9.1\/0.10.0 \"honesty fix\"\npattern: `cut.py`'s `mode`\/`keyframe_snapped`\/`duration_delta_seconds` fields,\n`check.py`'s `reason` field, and `render.py`'s check-stage exit code were all\nadded because a prior report (\"the cut is lossless,\" \"the check passed,\" \"the\nrender succeeded\") was true at one layer and silently false at the layer a\ncaller actually reads results from \u2014 exactly the \"genuine internal oddity\npromoted one layer too far\" pattern this skill describes, just discovered\nafter shipping rather than before. When investigating a new claim about this\ncodebase, reproduce it with real media via the test fixtures (`tests\/_fixtures.py`)\nbefore reporting it, the same way `test_cut_copy_keyframe_snap_reports_a_real_nonzero_delta`\nmeasured an actual 1.24s divergence rather than assuming one.\n\nSource: [wdm0006\/python-skills](https:\/\/github.com\/wdm0006\/python-skills) (MIT).\n","use_cases":["Filing an issue with a clear and accurate description of a defect","Writing the body of a PR or code review that asserts a defect","Triage someone else's report and determining whether it is reportable","Deciding whether a suspicious observation is reportable at all"],"limitations":[],"compatibility":[],"setup_tip":null,"sample_input":null,"sample_output":null,"source_url":"https:\/\/github.com\/kajisho5\/ffmpeg-skill\/blob\/daae28ea4fe27223932392be07206798423c0f8b\/.claude\/skills\/defect-reports\/SKILL.md","source_commit":"daae28ea4fe27223932392be07206798423c0f8b","license":null,"version":null,"listing_approved_at":"2026-11-28","created_at":"2026-11-28T08:11:10.000000Z","updated_at":"2026-11-28T18:38:03.000000Z","seo_title":"How to Write Accurate Defect Reports","seo_description":"Learn how to write defect reports that accurately reflect what actually reproduces at the user-visible layer, ensuring clarity and avoiding overstated claims.","seo_keywords":["defect report","accurate defect reporting","software development","writing defect reports","code review","issue filing"]}}