Exhaustive systems analysis

From petekp/claude-code-setup · View interactive version

Exhaustive systems analysis is an AI agent skill from the GitHub repository petekp/claude-code-setup. Perform evidence-driven, multi-subsystem audits of real codebases to find correctness bugs, race conditions, security gaps, stale documentation, dead code, and production-readiness risks. Use when asked to audit a system end-to-end, verify agent-written code before shipping, analyze a subsystem for

How to use this skill

Skill file

Exhaustive Systems Analysis

Use this skill for full-system correctness work. The job is to map the system, identify the highest-risk behaviors, prove or refute concrete failure hypotheses, and leave behind a report another engineer can act on without re-reading the whole codebase.

Failure Modes To Prevent

  1. Surface-level audits that scan files without following behavior end-to-end
  2. False certainty: reporting suspicions as bugs without enough evidence
  3. Context drift across large audits with many subsystems
  4. Cosmetic reviews that miss the real correctness and ship-readiness risks

Operating Mode

Workflow

0. Calibrate The Audit

Before reading deeply, write a one-screen scope brief using the template in references/templates.md.

Capture:

If the request is broad, narrow it to the modules that can actually change user outcomes or ship readiness.

1. Load Intent Before Code

Read only the materials that establish intended behavior:

Extract:

2. Build The Coverage Ledger

Map the system into subsystems before deep analysis. Use the coverage ledger template in references/templates.md.

For each subsystem record:

Prioritize by user impact first, then by side effects, concurrency, privilege, and recent churn. Folder structure alone is not a priority system.

3. Generate Hypotheses Before The Deep Pass

For each high- or medium-risk subsystem, write 2-3 concrete hypotheses before diving in. Good hypotheses are falsifiable and tied to a behavior boundary.

Examples:

Update or discard hypotheses as evidence comes in. This step prevents aimless scanning.

4. Audit One Subsystem At A Time

Read the subsystem end-to-end:

Select only the relevant checklist sections from references/checklists.md. Do not load every checklist if the subsystem only needs one or two.

When subagents are available, assign one bounded subsystem per subagent with disjoint files and ask for:

5. Classify Findings With Evidence, Status, And Confidence

Every finding must separate observation from inference.

Required fields:

Use Confirmed only when the bug is directly demonstrated by code, a failing test, a repro path, or a hard contradiction. Use Likely when the reasoning is strong but not directly reproduced. Use Needs follow-up when something is suspicious but the evidence is incomplete.

6. Run A Convergence Pass

After subsystem reviews:

Evidence Standard

Prefer stronger evidence over more words. From strongest to weakest:

  1. failing or targeted test
  2. reproducible path with exact steps
  3. direct code contradiction with exact citations
  4. logs, telemetry, or command output
  5. scoped search results with counts
  6. static reasoning

Static reasoning alone can still be valuable, but it should usually produce Likely, not Confirmed.

For dead code or stale docs, always show what you searched and why you believe the code or documentation is obsolete. A dead-code claim without a consumer search is incomplete.

Reporting Rules

Use the templates in references/templates.md for:

Session Management

Use single-session mode for small audits. For large audits or when context is tight, create a lightweight control plane:

A good handoff includes:

Anti-Patterns

Completion Criteria

The audit is complete when:

  1. high-risk subsystems have a ledger entry and a final status
  2. every reported finding has evidence, confidence, and a concrete location
  3. the final report includes fix order plus unverified surfaces
  4. cross-cutting and residue findings have been consolidated
  5. the report is honest about what was not proven
Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.