Analyze Test Coverage Gaps

Analyze test coverage gaps.

How to use it

Claude Code
  1. Run the line below. It pulls the whole folder into ~/.claude/skills/coverage, including the files SKILL.md points to.
  2. Describe your job in plain words. Claude Code follows the skill from there.
Claude Code — installs the whole folder, not just SKILL.md
npx degit alirezarezvani/claude-skills/engineering-team/playwright-pro/skills/coverage#main ~/.claude/skills/coverage

For one project only, change the path to .claude/skills/coverage. This skill also uses Next.js — copying SKILL.md alone won't be enough. See the folder on GitHub.

Claude (web or desktop app)
  1. On this page open ⋯ → Download .md.
  2. Save it as SKILL.md in a folder, zip the folder, then Customize → Skills → + → Create skill → Upload a skill.
  3. Pick the file and Save. Claude shows the name and description and runs a security scan.
  4. Check the skill is switched on.
  5. Start a new chat and describe your job in plain words. The AI follows the skill from there.
ChatGPT or another app
  1. ChatGPT: make a Project and paste it into Instructions.
  2. Neither? Paste it at the top of a new chat — it works for that chat.
Not working?
  • Check which app you pasted it into — the steps above name the right one.
  • Some skills need the paid tier of Claude or ChatGPT.
Step-by-step guide with screenshots · Ask in the forum

Paste into Claude, ChatGPT or Cursor.

Source of Analyze Test Coverage Gaps

Show the full text99 lines
namedescription
coverage>- Analyze test coverage gaps. Use when user says "test coverage", what's not tested", "coverage gaps", "missing tests", "coverage report", or "what needs testing".

Analyze Test Coverage Gaps

Map all testable surfaces in the application and identify what's tested vs. what's missing.

Steps

1. Map Application Surface

Use the Explore subagent to catalog:

Routes/Pages:

  • Scan route definitions (Next.js app/, React Router config, Vue Router, etc.)
  • List all user-facing pages with their paths

Components:

  • Identify interactive components (forms, modals, dropdowns, tables)
  • Note components with complex state logic

API Endpoints:

  • Scan API route files or backend controllers
  • List all endpoints with their methods

User Flows:

  • Identify critical paths: auth, checkout, onboarding, core features
  • Map multi-step workflows
2. Map Existing Tests

Scan all *.spec.ts / *.spec.js files:

  • Extract which pages/routes are covered (by page.goto() calls)
  • Extract which components are tested (by locator usage)
  • Extract which API endpoints are mocked or hit
  • Count tests per area
3. Generate Coverage Matrix
## Coverage Matrix

| Area | Route | Tests | Status |
|---|---|---|---|
| Auth | /login | 5 | ✅ Covered |
| Auth | /register | 0 | ❌ Missing |
| Auth | /forgot-password | 0 | ❌ Missing |
| Dashboard | /dashboard | 3 | ⚠️ Partial (no error states) |
| Settings | /settings | 0 | ❌ Missing |
| Checkout | /checkout | 8 | ✅ Covered |
4. Prioritize Gaps

Rank uncovered areas by business impact:

  1. Critical — auth, payment, core features → test first
  2. High — user-facing CRUD, search, navigation
  3. Medium — settings, preferences, edge cases
  4. Low — static pages, about, terms
5. Suggest Test Plan

For each gap, recommend:

  • Number of tests needed
  • Which template from templates/ to use
  • Estimated effort (quick/medium/complex)
## Recommended Test Plan

### Priority 1: Critical
1. /register (4 tests) — use auth/registration template — quick
2. /forgot-password (3 tests) — use auth/password-reset template — quick

### Priority 2: High
3. /settings (4 tests) — use settings/ templates — medium
4. Dashboard error states (2 tests) — use dashboard/data-loading template — quick
6. Auto-Generate (Optional)

Ask user: "Generate tests for the top N gaps? [Yes/No/Pick specific]"

If yes, invoke /pw:generate for each gap with the recommended template.

Output

  • Coverage matrix (table format)
  • Coverage percentage estimate
  • Prioritized gap list with effort estimates
  • Option to auto-generate missing tests
1---
2name: "coverage"
3description: >-
4 Analyze test coverage gaps. Use when user says "test coverage",
5 "what's not tested", "coverage gaps", "missing tests", "coverage report",
6 or "what needs testing".
7---
8 
9# Analyze Test Coverage Gaps
10 
11Map all testable surfaces in the application and identify what's tested vs. what's missing.
12 
13## Steps
14 
15### 1. Map Application Surface
16 
17Use the `Explore` subagent to catalog:
18 
19**Routes/Pages:**
20- Scan route definitions (Next.js `app/`, React Router config, Vue Router, etc.)
21- List all user-facing pages with their paths
22 
23**Components:**
24- Identify interactive components (forms, modals, dropdowns, tables)
25- Note components with complex state logic
26 
27**API Endpoints:**
28- Scan API route files or backend controllers
29- List all endpoints with their methods
30 
31**User Flows:**
32- Identify critical paths: auth, checkout, onboarding, core features
33- Map multi-step workflows
34 
35### 2. Map Existing Tests
36 
37Scan all `*.spec.ts` / `*.spec.js` files:
38 
39- Extract which pages/routes are covered (by `page.goto()` calls)
40- Extract which components are tested (by locator usage)
41- Extract which API endpoints are mocked or hit
42- Count tests per area
43 
44### 3. Generate Coverage Matrix
45 
46```
47## Coverage Matrix
48 
49| Area | Route | Tests | Status |
50|---|---|---|---|
51| Auth | /login | 5 | ✅ Covered |
52| Auth | /register | 0 | ❌ Missing |
53| Auth | /forgot-password | 0 | ❌ Missing |
54| Dashboard | /dashboard | 3 | ⚠️ Partial (no error states) |
55| Settings | /settings | 0 | ❌ Missing |
56| Checkout | /checkout | 8 | ✅ Covered |
57```
58 
59### 4. Prioritize Gaps
60 
61Rank uncovered areas by business impact:
62 
631. **Critical** — auth, payment, core features → test first
642. **High** — user-facing CRUD, search, navigation
653. **Medium** — settings, preferences, edge cases
664. **Low** — static pages, about, terms
67 
68### 5. Suggest Test Plan
69 
70For each gap, recommend:
71- Number of tests needed
72- Which template from `templates/` to use
73- Estimated effort (quick/medium/complex)
74 
75```
76## Recommended Test Plan
77 
78### Priority 1: Critical
791. /register (4 tests) — use auth/registration template — quick
802. /forgot-password (3 tests) — use auth/password-reset template — quick
81 
82### Priority 2: High
833. /settings (4 tests) — use settings/ templates — medium
844. Dashboard error states (2 tests) — use dashboard/data-loading template — quick
85```
86 
87### 6. Auto-Generate (Optional)
88 
89Ask user: "Generate tests for the top N gaps? [Yes/No/Pick specific]"
90 
91If yes, invoke `/pw:generate` for each gap with the recommended template.
92 
93## Output
94 
95- Coverage matrix (table format)
96- Coverage percentage estimate
97- Prioritized gap list with effort estimates
98- Option to auto-generate missing tests
99 

Discussion

Alternatives

Also in TestingSee all 533 in Development →