[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7EKCA3JSAKDVP8TA2BN60DC":3,"skill-same:01M7EKCA3JSAKDVP8TA2BN60DC":48},{"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":26,"commitSha":27,"skillDirectory":28,"forksCount":14,"repositoryHtmlUrl":29,"repositoryHomepageUrl":6,"ownerHtmlUrl":30,"ownerBlogUrl":31,"ownerDescription":32,"updatedAt":33,"install":34,"resources":47},"01M7EKCA3JSAKDVP8TA2BN60DC","root-cause",null,"Traces a bug backward through the call chain to the original trigger instead of patching where the error surfaces, then fixes it at the source and adds defensive validation at intermediate layers. Use when debugging an error, a failing test, or unexpected behavior where the symptom appears far from its cause.","razorvision\u002Fclara-skills","razorvision","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F11950812?v=4","01M7EKAE3CT4VN0CGC4GR8ZFAP","Razorvision Consulting","01M7EKAE3Z8WT4D2X0K2488E9V",0,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Frazorvision\u002Fclara-skills\u002Fblob\u002Fmain\u002Fskills\u002Froot-cause\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: root-cause\ndescription: Traces a bug backward through the call chain to the original trigger instead of patching where the error surfaces, then fixes it at the source and adds defensive validation at intermediate layers. Use when debugging an error, a failing test, or unexpected behavior where the symptom appears far from its cause.\nlicense: Apache-2.0\nmetadata:\n  version: \"0.1.0\" # x-release-please-version\n  owner: razorvision\n---\n\n# Root Cause Tracing\n\nA bug is reported where it becomes visible, which is rarely where it starts. Walk the bad value or state back to the line that first produced it, fix that line, and only then add guards on the way down.\n\n## The rule\n\nDo not change the line that throws until you can name the line that first produced the bad value. A guard at the symptom hides the bug from everything else that reads the same value.\n\n## The trace\n\n1. **Pin down the failure.** Record the exact error, the input that triggers it, and what should have happened instead. If you cannot reproduce it, make reproducing it the first task.\n2. **Find the failing line.** Use the stack trace or error location to find the statement that failed, and write down the value that was wrong at that point.\n3. **Move up one frame.** Find the caller that passed the wrong value in. Read the code there; do not assume.\n4. **Repeat until the value is born.** At each frame, decide which is true:\n   - the value arrived wrong from the caller (keep going up), or\n   - the value was computed, defaulted or mutated wrongly here (this is the origin).\n   Stop when you reach the origin, not when you reach a plausible place to add a check.\n5. **Fix the origin, then defend.** Correct the code that produced the value. Then add validation at the boundaries the value crossed, so the next bad value fails loudly near its source.\n6. **Prove it.** Add a test that fails on the original input before the fix and passes after it.\n\n## Example\n\n```\nSymptom:  invoice PDF shows a total of NaN\n  \u003C- renderTotal(total) receives NaN\n    \u003C- invoiceTotal(lines) sums line.amount\n      \u003C- one line has amount: undefined\n        \u003C- ORIGIN: the CSV importer maps the column \"Amount \" (trailing space),\n           so rows from one bank's export never set amount\n```\n\n- **Symptom fix (wrong):** `renderTotal` prints 0 when the total is NaN. Every other report still sums undefined.\n- **Origin fix (right):** the importer trims header names and rejects a row with no amount.\n- **Defense:** `invoiceTotal` throws when a line has a non-numeric amount, naming the line id.\n\n## When the chain is hard to follow\n\nAdd short-lived logging that captures the value and who passed it, placed before the operation rather than in the error handler:\n\n```typescript\nconsole.error(\"[trace] invoiceTotal input\", { count: lines.length, sample: lines[0] });\nconsole.error(\"[trace] caller\", new Error().stack);\n```\n\n- Print to stderr in tests, since test runners often silence the app logger.\n- Log identifiers and shapes, not secrets or full customer records.\n- Remove the logging once the origin is found.\n\n## Signs you stopped too early\n\n- The fix is a null check, default value or try\u002Fcatch at the line that threw.\n- You cannot say which earlier line produced the bad value.\n- The same symptom could still appear through another caller.\n\nAny of these means: keep tracing.\n\n## Common origins\n\n| Symptom | Where to look first |\n|---|---|\n| `undefined` or `null` deep in a call chain | Initialization order, a missing field mapping, an optional field treated as required |\n| Wrong format or units | The nearest parse, serialize or conversion step upstream |\n| Intermittent failure | Shared mutable state, a missing `await`, test order dependence |\n| Passes locally, fails in CI | Environment variables, timezone, locale, file ordering |\n| Wrong value only for some records | The import or migration that wrote those records |\n","# Root Cause Tracing\n\nA bug is reported where it becomes visible, which is rarely where it starts. Walk the bad value or state back to the line that first produced it, fix that line, and only then add guards on the way down.\n\n## The rule\n\nDo not change the line that throws until you can name the line that first produced the bad value. A guard at the symptom hides the bug from everything else that reads the same value.\n\n## The trace\n\n1. **Pin down the failure.** Record the exact error, the input that triggers it, and what should have happened instead. If you cannot reproduce it, make reproducing it the first task.\n2. **Find the failing line.** Use the stack trace or error location to find the statement that failed, and write down the value that was wrong at that point.\n3. **Move up one frame.** Find the caller that passed the wrong value in. Read the code there; do not assume.\n4. **Repeat until the value is born.** At each frame, decide which is true:\n   - the value arrived wrong from the caller (keep going up), or\n   - the value was computed, defaulted or mutated wrongly here (this is the origin).\n   Stop when you reach the origin, not when you reach a plausible place to add a check.\n5. **Fix the origin, then defend.** Correct the code that produced the value. Then add validation at the boundaries the value crossed, so the next bad value fails loudly near its source.\n6. **Prove it.** Add a test that fails on the original input before the fix and passes after it.\n\n## Example\n\n```\nSymptom:  invoice PDF shows a total of NaN\n  \u003C- renderTotal(total) receives NaN\n    \u003C- invoiceTotal(lines) sums line.amount\n      \u003C- one line has amount: undefined\n        \u003C- ORIGIN: the CSV importer maps the column \"Amount \" (trailing space),\n           so rows from one bank's export never set amount\n```\n\n- **Symptom fix (wrong):** `renderTotal` prints 0 when the total is NaN. Every other report still sums undefined.\n- **Origin fix (right):** the importer trims header names and rejects a row with no amount.\n- **Defense:** `invoiceTotal` throws when a line has a non-numeric amount, naming the line id.\n\n## When the chain is hard to follow\n\nAdd short-lived logging that captures the value and who passed it, placed before the operation rather than in the error handler:\n\n```typescript\nconsole.error(\"[trace] invoiceTotal input\", { count: lines.length, sample: lines[0] });\nconsole.error(\"[trace] caller\", new Error().stack);\n```\n\n- Print to stderr in tests, since test runners often silence the app logger.\n- Log identifiers and shapes, not secrets or full customer records.\n- Remove the logging once the origin is found.\n\n## Signs you stopped too early\n\n- The fix is a null check, default value or try\u002Fcatch at the line that threw.\n- You cannot say which earlier line produced the bad value.\n- The same symptom could still appear through another caller.\n\nAny of these means: keep tracing.\n\n## Common origins\n\n| Symptom | Where to look first |\n|---|---|\n| `undefined` or `null` deep in a call chain | Initialization order, a missing field mapping, an optional field treated as required |\n| Wrong format or units | The nearest parse, serialize or conversion step upstream |\n| Intermittent failure | Shared mutable state, a missing `await`, test order dependence |\n| Passes locally, fails in CI | Environment variables, timezone, locale, file ordering |\n| Wrong value only for some records | The import or migration that wrote those records |\n",{"name":5,"license":15,"metadata":24,"description":7},{"owner":9,"version":25},"0.1.0","main","0e72138c24cb36f409dcf3abe74fd283ebdfe998","skills\u002Froot-cause","https:\u002F\u002Fgithub.com\u002Frazorvision\u002Fclara-skills","https:\u002F\u002Fgithub.com\u002Frazorvision","http:\u002F\u002Fwww.razorvision.net","Software services firm with a focus in the finance industry.","2026-11-08 06:34:17",{"source":8,"skillName":5,"commands":35,"prompt":45,"zipAvailable":46},[36,39,42],{"tool":37,"command":38},"npx","npx skills add razorvision\u002Fclara-skills --skill root-cause",{"tool":40,"command":41},"bunx","bunx skills add razorvision\u002Fclara-skills --skill root-cause",{"tool":43,"command":44},"pnpm","pnpm dlx skills add razorvision\u002Fclara-skills --skill root-cause","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Frazorvision\u002Fclara-skills\u002Fblob\u002Fmain\u002Fskills\u002Froot-cause\u002FSKILL.md",true,[],[49,56,62,69,76,83],{"skillNo":50,"name":51,"nameZh":6,"description":52,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":53,"categories":54,"keywords":55,"publishedAt":19},"01M7EKD05TFNCAT51YJ7VV486B","\u003Cfolder-name-lowercase-hyphens>","\u003CWhat it does. Use when the user asks for \u003CX> or mentions \u003CY>.>","https:\u002F\u002Fgithub.com\u002Frazorvision\u002Fclara-skills\u002Fblob\u002Fmain\u002Ftemplates\u002Fminimal-skill\u002FSKILL.md",[],[],{"skillNo":57,"name":58,"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":59,"categories":60,"keywords":61,"publishedAt":19},"01M7EKCZ8AM1YBKFSH7JNK097P","full-skill","https:\u002F\u002Fgithub.com\u002Frazorvision\u002Fclara-skills\u002Fblob\u002Fmain\u002Ftemplates\u002Ffull-skill\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},"01M7EKCVJ2RBJ72MSFZ87DV801","typescript","Guides TypeScript best practices for strict-mode projects, covering discriminated unions, interface contracts, nullability, type guards, utility types, async return types, const assertions, and a review checklist of common anti-patterns. Use when writing, reviewing, or debugging TypeScript code or type definitions.","https:\u002F\u002Fgithub.com\u002Frazorvision\u002Fclara-skills\u002Fblob\u002Fmain\u002Fskills\u002Ftypescript\u002FSKILL.md",[],[],{"skillNo":70,"name":71,"nameZh":6,"description":72,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":73,"categories":74,"keywords":75,"publishedAt":19},"01M7EKCPAS3BDDTPZP8GZE4CR8","testing","Guides writing, reviewing, and debugging Vitest tests for JavaScript and TypeScript projects, covering test structure, async handling, mocking, error cases, setup and teardown, and a review checklist of common anti-patterns. Use when writing new tests, reviewing a test file, or debugging a failing or flaky Vitest suite. Not for Python test suites.","https:\u002F\u002Fgithub.com\u002Frazorvision\u002Fclara-skills\u002Fblob\u002Fmain\u002Fskills\u002Ftesting\u002FSKILL.md",[],[],{"skillNo":77,"name":78,"nameZh":6,"description":79,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":80,"categories":81,"keywords":82,"publishedAt":19},"01M7EKCHY6AN7HRM7DV6DD7MST","staleness-check","Sweeps the repo and related sources for artifacts that a just-completed body of work should have updated but did not, such as stale doc indexes, READMEs, ADRs, registries, agent instruction files, agent memory files, issue status, and cross-references, then reports each stale item with a proposed fix. Use at the end of an epic, feature, or executed plan, or when the user says \"staleness check\", \"did we miss anything\", \"are we done\", or \"anything stale\".","https:\u002F\u002Fgithub.com\u002Frazorvision\u002Fclara-skills\u002Fblob\u002Fmain\u002Fskills\u002Fstaleness-check\u002FSKILL.md",[],[],{"skillNo":84,"name":85,"nameZh":6,"description":86,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":87,"categories":88,"keywords":89,"publishedAt":19},"01M7EKCDGZQCRDC6DRXYEJMR66","software-architecture","Guides architectural decisions using Clean Architecture, separation of concerns, and SOLID principles, covering where new code should live, how modules depend on each other, and which anti-patterns to avoid, with a review checklist. Use when designing a new module or feature structure, refactoring code organization, deciding where code belongs, or reviewing a codebase's architecture.","https:\u002F\u002Fgithub.com\u002Frazorvision\u002Fclara-skills\u002Fblob\u002Fmain\u002Fskills\u002Fsoftware-architecture\u002FSKILL.md",[],[]]