agentsclimarketplace

Find root cause

Skill Marycka9/oh-my-claude-obsidian/skills/find-root-cause

Investigate a bug, error, or unexpected behavior to identify the root cause and responsible code, with anti-hallucination discipline - challenges whether the reported issue is actually a bug and concludes A (bug confirmed), B (not a bug), or C (inconclusive) with an explicit confidence level. Use for diagnosing errors, failures, or "why does X happen" questions, standalone or as the first phase of task-planning's bug-investigation flow. Do not use for implementing fixes (it diagnoses; the TDD fix prompt it emits at high confidence is the handoff), reviewing diffs (code-review), or verifying implementations (task-verification).From its SKILL.md

Install
npx -y skills add Marycka9/oh-my-claude-obsidian --skill find-root-cause

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

SKILL.md

12.3 KB, as published. Nobody here has run it

find-root-cause

Investigates objectively, challenges assumptions, and reaches an honest conclusion — even if that conclusion is "this is not a bug" or "cannot determine root cause with available info."

Shared references: config-resolution, obsidian-format, handoff.

Critical principle: Not every reported issue is a bug. The user's report is a hypothesis, not ground truth.

Arguments

/find-root-cause                              (user describes the issue in conversation)
/find-root-cause "error X happens when Y"     (brief description as argument)

Also invoked programmatically by task-planning (bug-investigation sub-flow) with task context.

Step 1 — Configuration and context load

Resolve configuration

Per config-resolution: registry lookup by cwd or explicit project. If the project is not in the registry, proceed without vault context (standalone diagnostic mode) — the investigation itself needs only the code. Never read the code repo's CLAUDE.md.

Load project context (skip each silently if missing)

  1. {base_path}/_about.md frontmatter + body — stack info, conventions, knowledge_deps.
  2. {base_path}/hot.md — current project state.
  3. {base_path}/topics/Architecture Overview.md — if it exists.
  4. Recent decisions — frontmatter of the 5 most recent files in {base_path}/decisions/.
  5. {base_path}/guides/_index.md — note which guides exist (e.g. a review profile with known anti-patterns can hint at recurring bug classes).

Report briefly what context was loaded, then proceed.

Step 2 — Gather information

If information is insufficient, ask the user for:

  • Exact error message or unexpected behavior
  • Stack traces or logs (if available)
  • Steps to reproduce
  • When the issue started (recent change? always?)
  • Relevant context (specific user, environment, data)

Important: if critical info is missing, request it once. Do not proceed on guesswork.

Step 3 — Challenge the bug report

Before diving into code, critically evaluate whether this is actually a bug:

  1. Verify expected behavior: Is the user's expectation correct? Check documentation, specs, or intended design.
  2. Consider alternative explanations: user error or misconfiguration? Expected behavior that is poorly documented? Environmental (network, permissions, data quality)? Is reproduction reliable or intermittent?
  3. Identify information gaps: what is missing that would confirm or rule out a bug?
  4. Form a preliminary assessment: real bug, expected behavior, or unclear?

If the reported behavior may be expected or the result of misconfiguration — say so clearly before proceeding.

Step 4 — Runtime tool detection

tools:
  gopls: available | unavailable
  pyright: available | unavailable
  tsserver: available | unavailable

Use semantic tools if available (faster, more accurate). Fall back to Grep + Read otherwise. Never fail because a tool is missing.

Step 5 — Analyze the symptoms

  1. Parse error messages/stack traces for clues (file names, line numbers, function names)
  2. Identify keywords, error codes, patterns to guide the search
  3. Form initial hypotheses about possible causes

Step 6 — Locate relevant code

  1. Search for error messages, function names, identifiers mentioned in the error
  2. Trace the code path from symptom back to source
  3. Identify the responsible component, service, or module

If invoked from task-planning: also read the task topic, related decisions, and related topics — the symptom may be connected to recent work.

Step 7 — Investigate root cause

  1. Read and understand the code flow leading to the issue — whole functions and their call sites, not isolated fragments
  2. Look for common causes: edge cases, race conditions, null values, incorrect assumptions, missing validation
  3. Check recent changes to relevant files (git log, git blame)
  4. Verify the hypothesis by tracing the logic end to end
  5. Challenge your own conclusion: could there be another explanation? Have you ruled out alternatives?

Step 8 — Report findings

The investigation must lead to one of three conclusions, stated clearly at the top of the report:

  • A. Bug Confirmed — genuine bug with identifiable root cause
  • B. Not a Bug — reported behavior is expected, by design, or due to user error/misconfiguration
  • C. Inconclusive — cannot determine whether it is a bug or identify the root cause with available info

Conclusion B — Not a Bug

# Investigation: <issue>

## Conclusion: B -- Not a Bug

## What was reported
<Brief description of the reported issue>

## What we found
<Why this is not a bug>

## Evidence
<Code, documentation, or logic demonstrating expected behavior>

## Recommendation
<What the user should do instead -- update configuration, read docs, adjust expectations>

Conclusion C — Inconclusive

# Investigation: <issue>

## Conclusion: C -- Inconclusive

## What was investigated
<Summary of analysis performed>

## What remains unclear
<Specific questions or gaps preventing a definitive conclusion>

## Possible hypotheses
- <Hypothesis 1> -- could not be confirmed because <reason>
- <Hypothesis 2> -- could not be ruled out because <reason>

## What would help
<Specific info, logs, reproduction steps, or access needed>

## Suggested next steps
<Concrete actions to gather the missing information>

Conclusion A — Bug Confirmed

