Help us improve
Share bugs, ideas, or general feedback.
From mthines-agent-skills
Forces a structured step-back analysis tracing the full execution path when isolated fixes fail. Useful for debugging, refactoring, or PR review with three modes.
npx claudepluginhub mthines/agent-skillsHow this skill is triggered — by the user, by Claude, or both
Slash command
/mthines-agent-skills:holistic-analysisThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
When this skill activates, STOP all incremental patching. Do not attempt another
Guides technical evaluation of code review feedback: read fully, restate for understanding, verify against codebase, respond with reasoning or pushback before implementing.
Share bugs, ideas, or general feedback.
When this skill activates, STOP all incremental patching. Do not attempt another narrow change. Instead, execute the full analysis protocol below before writing any code.
fix (default), refactor, or review (rule file)/confidence analysis or /confidence plan/confidence code gateCheck $ARGUMENTS for mode:
| Mode | Default | Use case |
|---|---|---|
fix | yes | Bug, broken behavior, failing test — something is wrong and needs root cause analysis |
refactor | Restructuring, cleanup, improvement — the code works but needs to be better | |
review | PR validation — does this diff implement what its description claims, and does the change make sense given how the changed code is used in the wider system? Returns structured findings for a reviewer agent to consume — not root-cause analysis. Streamlined three-phase flow that skips Phases 2–8; full procedure lives in rules/review-mode.md. |
The mode determines how certain phases are framed (noted inline below). fix and refactor walk the full eight-phase protocol in this file. review is a structurally different flow — see the rule file linked above.
Before analyzing, gather all relevant context:
git log -10 --oneline -- <file> and git diff HEAD~5 -- <file> to see what changed recentlyDo NOT skip any of these. The point is to build a complete mental model before reasoning.
After gathering context, walk through the execution path sequentially from entry to exit.
Create a numbered list of every step in the execution path:
## Execution Path: [name of the flow, e.g., "POST /api/v1/ingest"]
1. [file:line] Route registration / middleware entry
2. [file:line] Authentication middleware
3. [file:line] Request validation
4. [file:line] Business logic - step A
5. [file:line] Business logic - step B
6. [file:line] Database interaction
7. [file:line] Response construction
8. [file:line] Error handler / response send
For each step in the execution map, answer:
| Question | Answer |
|---|---|
| What does this block expect? | Input shape, preconditions, assumptions about prior state |
| What does this block guarantee? | Output shape, postconditions, side effects |
| Does the previous block's guarantee match this block's expectation? | YES / NO / PARTIALLY — explain any gaps |
| Are there implicit assumptions? | Types that aren't validated, null checks that are missing, ordering that isn't enforced |
| What happens on the unhappy path? | Error handling, edge cases, timeouts, empty inputs |
| Is there a "hole in the cheese" here? | A subtle issue that only matters in combination with other blocks |
After analyzing each block individually, check every boundary between blocks:
string that's supposed to be a UUID but nothing validates that)Produce a Walkthrough Summary before continuing:
## Execution Path Summary
### Health
- Total blocks analyzed: X
- Blocks with no issues: X
- Blocks with potential issues: X
- Contract boundary mismatches found: X
### Issues Found (ordered by severity)
#### Critical
- [block N → block N+1]: Description of the issue
#### Warning
- [block N]: Description of the concern
#### Info
- [block N]: Observation worth noting
### The Full Picture
[2-3 paragraphs explaining what the end-to-end analysis reveals that isolated
analysis would miss. Connect the dots across the entire chain.]
Based on step-back prompting research (Zheng et al., 2023 — up to 36% improvement over chain-of-thought).
Answer these questions explicitly in your thinking:
Based on rubber duck debugging protocol — forces externalization of hidden assumptions.
Before any analysis, state clearly:
Write this out explicitly. Do not skip to hypotheses.
Based on structured RCA frameworks and the 5 Whys technique.
Generate at least 3 distinct hypotheses for the root cause:
| # | Hypothesis | Supporting Evidence | Contradicting Evidence | Confidence |
|---|---|---|---|---|
| 1 | ... | ... | ... | low/med/high |
| 2 | ... | ... | ... | low/med/high |
| 3 | ... | ... | ... | low/med/high |
Then ask:
Generate at least 3 distinct refactoring approaches:
| # | Approach | Pros | Cons | Risk level |
|---|---|---|---|---|
| 1 | ... | ... | ... | low/med/high |
| 2 | ... | ... | ... | low/med/high |
| 3 | ... | ... | ... | low/med/high |
Then ask:
Based on metacognitive prompting research (Wang & Zhao, 2023 — up to 26.9% improvement).
Answer honestly:
Run the appropriate /confidence mode based on the analysis type:
/confidence analysisScores:
/confidence planScores:
Thresholds (both modes):
No code until this phase is complete.
Only now write code. After implementing:
/confidence code to validate the implementation:
/confidence code fix to auto-fix mechanical issues and re-assess.Present the analysis using this structure:
## Holistic Analysis
### Context Gathered
[List files read and key findings from each]
### Execution Path Walkthrough
[Full execution map from Phase 1]
[Per-block analysis table]
[Contract boundary findings]
[Walkthrough Summary with severity-ordered issues]
### Step Back: The Principle
[What general concept governs this code and what invariants must hold]
### The Situation (Scene Set)
[Fix mode: Expected / Actual / Gap / Prior attempts]
[Refactor mode: Current state / Desired state / Gap / Prior attempts]
### Hypotheses / Approaches
[Fix mode: Root cause hypothesis table from Phase 4]
[Refactor mode: Approach comparison table from Phase 4]
### Meta-Cognitive Check
[Key assumptions challenged, strongest counter-argument]
### Root Cause / Chosen Approach
[Fix mode: The identified root cause]
[Refactor mode: The selected approach and rationale]
### Analysis Confidence
[Fix mode: /confidence analysis score and breakdown]
[Refactor mode: /confidence plan score and breakdown]
### Change Plan
[Plain-language description, impact analysis, verification plan]
### Implementation Confidence (/confidence code)
[Score and dimension breakdown from Phase 8]