Back to Skills

root-cause-tracing-skill

Eibon7
Updated Yesterday
29 views
0
View on GitHub
Metadata

About

This skill systematically traces bugs backward through the call stack to identify the original source of invalid data or incorrect behavior. It is triggered for deep execution errors and guides you step-by-step from the symptom to the root cause. The process includes adding instrumentation like stack traces and using bisection when necessary to pinpoint the issue.

Quick Install

Claude Code

Recommended
Plugin CommandRecommended
/plugin add https://github.com/Eibon7/roastr-ai
Git CloneAlternative
git clone https://github.com/Eibon7/roastr-ai.git ~/.claude/skills/root-cause-tracing-skill

Copy and paste this command in Claude Code to install this skill

Documentation


name: root-cause-tracing-skill description: Use when errors occur deep in execution and you need to trace back to find the original trigger - systematically traces bugs backward through call stack, adding instrumentation when needed, to identify source of invalid data or incorrect behavior triggers:

  • "deep error"
  • "call stack"
  • "invalid data"
  • "wrong value"
  • "trace backward"
  • "bad value" used_by:
  • test-engineer
  • back-end-dev
  • systematic-debugging-skill steps:
  • paso1: "Observe the symptom carefully - note exact error message, stack trace, line numbers"
  • paso2: "Find immediate cause - what code directly causes this error?"
  • paso3: "Ask what called this - trace one level up in call chain"
  • paso4: "Continue tracing backward until finding original trigger"
  • paso5: "Add instrumentation if needed: console.error() with stack traces in test code"
  • paso6: "Run with bisection if needed to identify which test/path causes issue"
  • paso7: "Fix at source where invalid data originates, not at symptom point"
  • paso8: "Add defense-in-depth validation at multiple layers" output: |
  • Original trigger identified
  • Full trace documented showing call chain
  • Fix at source implemented
  • Defense-in-depth added at each layer
  • Bug becomes impossible to reproduce examples:
  • contexto: "git init runs in wrong directory (symptom: error deep in git operations)" trace: |
    1. Error: git init in /Users/project/packages/core
    2. Immediate cause: await execFileAsync('git', ['init'], { cwd: projectDir })
    3. Called by: WorktreeManager.createSessionWorktree(projectDir)
    4. Called by: Session.initializeWorkspace()
    5. Called by: Session.create()
    6. Called by: Project.create()
    7. Original trigger: Project.create() called with empty tempDir
    8. Fix: Made tempDir a getter that throws if accessed before beforeEach defense_in_depth:
    • Layer 1: Project.create() validates directory
    • Layer 2: WorkspaceManager validates not empty
    • Layer 3: NODE_ENV guard
    • Layer 4: Stack trace logging
  • contexto: "Database query fails with invalid parameter" trace: |
    1. Error: Invalid parameter in query
    2. Immediate: Database query with NULL value
    3. Called by: ShieldService.executeAction()
    4. Called by: AnalyzeToxicityWorker.process()
    5. Called by: Worker.run()
    6. Original trigger: Worker receives incomplete context from API
    7. Fix: Added validation in context parsing + default values principle:
  • "NEVER fix just where error appears"
  • "Trace backward until finding original trigger"
  • "Fix at source + add validation at each layer" instrumentacion:
  • "Use console.error() not logger in tests"
  • "Log before dangerous operation, not after"
  • "Include full context: directory, cwd, env vars, timestamps"
  • "Capture stack: new Error().stack shows complete call chain" bisection_script:
  • "Use find-polluter.sh script when multiple tests could be culprit"
  • "./find-polluter.sh '.git' 'src/**/*.test.ts'"
  • "Runs tests one-by-one, stops at first polluter" referencias:
  • "Fuente: superpowers-skills/root-cause-tracing"
  • "Completa: systematic-debugging-skill"
  • "Roastr: Útil para debugging multi-layer (API → service → DB)"

GitHub Repository

Eibon7/roastr-ai
Path: .claude/skills/root-cause-tracing-skill.md

Related Skills

content-collections

Meta

This skill provides a production-tested setup for Content Collections, a TypeScript-first tool that transforms Markdown/MDX files into type-safe data collections with Zod validation. Use it when building blogs, documentation sites, or content-heavy Vite + React applications to ensure type safety and automatic content validation. It covers everything from Vite plugin configuration and MDX compilation to deployment optimization and schema validation.

View skill

hybrid-cloud-networking

Meta

This skill configures secure hybrid cloud networking between on-premises infrastructure and cloud platforms like AWS, Azure, and GCP. Use it when connecting data centers to the cloud, building hybrid architectures, or implementing secure cross-premises connectivity. It supports key capabilities such as VPNs and dedicated connections like AWS Direct Connect for high-performance, reliable setups.

View skill

llamaindex

Meta

LlamaIndex is a data framework for building RAG-powered LLM applications, specializing in document ingestion, indexing, and querying. It provides key features like vector indices, query engines, and agents, and supports over 300 data connectors. Use it for document Q&A, chatbots, and knowledge retrieval when building data-centric applications.

View skill

csv-data-summarizer

Meta

This skill automatically analyzes CSV files to generate comprehensive statistical summaries and visualizations using Python's pandas and matplotlib/seaborn. It should be triggered whenever a user uploads or references CSV data without prompting for analysis preferences. The tool provides immediate insights into data structure, quality, and patterns through automated analysis and visualization.

View skill