Analyze Test Coverage Gaps
Analyze test coverage gaps.
How to use it
Claude Code
- Run the line below. It pulls the whole folder into
~/.claude/skills/coverage, including the files SKILL.md points to. - 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/coverageFor 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)
- On this page open ⋯ → Download .md.
- Save it as SKILL.md in a folder, zip the folder, then Customize → Skills → + → Create skill → Upload a skill.
- Pick the file and Save. Claude shows the name and description and runs a security scan.
- Check the skill is switched on.
- Start a new chat and describe your job in plain words. The AI follows the skill from there.
ChatGPT or another app
- ChatGPT: make a Project and paste it into Instructions.
- 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.
Paste into Claude, ChatGPT or Cursor.
Source of Analyze Test Coverage Gaps
Show the full text99 lines
| name | description |
|---|---|
| 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:
- Critical — auth, payment, core features → test first
- High — user-facing CRUD, search, navigation
- Medium — settings, preferences, edge cases
- 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 | |
| 2 | name "coverage" |
| 3 | description >- |
| 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 | |
| 11 | Map 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 | |
| 17 | Use 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 | |
| 37 | Scan 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 | |
| 61 | Rank uncovered areas by business impact: |
| 62 | |
| 63 | **Critical** — auth, payment, core features → test first |
| 64 | **High** — user-facing CRUD, search, navigation |
| 65 | **Medium** — settings, preferences, edge cases |
| 66 | **Low** — static pages, about, terms |
| 67 | |
| 68 | ### 5. Suggest Test Plan |
| 69 | |
| 70 | For 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 |
| 79 | 1. /register (4 tests) — use auth/registration template — quick |
| 80 | 2. /forgot-password (3 tests) — use auth/password-reset template — quick |
| 81 | |
| 82 | ### Priority 2: High |
| 83 | 3. /settings (4 tests) — use settings/ templates — medium |
| 84 | 4. Dashboard error states (2 tests) — use dashboard/data-loading template — quick |
| 85 | |
| 86 | |
| 87 | ### 6. Auto-Generate (Optional) |
| 88 | |
| 89 | Ask user: "Generate tests for the top N gaps? [Yes/No/Pick specific]" |
| 90 | |
| 91 | If 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
Test-Driven Development (TDD)Use when implementing any feature or bugfix, before writing implementation codeTest first bug fixing approachGuide to fixing bugs using a test-first approach, ensuring code reliability through systematic testing and implementation.Web application testing skillToolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.Bats testing patternsMaster Bash Automated Testing System (Bats) for comprehensive shell script testing. Use when writing tests for shell scripts, CI/CD pipelines, or requiring test-driven development of shell utilities.
Browse more free Claude skills or everything in Development.