# Z M Huang Vcp Vcp Review Tests

> VCP Review Tests

- Skill: `tomevault-io/z-m-huang-vcp-vcp-review-tests` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add tomevault-io/z-m-huang-vcp-vcp-review-tests`
- Raw SKILL.md: https://api.skillmd.com/api/skills/tomevault-io/z-m-huang-vcp-vcp-review-tests/raw
- Safety review: pending (external: skill-scanner PASS, skillspector PASS)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: tomevault-io (https://skillmd.com/u/tomevault-io)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/tomevault-io/z-m-huang-vcp-vcp-review-tests

---


# VCP Review Tests

Review test files for quality anti-patterns against VCP testing standards.

## Step 1: Resolve Config

1. Read `.vcp/config.json` from the project root. Extract the `pluginRoot` field.
2. **If `.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."
3. **Validate `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."
4. Run the config resolution script via Bash:
   ```bash
   bun "<pluginRoot>/lib/resolve-config.ts" "<project-root>"
   ```
5. Parse the JSON output. It contains: `applicableStandards`, `ignoredRules`, `severity`, `exclude`.

## Step 2: Fetch Applicable Standards

From the `applicableStandards` array in the resolved config, keep only the entry where:
- `id` is `core-testing`

Use WebFetch to fetch its content from:
```
{entry.url}
```

Extract the **Rules** section and the **Patterns** section (for anti-pattern reference).

## Step 4: Find and Review Test Files

**Target path:** `$ARGUMENTS` if provided. If not provided, scan the entire project.

1. Use Glob to find test files matching these patterns (exclude patterns from `exclude` in the resolved config):
   - `**/*.test.*` (JavaScript/TypeScript)
   - `**/*.spec.*` (JavaScript/TypeScript)
   - `**/test_*.*` (Python)
   - `**/__tests__/**` (JavaScript/TypeScript)
   - `**/*_test.go` (Go)
   - `**/*Test.java` (Java)
   - `**/*_test.rb` (Ruby)
   - `**/*_spec.rb` (Ruby/RSpec)
   - `**/*_test.rs` (Rust)

2. Read each test file and check for these 8 anti-patterns:

### Anti-Pattern Checks

1. **Tautological tests** — Tests that assert the code does what it does (generated by reading implementation and asserting same logic). Test verifies its own setup, not real behavior. (Rules 3, 11)

2. **Over-mocking** — More than 3 mock/stub setups in a single test, especially mocking internal classes/services that should be tested through. (Rules 4, 6)

3. **Mock-only assertions** — Test assertions only verify mock calls (`.assert_called_once()`, `.toHaveBeenCalledWith()`) with no assertions on actual return values, state changes, or side effects. (Rule 5)

4. **Missing edge cases** — Happy path tested but no tests for: null/undefined/empty inputs, boundary values, error conditions, special characters. (Rule 7)

5. **Missing error paths** — Operations that can fail (network, file I/O, parsing, validation) have no failure-case tests. (Rule 8)

6. **Implementation coupling** — Tests assert on internal method calls, private state, or execution order rather than observable outcomes. Tests that would break on refactoring without behavior change. (Rule 1)

7. **Non-deterministic tests** — Tests depending on current time, random values, network availability, or uncontrolled filesystem state. (Rule 10)

8. **Shared mutable state** — Tests that modify shared variables, global state, or class-level fixtures without reset. Tests that depend on execution order. (Rule 9)

## Step 5: Report Findings

Output findings per file with a quality rating, then detail findings.

Before outputting findings, remove any that match an entry in the `ignoredRules` array from the resolved config. If `"standard-id/rule-N"` is in the list, suppress that specific rule's findings. (Standard-level ignores are already applied by the config resolution script.) After filtering, if any findings were suppressed, append a line: `**Suppressed:** X finding(s) by ignore config.`

Use this format:

```
### VCP Test Review

**Standard:** core-testing (12 rules)
**Test files found:** N files

#### Summary

| File | Rating | Issues |
|------|--------|--------|
| tests/test_orders.py | GOOD | 0 |
| tests/test_payments.py | NEEDS WORK | 3 (over-mocking, mock-only assertions, missing edge cases) |
| tests/test_auth.py | REWRITE | 5 (tautological, over-mocking, implementation coupling, ...) |

#### Findings

##### tests/test_payments.py — NEEDS WORK

- **Over-mocking** (Rule 4) — `test_process_payment` at line 42
  - **Issue:** 5 mocks set up including internal `PriceCalculator` and `OrderValidator`
  - **Fix:** Only mock the external payment gateway. Use real `PriceCalculator` and `OrderValidator`.

- **Mock-only assertions** (Rule 5) — `test_process_payment` at line 55
  - **Issue:** Only asserts `mock_gateway.charge.assert_called_once()` — no assertion on the returned order total
  - **Fix:** Assert on the return value: `assert result.total == expected_total`

- **Missing edge cases** (Rule 7) — `test_process_payment` has no tests for:
  - Zero-amount orders
  - Negative amounts
  - Currency edge cases

...
```

Rating criteria:
- **GOOD** — No anti-patterns found
- **NEEDS WORK** — 1-3 anti-patterns found. Tests have value but need improvement.
- **REWRITE** — 4+ anti-patterns found, or tautological tests (tests that validate nothing real). Tests provide false confidence and should be rewritten.

If no test files found: **"No test files found in [path]. Nothing to review."**
If all tests pass: **"All N test files pass quality review. No anti-patterns found."**

---
> Converted and distributed by [TomeVault](https://tomevault.io/claim/z-m-huang) — claim your Tome and manage your conversions.
<!-- tomevault:4.0:skill_md:2026-04-16 -->

