agentleFS
PatriotAgenticLLCPatriotAgenticLLC/better_claude_skillz/skills/test/SKILL.md

test

Skill3 starsChanged 5 months agoMITView on GitHub

Universal test runner. Auto-detects project type and runs the appropriate test suite with optional scope and coverage flags.

179 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use agent-context-isolation, agentica-infrastructure and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.

The file

Show its rules and text

We split this skill into the rules it gives an agent

22 rules. 0 are common, 9 are distinctive, and 13 are very specific to this project.

  • 0

    Common

    Most of the 154 edited versions we read keep these.

  • 9

    Distinctive

    This author's own choices. Worth a look.

  • 13

    Very specific

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

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

    If vitest in devDependencies -> vitest project

    line 18
  2. Very specific:

    If jest in devDependencies -> jest project

    line 19
  3. Very specific:

    If test script defined in scripts.test -> use that

    line 20
  4. Distinctive:

    No arguments: Run the default test suite

    line 32
  5. Very specific:

    --unit: Run only unit tests

    line 33
  6. Very specific:

    --integration: Run only integration tests

    line 34
  7. Very specific:

    --e2e: Run only E2E tests

    line 35
  8. Very specific:

    --coverage: Run with coverage reporting

    line 36
  9. Very specific:

    <path>: Run tests for a specific file or directory

    line 37
  10. Very specific:

    Check if tests/unit/ and tests/integration/ directories exist

    line 54
  11. Distinctive:

    If they exist, use directory-based scoping

    line 55
  12. Very specific:

    If not, check pytest.ini or pyproject.toml for markers and use -m flag

    line 56
  13. Distinctive:

    If the project uses markers, report which markers are available

    line 57
  14. Very specific:

    Read package.json scripts section for existing test commands (test:unit, test:e2e, test:integration, test:coverage)

    line 71
  15. Distinctive:

    If specific scripts exist, prefer those over generic flags

    line 72
  16. Very specific:

    Check for Playwright config (playwright.config.ts/.js) for E2E

    line 73
  17. Distinctive:

    Look for a "Testing" or "Test" section

    line 97
  18. Distinctive:

    If CLAUDE.md specifies custom test commands, prefer those

    line 98
  19. Distinctive:

    If no manifest files found: report "Could not detect project type.

    line 114
  20. Distinctive:

    If test directory doesn't exist for the requested scope: report which scopes are available

    line 115
  21. Distinctive:

    If tests fail: show the failure summary but don't treat it as a skill error

    line 116
  22. Very specific:

    Always respect the project's existing test configuration (pytest.ini, vitest.config.ts, etc.)

    line 122

“Common” is measured: kept by at least 6 in 10 of the 154 edited versions of this file we could read. “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

Universal Test Runner

Auto-detect the project type and run the appropriate test suite. Works across Python, Node.js, and Go projects.

Detection Logic

Detect the project type by checking for manifest files in the current working directory. Check in this order (first match wins):

  1. Go: go.mod exists
  2. Python: pytest.ini, pyproject.toml (with [tool.pytest]), or setup.py exists
  3. Node.js: package.json exists — then check:
    • If vitest in devDependencies -> vitest project
    • If jest in devDependencies -> jest project
    • If test script defined in scripts.test -> use that

Also detect the package manager for Node.js projects:

  • pnpm-lock.yaml exists -> pnpm
  • yarn.lock exists -> yarn
  • bun.lockb exists -> bun
  • Otherwise -> npm

Arguments

Parse $ARGUMENTS for flags and positional arguments:

  • No arguments: Run the default test suite
  • --unit: Run only unit tests
  • --integration: Run only integration tests
  • --e2e: Run only E2E tests
  • --coverage: Run with coverage reporting
  • <path>: Run tests for a specific file or directory
  • Flags can be combined: /test --unit --coverage

Test Commands by Project Type

Python (pytest)

FlagCommand
(default)pytest tests/ -v
--unitpytest tests/unit/ -v (or pytest -m unit -v)
--integrationpytest tests/integration/ -v (or pytest -m integration -v)
--e2epytest tests/e2e/ -v (or pytest -m e2e -v)
--coveragepytest tests/ -v --cov=. --cov-report=term-missing
<path>pytest <path> -v

Detection refinements for Python:

  1. Check if tests/unit/ and tests/integration/ directories exist
  2. If they exist, use directory-based scoping
  3. If not, check pytest.ini or pyproject.toml for markers and use -m flag
  4. If the project uses markers, report which markers are available

Node.js (vitest/jest)

FlagCommand
(default)<pm> test (using detected package manager)
--unit<pm> test -- --testPathPattern="unit" or <pm> run test:unit if script exists
--integration<pm> run test:integration if script exists, else <pm> test -- --testPathPattern="integration"
--e2e<pm> run test:e2e if script exists, else check for Playwright: npx playwright test
--coverage<pm> test -- --coverage
<path><pm> test -- <path>

Detection refinements for Node.js:

  1. Read package.json scripts section for existing test commands (test:unit, test:e2e, test:integration, test:coverage)
  2. If specific scripts exist, prefer those over generic flags
  3. Check for Playwright config (playwright.config.ts/.js) for E2E
  4. Report available test scripts from package.json

Go

FlagCommand
(default)go test ./... -v
--unitgo test ./... -v -short (skip long-running tests)
--integrationgo test ./... -v -run Integration
--e2ego test ./... -v -run E2E
--coveragego test ./... -v -cover -coverprofile=coverage.out && go tool cover -func=coverage.out
<path>go test <path> -v

Execution

  1. Detect the project type and report it:
    Detected: Python/pytest project
  2. Build the command based on arguments
  3. Check for project-specific overrides in CLAUDE.md:
    • Look for a "Testing" or "Test" section
    • If CLAUDE.md specifies custom test commands, prefer those
    • Report: "Using custom test command from CLAUDE.md" if applicable
  4. Run the test command using Bash tool
    • For long-running test suites (e2e, full integration), suggest tmux but run directly
    • Stream output so the user can see progress
  5. Report results:
    Tests: X passed, Y failed, Z skipped
    Coverage: N% (if --coverage)
    Duration: Xs

Error Handling

  • If no manifest files found: report "Could not detect project type. No manifest files found in current directory."
  • If test directory doesn't exist for the requested scope: report which scopes are available
  • If tests fail: show the failure summary but don't treat it as a skill error

Notes

  • This skill wraps existing project test infrastructure — it does not install test frameworks
  • For projects with both Python and Node.js tests (e.g., a monorepo with a Python backend and a JS frontend), detect both and ask which to run, or run both if no scope flag is given
  • Always respect the project's existing test configuration (pytest.ini, vitest.config.ts, etc.)

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.