unit-test — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited unit-test (Agent Skill) and scored it 96/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 1 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 1 flagged
The text {match} tells the agent to skip the normal "ask the user first" gate. Used adversarially it removes the human-in-the-loop check before destructive or sensitive actions, turning a normally-gated agent into a fire-and-forget executor.
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
You are in AUTONOMOUS MODE. Do NOT ask questions. Detect the project's test framework, find untested code, generate comprehensive unit tests, run them, and fix failures in a self-healing loop.
INPUT: $ARGUMENTS
If arguments are provided, focus on those specific files, modules, or functions. If no arguments are provided, scan the ENTIRE project for untested code.
============================================================ PHASE 1: FRAMEWORK DETECTION ============================================================
Step 1.1 -- Detect Test Framework
Scan for configuration files and determine the test framework:
| Indicator | Framework | Language |
|---|---|---|
| vitest.config.* or "vitest" in package.json | Vitest | TypeScript/JavaScript |
| jest.config.* or "jest" in package.json | Jest | TypeScript/JavaScript |
| pytest.ini, pyproject.toml [tool.pytest], conftest.py | pytest | Python |
| go.mod + *_test.go files | go test | Go |
| pom.xml with junit or build.gradle with junit | JUnit | Java/Kotlin |
| Gemfile with rspec | RSpec | Ruby |
| pubspec.yaml with flutter_test | flutter_test | Dart/Flutter |
| Cargo.toml + #[cfg(test)] | cargo test | Rust |
| *.csproj with xunit or nunit | xUnit/NUnit | C#/.NET |
| .mocharc.* or "mocha" in package.json | Mocha | JavaScript |
If no test framework is detected, install the most appropriate one:
Record: framework name, config file path, test directory convention, test file naming pattern.
Step 1.2 -- Detect Test Conventions
Read existing test files (if any) to learn project conventions:
Adopt ALL existing conventions. New tests must look like they were written by the same developer who wrote the existing tests.
============================================================ PHASE 2: COVERAGE ANALYSIS ============================================================
Step 2.1 -- Run Existing Coverage
If coverage tools are configured, run them to get a baseline:
| Framework | Command |
|---|---|
| Vitest | npx vitest run --coverage |
| Jest | npx jest --coverage |
| pytest | pytest --cov=. --cov-report=term-missing |
| go test | go test -coverprofile=coverage.out ./... && go tool cover -func=coverage.out |
| flutter_test | flutter test --coverage |
| cargo test | cargo tarpaulin --out Stdout |
Parse the output to identify:
Step 2.2 -- Scan for Untested Code
If no coverage data is available, scan manually:
Build the untested code inventory:
| Source File | Functions | Complexity | Test File Exists | Priority |
|---|
Priority ranking:
============================================================ PHASE 3: TEST GENERATION ============================================================
Step 3.1 -- Generate Test Files
For each untested source file (ordered by priority), generate a test file.
FOLLOW THE PROJECT'S CONVENTIONS for file naming and location.
Each test file must include:
IMPORTS:
HAPPY PATH TESTS:
EDGE CASE TESTS:
ERROR PATH TESTS:
BOUNDARY VALUE TESTS:
Step 3.2 -- Mock Strategy
Use mocks appropriately:
MOCK THESE (external dependencies):
DO NOT MOCK THESE (test the real thing):
Mock setup pattern (adapt to detected framework):
Step 3.3 -- Test Quality Rules
Every generated test must:
============================================================ PHASE 4: EXECUTION AND SELF-HEALING ============================================================
Step 4.1 -- Run Generated Tests
Execute the new tests:
| Framework | Command |
|---|---|
| Vitest | npx vitest run [test-files] --reporter=verbose |
| Jest | npx jest [test-files] --verbose --forceExit |
| pytest | pytest [test-files] -v --tb=short |
| go test | go test -v -run [TestPattern] ./... |
| flutter_test | flutter test [test-files] |
| RSpec | bundle exec rspec [test-files] --format documentation |
| cargo test | cargo test [test-names] -- --nocapture |
| JUnit | mvn test -Dtest=[TestClass] or gradle test --tests [TestClass] |
Record results for each test: PASS, FAIL (with error), or ERROR.
Step 4.2 -- Self-Healing Loop (max 3 iterations)
For each failing test, diagnose the failure:
CATEGORY A -- TEST BUG (fix the test):
CATEGORY B -- APP BUG (fix the application):
FIX: Apply the appropriate fix, re-run ONLY the previously failing tests.
ITERATION RULES:
Step 4.3 -- Full Suite Verification
After the healing loop, run the ENTIRE test suite (existing + new tests):
Verify:
If existing tests broke, fix the regression before continuing.
============================================================ PHASE 5: COVERAGE MEASUREMENT ============================================================
Run coverage again with all tests (existing + new):
| Framework | Command |
|---|---|
| Vitest | npx vitest run --coverage |
| Jest | npx jest --coverage |
| pytest | pytest --cov=. --cov-report=term-missing |
| go test | go test -coverprofile=coverage.out ./... |
| flutter_test | flutter test --coverage |
Record the improvement: before vs. after coverage percentage.
============================================================ OUTPUT ============================================================
| Source File | Test File | Tests Added | Category | Status |
|---|---|---|---|---|
| [source] | [test] | N | [CRITICAL/HIGH/MEDIUM/LOW] | [ALL PASS / N UNRESOLVED] |
NEXT STEPS:
/integration-test to test component interactions."/e2e for end-to-end user flow testing."/test-suite to see the overall test health score after adding unit tests."/qa for a full quality audit beyond just test coverage."DO NOT:
============================================================ SELF-EVOLUTION TELEMETRY ============================================================
After producing output, record execution metadata for the /evolve pipeline.
Check if a project memory directory exists:
~/.claude/projects/skill-telemetry.md in that memory directoryEntry format:
### /unit-test — {{YYYY-MM-DD}}
- Outcome: {{SUCCESS | PARTIAL | FAILED}}
- Self-healed: {{yes — what was healed | no}}
- Iterations used: {{N}} / {{N max}}
- Bottleneck: {{phase that struggled or "none"}}
- Suggestion: {{one-line improvement idea for /evolve, or "none"}}Only log if the memory directory exists. Skip silently if not found. Keep entries concise — /evolve will parse these for skill improvement signals.
~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.