Skip to content
Back to skills

Map Test Surface

ASecurity

Enumerate every test file in a codebase, extract test subjects and assertions, detect the test framework in use, and emit test-surface.yaml. Used by test-engineer.

  • 3 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added September 10, 2026
testinggobash

Security analysis

A100/100

Scanned September 10, 2026

npx -y skills add kapilvirenahuja/garura --skill map-test-surface --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Map Test Surface?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Map Test Surface
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/kapilvirenahuja-map-test-surface/badge)](https://www.skillsdirectory.com/skills/kapilvirenahuja-map-test-surface)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: map-test-surface
description: Enumerate every test file in a codebase, extract test subjects and assertions, detect the test framework in use, and emit test-surface.yaml. Used by test-engineer.
user-invocable: false
model: sonnet
allowed-tools: Read, Write, Grep, Glob, Bash
deprecated: true
deprecated_note: '#434 ProductOS realignment — superseded by the command model; retained for Phase E reference, not installed'
---

# map-test-surface

Model-invocable skill for mapping the test surface of a codebase.

## Purpose

Produce a complete inventory of existing tests: file locations, subjects (what they test), assertion counts, frameworks used. Emit `test-surface.yaml` — the basis for later blast-radius computation and coverage-gap analysis.

Previously authored inline by test-engineer.

## Input

| Field | Required | Description |
|-------|----------|-------------|
| `project_root` | yes | Codebase root |
| `test_globs` | optional | Override test-file globs (default auto-detect by language) |
| `output_base` | yes | Directory to write test-surface.yaml |

## Process

1. **Detect test framework(s).** From config (`pytest.ini`, `jest.config`, `go.sum`, etc.) and file naming (`*_test.py`, `*.test.ts`, `*_test.go`, `spec/` dirs).

2. **Glob test files.** Language-specific defaults; user override via `test_globs`.

3. **Per file, extract:**
   - **framework** — pytest | unittest | jest | vitest | mocha | go-test | junit | ...
   - **subjects** — the module/class/function each test block exercises (derived from imports + test names)
   - **test_count** — number of test functions / `it(...)` / methods
   - **assertion_count** — approximate count via grep (`assert`, `expect(`, `should`)
   - **tags** — skip / xfail / slow / integration markers

4. **Aggregate.** Total test count, assertion count, per-framework counts, subjects covered.

5. **Emit test-surface.yaml:**

   ```yaml
   project_root: "{project_root}"
   generated_at: "{ISO-8601}"
   frameworks: [ ... ]
   totals:
     test_files: {n}
     test_functions: {n}
     assertions: {n}
   files:
     - path: "{test file}"
       framework: "{name}"
       subjects: [ "{module/class/function under test}" ]
       test_count: {n}
       assertion_count: {n}
       tags: [ ... ]
   subjects_index:
     - subject: "{module/class/function}"
       tested_by: [ "{test file path}" ]
   ```

## Output

```yaml
test_surface_path: "{output_base}/test-surface.yaml"
test_file_count: {n}
status: written
```

## Boundaries

- Read-only.
- Do not execute tests — that is quality-auditor's domain.
- Approximate assertion counts via grep are acceptable — deep AST analysis is out of scope.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…