From vcp
Maps source files to test files in JS/TS, Python, Go, Java, Ruby, Rust projects to find untested functions and missing edge case coverage.
How this skill is triggered — by the user, by Claude, or both
Slash command
/vcp:vcp-coverage-gapsThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
Map source files to test files and identify untested or under-tested code.
Map source files to test files and identify untested or under-tested code.
.vcp/config.json from the project root. Extract the pluginRoot field..vcp/config.json does not exist or pluginRoot is missing: Stop and tell the user: "No VCP configuration found. Run /vcp-init to configure VCP for this project."pluginRoot: The path must be absolute, contain /.claude/ (or \.claude\ on Windows) as a path segment, and contain only safe path characters (letters, digits, /, \, -, _, ., :, and spaces). Reject any path with shell metacharacters (;, &, |, $, `, (, ), {, }, <, >, !, ~, #, *, ?, [, ], ', "). If validation fails, stop and tell the user: "Invalid pluginRoot — must be within ~/.claude/ and contain no shell metacharacters. Run /vcp-init to fix." Also verify the file <pluginRoot>/lib/vcp-context-core.ts exists using Glob. If it does not exist, stop and tell the user: "pluginRoot points to an invalid VCP installation. Run /vcp-init to fix."bun "<pluginRoot>/lib/resolve-config.ts" "<project-root>"
applicableStandards, ignoredRules, severity, exclude.From the applicableStandards array in the resolved config, keep only entries where:
id is core-testing, ORid is core-error-handlingFor each selected standard, use WebFetch to fetch its content from:
{entry.url}
Extract the Rules section from each fetched standard.
Target path: $ARGUMENTS if provided. If not provided, scan the entire project.
Use Glob to find source files in the target path (exclude patterns from exclude in the resolved config, and also exclude test files themselves).
For each source file, attempt to find a corresponding test file using naming conventions:
src/foo.ts → src/foo.test.ts, src/foo.spec.ts, tests/foo.test.ts, test/foo.test.ts, src/__tests__/foo.test.tssrc/foo.py → tests/test_foo.py, test/test_foo.py, src/test_foo.pysrc/foo.go → src/foo_test.gosrc/Foo.java → src/FooTest.java, test/FooTest.javasrc/foo.rb → spec/foo_spec.rb, test/test_foo.rbsrc/foo.rs → src/foo_test.rs, tests/foo.rsAlso use Grep to search for imports/references to the source file's exports within test directories, to catch non-conventional test file locations.
For each source file:
Identify public functions/exports — Read the file and list all exported functions, public methods, API endpoints, route handlers, and CLI commands.
Check test existence — Does a corresponding test file exist? Does any test file import or reference this source file?
Check function-level coverage — For each public function, search the test files for tests that call or exercise it. A function is "untested" if no test references it.
Check edge case coverage — For tested functions, check if the tests cover:
core-error-handling rules)core-testing Rule 7)Prioritize gaps by risk:
Output a coverage map and prioritized gaps.
### VCP Coverage Gaps
**Standards:** core-testing, core-error-handling
**Source files scanned:** N files
**Test files found:** M files
#### Coverage Map
| Source File | Test File | Tested Functions | Untested Functions | Priority |
|-------------|-----------|------------------|--------------------|----------|
| src/routes/users.ts | tests/users.test.ts | 3/5 | createUser, deleteUser | Critical |
| src/services/payment.ts | tests/payment.test.ts | 2/4 | refund, handleWebhook | Critical |
| src/utils/validation.ts | — | 0/6 | all | High |
| src/models/order.ts | tests/order.test.ts | 4/4 | — | — |
#### Untested Code (by priority)
##### Critical — Integration Boundaries
- **src/routes/users.ts** — `createUser` (line 25), `deleteUser` (line 78)
- These are API endpoints handling user input. Untested endpoints are direct security risk.
- **src/services/payment.ts** — `refund` (line 42), `handleWebhook` (line 95)
- External payment service integration. Failures here affect money.
##### High — Error Handling & Validation
- **src/utils/validation.ts** — No test file exists
- 6 validation functions with no test coverage. Validation bugs lead to bad data entering the system.
##### Medium — Business Logic
...
#### Edge Case Gaps (tested but incomplete)
- **tests/payment.test.ts** → `processPayment`:
- Missing: zero-amount test, currency mismatch test, duplicate payment test
- **tests/users.test.ts** → `updateUser`:
- Missing: empty payload test, invalid email format test
**Summary:** X untested functions across Y files. Z edge case gaps in existing tests.
If all source files have corresponding test files and all public functions are tested: "Full coverage mapped. N source files, M test files. No untested public functions found." (Still note edge case gaps if found.)
npx claudepluginhub z-m-huang/vcp --plugin vcpAnalyzes test coverage to identify untested code paths and suggest test additions. Useful when reviewing code safety or planning refactors.
Queries test coverage in Python, Node.js, Rust, Go projects. Identifies uncovered areas/files, analyzes trends, and generates reports before changes or PRs.
Assesses three-layer test coverage (unit/integration/E2E) by mapping source code to tests, identifying gaps, and recommending new tests.