Skill

inspect

Install
1
Install the plugin
$
npx claudepluginhub vinhnxv/rune --plugin rune

Want just this skill?

Add to a custom plugin, then install with one command.

Description

Plan-vs-implementation deep audit using Agent Teams. Parses a plan file (or inline description), extracts requirements, and summons 4 Inspector Ashes to measure implementation completeness, quality across 10 dimensions, and gaps across 8 categories. Produces a VERDICT.md with requirement matrix, dimension scores, gap analysis, and actionable recommendations. <example> user: "/rune:inspect plans/feat-user-auth-plan.md" assistant: "The Tarnished gazes upon the land, measuring what has been forged against what was decreed..." </example> <example> user: "/rune:inspect Add user authentication with JWT tokens and rate limiting" assistant: "The Tarnished inspects the codebase against the inline plan..." </example>

Tool Access

This skill is limited to using the following tools:

AgentTaskCreateTaskListTaskUpdateTaskGetTeamCreateTeamDeleteSendMessageReadWriteBashGlobGrepAskUserQuestion
Supporting Assets
View in Repository
references/codex-drift-detection.md
references/inspector-prompts.md
references/phase-0-preflight.md
references/phase-1-scope.md
references/phase-2-forge-team.md
references/risk-context-injection.md
references/verdict-synthesis.md
Skill Content

/rune:inspect — Plan-vs-Implementation Deep Audit

Orchestrate a multi-agent inspection that measures implementation completeness and quality against a plan. Each Inspector Ash gets its own dedicated context window via Agent Teams.

Load skills: roundtable-circle, context-weaving, rune-echoes, rune-orchestration, team-sdk, polling-guard, zsh-compat, goldmask, codex-cli

Flags

FlagDescriptionDefault
--focus <dimension>Focus on a specific dimension: correctness, completeness, security, failure-modes, performance, design, observability, tests, maintainability, design-fidelityAll dimensions
--max-agents <N>Limit total Inspector Ashes (1-4)4
--dry-runShow scope, requirements, and inspector assignments without summoning agentsOff
--threshold <N>Override completion threshold for READY verdict (0-100)80
--fixAfter VERDICT, spawn gap-fixer to auto-fix FIXABLE findingsOff
--max-fixes <N>Cap on fixable gaps per run20
--mode <mode>Inspection mode: implementation (default) or planimplementation
--no-loreDisable Phase 1.3 Lore Layer (git history risk scoring)Off

Dry-run mode executes Phase 0 + Phase 0.5 + Phase 1 only. Displays: extracted requirements with IDs and priorities, inspector assignments, relevant codebase files, estimated team size. No teams, tasks, state files, or agents are created.

4 Inspector Ashes

InspectorDimensionsPriority
grace-wardenCorrectness, Completeness1st
ruin-prophetSecurity, Failure Modes2nd
sight-oraclePerformance, Design3rd
vigil-keeperObservability, Tests, Maintainability4th

For full prompt templates, focus mode, --max-agents redistribution, and --fix gap-fixer protocol — see inspector-prompts.md.

Phase 0: Pre-flight

Parses input (file path or inline description), validates with SEC-003 path guard, reads talisman config with runtime clamping (RUIN-001), and generates a base-36 identifier.

See phase-0-preflight.md for the full pseudocode (Steps 0.1–0.3).

Phase 0.5: Classification

Extracts requirements from plan using plan-parser.md algorithm, assigns to inspectors via keyword classification, applies --focus and --max-agents redistribution.

See phase-0-preflight.md for Steps 0.5.1–0.5.4. See inspector-prompts.md for assignment logic.

Phase 1: Scope

Identifies relevant codebase files by type (file → Glob, code → Grep, config → Grep with glob filter), deduplicates, caps at 120 files. In --dry-run, displays scope + assignments and stops.

See phase-1-scope.md for the full scope resolution code and dry-run output.

Phase 1.3: Lore Layer (Risk Intelligence)

