---
name: Diagnose Before Plan
slug: diagnose-before-plan
category: AI Engineering
description: A diagnostic workflow that performs root cause analysis on bugs, test failures, CI issues, and incidents before deciding whether to create a fix plan. It guides the user through evidence inspection and RCA summary, then offers to proceed with a scoped plan.
github: "https://github.com/Optim-Agent/optim-plans/tree/main/skills/diagnose-before-plan"
language: Python
stars: 489
forks: 1
install: "npx degit https://github.com/Optim-Agent/optim-plans/tree/main/skills/diagnose-before-plan ~/.claude/skills/diagnose-before-plan"
installs_to: ~/.claude/skills/diagnose-before-plan
source_path: skills/diagnose-before-plan/SKILL.md
collection_size: 5
category_size: 2451
collection_url: "https://dirskills.com/collections/Optim-Agent/optim-plans"
added: 2026-08-11T07:20:27.751Z
last_synced: 2026-08-11T07:20:27.751Z
canonical_url: "https://dirskills.com/skills/diagnose-before-plan"
---

# Diagnose Before Plan

A diagnostic workflow that performs root cause analysis on bugs, test failures, CI issues, and incidents before deciding whether to create a fix plan. It guides the user through evidence inspection and RCA summary, then offers to proceed with a scoped plan.

**Install:**

```bash
npx degit https://github.com/Optim-Agent/optim-plans/tree/main/skills/diagnose-before-plan ~/.claude/skills/diagnose-before-plan
```

## README

# Diagnose Before Plan

Use this skill for problem or failure inputs that need diagnosis before planning.

## Setup

1. Read `../_shared/references/prime-planning-workflow.md`, `../_shared/references/state-and-config.md`, and `../_shared/references/plan-artifact-template.md`.
2. Use `.git/optim-plans` for controller state and `docs/optim-plans/YYYY-MM-DD-topic/` for public artifacts.
3. Preserve reviewer and criticizer settings for any selected planning skill.

## Diagnostic Workflow

1. Inspect available evidence first: repository files, logs, tests, command output, stack traces, recent diffs, CI output, environment details, and user-provided symptoms.
2. Produce an in-message RCA summary before asking whether to plan. Use at most 5 Whys. Stop with `unknown` when evidence is insufficient.
3. Ask one choice prompt in the configured language:
   1. `Create the scoped fix plan` - recommended when evidence supports a planning path.
   2. `Stop after RCA` - keep the diagnosis only.
   3. `Other`.
   4. `Auto-complete`.
4. On opt-out, stop after the summary. Do not write `PROBLEM_ANALYSIS.md` on opt-out.
5. On opt-in or `Auto-complete`, select the smallest fitting planning skill and continue with that skill's contract.

## Level Selection

- `create-a-small-plan`: clear root cause, obvious fix shape, few local files, limited risk.
- `create-a-plan`: multi-file fix, external API or dependency behavior, compatibility concerns, or research needed.
- `create-a-big-plan`: cross-system failure, unclear root cause, redesign pressure, or high recoverability risk.

After opt-in, write `PROBLEM_ANALYSIS.md` in the selected run artifact directory before `PLAN_v1.md` and pass the RCA summary into the selected planning skill.
