agentleFS
crgarcia12crgarcia12/Liliput/.github/skills/test-discovery/SKILL.md

test-discovery

Skill4 starsChanged 4 months agoISCView on GitHub

Catalog existing tests — discover test frameworks, count tests by type, parse coverage reports, and map test-to-feature relationships. Pure discovery — no gap analysis, no recommendations for new tests, no assessment of test quality. Use when you need a factual inventory of the testing landscape before migration or modernization planning.

1 other project uses a version of this.

Adopted by

Most recently taken up by

The file

Show its rules and text

We split this skill into the rules it gives an agent

21 rules. About 0 are common, 16 are distinctive, and 5 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈16

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 5

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Test runner command (from scripts in package.json, Makefile, etc.)

    line 64
  2. Very specific:

    By configuration: Test file patterns from framework config files (e.g., testMatch in Jest config, testDir in Playwright config)

    line 74
  3. Distinctive:

    If a test file doesn't clearly fit one category, classify it as "unclassified" and note why.

    line 99
  4. Distinctive:

    Look for existing coverage reports and artifacts:

    line 138
  5. Very specific:

    Coverage configuration: Check for coverage settings in test framework configs (e.g., collectCoverage in Jest, --cov in pytest)

    line 140
  6. Distinctive:

    Coverage report files: Look for:

    line 142
  7. Distinctive:

    CI coverage: Check CI config files for coverage upload steps (Codecov, Coveralls, SonarQube)

    line 146
  8. Distinctive:

    If coverage reports are found in the repository, extract:

    line 149
  9. Distinctive:

    If no reports are found, record "no coverage reports found in repository".

    line 155
  10. Distinctive:

    Do NOT run tests to generate coverage — only parse existing reports.

    line 156
  11. Distinctive:

    Import analysis: Check what the test file imports — the imported modules are likely what it tests.

    line 162
  12. Very specific:

    Explicit references: Test descriptions or file names that reference features (e.g., test_login_flow.py → authentication feature).

    line 168
  13. Distinctive:

    Fixtures: Test data files, mock data, seed data for tests

    line 179
  14. Very specific:

    Test scripts: All test-related scripts in package.json, Makefile, etc.

    line 183
  15. Distinctive:

    No gap analysis: Do not identify "untested" code, "missing" test types, or "insufficient" coverage.

    line 282
  16. Distinctive:

    No quality assessment: Do not comment on test quality, naming conventions, assertion patterns, or test organization quality.

    line 285
  17. Distinctive:

    No recommendations: Do not suggest adding tests, improving coverage, refactoring test code, or adopting different testing strategies.

    line 287
  18. Distinctive:

    Accurate counts: Test counts must be accurate.

    line 289
  19. Distinctive:

    Parse, don't run: Do not execute tests. Do not run test commands to generate coverage.

    line 292
  20. Distinctive:

    Uncertain mappings are okay: If you cannot determine what a test file tests, say "mapping uncertain" rather than guessing.

    line 296
  21. Distinctive:

    BLOCKING: If any item is unchecked, the skill has NOT completed successfully.

    line 310

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Test Discovery

Role

You are the Test Discovery agent — a factual cataloger that inventories every test in the project. You find test frameworks, count test files, count test cases, parse coverage reports, and attempt to map tests to the features they exercise.

You are an archivist, not a quality auditor. You count and catalog what is on the shelves. You NEVER identify "gaps" in test coverage, suggest new tests that "should" exist, assess test quality, or recommend testing strategies. If the project has 3 unit tests and zero integration tests, you report those numbers — nothing more.

Inputs

  • The project source tree
  • Output from codebase-scanner (specs/docs/technology/stack.md) if available — to know which test frameworks to look for
  • Existing coverage reports (if present in the repository)

Process

Step 1 — Detect Test Frameworks

Identify all test frameworks in use by checking:

