# Principle fix root causes

> Principle fix root causes is an open-source agent skill for developer tools. Guides the agent to trace bugs to their first wrong decision and fix them there. It is available on Claude Code.

- **Kind:** Skill
- **Pricing:** Open source
- **Platforms:** Claude Code
- **Website:** https://github.com/michael-denyer/pstack-claude/tree/main/plugins/pstack/skills/principle-fix-root-causes
- **Repository:** https://github.com/michael-denyer/pstack-claude
- **GitHub stars:** 5,057
- **License:** MIT
- **Skill name:** principle-fix-root-causes
- **Collection:** https://github.com/michael-denyer/pstack-claude
- **Categories:** [developer tools](https://ai-powered.com/categories/developer-tools)
- **Listing updated:** 2026-12-01

## About

This skill shapes how the agent approaches debugging. Instead of patching the spot where a failure becomes visible, it pushes the agent to follow each symptom backwards until it reaches the first point where the system did something it should not have, or failed to handle a state it should have handled.

The workflow starts with reproducing the problem and repeatedly asking why until the answer is a concrete wrong decision in the code. When the cause is unclear, the agent is told to add instrumentation and read the actual runtime state rather than guess. The skill also asks whether the troublesome state is legitimate. If it is, the code should handle it where it broke; if it should never exist, the agent looks for whatever produced it, since guards, retries, swallowed errors, clamped values and discarded state can hide the real fault.

The skill also covers fixing the whole pattern rather than one instance, searching for other places with the same fault, and suggesting a cheap, always-on signal that would have revealed a hard-to-find cause at first glance. It needs no scripts or special tools and is written as a plain instruction file for Claude Code.

## When your agent uses it

> Apply when debugging. Trace each symptom back to the first place the system went wrong and fix it there. A guard is a fix only when the state it handles is legitimate.

## What it can access

From a static check of the files on GitHub; nothing was run.

- [Instructions only, no scripts](https://github.com/michael-denyer/pstack-claude/tree/HEAD/plugins/pstack/skills/principle-fix-root-causes)
- [License: MIT](https://github.com/michael-denyer/pstack-claude/tree/HEAD/plugins/pstack/skills/principle-fix-root-causes)

## Features

- **Trace symptoms to origin:** Follows each failure backwards to the first place the system went wrong instead of the place it surfaced.
- **Legitimate state check:** Decides whether a troublesome state should be handled where it broke or traced to its source.
- **Guard and workaround review:** Flags guards, retries, swallowed errors and clamped values that can mask a real bug.
- **Pattern-wide fixes:** Encourages finding and correcting every place sharing the same fault, not just one instance.
- **Instrument before guessing:** Recommends adding instrumentation and reading actual state when the cause is not obvious.
- **Early warning signals:** Suggests lightweight, always-on signals that would have exposed a deep cause at first look.

## Good for

- Track down why a function returns bad data even though the error appears elsewhere
- Find the real source of a null value that crashes a downstream component
- Fix a race condition instead of adding a retry around the failing call
- Review a bug fix to check whether it hides an upstream fault
- Locate every code path that shares the same faulty pattern after one bug is found

## Install

### Claude Code

This skill ships in the `pstack` plugin. In Claude Code, add the marketplace and install the plugin (it may include other skills too):

```sh
/plugin marketplace add michael-denyer/pstack-claude
/plugin install pstack@pstack-claude
```

Or copy only this skill to `~/.claude/skills/principle-fix-root-causes`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/michael-denyer/pstack-claude.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/principle-fix-root-causes &&
cp -R "$tmp/plugins/pstack/skills/principle-fix-root-causes" ~/.claude/skills/principle-fix-root-causes &&
rm -rf "$tmp"
```

For one project only, put the folder in `.claude/skills/principle-fix-root-causes` inside it instead.

### Codex

Copy the skill folder to `~/.agents/skills/principle-fix-root-causes` to use it in every repository:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/michael-denyer/pstack-claude.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/principle-fix-root-causes &&
cp -R "$tmp/plugins/pstack/skills/principle-fix-root-causes" ~/.agents/skills/principle-fix-root-causes &&
rm -rf "$tmp"
```

For one repository only, put the folder in `.agents/skills/principle-fix-root-causes` inside it instead.

### Cursor

Copy the skill folder to `~/.cursor/skills/principle-fix-root-causes` to use it in every project:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/michael-denyer/pstack-claude.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/principle-fix-root-causes &&
cp -R "$tmp/plugins/pstack/skills/principle-fix-root-causes" ~/.cursor/skills/principle-fix-root-causes &&
rm -rf "$tmp"
```

For one project only, put the folder in `.cursor/skills/principle-fix-root-causes` inside it instead.

### Gemini CLI

Run in a terminal (add `--scope workspace` to install it for the current workspace only):

```sh
gemini skills install https://github.com/michael-denyer/pstack-claude.git --path plugins/pstack/skills/principle-fix-root-causes
```

Or copy the folder to `~/.gemini/skills/principle-fix-root-causes` yourself.

### VS Code

For GitHub Copilot in VS Code, copy the skill folder to `~/.copilot/skills/principle-fix-root-causes`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/michael-denyer/pstack-claude.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/principle-fix-root-causes &&
cp -R "$tmp/plugins/pstack/skills/principle-fix-root-causes" ~/.copilot/skills/principle-fix-root-causes &&
rm -rf "$tmp"
```

For one project only, put the folder in `.github/skills/principle-fix-root-causes` inside it instead.

### Other agents

Get the folder:

```sh
git clone --depth 1 https://github.com/michael-denyer/pstack-claude.git
```

Then copy `pstack-claude/plugins/pstack/skills/principle-fix-root-causes` into your agent's skills folder as `principle-fix-root-causes`. Agents that support SKILL.md read one folder per skill.

## FAQ

### When does Principle fix root causes trigger?

It is described as applying when the agent is debugging, and it is set to be non-user-invocable, so it loads based on the task matching its description.

### Does Principle fix root causes need any scripts or tools?

No scripts are included and no allowed tools are set. It consists of a SKILL.md instruction file and one supporting file.

### Where does Principle fix root causes work?

It is distributed as a Claude Code plugin through the pstack-claude marketplace.

### How do I install Principle fix root causes in Claude Code?

Copy the skill folder from GitHub to ~/.claude/skills/principle-fix-root-causes to use it in all your projects, or to .claude/skills/principle-fix-root-causes in one project. Or install the pstack plugin, which includes it: /plugin marketplace add michael-denyer/pstack-claude, then /plugin install pstack@pstack-claude.

### Does Principle fix root causes run scripts?

No. It is instructions only, with no scripts. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.

### Which AI agents can use Principle fix root causes?

Claude Code. It reads skills in the SKILL.md format; the install steps on this page show where to put the folder.

### What are the best alternatives to Principle fix root causes?

The closest alternatives to Principle fix root causes are Debug, Diagnostic reasoning, Bug fix, Principle attack the premise and Correct.

## Where this comes from

- Description: from the skill's own SKILL.md.

## Alternatives

- [Debug](https://ai-powered.com/skills/debug-jasgujral): Debug is an open-source agent skill for developer tools.
- [Diagnostic reasoning](https://ai-powered.com/skills/diagnostic-reasoning): Diagnostic reasoning is an open-source agent skill for developer tools.
- [Bug fix](https://ai-powered.com/skills/bug-fix): Bug fix is an open-source agent skill for developer tools.
- [Principle attack the premise](https://ai-powered.com/skills/principle-attack-the-premise): Principle attack the premise is an open-source agent skill for developer tools.
- [Correct](https://ai-powered.com/skills/correct): Correct is an open-source agent skill for developer tools.
- [TDD](https://ai-powered.com/skills/tdd-michael-denyer): TDD is an open-source agent skill for developer tools.
- [Agent introspection debugging](https://ai-powered.com/skills/agent-introspection-debugging): Agent introspection debugging is an open-source agent skill for developer tools.
- [Ci](https://ai-powered.com/skills/ci-chachamaru127): Ci is an open-source agent skill for developer tools.

---
Source: https://ai-powered.com/skills/principle-fix-root-causes