Runs AFTER scope (Phase 1), BEFORE team creation (Phase 2). Discovers existing risk-map or spawns lore-analyst. Re-sorts scopeFiles by risk tier and enriches requirement classification.

See phase-1-scope.md for skip conditions, discovery steps, and the dual-inspector gate. See lore-layer-integration.md for the shared protocol and risk-tier-sorting.md for sorting.

Phase 1.5: Codex Drift Detection (v1.51.0)

Cross-model comparison of plan intent vs code semantics before inspector team creation. Flags semantic drift where code implements something different from what the plan specified. Default OFF (greenfield). Non-blocking — drift report is additional context, not a gate.

Output: tmp/inspect/{identifier}/drift-report.md

See codex-drift-detection.md for the full protocol — detection infrastructure, prompt generation, and drift report injection into Phase 3 inspector prompts.

MCP-First Inspector Discovery (v1.170.0+)

Inspector agents can be discovered via MCP search, enabling user-defined inspectors:

# Phase 2: Inspector Selection
inspectors = []

if mcp_available:
  # Discover phase-appropriate inspectors
  candidates = agent_search({
    query: "inspect plan requirements completeness correctness",
    phase: "inspect",
    limit: 8
  })
  inspectors = candidates.filter(c => c.categories.includes("inspection") or c.categories.includes("investigation"))

  # Write signal
  Bash("mkdir -p tmp/.rune-signals && touch tmp/.rune-signals/.agent-search-called")

if not inspectors or len(inspectors) < 4:
  # Fallback: use hardcoded inspector list
  inspectors = [
    { name: "grace-warden-inspect", mode: "inspect" },
    { name: "ruin-prophet-inspect", mode: "inspect" },
    { name: "sight-oracle-inspect", mode: "inspect" },
    { name: "vigil-keeper-inspect", mode: "inspect" }
  ]

# For plan-review mode, swap "-inspect" variants with "-plan-review":
if mode == "plan-review":
  inspectors = inspectors.map(i => {
    name: i.name.replace("-inspect", "-plan-review"),
    mode: "plan-review"
  })

This allows users to register custom inspectors (e.g., "compliance-inspector" for regulatory projects) that participate alongside the 4 built-in inspectors.

Phase 2: Forge Team

Writes state file (with session isolation: config_dir, owner_pid, session_id), creates output directory + inscription.json, acquires workflow lock (reader), runs pre-create guard (teamTransition), TeamCreate + signal directory, creates tasks per inspector + aggregator.

See phase-2-forge-team.md for the full pseudocode (Steps 2.1–2.6).

Phase 3: Summon Inspectors

Read and execute inspector-prompts.md for the full prompt generation contract, mode-aware template selection, inline plan sanitization, and --focus single-inspector logic.

Key rules:

  • Summon all inspectors in a single message (parallel, run_in_background: true)
  • All inspectors get full scopeFiles — they filter by relevance internally
  • model: resolveModelForAgent(inspector, talisman) for each inspector (cost tier mapping)
  • Template path: agents/investigation/{inspector}-inspect.md (or {inspector}-plan-review.md for --mode plan)

Step 3.1 — Risk Context Injection (Goldmask Enhancement)

If riskMap is available from Phase 1.3, inject risk context (file tiers, wisdom advisories, inspector-specific guidance) into each inspector's prompt. Only inject when non-empty. See risk-context-injection.md for the full injection protocol and risk-context-template.md for rendering rules.

Phase 4: Monitor

Poll TaskList every 30s with stale detection (3 consecutive no-progress → break with warning). See monitor-utility.md for the shared polling utility.

Phase 5 + Phase 6: Verdict

Read and execute verdict-synthesis.md for the full Verdict Binder aggregation, score aggregation, evidence verification, gap classification, and VERDICT.md structure.

Summary:

  1. Phase 5.2 (Verdict Binder): Aggregates inspector outputs. Produces VERDICT.md with requirement matrix, 10 dimension scores, gap analysis (8 categories), recommendations.
  2. Phase 5.3 (Wait): TaskList polling, 2-min timeout, 10s interval.
  3. Phase 6.1 (Evidence check): Verify up to 10 file references in VERDICT.md against disk.
  4. Phase 6.2 (Display): Show verdict summary (verdict, completion %, finding counts, report path).

