investigate

Diagnose bugs through root cause investigation before applying verified fixes.

2|Updated Mar 26, 2026
One-click install
npx skills add https://github.com/westkite1201/garden-engine --skill investigate-westkite1201
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: investigate
Source: https://github.com/westkite1201/garden-engine/tree/main/.claude/skills/gstack/investigate
Command: npx skills add https://github.com/westkite1201/garden-engine --skill investigate-westkite1201

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Debugging often devolves into whack-a-mole fixes that patch symptoms while the real defect survives. This Skill enforces a disciplined five-phase workflow — investigate, analyze, hypothesize, implement, verify — so every fix is grounded in a confirmed root cause and backed by a regression test. ## Core Features & Use Cases - Root Cause First: An Iron Law blocks any fix until symptoms, code paths, and recent git history have been traced to a testable hypothesis. - Scope Lock: Optionally freezes edits to the affected directory so debugging never drifts into unrelated refactors. - Pattern Matching & 3-Strike Rule: Matches bugs against known patterns (race conditions, null propagation, stale cache) and escalates after three failed hypotheses instead of guessing. - Use Case: A user reports "checkout fails intermittently in staging." The Skill gathers the stack trace, checks recent commits to the payment module, confirms a race condition hypothesis with a temporary log, applies a minimal fix, and adds a regression test that fails without it. ## Quick Start Ask the assistant to investigate why your application throws an error and find the root cause before fixing it.

Frequently Asked Questions about investigate

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I debug a bug systematically instead of guessing?

Follow a phased approach: collect symptoms and stack traces, trace the code path with grep, check recent git history for regressions, then form one testable hypothesis. Confirm it with a temporary log or assertion before writing any fix.

What is root cause analysis in software debugging?

Root cause analysis identifies the actual defect behind a symptom rather than patching surface behavior. The workflow outputs a specific, testable hypothesis, verifies it with evidence, then applies the smallest change that eliminates the problem.

How do I write a regression test for a bug fix?

Write a test that reproduces the original bug scenario and fails without the fix, then passes once the fix is applied. This proves both that the test is meaningful and that the fix actually resolves the root cause.

What should I do when multiple fix attempts keep failing?

Stop after three failed hypotheses — repeated failures signal an architectural problem, not a bad guess. Escalate for human review, continue with a new evidence-backed hypothesis, or add instrumentation and wait for the bug to recur.

Why does a bug work locally but fail in staging or production?

This pattern indicates configuration drift: differences in environment variables, feature flags, or database state between environments. Compare configuration across environments before investigating application code.