This skill should be used when the user asks to "analyze a scenario", "check narrative completeness", "find missing paths", "validate my scenario", "show grid coverage", "check item obtainability", "analyze traits", "find cycles", or wants to understand the structure of a Kleene scenario. Performs graph analysis, Decision Grid coverage checking, and deep structural analysis (yq-enabled) including item/trait/flag dependencies, relationship networks, consequence magnitude, scene pacing, and path diversity.
Analyze scenario structure for narrative completeness, detecting missing cells in the 3x3 grid, unreachable nodes, dead ends, and structural issues.
| # | Type | Description |
|---|---|---|
| 1 | Grid Coverage | Check 9-cell coverage and determine tier (Bronze/Silver/Gold) |
| 2 | Null Cases | Verify death, departure, and blocked paths exist |
| 3 | Structural | Find unreachable nodes, dead ends, railroads, illusory choices |
| 4 | Path Enumeration | List all paths from start to endings |
| 5 | Cycle Detection | Find loops, self-referential choices (yq) |
| 6 | Item Obtainability | Verify required items are obtainable (yq) |
| 7 | Trait Balance | Detect impossible trait requirements (yq) |
| 8 | Flag Dependencies | Find unused/unobtainable flags (yq) |
| 9 | Relationship Network | Map NPC relationship dynamics (yq) |
| 10 | Consequence Magnitude | Flag over/undersized consequences (yq) |
| 11 | Scene Pacing | Analyze scene_break usage (yq) |
| 12 | Path Diversity | Identify false choices, railroads (yq) |
| 13 | Ending Reachability | Verify all endings are reachable (yq) |
| 14 | Travel Consistency | Validate travel time config (v5, yq) |
| 15 | Schema Validation | Validate structure, types, references (yq) |
Tool Detection: See
${CLAUDE_PLUGIN_ROOT}/lib/framework/scenario-file-loading/tool-detection.mdQuery Templates: See${CLAUDE_PLUGIN_ROOT}/lib/patterns/analysis-queries.mdReport Format: See${CLAUDE_PLUGIN_ROOT}/lib/framework/formats/analysis-report-format.mdfor output specification. Validation Checklists: See${CLAUDE_PLUGIN_ROOT}/lib/framework/authoring/analysis-validation-guide.mdfor all checks.
Read scenario from:
scenario.yaml in current directory${CLAUDE_PLUGIN_ROOT}/scenarios/Parse YAML and validate basic structure.
Construct directed graph:
Use yq graph structure extraction (see ${CLAUDE_PLUGIN_ROOT}/lib/patterns/analysis-queries.md → "Analysis Patterns"):
yq '.nodes | to_entries | .[] | {"node": .key, "options": [.value.choice.options[] | {"id": .id, "cell": .cell, "next": (.next_node // .next), "precondition": .precondition}]}' scenario.yaml
From start_node, find all reachable nodes using BFS/DFS.
Distinguish static and dynamic edges:
next_node) - Unconditionally reachablenext: improvise + outcome_nodes) - Conditionally reachableNodes only in outcome_nodes should be "conditionally reachable via improvisation" NOT "unreachable".
Enumerate paths from start_node to each ending. Track path length and required preconditions.
Reference: See
${CLAUDE_PLUGIN_ROOT}/lib/framework/core/core.md→ "The Decision Grid" for cell definitions.
Classification Signals:
outcome_nodes.discovery, or improv_* flag + positive outcomeoutcome_nodes.constraint, or improv_* flag + blockedReference: See
${CLAUDE_PLUGIN_ROOT}/lib/framework/core/endings.mdfor type→Option mappings.
Map each ending to outcome type (victory→SOME_TRANSFORMED, death→NONE_DEATH, etc.).
| Issue | Detection |
|---|---|
| Unreachable Nodes | No incoming edges (except start) |
| Dead Ends | Non-ending nodes with no outgoing edges |
| Railroads | 3+ nodes with only one path through |
| Single-Option Nodes | Choice with only 1 option (warn unless next: improvise) |
| Illusory Choices | Multiple options leading to same destination |
All deep analysis queries are in ${CLAUDE_PLUGIN_ROOT}/lib/patterns/analysis-queries.md → "Deep Analysis Queries".
| Analysis | Query Section |
|---|---|
| Cycle Detection | ### Cycle Detection |
| Item Obtainability | ### Item Obtainability |
| Trait Balance | ### Trait Balance |
| Flag Dependencies | ### Flag Dependencies |
| Relationship Network | ### Relationship Network |
| Consequence Magnitude | ### Consequence Magnitude |
| Scene Pacing | ### Scene Pacing |
| Path Diversity | ### Path Diversity |
| Ending Reachability | ### Ending Reachability |
For scenarios using v5 features, queries are in ${CLAUDE_PLUGIN_ROOT}/lib/patterns/analysis-queries.md → "v5 Feature Queries".
| Validation | Query Section |
|---|---|
| Location State | ### Location State Validation |
| Node Preconditions | ### Node Precondition Validation |
| NPC Tracking | ### NPC Location Validation |
| Temporal Events | ### Temporal/Event Validation |
| Travel Consistency | ### Travel Consistency Validation |
| Improvisation Coverage | ### Improvisation Coverage Analysis |
Queries are in ${CLAUDE_PLUGIN_ROOT}/lib/patterns/analysis-queries.md → "Schema Validation Queries".
Levels:
Reference: See
${CLAUDE_PLUGIN_ROOT}/lib/framework/formats/analysis-report-format.mdfor complete specification.
Reports use:
═══───✓ (OK), ⚠ (Warning), ✗ (Error), ○ (Fallback), ! (Issue)Reference: See
${CLAUDE_PLUGIN_ROOT}/lib/framework/authoring/analysis-validation-guide.mdfor complete checklists.
Validation types: Schema, Structural, Semantic, v5 Features, Narrative
When no specific analysis is requested:
{
"questions": [
{
"question": "What type of analysis would you like?",
"header": "Analysis",
"multiSelect": false,
"options": [
{"label": "Full analysis (Recommended)", "description": "Complete grid coverage, structure, deep analysis, and paths"},
{"label": "Grid coverage", "description": "Check all nine narrative cells and determine tier"},
{"label": "Deep structural (yq)", "description": "Items, traits, flags, relationships, cycles, pacing"},
{"label": "Path enumeration", "description": "List all possible routes through the scenario"}
]
}
]
}
| Keyword | Analysis |
|---|---|
| "analyze for completeness" | Full analysis |
| "check grid coverage" | Grid check only |
| "what tier is this" | Tier check |
| "find structural problems" | Structural issues |
| "show all paths" | Path enumeration |
| "check items/flags" | Precondition map |
| "run deep analysis" | Deep structural (yq) |
| "check item obtainability" | Item analysis |
| "analyze traits" | Trait balance |
| "find flag problems" | Flag dependencies |
| "map relationships" | Relationship network |
| "check consequence sizes" | Consequence magnitude |
| "analyze pacing" | Scene pacing |
| "find false choices" | Path diversity |
| "check ending reachability" | Ending reachability |
| "find cycles/loops" | Cycle detection |
| "check travel config" | Travel consistency |
| "validate schema" | Schema validation |
If check-jsonschema is installed:
check-jsonschema --schemafile ${CLAUDE_PLUGIN_ROOT}/lib/schema/scenario-schema.json <scenario.yaml>
Or use the wrapper script:
./scripts/validate-scenario.sh scenarios/dragon_quest.yaml
${CLAUDE_PLUGIN_ROOT}/lib/framework/core/core.md - Decision Grid and tier definitions${CLAUDE_PLUGIN_ROOT}/lib/framework/core/endings.md - Ending classification${CLAUDE_PLUGIN_ROOT}/lib/patterns/analysis-queries.md - All yq query patterns${CLAUDE_PLUGIN_ROOT}/lib/framework/formats/scenario-format.md - YAML format${CLAUDE_PLUGIN_ROOT}/lib/framework/formats/analysis-report-format.md - Report format${CLAUDE_PLUGIN_ROOT}/lib/framework/authoring/analysis-validation-guide.md - Validation checklists${CLAUDE_PLUGIN_ROOT}/lib/framework/gameplay/presentation.md - Menu conventions