Phase 5-6 Enhancement: Historical Risk Assessment in VERDICT.md

If riskMap is available from Phase 1.3, the Verdict Binder appends a Historical Risk Assessment section (file risk distribution, bus factor warnings, inspection coverage vs risk) to VERDICT.md. Optional — omitted on null/parse error. See verdict-synthesis.md "Historical Risk Assessment" section.

10 Dimensions + 8 Gap Categories

10 Dimensions

DimensionInspectorDescription
Correctnessgrace-wardenLogic implements requirements correctly
Completenessgrace-wardenAll requirements implemented, no gaps
Securityruin-prophetVulnerabilities, auth, input validation
Failure Modesruin-prophetError handling, retries, circuit breakers
Performancesight-oracleBottlenecks, N+1 queries, memory leaks
Designsight-oracleArchitecture, coupling, SOLID principles
Observabilityvigil-keeperLogging, metrics, tracing
Testsvigil-keeperUnit/integration coverage, test quality
Maintainabilityvigil-keeperDocumentation, naming, complexity
Design Fidelitygrace-wardenDesign spec compliance — COMPLETE/PARTIAL/MISSING/DEVIATED (conditional: design_sync.enabled + design refs)

8 Gap Categories

CategoryDescription
MISSINGRequirement not implemented at all
INCOMPLETEPartially implemented — edge cases missing
INCORRECTImplemented but wrong — logic error
INSECURESecurity vulnerability or missing control
FRAGILEWorks but likely to break — missing error handling
UNOBSERVABLENo logging/metrics/tracing
UNTESTEDNo tests or insufficient coverage
UNMAINTAINABLEHard to change — excessive coupling, magic values

Phase 7: Cleanup

See verdict-synthesis.md for full cleanup protocol.

Summary:

  1. Shutdown all inspectors + verdict-binder (SendMessage shutdown_request)
  2. TeamDelete with filesystem fallback (CHOME pattern)
  3. Update state file to "completed" (preserve config_dir, owner_pid, session_id, verdict, completion)
  4. Release workflow lock: Bash(\cd "${CWD}" && source plugins/rune/scripts/lib/workflow-lock.sh && rune_release_lock "inspect"`)`
  5. Persist echo if P1 findings exist
  6. If --fix: run Phase 7.5 remediation (gap-fixer team, 2-min timeout, append results to VERDICT.md)
  7. Post-inspection: AskUserQuestion with options (View VERDICT, Fix gaps /rune:strive, /rune:appraise, Done)

Error Handling

ErrorRecovery
Plan file not foundError with file path suggestion
No requirements extractedError with plan format guidance
Inspector timeoutProceed with available outputs
All inspectors failedError — no VERDICT possible
TeamCreate failsRetry with pre-create guard
TeamDelete failsFilesystem fallback (CHOME pattern)
VERDICT.md not createdManual aggregation from inspector outputs
Lore-analyst timeout (Phase 1.3)Proceed without risk data (WARN)
risk-map.json parse error (Phase 1.3)Proceed without risk data (WARN)
Wisdom passthrough unavailable (Phase 3)Skip wisdom injection (INFO)
Risk section render error (Phase 5-6)Omit Historical Risk section from VERDICT (WARN)

Security

  • Plan path validated with /^[a-zA-Z0-9._\/-]+$/ before shell interpolation
  • Team name validated with /^[a-zA-Z0-9_-]+$/ before rm -rf
  • Inspector outputs treated as untrusted (Truthbinding protocol)
  • CHOME pattern used for all filesystem operations
  • Inline plan sanitized before prompt injection (SEC-002, SEC-004)
  • Inspector Ashes are read-only — they cannot modify the codebase
Stats
Stars1
Forks0
Last CommitMar 16, 2026
Actions

Similar Skills