/ctx:ctx-architecture-failure-analysisfrom ctx
Generates falsifiable incident hypotheses for codebases, identifying race conditions, ordering assumptions, cache staleness, error swallowing, ownership gaps, idempotency failures, and scaling cliffs. Produces evidence-backed DANGER-ZONES.md. Requires /ctx-architecture artifacts.
Ships in ctx. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Adversarial analysis that identifies where a codebase will silently betray you. Think like a correctness chaos monkey: someone who knows the code intimately and exploits logical bugs, not security holes.
Generate falsifiable incident hypotheses. /ctx-architecture
maps what exists. /ctx-architecture-enrich improves map fidelity.
This skill generates concrete, disprovable claims about where the
map will break under real-world conditions. Every finding is a
hypothesis with evidence, not a suspicion or a vibe.
The goal is to find failure modes that code review misses: the ones that ship, pass tests, and break in production at 3am.
This skill requires /ctx-architecture artifacts as input.
If they don't exist, stop and tell the user to run
/ctx-architecture first.
/ctx-architecture has run and artifacts exist/ctx-architecture first)ctx-threat-model, a separate
concern: auth bypass, injection, privilege escalation)Required (must exist before running):
.context/ARCHITECTURE.md: system map.context/DETAILED_DESIGN*.md: module-level detail.context/map-tracking.json: coverage dataOptional (enhances analysis):
.context/DANGER-ZONES.md: existing danger zones from
/ctx-architecture principal mode (used as starting points,
not as the final word)Architecture artifacts not found. Run
/ctx-architecturefirst; this skill analyzes existing maps, it doesn't create them.
map-tracking.json to identify which modules have
sufficient coverage (confidence >= 0.7). Low-confidence
modules get flagged as "unanalyzed, risk unknown" rather
than skipped..context/DANGER-ZONES.md exists, load it as seed
findings to extend, not as the complete picture.Read architecture artifacts and identify mutation points: places where state changes, data transforms, or side effects occur. These are the attack surface for correctness failures.
For each module with confidence >= 0.7:
Read the DETAILED_DESIGN entry for the module
Identify:
For each mutation point, read the actual source code, DETAILED_DESIGN summaries are not enough for failure analysis. You need to see the actual lock scope, the actual error check, the actual nil guard.
Apply each failure category systematically to the mutation points identified in Phase 1. For each category, ask: "How would a correctness chaos monkey make this fail silently?"
Every candidate finding must meet the evidence standard before it can be recorded:
If you cannot provide all five, the finding is a hypothesis, not a confirmed hazard. Label it accordingly (see Confidence below).
init() functions with side effects that
depend on other packages' init()_ = someFunc() or empty if err
blocksrecover() that catches too broadly and
masks real bugsBefore a candidate finding is accepted, attempt to disprove it. For each candidate, explicitly check:
If the challenge succeeds (the concern is invalid), drop the finding. If the challenge partially succeeds (the concern is mitigated but not eliminated), note the mitigation and adjust confidence downward.
This phase is mandatory. Skipping it produces smart fiction.
For each surviving finding:
Blast radius: If this fails, what breaks?
impact; equivalents include sourcegraph-cody),
use it to get caller chains and dependency graphsDetection gap: Would existing tests catch this?
Likelihood: How likely is this to trigger?
Risk score: Assign explicit scores on a 1-3 scale:
Cross-reference: If a web-search-with-citations MCP is available (canonical: Gemini Search; equivalents include Firecrawl, Exa, Tavily), search for the pattern in known incident databases, blog posts, and similar project post-mortems. This grounds findings in real-world evidence. If no such MCP is connected, fall back to built-in web search.
Write .context/DANGER-ZONES.md with findings ranked by
risk score (highest first within each tier).
# Danger Zones
_Generated YYYY-MM-DD by /ctx-architecture-failure-analysis._
_Run after /ctx-architecture for full coverage._
## Critical (risk score >= 7, silent or cascading)
### DZ-1: [Location]: [Failure Mode]
**Category**: Concurrency | Ordering | Cache | Amplification
| Ownership | Error Handling | Scaling | Idempotency
| State Machine
**Confidence**: High | Medium | Low
**Risk score**: L:N + B:N + D:N = N
**Location**: `package/file.go:function`
**Failure mode**: What goes wrong and why
**Triggering precondition**: What must be true for this to fire
**Failure path**: Step-by-step from trigger to effect
**Blast radius**: What breaks when this fails
**Detection gap**: Why tests don't catch it
**Evidence**: The specific code pattern (with file:line)
**Suggested fix**: Concrete code change, not vague advice
### DZ-2: ...
## Elevated (risk score < 7 or non-silent)
### DZ-3: ...
## Unanalyzed Modules
Modules with coverage < 0.7 in map-tracking.json:
- `module/path` (confidence: 0.3): risk unknown
Confidence levels:
DZ numbering: Sequential across the file. Stable across re-runs (findings for the same location keep their number).
Print a summary to the terminal:
## Failure Analysis Report
Modules analyzed: N (of M total)
Findings: N critical, M elevated
High confidence: N
Medium confidence: N
Low confidence: N
Unanalyzed modules: K (coverage < 0.7)
Findings challenged and dropped: N
### Critical Findings
- DZ-1: [one-line summary] (L:N B:N D:N = N)
- DZ-2: [one-line summary] (L:N B:N D:N = N)
### Top Recommendation
[Single most impactful fix across all findings]
| Skill | Mode |
|---|---|
/ctx-architecture | Map what exists |
/ctx-architecture-enrich | Improve map fidelity |
/ctx-architecture-failure-analysis | Generate falsifiable incident hypotheses |
ctx-threat-model (future) | Security-focused analysis |
/ctx-architecture P4 | Surface danger zones noticed during mapping |
The key distinction: P4 extracts danger zones that were noticed during mapping. This skill generates hypotheses and tests them against the code. P4 findings are observations; this skill's findings are tested claims.
Before writing DANGER-ZONES.md, verify:
What SKILL.md sets; muted values are Claude Code's defaults
54 skills in this plugin
/ctx-agentLoad full context packet. Use at session start or when context seems stale or incomplete./ctx-architectureBuild and maintain architecture maps. Use to create or refresh ARCHITECTURE.md and DETAILED_DESIGN.md. Supports principal mode for deeper analysis: vision, future direction, bottlenecks, implementation alternatives, gaps, upstream proposals, and intervention points./ctx-architecture-enrichEnrich architecture artifacts with code intelligence data. Takes existing /ctx-architecture output as baseline, verifies and quantifies with GitNexus MCP (blast radius, execution flows, domain clustering, registration sites). Run after /ctx-architecture, not instead of it./ctx-archiveArchive completed tasks. Use when TASKS.md has many completed items cluttering the view./ctx-blogGenerate blog post draft. Use when documenting project progress, sharing learnings, or writing about development experience./ctx-blog-changelogGenerate themed blog post from commits. Use when writing about changes between releases or documenting a development arc.npx claudepluginhub activememory/ctx --plugin ctxOther plugins' skills for the same job