# Investigation: <issue>

## Conclusion: A -- Bug Confirmed

## Confidence Level

**High** | **Medium** | **Low**

Briefly explain what would increase confidence if not High.

- **High:** clear evidence, reproducible path, root cause certain
- **Medium:** strong hypothesis supported by code analysis, some assumptions untested
- **Low:** multiple possible causes, limited information, or requires further investigation

## Location

- **Component/Service:** <which part of the application>
- **File(s):** <specific paths>
- **Function(s):** <where the issue originates>

## Root Cause

<What is causing the issue, in clear terms>

## Evidence

<Relevant code and why it causes the observed behavior>

## Plain-Language Summary

For non-technical stakeholders:

- **Where in the system:** <front-end / back-end / data pipeline / etc.>
- **What is happening:** <problem from the user perspective, no jargon>
- **Why is it happening:** <cause, no technical terms, analogies if helpful>
- **What is the impact:** <effect on users or business>
- **Estimated effort:** Low (quick, isolated fix) | Medium (careful changes across a few areas) | High (significant refactoring)
- **Complexity:** Low (straightforward) | Medium (some dependencies/edge cases) | High (complex logic, many moving parts, risk of side effects)

## Suggested Next Steps

- Straightforward fix: describe what needs to change
- More investigation needed: what to look at next
- Deeper architectural issue: explain the trade-offs

TDD Fix Prompt (ONLY if confidence is High)

Do not include this section if confidence is Medium or Low. For Medium/Low, instead explain what additional investigation is needed before a fix can be reliably implemented.

For High confidence, generate a structured prompt. The fix workflow is RED-first TDD: the failing test comes before any fix code.

## Bug Summary
<One sentence describing the bug>

## Root Cause
<Concise explanation of why the bug occurs>

## Location
- File(s): <paths with line numbers>
- Function(s): <names>
- Component: <service/module>

## Current Behavior
<What the code currently does -- the bug>

## Expected Behavior
<What the code should do instead>

## Reproduction Context
<Key conditions or inputs that trigger the bug>

## Fix Workflow (RED-first — follow in order)
1. RED: write a failing test that reproduces this bug BEFORE touching the fix.
   <Concrete test hint: "Test that X returns Y when given Z">
   Run it and confirm it FAILS for the reason described in Root Cause —
   a test that passes immediately does not reproduce the bug; stop and revisit.
2. GREEN: make the minimal change that turns the test green.
   <Brief description of what needs to change, no implementation details>
3. Run the full test suite to confirm no regressions.

Integration with task-planning

When task-planning detects task type bug-investigation, it invokes find-root-cause as the first phase, before planning the fix:

  1. User: /task-planning "Fix X bug"
  2. task-planning detects bug-investigation and invokes find-root-cause with task context
  3. find-root-cause returns Conclusion A/B/C
  4. task-planning proceeds based on the conclusion:
    • A, High confidence: proceed with the standard planning flow using find-root-cause's location/evidence as input
    • A, Medium/Low: task-planning asks the user whether to proceed with a low-confidence fix or gather more info
    • B: task-planning stops, presents the conclusion, asks the user to reconsider the task
    • C: task-planning stops, presents the conclusion with suggested next steps, asks the user to gather info before planning

Anti-hallucination discipline (concrete rules)

  1. Do not propose fixes unless asked. Understand and explain the root cause first.
  2. Be honest when you cannot find a bug or determine the root cause. A thorough "inconclusive" report is more valuable than a speculative diagnosis.
  3. No TDD fix prompts for Medium or Low confidence. Risks fixing the wrong thing.
  4. Challenge the user's framing. "There's a bug in X" means investigate whether X actually has a bug, not assume it does.
  5. Evidence-based. Every claim is backed by a specific code reference or documentation.
  6. Three-way conclusion is non-negotiable. Never pretend you found a bug when you did not. Never pretend you are sure when you are not.
  7. "I don't know" is a valid answer. Option C exists for this reason. Use it.

Edge cases

  • Insufficient information — ask once for the specific missing info; do not proceed until critical gaps are filled, OR conclude C with a detailed "what would help" section.
  • User insists it is a bug but evidence says otherwise — present Conclusion B with full evidence; do not capitulate to pressure. New info from the user is welcome — re-analyze.
  • Multiple possible root causes — either A with Medium confidence (one cause more likely) or C (causes equally probable). Surface all candidates with ruling-in/ruling-out evidence.
  • Ambiguous evidence — default to lower confidence; do not force a conclusion.
  • Intermittent / not reproducible — often C; suggest data collection to improve reproducibility. If a pattern can be inferred, may upgrade to A with Low/Medium confidence.

Rules

  • The primary deliverable is understanding, not a fix. Do not conflate them.
  • Challenge the framing. The report is a hypothesis, not ground truth.
  • Confidence levels are real. High/Medium/Low gate the TDD fix prompt downstream.
  • Three-way conclusion. A/B/C — all equally valid outcomes.
  • Evidence-based. Every claim cites code or documentation.
  • Stack-agnostic core. Stack specifics come from the vault (_about.md, guides), never from the code repo's CLAUDE.md.
  • Anti-hallucination discipline is core, not decorative.

After the report, end with the handoff block (conclusion line first). Typical Next: Conclusion A High -> run the TDD fix prompt (via /task-planning if the fix is nontrivial); C -> gather the listed info and re-run. This skill writes nothing to the vault; if the investigation is worth preserving, suggest /obsidian-topic or /obsidian-session.

Keep looking

Skills are one crate of 607,533. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.