supercov – skill Lập trình cho agent AI
Đo độ bao phủ dòng, nhánh và MC/DC của các test hiện có bằng CLI supercov, sau đó viết các test nhỏ, tập trung cho đoạn code mà test nào cũng chưa chạm tới.
Cài skill supercov 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/supercov-9c352.tgz | tar xz -C ~/.claude/skills
Gọi trong Claude Code: /supercov – 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/supercov-9c352.tgz | tar xz -C ~/.codex/skills
Gọi trong Codex: $supercov – 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/supercov-9c352.tgz | tar xz -C ~/.hermes/skills
Gọi trong Hermes Agent: /supercov – 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/supercov-9c352.tgz | tar xz -C ~/.deepcode/skills
Gọi trong DeepSeek: /supercov – 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.
Supercov
Overview
Supercov runs the project's own test command on the user's machine and reports line, branch and MC/DC coverage per test. It changes no source, tests or configuration. This skill uses that report to pick one untested piece of code at a time and write a focused test for it.
It works with JavaScript, TypeScript, Python, Ruby, Rust, Go, Java and Kotlin projects.
When to Use This Skill
- Use when the user asks to add or improve tests.
- Use when the user asks which code is untested, or asks to raise coverage.
- Use when the user asks which file to refactor first and has agreed to a quality check (see "Quality check").
Preconditions
- Node.js 22 or newer. If it is missing, tell the user. Do not install software without the user's approval.
- The project's test command, for example
npm test,pytestorcargo test. Ask if it is not obvious from the repository. - Always run the pinned version,
npx [email protected]. The first run downloads that release from npm, so get the user's approval before it.
How It Works
Step 1: Measure the suite
Run the full test command under Supercov. Coverage is measured locally and sends nothing over the network.
npx [email protected] -- npm testStep 2: Pick a target
List the untested code, pick one item, and read it in context.
npx [email protected] runs latest gaps --limit 5
npx [email protected] runs latest file src/session.jsStep 3: Write one focused test
Write one test for the chosen target. Change only test files unless the user asks otherwise.
Step 4: Rerun and report
Rerun the command from step 1. Report the test you added and the coverage before and after.
For anything not shown here, npx [email protected] docs <topic> prints the guide for that version. Topics: agent-loop, quality, supported-suites, troubleshooting.
Examples
Example 1: Add a test for untested code
npx [email protected] -- npm test
npx [email protected] runs latest gaps --limit 5
# add one test for the first gap, then:
npx [email protected] -- npm testExample 2: Other languages
npx [email protected] -- pytest
npx [email protected] -- cargo test
npx [email protected] -- go test ./...
npx [email protected] -- ./gradlew testQuality check
npx [email protected] quality ranks files by code smells, and npx [email protected] quality patch reports what a change introduced.
- These two commands send the project's source files to TypeSafe's API for analysis. Run them only when the user asked for a quality check, and tell the user before running that their source files will be sent to TypeSafe.
- They need the user's own
TYPESAFE_API_KEYin the environment. Never ask the user to paste a key into the conversation, and never create, read or print one. - If the key is missing, tell the user the check needs it, then answer from reading the code and say Supercov did not check it.
Best Practices
- ✅ Measure the full suite first, so the gaps reflect every test.
- ✅ Add one test per gap and rerun before picking the next.
- ✅ Report coverage before and after with the numbers Supercov printed.
- ❌ Don't change application code to raise coverage unless the user asks.
- ❌ Don't run the quality commands without the user's request and consent.
Limitations
- Coverage shows which code ran under a test. It does not show that the test checked the result.
- Supercov measures the suites listed in
npx [email protected] docs supported-suites. Other runners are not measured. - The test command runs as the project defines it. If the suite needs services, credentials or network access, those needs still apply.
- This skill does not replace environment-specific validation, testing, or expert review.
- Stop and ask for clarification if required inputs, permissions, or safety boundaries are missing.
Security & Safety Notes
- The skill runs the project's own test command and writes test files in the user's repository. Run it only in a repository the user has authorized, and keep changes to test files unless the user asks otherwise.
- Supercov writes its run data to a
.supercovdirectory in the project. It does not edit source, tests or configuration. npx [email protected]downloads a pinned release from the npm registry. Get the user's approval before the first run. Upgrading the pin needs a new review.- Coverage commands make no network requests. Only the quality commands contact a third party, TypeSafe's API, and only with the user's consent and their own key.
Related Skills
@test-driven-development- Use when the behavior does not exist yet and the test should come first.
Skill liên quan
- sveltekit – Xây dựng ứng dụng web full-stack với SvelteKit — định tuyến theo file, SSR, SSG, API…
- swift – Hướng dẫn viết code chuẩn theo ngôn ngữ dành cho Swift.
- swift-concurrency-expert – Rà soát và sửa các lỗi concurrency trong Swift như actor isolation và vi phạm Sendable.
- swiftui-expert-skill – Viết, rà soát và tái cấu trúc SwiftUI cho iOS hoặc macOS, bao gồm luồng dữ liệu, cấu…
- swiftui-liquid-glass – Triển khai hoặc rà soát các API Liquid Glass của SwiftUI với fallback đúng và thứ tự…
- swiftui-view-refactor – Tái cấu trúc view SwiftUI thành các component nhỏ hơn với luồng dữ liệu ổn định và rõ…
- sympy – SymPy là thư viện Python cho toán học ký hiệu, cho phép tính toán chính xác bằng các ký…
- syncbook-discovery – Tìm người cộng tác đối ứng trên Syncbook hoặc chuẩn bị bản nháp hồ sơ riêng tư để con…