coverage
它能做什么
这项技能让智能体列出应用的各个部分,并与你已有的测试进行比较。适合想知道哪里缺少测试的开发者和质量保证人员。
适用场景
- ✓当你想知道哪些页面或功能没有测试时。
- ✓当你在规划下一步测试、并希望对缺口进行排序的时候。
- ✓当有人要求你提供测试覆盖率报告的时候。
技能链接
https://github.com/alirezarezvani/claude-skills/blob/main/engineering-team/playwright-pro/skills/coverage/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“请告诉我我的应用中哪些部分还没有测试,先列出最重要的部分。”
每周 5 个新技能,1 分钟读完。
工作原理
智能体会映射你的路由、组件和 API 端点,然后读取现有测试文件,看它们覆盖了什么。它会生成一张已覆盖和缺失区域的表格,并按业务影响对缺口排序。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
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
常见问题
它也会编写缺失的测试吗?
不会。它只负责找出并排序缺口,编写测试是另一个步骤。
它能理解哪些类型的应用?
它会查看常见的路由设置,例如 Next.js、React Router 和 Vue Router,以及 Playwright 测试文件。
覆盖率表格显示什么?
每个区域都有一个状态,例如已覆盖、部分覆盖或缺失,并附有其测试的数量。
详情
作者的原始描述
Use when asked what's not tested or for test coverage gaps ('test coverage', 'coverage gaps', 'missing tests', 'what needs testing'). Maps untested pages and flows.
热度
- GitHub 星标
- 29k
- 排名
- #9473
- 许可证
- MIT
- 更新时间
- 2026/11/2
评论
- …
同一仓库的更多技能
agent-launcher-orchestrator
29k帮你的智能体从一个清晰的目标出发,逐步规划、构建、测试并定时运行你自己账户中的 Claude 托管智能体。
grade-iterate
29k让你的智能体按评分标准为托管 AI 智能体的工作打分,并在固定的轮次内改进,因此它永远不会无限循环。
interview
29k让你的智能体就一个 AI 智能体的想法对你进行访谈,并在任何上线之前,把你的回答整理成一份简单的构建计划。
run-without-you
29k帮你的智能体设置托管 AI 智能体,使其按计划或在某个事件发生时运行,并在启动前检查定时设置。