agentleFS
excattexcatt/superclaude-plusplus/skills/gap-analysis/SKILL.md

gap-analysis

Skill14 starsChanged 37 days agoMITView on GitHub

Compare design documents against implementation and compute a Match Rate with a gap list (PDCA Check phase). Use after implementation or before PR to verify design conformance.

21 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

2 rules. 0 are common, 1 is distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 20 edited versions we read keep these.

  • 1

    Distinctive

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Do NOT use for: Simple code review, design document creation, bug fixes

    line 24
  2. Very specific:

    Update .pdca-status.json on analysis completion:

    line 161

“Common” is measured: kept by at least 6 in 10 of the 20 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Gap Analysis Skill

Analyze discrepancies between design documents and actual implementation code to calculate Match Rate.

When to Use

Use proactively when:

  • Post-implementation design comparison needed
  • "Does it match design?", "Is it correct?", "Verify" requests
  • Pre-PR/code review verification
  • PDCA Check phase execution

Triggers: gap analysis, design-implementation comparison, verify, validate, verify implementation, compare design, check implementation, design vs code

Do NOT use for: Simple code review, design document creation, bug fixes

Usage

/gap-analysis user-auth          # Analyze user-auth feature gaps
/gap-analysis                    # Analyze current PDCA state feature

Analysis Workflow

Step 1: Document & Code Discovery

1. Find design document
   - docs/02-design/features/{feature}.design.md
   - docs/02-design/{feature}.design.md
   - docs/design/{feature}.md

2. Find implementation code
   - src/features/{feature}/
   - src/{feature}/
   - app/{feature}/
   - lib/{feature}/

Step 2: Comparison Items

2.1 API Comparison

ItemDesignImplementationStatus
Endpoint URLDesign specActual route✅/❌
HTTP MethodGET/POST/PUT/DELETEActual method✅/❌
Request ParamsSchema definitionActual type✅/❌
Response FormatDesign schemaActual response✅/❌
Error CodesDefined errorsActual errors✅/❌

2.2 Data Model Comparison

ItemDesignImplementationStatus
Entity ListDesign ERDActual models✅/❌
Field DefinitionsSchemaType definitions✅/❌
RelationshipsDesign relationsActual relations✅/❌

2.3 Feature Comparison

ItemDesignImplementationStatus
Feature ListRequirementsActual functions✅/❌
Business LogicDesign flowActual logic✅/❌
Error HandlingDesign casesActual handling✅/❌

2.4 Convention Compliance

ItemRuleActualStatus
NamingPascalCase/camelCaseActual naming✅/❌
Folder StructureDesign structureActual structure✅/❌
Import OrderRuleActual order✅/❌

Step 3: Match Rate Calculation

Match Rate = (Matched Items / Total Comparison Items) × 100

Status Determination:
├─ >= 90%  → ✅ PASS (Proceed to Report phase)
├─ 70-89%  → ⚠️ WARN (Act phase - auto fix)
└─ < 70%   → ❌ FAIL (Design review required)

Step 4: Gap Classification

## Gap Classification

### 🔴 Missing (Design O, Implementation X)
Items in design but not implemented
→ Implementation required

### 🟡 Added (Design X, Implementation O)
Items implemented but not in design
→ Update design document or remove code

### 🔵 Changed (Design ≠ Implementation)
Items where design differs from implementation
→ Synchronization needed (fix design or implementation)

Output Format

# Gap Analysis Report: {feature}

## Analysis Overview
- **Target**: {feature}
- **Design Doc**: docs/02-design/features/{feature}.design.md
- **Implementation Path**: src/features/{feature}/
- **Analysis Time**: YYYY-MM-DD HH:mm

## Match Rate

| Category | Score | Status |
|----------|:-----:|:------:|
| API Match | 85% | ⚠️ |
| Data Model | 100% | ✅ |
| Feature Implementation | 80% | ⚠️ |
| Convention | 90% | ✅ |
| **Total** | **88%** | ⚠️ |

## Gap List

### 🔴 Missing (Implementation Required)
| Item | Design Location | Description |
|------|----------------|-------------|
| Password Reset | design.md:45 | POST /auth/forgot-password not implemented |

### 🟡 Added (Documentation Required)
| Item | Implementation Location | Description |
|------|------------------------|-------------|
| Social Login | src/auth/social.ts | Feature added not in design |

### 🔵 Changed (Synchronization Required)
| Item | Design | Implementation | Impact |
|------|--------|----------------|--------|
| Response Format | { data: [] } | { items: [] } | High |

## Recommended Actions

### Immediate Actions (matchRate < 90%)
1. Implement or remove Missing items from design
2. Synchronize Changed items

### Documentation Updates
1. Reflect Added items in design document

PDCA Status Update

Update .pdca-status.json on analysis completion:

{
  "feature": "{feature}",
  "phase": "check",
  "matchRate": 88,
  "gaps": {
    "missing": 1,
    "added": 1,
    "changed": 1
  },
  "lastAnalysis": "2025-01-31T10:00:00Z",
  "iteration": 0
}

Next Steps Guidance

matchRate >= 90%:
  → "Gap analysis passed! Generate completion report with /pdca report {feature}."

matchRate < 90%:
  → "Gaps detected. Start auto-correction? (Act phase)"
  → On user approval, proceed with gap-based fixes
  → Auto re-analysis after fixes

Related Skills

  • /feature-planner - Plan phase
  • /verify - General verification (Gap Analysis specializes in design-implementation comparison)

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.