coverage – skill Lập trình cho agent AI
Phân tích khoảng trống độ phủ test. Dùng khi người dùng nói "test coverage", "what's not tested", "coverage gaps", "missing tests", "coverage report", hoặc "what needs testing".
Cài skill coverage bằng một lệnh
Chọn công cụ bạn đang dùng, copy lệnh và dán vào terminal. Skill sẽ nằm trong thư mục skills của công cụ đó và sẵn sàng dùng ở phiên làm việc tiếp theo.
Claude Code
mkdir -p ~/.claude/skills && curl -fsSL https://skill.dn1nguoi.com/z/coverage-520c1.tgz | tar xz -C ~/.claude/skills
Gọi trong Claude Code: /coverage – rồi mô tả công việc bạn muốn làm.
Codex
mkdir -p ~/.codex/skills && curl -fsSL https://skill.dn1nguoi.com/z/coverage-520c1.tgz | tar xz -C ~/.codex/skills
Gọi trong Codex: $coverage – rồi mô tả công việc bạn muốn làm.
Hermes Agent
mkdir -p ~/.hermes/skills && curl -fsSL https://skill.dn1nguoi.com/z/coverage-520c1.tgz | tar xz -C ~/.hermes/skills
Gọi trong Hermes Agent: /coverage – rồi mô tả công việc bạn muốn làm.
DeepSeek
mkdir -p ~/.deepcode/skills && curl -fsSL https://skill.dn1nguoi.com/z/coverage-520c1.tgz | tar xz -C ~/.deepcode/skills
Gọi trong DeepSeek: /coverage – rồi mô tả công việc bạn muốn làm.
Nội dung SKILL.md
Nội dung SKILL.md gốc bằng tiếng Anh.
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 — quick6. 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
Skill liên quan
- hunt-open-redirect – Săn Open Redirect — mọi loại, kể cả mức ảnh hưởng thấp, chuỗi tới đánh cắp token OAuth →…
- modal – Modal là nền tảng đám mây serverless để chạy Python theo yêu cầu, bao gồm GPU theo yêu…
- azure-eventhub-rust – SDK Azure Event Hubs cho Rust. Dùng để gửi và nhận sự kiện, nhập dữ liệu streaming.
- cpo-review – /c-level-agents:cpo-review [plan] — Chất vấn theo JTBD về lộ trình sản phẩm, tín hiệu…
- ncats-arax – Truy vấn API production ARAX của NCATS Translator để lấy quan hệ đồ thị tri thức sinh…
- azure-identity-rust – SDK Azure Identity cho xác thực Rust. Dùng cho DeveloperToolsCredential…
- azure-keyvault-certificates-rust – SDK Azure Key Vault Certificates cho Rust. Dùng để tạo, nhập và quản lý chứng chỉ.
- azure-keyvault-keys-rust – SDK Azure Key Vault Keys cho Rust. Dùng để tạo, quản lý và sử dụng khóa mật mã. Từ khóa…