[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7AVEMTRNHNSH3QP4N2CVEY6":3,"skill-same:01M7AVEMTRNHNSH3QP4N2CVEY6":50},{"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":6,"ownerDescription":6,"updatedAt":29,"install":30,"resources":43},"01M7AVEMTRNHNSH3QP4N2CVEY6","debugging-and-error-recovery",null,"Use when diagnosing bugs, failing checks, unexpected behavior, performance regressions, or repeated unsuccessful fixes.","MinhDuyDEV\u002Fmd-pikit","MinhDuyDEV","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F94704296?v=4","01M7AVDRJB5JM5VG5B6K49X0EZ","Nguyễn Viết Minh Duy","01M7AVDRKDB3JPGHFE4HGK1Z5M",0,"MIT","https:\u002F\u002Fgithub.com\u002FMinhDuyDEV\u002Fmd-pikit\u002Fblob\u002Fmain\u002F.pi\u002Fskills\u002Fdebugging-and-error-recovery\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: debugging-and-error-recovery\ndescription: Use when diagnosing bugs, failing checks, unexpected behavior, performance regressions, or repeated unsuccessful fixes.\n---\n\n# Debugging and Error Recovery\n\n\u003CHARD-GATE>\n**Root cause over local patch.** Reproduce before changing code. Test one hypothesis at a time, fix the invariant that allowed the failure class, and rerun the original scenario before claiming success.\n\u003C\u002FHARD-GATE>\n\nUse this for reported bugs, test\u002Fbuild\u002Fruntime failures, unknown regressions, and deep failures whose visible symptom is far from its cause. If the cause is already known, implement the smallest verified fix instead.\n\n## Diagnose Loop\n\n1. **Gather** — read the full error, logs, recent changes, and environment. No fix proposal until the symptom fits in one sentence.\n2. **Reproduce** — run the failure or state why reproduction is blocked. Reduce it to the smallest failing case.\n3. **Localize** — identify the suspect boundary: input, validation, domain logic, persistence, integration, or environment.\n4. **Hypothesize** — name one or two candidate causes and the observation that would falsify each.\n5. **Instrument** — add the minimum probe, structured boundary log, or failing test that distinguishes the candidates. One hypothesis per probe.\n6. **Confirm or revise** — run the probe. Evidence selects the next step; plausibility does not.\n7. **Fix upstream** — repair the upstream cause or invariant with the smallest change, not the symptom layer.\n8. **Guard** — add a regression test that would have caught the original symptom when feasible.\n9. **Verify** — rerun the original reproduction, regression test, and relevant type\u002Flint checks.\n\n## Trace Deep Failures Backward\n\nTrace backward from the symptom:\n\n```text\nfailure \u003C- received input \u003C- caller output \u003C- earlier boundary \u003C- origin of invalid state\n```\n\nAt each boundary, record structured input\u002Foutput evidence and ask: what called this, where did its data come from, and what changed? Log stable identifiers and relevant fields; redact secrets. Do not add broad body logging or ten probes at once.\n\nIf an unknown test creates unwanted files or state, use the bundled `{baseDir}\u002Ffind-polluter.sh \u003Cpath-to-check> \u003Ctest-pattern>` to identify the first polluting test.\n\nUseful clues:\n\n| Symptom | First suspects |\n| --- | --- |\n| Dev\u002Fprod mismatch | config, data, dependency, race |\n| Only one user | identity, permissions, stored data |\n| Intermittent failure | timing, ordering, cache, race |\n| Recently regressed | recent change, deploy, schema, dependency |\n\n## Retry and Escalation\n\n- If an operation fails, reread current state; retry once only if failure may be transient, then use a fallback approach.\n- After two unsuccessful fixes, run a map-vs-territory check: reread the request, reproduction, and eliminated hypotheses.\n- After three failed fixes, stop and escalate the disputed assumption or architecture. Do not stack another patch.\n\n## Evidence Required\n\nRecord the reproduction, tested and eliminated hypotheses, confirmed root cause, changed invariant, regression guard, and verification commands. If the bug is non-reproducible or a guard is infeasible, report that limitation explicitly.\n","# Debugging and Error Recovery\n\n\u003CHARD-GATE>\n**Root cause over local patch.** Reproduce before changing code. Test one hypothesis at a time, fix the invariant that allowed the failure class, and rerun the original scenario before claiming success.\n\u003C\u002FHARD-GATE>\n\nUse this for reported bugs, test\u002Fbuild\u002Fruntime failures, unknown regressions, and deep failures whose visible symptom is far from its cause. If the cause is already known, implement the smallest verified fix instead.\n\n## Diagnose Loop\n\n1. **Gather** — read the full error, logs, recent changes, and environment. No fix proposal until the symptom fits in one sentence.\n2. **Reproduce** — run the failure or state why reproduction is blocked. Reduce it to the smallest failing case.\n3. **Localize** — identify the suspect boundary: input, validation, domain logic, persistence, integration, or environment.\n4. **Hypothesize** — name one or two candidate causes and the observation that would falsify each.\n5. **Instrument** — add the minimum probe, structured boundary log, or failing test that distinguishes the candidates. One hypothesis per probe.\n6. **Confirm or revise** — run the probe. Evidence selects the next step; plausibility does not.\n7. **Fix upstream** — repair the upstream cause or invariant with the smallest change, not the symptom layer.\n8. **Guard** — add a regression test that would have caught the original symptom when feasible.\n9. **Verify** — rerun the original reproduction, regression test, and relevant type\u002Flint checks.\n\n## Trace Deep Failures Backward\n\nTrace backward from the symptom:\n\n```text\nfailure \u003C- received input \u003C- caller output \u003C- earlier boundary \u003C- origin of invalid state\n```\n\nAt each boundary, record structured input\u002Foutput evidence and ask: what called this, where did its data come from, and what changed? Log stable identifiers and relevant fields; redact secrets. Do not add broad body logging or ten probes at once.\n\nIf an unknown test creates unwanted files or state, use the bundled `{baseDir}\u002Ffind-polluter.sh \u003Cpath-to-check> \u003Ctest-pattern>` to identify the first polluting test.\n\nUseful clues:\n\n| Symptom | First suspects |\n| --- | --- |\n| Dev\u002Fprod mismatch | config, data, dependency, race |\n| Only one user | identity, permissions, stored data |\n| Intermittent failure | timing, ordering, cache, race |\n| Recently regressed | recent change, deploy, schema, dependency |\n\n## Retry and Escalation\n\n- If an operation fails, reread current state; retry once only if failure may be transient, then use a fallback approach.\n- After two unsuccessful fixes, run a map-vs-territory check: reread the request, reproduction, and eliminated hypotheses.\n- After three failed fixes, stop and escalate the disputed assumption or architecture. Do not stack another patch.\n\n## Evidence Required\n\nRecord the reproduction, tested and eliminated hypotheses, confirmed root cause, changed invariant, regression guard, and verification commands. If the bug is non-reproducible or a guard is infeasible, report that limitation explicitly.\n",{"name":5,"description":7},"main","01207a96514af9f9c4d7d6cb594b936c6a9ddb10",".pi\u002Fskills\u002Fdebugging-and-error-recovery","https:\u002F\u002Fgithub.com\u002FMinhDuyDEV\u002Fmd-pikit","https:\u002F\u002Fgithub.com\u002FMinhDuyDEV","2026-08-20 02:00:33",{"source":8,"skillName":5,"commands":31,"prompt":41,"zipAvailable":42},[32,35,38],{"tool":33,"command":34},"npx","npx skills add MinhDuyDEV\u002Fmd-pikit --skill debugging-and-error-recovery",{"tool":36,"command":37},"bunx","bunx skills add MinhDuyDEV\u002Fmd-pikit --skill debugging-and-error-recovery",{"tool":39,"command":40},"pnpm","pnpm dlx skills add MinhDuyDEV\u002Fmd-pikit --skill debugging-and-error-recovery","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FMinhDuyDEV\u002Fmd-pikit\u002Fblob\u002Fmain\u002F.pi\u002Fskills\u002Fdebugging-and-error-recovery\u002FSKILL.md",true,[44],{"path":45,"resourceType":46,"resourceTypeDesc":47,"sizeBytes":48,"sourceHtmlUrl":49},"find-polluter.sh","SCRIPT","脚本",1528,"https:\u002F\u002Fgithub.com\u002FMinhDuyDEV\u002Fmd-pikit\u002Fblob\u002Fmain\u002F.pi\u002Fskills\u002Fdebugging-and-error-recovery\u002Ffind-polluter.sh",[51,58,65,72,79,86],{"skillNo":52,"name":53,"nameZh":6,"description":54,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":55,"categories":56,"keywords":57,"publishedAt":19},"01M7AVGJR1RSRVA3VJT8ZW4Y27","writing-skills","Use when creating new skills, editing existing skills, or verifying skills work before deployment - applies TDD to process documentation by testing with subagents before writing, iterating until bulletproof against rationalization. Includes complete pressure testing methodology.","https:\u002F\u002Fgithub.com\u002FMinhDuyDEV\u002Fmd-pikit\u002Fblob\u002Fmain\u002F.pi\u002Fskills\u002Fwriting-skills\u002FSKILL.md",[],[],{"skillNo":59,"name":60,"nameZh":6,"description":61,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":62,"categories":63,"keywords":64,"publishedAt":19},"01M7AVGE076BNB3J7JDBGAKD2T","verification-before-completion","Use when about to claim work is complete, fixed, or passing, before committing or creating PRs - requires running verification commands and confirming output before making any success claims; evidence before assertions always","https:\u002F\u002Fgithub.com\u002FMinhDuyDEV\u002Fmd-pikit\u002Fblob\u002Fmain\u002F.pi\u002Fskills\u002Fverification-before-completion\u002FSKILL.md",[],[],{"skillNo":66,"name":67,"nameZh":6,"description":68,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":69,"categories":70,"keywords":71,"publishedAt":19},"01M7AVGAYJ6APXRB9QWBG7482S","typescript-coding-standards","Use when writing, refactoring, or reviewing TypeScript code that needs strong domain modeling, typed errors, schema parsing, safe adapters, test seams, or maintainable module boundaries.","https:\u002F\u002Fgithub.com\u002FMinhDuyDEV\u002Fmd-pikit\u002Fblob\u002Fmain\u002F.pi\u002Fskills\u002Ftypescript-coding-standards\u002FSKILL.md",[],[],{"skillNo":73,"name":74,"nameZh":6,"description":75,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":76,"categories":77,"keywords":78,"publishedAt":19},"01M7AVG8CE5BTR2CRFPHHVJCJZ","test-driven-development","Use when implementing a feature, bugfix, or behavior-changing refactor — require a failing behavior test before production code, then make the smallest change that passes.","https:\u002F\u002Fgithub.com\u002FMinhDuyDEV\u002Fmd-pikit\u002Fblob\u002Fmain\u002F.pi\u002Fskills\u002Ftest-driven-development\u002FSKILL.md",[],[],{"skillNo":80,"name":81,"nameZh":6,"description":82,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":83,"categories":84,"keywords":85,"publishedAt":19},"01M7AVG5FJH3WTG9XR2G0608ND","source-driven-development","Use when unfamiliar libraries, dependency internals, external APIs, framework behavior, migrations, or current ecosystem guidance require official documentation, version-matched source, read the tests, and cited evidence.","https:\u002F\u002Fgithub.com\u002FMinhDuyDEV\u002Fmd-pikit\u002Fblob\u002Fmain\u002F.pi\u002Fskills\u002Fsource-driven-development\u002FSKILL.md",[],[],{"skillNo":87,"name":88,"nameZh":6,"description":89,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":90,"categories":91,"keywords":92,"publishedAt":19},"01M7AVG37PZ77CF35KAR6E93ZJ","security-and-hardening","Use when auditing security, implementing authentication or authorization, handling secrets, or validating data across external trust boundaries.","https:\u002F\u002Fgithub.com\u002FMinhDuyDEV\u002Fmd-pikit\u002Fblob\u002Fmain\u002F.pi\u002Fskills\u002Fsecurity-and-hardening\u002FSKILL.md",[],[]]