skills/analyzing-gaps/SKILL.md
Compare user expectations (UTCs) with code reality to identify gaps. Use when you need to understand discrepancies between what users expect and what code actually does.
npx skillsauth add 0xhoneyjar/construct-observer analyzing-gapsInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Compare user expectations captured in UTCs and journeys with actual code behavior documented in reality files. Generate structured gap reports with severity classification, JTBD impact mapping, and resolution recommendations.
/analyze-gap {journey-id}
/analyze-gap {journey-id} --reality {component}
/analyze-gap {journey-id} --severity-threshold {level}
Examples:
/analyze-gap reward-understanding
/analyze-gap reward-understanding --reality use-recipe-deposit-flow
/analyze-gap informed-decision --severity-threshold high
| Argument | Required | Description |
|----------|----------|-------------|
| journey-id | Yes | Journey identifier to analyze |
| --reality {component} | No | Specific reality file to compare (otherwise uses journey's linked reality) |
| --severity-threshold {level} | No | Filter output to show only gaps at or above this severity |
| --update-canvases | No | Automatically update source canvas expectation gap tables |
grimoires/observer/journeys/{journey-id}.mdFor each canvas in source_canvases:
grimoires/observer/canvas/{username}.mdAggregate user expectations:
Find reality file:
--reality {component} if providedreality_file metadatagrimoires/observer/reality/ for matchesRead reality file and extract:
For each journey step:
User Expects (from journey + canvases):
Code Does (from reality file):
Identify Gap:
For each identified gap, determine:
Gap Type: | Type | Definition | Example | |------|------------|---------| | Bug | Code doesn't work as designed | Transaction fails silently | | Feature | Functionality doesn't exist | No activity log for rebates | | Flow | Steps are confusing or wrong order | Can't find migration button | | Communication | Information not conveyed clearly | No explanation of what "approve" does | | Strategy | Design decision creates friction | Too many transaction steps |
Severity: | Level | Criteria | |-------|----------| | Critical | Blocks core functionality, data loss risk | | High | Major friction, workaround difficult | | Medium | Noticeable friction, workaround exists | | Low | Minor annoyance, improvement opportunity |
JTBD Impact:
Create report at grimoires/crucible/gaps/{journey-id}-gaps.md:
---
type: gap-report
journey: "{journey-id}"
created: "{ISO-8601}"
updated: "{ISO-8601}"
total_gaps: {N}
by_severity:
critical: {N}
high: {N}
medium: {N}
low: {N}
by_type:
bug: {N}
feature: {N}
flow: {N}
communication: {N}
strategy: {N}
linked_reality_files:
- {reality-file}
---
Include sections:
gap_report field to frontmatter--update-canvases):
gaps:
directory: grimoires/crucible/gaps/
count: {n+1}
last_analysis: "{timestamp}"
journeys:
{journey-id}:
gap_report: grimoires/crucible/gaps/{journey-id}-gaps.md
gap_count: {N}
### Gap {N}: {Short Title}
| Field | Value |
|-------|-------|
| **ID** | `GAP-{journey}-{N}` |
| **Type** | {Bug / Feature / Flow / Communication / Strategy} |
| **Severity** | {Critical / High / Medium / Low} |
| **JTBD** | `[J] {label}` |
| **Step** | {journey step number} |
**User Expects**:
> {Description of user expectation}
> Source: {canvas username}, quote: "{relevant quote}"
**Code Does**:
> {Description of actual code behavior}
> Source: `{file}:{line}` — `{code snippet or description}`
**Gap**:
{Description of the discrepancy}
**Resolution**:
| Resolution Type | Description | Status |
|-----------------|-------------|--------|
| {Bug/Feature/etc} | {What to do} | Pending / In Progress / Done |
**Linked Artifacts**:
- Canvas: `canvas/{username}.md`
- Reality: `reality/{component}-reality.md:{line}`
- Issue: `{TEAM-###}` (if filed)
Bug Indicators:
Feature Indicators:
Flow Indicators:
Communication Indicators:
Strategy Indicators:
Critical:
High:
Medium:
Low:
Gap Analysis Complete
Journey: {journey-id}
Source Canvases: {count} ({usernames})
Reality File: {component}
Gaps Found: {total}
Critical: {N}
High: {N}
Medium: {N}
Low: {N}
Top Priority Gaps:
1. [Critical] {gap title} - {brief description}
2. [High] {gap title} - {brief description}
Report: grimoires/crucible/gaps/{journey-id}-gaps.md
Next Steps:
- File issues: /file-gap {journey-id} GAP-{journey}-1
- Update diagram: /diagram {journey-id} --with-reality
- Walkthrough test: /walkthrough {journey-id}
Gap analysis compares user expectations (from canvases) with code behavior (from reality files). The failure modes arise when either input is wrong — producing phantom gaps that don't exist, or missing real gaps because the comparison baseline is outdated.
The skill loads a journey definition, reads the linked canvases to extract user expectations (Level 3 hypotheses, expectation gaps, journey fragments), then loads the corresponding reality file from /ground to get actual code behavior. For each expectation, it checks whether the code supports, partially supports, or does not support the expected behavior. Gaps are classified by type (Bug, Feature, Discoverability) and severity.
A gap exists only when there is a verifiable mismatch between what the user expects (grounded in their quotes and behavior) and what the code actually does (grounded in the reality file). Both sides must be grounded — hypothesis vs. hypothesis is not a gap, it's speculation.
The seductively wrong behavior: using a stale reality file as the code-side ground truth.
Reality files are point-in-time snapshots generated by /ground or /ride. Code changes continuously — a bug fix merged yesterday may have closed a gap that the reality file still shows as open. Running gap analysis against a week-old reality file produces false positives: gaps that were real when the reality was captured but no longer exist.
The staleness risk compounds with canvas data:
The correct behavior: check reality file freshness before analysis. If the reality file is older than the most recent commit touching the relevant code paths, warn the operator and suggest re-running /ground. Never report a gap with HIGH confidence from stale inputs — downgrade to MEDIUM with a staleness note.
The /drift skill exists precisely for this purpose — it computes confidence decay on artifacts. Gap analysis should consume drift scores, not ignore them.
The fundamentally wrong behavior: treating every code change in a relevant file as evidence of a gap.
A code change is not a gap. A gap is a mismatch between user expectation and code behavior. When /ground generates a new reality file showing a function was refactored, that refactoring is only a gap if it changed behavior that users depend on. Internal refactoring (same behavior, different implementation) produces a diff in the reality file but zero user-facing impact.
The inversion: the skill should flow from user expectations → code behavior check. Not from code changes → user impact speculation. Starting from code changes and guessing which users might be affected reverses the Observer's research direction — it turns hypothesis-first research into code-first speculation.
Examples of this inversion:
The skill should only report gaps where a specific user expectation (quoted, attributed, from a canvas) does not match a specific code behavior (verified, from a fresh reality file). Everything else is noise.
A concrete scenario: the score-api team refactors the calculateOGScore() function — extracting helper methods, renaming internal variables, improving test coverage. The reality file diff shows 200 lines changed. But the function's inputs and outputs are identical. Gap analysis that starts from "200 lines changed in scoring" and speculates about user impact will generate false gaps for every canvas that mentions OG scores.
The correct sequence:
calculateOGScore() include recent mints? → Yes (unchanged behavior)Starting from the code diff inverts this: "200 lines changed → which users might be affected? → anyone who mentioned OG scores." This produces a gap report full of false positives that wastes the operator's time triaging non-issues.
The /drift skill provides the necessary freshness signal. If the reality file's confidence has decayed below the threshold, gap analysis should either refuse to run (with a suggestion to re-ground) or downgrade all reported gaps to LOW confidence with a staleness warning. High-confidence gaps from stale inputs are worse than no gaps at all — they create false certainty.
| Error | Resolution |
|-------|------------|
| Journey not found | List available journeys, suggest creation |
| No source canvases | Prompt to add canvases to journey |
| Reality file not found | Suggest running /ground first |
| No gaps found | Report success, mark journey as aligned |
| Canvas parse error | Log error, continue with available canvases |
/ground - Create reality files from code/file-gap - Create issues from gaps/diagram --with-reality - Visualize gaps in diagrams/walkthrough - Verify gaps through interactive testing/iterate - Update artifacts after gap resolutiondata-ai
Cognition orchestrator — analyze canvases, distill fears via /distill subagent, run gap analysis, optional cross-user synthesis.
development
Golden path /speak — generate RLM-isolated follow-ups with chronicle temporal context injection.
testing
# /snapshot — MiDi Experience Record (MER) Capture Capture a point-in-time MER for a wallet. Produces a 4-layer snapshot: data state, visual screenshot, user perception, and decision context. ## Usage ``` /snapshot <wallet-or-alias> /snapshot xabbu --trigger feedback /snapshot xabbu --data-only /snapshot --cohort /snapshot --cohort --diff MER-2026-001 ``` ## Arguments | Argument | Description | Required | |----------|-------------|----------| | `wallet-or-alias` | Wallet address or alias fr
development
Golden path /shape — consolidate journey patterns across canvases and file gap issues.