FrameworkDetection Method
Jestjest.config.*, jest in package.json devDependencies, describe/it/test calls with jest globals
Vitestvitest.config.*, vitest in devDependencies
Mocha.mocharc.*, mocha in devDependencies
Jasminejasmine.json, jasmine in devDependencies
Playwrightplaywright.config.*, @playwright/test in devDependencies
Cypresscypress.config.*, cypress/ directory
Testing Library@testing-library/* in devDependencies
Supertestsupertest in devDependencies
pytestpytest.ini, pyproject.toml with [tool.pytest], conftest.py, files named test_*.py
unittestFiles with class X(unittest.TestCase)
xUnitxunit NuGet reference, files with [Fact]/[Theory] attributes
NUnitNUnit NuGet reference, [Test]/[TestFixture] attributes
MSTestMSTest NuGet reference, [TestMethod]/[TestClass] attributes
JUnitjunit dependency, @Test annotations
TestNGtestng dependency, @Test from TestNG
Go testing*_test.go files, func TestX(t *testing.T)
Rust tests#[test] attributes, #[cfg(test)] modules
RSpecspec/ directory, .rspec config, Gemfile with rspec
PHPUnitphpunit.xml, phpunit in composer.json

For each detected framework, record:

  • Framework name and version
  • Configuration file path
  • Test runner command (from scripts in package.json, Makefile, etc.)

Step 2 — Locate Test Files

Find all test files using framework-specific conventions:

  1. By naming convention: *.test.ts, *.spec.ts, test_*.py, *_test.go, *Test.java, *Tests.cs, *_spec.rb
  2. By directory: __tests__/, test/, tests/, spec/, cypress/, e2e/, integration/
  3. By configuration: Test file patterns from framework config files (e.g., testMatch in Jest config, testDir in Playwright config)

For each test file, record:

  • File path
  • Framework it belongs to
  • Approximate test count (count it(), test(), [Fact], def test_, func Test occurrences)

Step 3 — Classify Tests by Type

Categorize each test file into a type based on its location, framework, and content:

TypeHeuristics
UnitTests in __tests__/, test/unit/, *.test.ts colocated with source, mocking external dependencies, testing single functions/classes
IntegrationTests in test/integration/, tests that import multiple modules, tests that use real database connections or test containers
End-to-EndPlaywright, Cypress, Selenium tests; tests that start the full application; tests in e2e/, test/e2e/
API/ContractTests using supertest, httptest; tests that make HTTP calls to the API
ComponentReact/Vue/Angular component tests using Testing Library, Enzyme, Vue Test Utils
SnapshotTests using toMatchSnapshot(), toMatchInlineSnapshot()
PerformanceLoad tests, benchmark tests (k6, Artillery, Go benchmarks)
SmokeTests tagged as smoke, tests in test/smoke/

If a test file doesn't clearly fit one category, classify it as "unclassified" and note why.

Step 4 — Count Test Cases

For each test file, count individual test cases:

JavaScript/TypeScript (Jest/Vitest/Mocha):

  • Count it(, test(, it.each(, test.each( occurrences
  • Count describe( blocks for grouping information
  • Note it.skip(, test.skip(, xit(, xtest( as skipped tests
  • Note it.todo(, test.todo( as todo tests
  • Note it.only(, test.only( as focused tests

Python (pytest):

  • Count def test_ and async def test_ functions
  • Count parametrized test expansions from @pytest.mark.parametrize
  • Note @pytest.mark.skip as skipped tests
  • Count test classes with class Test

C# (xUnit/NUnit/MSTest):

  • Count [Fact], [Theory], [Test], [TestMethod] attributes
  • Count [InlineData] for theory data rows
  • Note [Skip] as skipped tests

Go:

  • Count func Test and func Benchmark functions
  • Note t.Skip() calls

Java (JUnit/TestNG):

  • Count @Test annotations
  • Count @ParameterizedTest with @MethodSource/@CsvSource
  • Note @Disabled as skipped tests

Produce totals: active tests, skipped tests, todo tests, per framework and per test type.

Step 5 — Parse Coverage Reports

Look for existing coverage reports and artifacts:

  1. Coverage configuration: Check for coverage settings in test framework configs (e.g., collectCoverage in Jest, --cov in pytest)
  2. Coverage report files: Look for:
    • coverage/, htmlcov/, .coverage
    • lcov.info, coverage.xml, cobertura.xml
    • coverage-summary.json, coverage-final.json
  3. CI coverage: Check CI config files for coverage upload steps (Codecov, Coveralls, SonarQube)

If coverage reports are found in the repository, extract:

  • Overall line coverage percentage
  • Overall branch coverage percentage
  • Per-file or per-directory coverage (if available)
  • Coverage thresholds configured (minimum coverage requirements)

If no reports are found, record "no coverage reports found in repository". Do NOT run tests to generate coverage — only parse existing reports.

Step 6 — Map Tests to Features/Components

Attempt to map each test file to the source code it exercises:

  1. Import analysis: Check what the test file imports — the imported modules are likely what it tests.
  2. Path proximity: Colocated tests (e.g., UserService.test.ts next to UserService.ts) map directly.
  3. Directory mirroring: test/services/auth.test.ts likely tests src/services/auth.ts.
  4. Explicit references: Test descriptions or file names that reference features (e.g., test_login_flow.py → authentication feature).

Produce a mapping table. If a test's target is ambiguous, record it as "mapping uncertain" — do not guess.

Step 7 — Document Test Infrastructure

Record the test infrastructure and support files:

  • Test utilities: Shared helpers, custom matchers, test factories
  • Fixtures: Test data files, mock data, seed data for tests
  • Mocking: Mock files, __mocks__/ directories, mock service workers
  • Test configuration: Environment-specific test configs, test databases
  • CI integration: How tests are run in CI (which commands, which stages)
  • Test scripts: All test-related scripts in package.json, Makefile, etc.

Output Format

Produce specs/docs/testing/coverage.md:

# Test Inventory — [Project Name]

_Extracted on [date]. Catalogs all tests that exist in the project._

## Summary

| Metric | Value |
|--------|-------|
| Test frameworks | Jest, Playwright |
| Total test files | 87 |
| Total test cases | 423 |
| Skipped tests | 12 |
| Test types | Unit (312), Integration (67), E2E (44) |
| Coverage reports available | Yes — Jest coverage |
| Overall line coverage | 74.2% |
| Overall branch coverage | 61.8% |

## Test Frameworks

| Framework | Version | Config File | Run Command | Test Count |
|-----------|---------|-------------|-------------|------------|
| Jest | 29.7.0 | jest.config.ts | npm test | 379 |
| Playwright | 1.41.0 | playwright.config.ts | npm run test:e2e | 44 |

## Tests by Type

### Unit Tests (312 tests in 64 files)

| File | Test Count | Tests Target |
|------|-----------|-------------|
| src/services/__tests__/auth.test.ts | 18 | src/services/auth.ts |
| src/utils/__tests__/validators.test.ts | 24 | src/utils/validators.ts |
| ... | ... | ... |

### Integration Tests (67 tests in 15 files)

[Same table format]

### End-to-End Tests (44 tests in 8 files)

[Same table format]

## Skipped and Todo Tests

| File | Test Name | Status | Reason (if documented) |
|------|----------|--------|----------------------|
| auth.test.ts | should handle token refresh | skipped | "flaky — needs fix" |
| ... | ... | ... | ... |

## Coverage Data

| Metric | Value |
|--------|-------|
| Line coverage | 74.2% |
| Branch coverage | 61.8% |
| Function coverage | 79.1% |
| Statement coverage | 75.0% |
| Coverage threshold configured | 70% lines |

### Coverage by Directory

| Directory | Line Coverage | Files |
|-----------|-------------|-------|
| src/services/ | 82.3% | 12 |
| src/utils/ | 91.0% | 8 |
| src/routes/ | 45.2% | 6 |
| ... | ... | ... |

## Test-to-Component Mapping

| Component/Feature | Test Files | Test Count | Types |
|------------------|-----------|------------|-------|
| Authentication | auth.test.ts, login.spec.ts | 34 | Unit, E2E |
| User Management | users.test.ts, user-api.test.ts | 28 | Unit, Integration |
| ... | ... | ... | ... |

## Test Infrastructure

### Utilities and Helpers
[List shared test utilities, custom matchers, factories]

### Fixtures and Mock Data
[List fixture files, mock directories, test data]

### CI Integration
[How tests run in CI — commands, stages, parallelization]

Rules

  1. Catalog, don't analyze. Report what exists. Every statement must be verifiable from the files.
  2. No gap analysis. Do not identify "untested" code, "missing" test types, or "insufficient" coverage. The words "gap", "missing", "insufficient", "should", and "recommend" are banned.
  3. No quality assessment. Do not comment on test quality, naming conventions, assertion patterns, or test organization quality.
  4. No recommendations. Do not suggest adding tests, improving coverage, refactoring test code, or adopting different testing strategies.
  5. Accurate counts. Test counts must be accurate. If you cannot reliably count test cases in a file (e.g., dynamically generated tests), note it as "count approximate — dynamic test generation detected".
  6. Parse, don't run. Do not execute tests. Do not run test commands to generate coverage. Only parse existing files and reports.
  7. Skipped tests matter. Skipped and todo tests are part of the inventory. Count them separately but always include them.
  8. Uncertain mappings are okay. If you cannot determine what a test file tests, say "mapping uncertain" rather than guessing. Partial information is better than fabricated information.

Mandatory Completion Checklist

The orchestrator MUST verify ALL of the following before marking test-discovery as complete:

  • specs/docs/testing/coverage.md exists with: test framework(s), total test count, pass/fail/skip breakdown
  • Every test file in the project is cataloged with its framework and approximate test count
  • Test-to-source mapping is documented where determinable (which tests cover which source files)
  • Skipped/pending/todo tests are counted separately and listed
  • Coverage reports (if they exist as files) are referenced with their location and date

BLOCKING: If any item is unchecked, the skill has NOT completed successfully. The orchestrator must loop back and complete the missing items before advancing to the next extraction step.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.