Work out how the target repository expects automated tests to be run (commands, frameworks, prerequisites, and scope), then run the best-matching test suite under a safety-first interaction policy.
Core Objective
Primary goal: produce test execution results through evidence-based command selection and safety guardrails.
Success criteria (all must hold):
✅ Test plan discovered: the evidence source is identified (documentation, CI configuration, or build manifest)
✅ Command selected: the appropriate test command is chosen for the mode (fast/ci/full) and the constraints
✅ User confirmation obtained: approval received before installing dependencies, using the network, or starting services
✅ Tests executed: the command was run with its output and exit code captured
✅ Results summarized: a test plan summary with evidence, commands, execution status, and failures (if any)
Acceptance test: can a developer reproduce the test execution by following the test plan summary, with no extra context?
Scope Boundaries
This skill owns:
Discovering the test command from repository evidence (documentation, CI, build manifests)
Selecting the appropriate test command for the mode and the constraints
Executing tests behind safety guardrails and user confirmation
Summarizing test results with evidence and failure diagnostics
This skill does not own:
Test quality assessment or coverage analysis (use review-testing)
Fixing failing tests or debugging test failures (use orchestrate-repair-loop)
Writing new tests or test infrastructure (use the development skills)
Reviewing test code against best practices (use review-testing)
Handoff point: once the tests finish (pass or fail), hand off to orchestrate-repair-loop to fix the failures, or to review-testing for a quality assessment.
Use Cases
You cloned a repository and want the right test command without guessing.
The repository has several test layers (unit/integration/e2e) and you need a safe default run plan.
CI failed and you want to reproduce it locally by running the same commands the workflow uses.
Behavior
Establish scope and constraints (ask when unclear)
With nothing specified by the user, default to a fast, local, non-destructive run:
Unit tests only, no external services, no Docker, no network-dependent setup.
Where it matters, have the user pick a mode:
fast: unit tests only, minimal setup.
ci: mirror the CI workflow commands as closely as possible.
full: include integration/e2e tests and service dependencies.
Ask whether Docker is allowed, whether network access is allowed, and whether dependency installation is allowed.
Discover the test plan (evidence-based)
If CLAUDE.md or .ai-cortex/config.yaml exists, prefer the test_command recorded there; otherwise discover it from the sources below. See docs/guides/project-config.md.
Read these sources in order; stop early once a clear, unambiguous test command turns up:
How CI sets up its dependencies (services, caches, artifacts)
Prefer an explicit statement in the documentation or CI over heuristic inference.
Choose the execution plan
In ci mode: derive the run sequence from the repository's CI workflow steps (closest match).
In fast mode: pick the most direct unit test command, the one with the fewest prerequisites.
With several stacks present (backend + frontend, say), suggest running each stack separately in a fixed order.
If the plan needs a dependency install or a service start, ask for confirmation before continuing.
Execute with guardrails
Always print the exact command you are about to run, before running it.
Use a working directory rooted at the target repository (default .).
Capture and summarize failures:
The first failing command and its exit code
The most relevant error excerpt
Next actions (missing toolchain, missing environment variable, service not running, and so on)
Avoid destructive operations:
Do not run rm -rf, git clean -fdx, docker system prune, or database drop/migration commands without the user's explicit approval.
If the repository needs secrets, do not ask the user to paste them into the chat. Use a .env file, a secret manager, or the documented local development flow.
Enough of the command log to debug a failure (do not dump extremely long logs unless asked).
Restrictions
Hard Boundaries
Do not invent a test command when evidence exists (documentation/CI takes precedence).
Do not install dependencies, run Docker, or start external services without confirmation.
Do not modify repository files unless the user explicitly asks (exception: generating a report file when the user asks for an artifact).
Do not leak secrets; do not request sensitive credentials in the chat.
Skill Boundaries (avoid overlap)
Do not do these (other skills handle them):
Test quality assessment: judging test coverage, test design, or testing best practices → use review-testing
Fixing test failures: debugging failing tests, repairing broken test code, or root-causing → use orchestrate-repair-loop
Writing tests: creating new test cases, test infrastructure, or a test framework → use the development/implementation skills
Code review: reviewing test code for quality, maintainability, or best practices → use review-testing
Repository analysis: full codebase structure analysis or architecture review → use review-codebase
When to stop and hand off:
Tests fail and the user asks "why?" or "how do I fix it?" → hand off to orchestrate-repair-loop for debugging and repair
The user asks "are these tests any good?" or "what is our coverage?" → hand off to review-testing for a quality assessment
The user asks "can you write tests for X?" → hand off to the development workflow for test implementation
Tests pass and the user asks "what should we test next?" → hand the test strategy suggestion to review-testing
Self-Check
Core success criteria (all must hold)
Test plan discovered: the evidence source is identified (documentation, CI configuration, or build manifest)
Command selected: the appropriate test command is chosen for the mode (fast/ci/full) and the constraints
User confirmation obtained: approval received before installing dependencies, using the network, or starting services
Tests executed: the command was run with its output and exit code captured
Results summarized: a test plan summary with evidence, commands, execution status, and failures (if any)
Process quality checks
Evidence-based selection: did I identify at least one authoritative source for the test command (a doc file, a CI workflow, or a build manifest)?
Safety guardrails applied: did I ask for confirmation before installing dependencies, using the network, starting Docker/services, or any state-changing action?
Commands printed: did I print the exact command before running it?
Failures diagnosed: when tests failed, did I give the first failing command, the exit code, and a likely root-cause category?
No destructive operations: did I avoid running destructive commands (rm -rf, git clean, docker system prune, database drops) without explicit approval?
No secret leakage: did I avoid asking for sensitive credentials in the conversation, using a .env file or the documented local development flow instead?
Acceptance test
Can a developer reproduce the test execution by following the test plan summary, with no extra context?
If no: the test plan summary is incomplete. Add the missing evidence, commands, or prerequisites.
If yes: the skill run is complete. Continue to the handoff if one is needed.
Examples
Example 1: a JavaScript repo with package.json
User: "run the tests for this repository."
Agent:
Check the package.json scripts and .github/workflows/*.
Settle on fast mode and propose:
npm test (or pnpm test / yarn test if the repository standardizes on one)
Ask: "install dependencies (npm ci) and allow network access?"
Run:
npm ci
npm test
Summarize the results and point at the failing test output, if any.
Example 2 (edge case): a monorepo that needs Docker for integration tests
User: "mirror CI locally."
Agent:
Parse .github/workflows/ci.yml and identify the separate jobs:
Backend unit tests
Frontend tests
Integration tests with docker compose
Ask for confirmation:
Docker allowed
Network allowed
Which jobs to run (all of them, or only the failing one)
Execute in a controlled order:
Install deps per job
Run unit tests first
Start the services for the integration tests
If the integration tests fail, summarize:
Service health/port conflicts
Missing environment variables
How the CI configuration differs from the local one
1---2name: automate-tests3description: Discover and execute repository test commands safely with evidence-based command selection and safety guardrails.4license: MIT5---67# Skill: Run Automated Tests89## Purpose1011Work out how the target repository expects automated tests to be run (commands, frameworks, prerequisites, and scope), then run the best-matching test suite under a safety-first interaction policy.1213---1415## Core Objective1617**Primary goal**: produce test execution results through evidence-based command selection and safety guardrails.1819**Success criteria** (all must hold):20211. ✅ **Test plan discovered**: the evidence source is identified (documentation, CI configuration, or build manifest)222. ✅ **Command selected**: the appropriate test command is chosen for the mode (fast/ci/full) and the constraints233. ✅ **User confirmation obtained**: approval received before installing dependencies, using the network, or starting services244. ✅ **Tests executed**: the command was run with its output and exit code captured255. ✅ **Results summarized**: a test plan summary with evidence, commands, execution status, and failures (if any)2627**Acceptance** test: can a developer reproduce the test execution by following the test plan summary, with no extra context?2829---3031## Scope Boundaries3233**This skill owns**:3435- Discovering the test command from repository evidence (documentation, CI, build manifests)36- Selecting the appropriate test command for the mode and the constraints37- Executing tests behind safety guardrails and user confirmation38- Summarizing test results with evidence and failure diagnostics3940**This skill does not own**:4142- Test quality assessment or coverage analysis (use `review-testing`)43- Fixing failing tests or debugging test failures (use `orchestrate-repair-loop`)44- Writing new tests or test infrastructure (use the development skills)45- Reviewing test code against best practices (use `review-testing`)4647**Handoff point**: once the tests finish (pass or fail), hand off to `orchestrate-repair-loop` to fix the failures, or to `review-testing` for a quality assessment.4849## Use Cases5051- You cloned a repository and want the right test command without guessing.52- The repository has several test layers (unit/integration/e2e) and you need a safe default run plan.53- CI failed and you want to reproduce it locally by running the same commands the workflow uses.5455## Behavior56571. **Establish scope and constraints (ask when unclear)**58 - With nothing specified by the user, default to a **fast, local, non-destructive** run:59 - Unit tests only, no external services, no Docker, no network-dependent setup.60 - Where it matters, have the user pick a mode:61 - `fast`: unit tests only, minimal setup.62 - `ci`: mirror the CI workflow commands as closely as possible.63 - `full`: include integration/e2e tests and service dependencies.64 - Ask whether Docker is allowed, whether network access is allowed, and whether dependency installation is allowed.65662. **Discover the test plan (evidence-based)**67 - If `CLAUDE.md` or `.ai-cortex/config.yaml` exists, prefer the `test_command` recorded there; otherwise discover it from the sources below. See [docs/guides/project-config.md](../../docs/guides/project-config.md).68 - Read these sources in order; stop early once a clear, unambiguous test command turns up:69 - `README.md`, `CONTRIBUTING.md`, `TESTING.md`, `docs/testing*`, `Makefile`70 - CI configuration: `.github/workflows/*.yml`, `.gitlab-ci.yml`, `azure-pipelines.yml`, `Jenkinsfile`71 - Build manifests: `package.json`, `pyproject.toml`, `setup.cfg`, `tox.ini`, `go.mod`, `pom.xml`, `build.gradle*`, `*.csproj`, `Cargo.toml`72 - Identify:73 - The primary test entry point (`npm test`, `pnpm test`, `yarn test`, `pytest`, `tox`, `go test`, `dotnet test`, `mvn test`, `gradle test`, `cargo test`, and so on)74 - Test layers and markers (unit, integration, e2e)75 - Environment prerequisites (DB, Redis, Docker Compose, required environment variables, secrets)76 - How CI sets up its dependencies (services, caches, artifacts)77 - Prefer an **explicit statement** in the documentation or CI over heuristic inference.78793. **Choose the execution plan**80 - In `ci` mode: derive the run sequence from the repository's CI workflow steps (closest match).81 - In `fast` mode: pick the most direct unit test command, the one with the fewest prerequisites.82 - With several stacks present (backend + frontend, say), suggest running each stack separately in a fixed order.83 - If the plan needs a dependency install or a service start, ask for confirmation before continuing.84854. **Execute with guardrails**86 - Always print the exact command you are about to run, before running it.87 - Use a working directory rooted at the target repository (default `.`).88 - Capture and summarize failures:89 - The first failing command and its exit code90 - The most relevant error excerpt91 - Next actions (missing toolchain, missing environment variable, service not running, and so on)92 - Avoid destructive operations:93 - Do not run `rm -rf`, `git clean -fdx`, `docker system prune`, or database drop/migration commands without the user's explicit approval.94 - If the repository needs secrets, do not ask the user to paste them into the chat. Use a `.env` file, a secret manager, or the documented local development flow.9596## Input & Output9798### Input99100- Target repository path (default `.`).101- Mode: `fast` (default), `ci`, or `full`.102- Constraints: dependency install allowed (yes/no), network allowed (yes/no), Docker allowed (yes/no).103104### Output105106- A short "test plan summary" containing:107 - Evidence: which files/paths informed the plan108 - The selected commands (in order)109 - Assumptions and prerequisites110 - What was executed and what was skipped (and why)111- Enough of the command log to debug a failure (do not dump extremely long logs unless asked).112113## Restrictions114115### Hard Boundaries116117- Do not invent a test command when evidence exists (documentation/CI takes precedence).118- Do not install dependencies, run Docker, or start external services without confirmation.119- Do not modify repository files unless the user explicitly asks (exception: generating a report file when the user asks for an artifact).120- Do not leak secrets; do not request sensitive credentials in the chat.121122### Skill Boundaries (avoid overlap)123124**Do not do these (other skills handle them)**:125126- **Test quality assessment**: judging test coverage, test design, or testing best practices → use `review-testing`127- **Fixing test failures**: debugging failing tests, repairing broken test code, or root-causing → use `orchestrate-repair-loop`128- **Writing tests**: creating new test cases, test infrastructure, or a test framework → use the development/implementation skills129- **Code review**: reviewing test code for quality, maintainability, or best practices → use `review-testing`130- **Repository analysis**: full codebase structure analysis or architecture review → use `review-codebase`131132**When to stop and hand off**:133134- Tests fail and the user asks "why?" or "how do I fix it?" → hand off to `orchestrate-repair-loop` for debugging and repair135- The user asks "are these tests any good?" or "what is our coverage?" → hand off to `review-testing` for a quality assessment136- The user asks "can you write tests for X?" → hand off to the development workflow for test implementation137- Tests pass and the user asks "what should we test next?" → hand the test strategy suggestion to `review-testing`138139## Self-Check140141### Core success criteria (all must hold)142143- [ ] **Test plan discovered**: the evidence source is identified (documentation, CI configuration, or build manifest)144- [ ] **Command selected**: the appropriate test command is chosen for the mode (fast/ci/full) and the constraints145- [ ] **User confirmation obtained**: approval received before installing dependencies, using the network, or starting services146- [ ] **Tests executed**: the command was run with its output and exit code captured147- [ ] **Results summarized**: a test plan summary with evidence, commands, execution status, and failures (if any)148149### Process quality checks150151- [ ] **Evidence-based selection**: did I identify at least one authoritative source for the test command (a doc file, a CI workflow, or a build manifest)?152- [ ] **Safety guardrails applied**: did I ask for confirmation before installing dependencies, using the network, starting Docker/services, or any state-changing action?153- [ ] **Commands printed**: did I print the exact command before running it?154- [ ] **Failures diagnosed**: when tests failed, did I give the first failing command, the exit code, and a likely root-cause category?155- [ ] **No destructive operations**: did I avoid running destructive commands (`rm -rf`, `git clean`, `docker system prune`, database drops) without explicit approval?156- [ ] **No secret leakage**: did I avoid asking for sensitive credentials in the conversation, using a `.env` file or the documented local development flow instead?157158### Acceptance test159160**Can a developer reproduce the test execution by following the test plan summary, with no extra context?**161162If no: the test plan summary is incomplete. Add the missing evidence, commands, or prerequisites.163164If yes: the skill run is complete. Continue to the handoff if one is needed.165166## Examples167168### Example 1: a JavaScript repo with package.json169170User: "run the tests for this repository."171172Agent:1731741. Check the `package.json` scripts and `.github/workflows/*`.1752. Settle on `fast` mode and propose:176 - `npm test` (or `pnpm test` / `yarn test` if the repository standardizes on one)1773. Ask: "install dependencies (`npm ci`) and allow network access?"1784. Run:179 - `npm ci`180 - `npm test`1815. Summarize the results and point at the failing test output, if any.182183### Example 2 (edge case): a monorepo that needs Docker for integration tests184185User: "mirror CI locally."186187Agent:1881891. Parse `.github/workflows/ci.yml` and identify the separate jobs:190 - Backend unit tests191 - Frontend tests192 - Integration tests with `docker compose`1932. Ask for confirmation:194 - Docker allowed195 - Network allowed196 - Which jobs to run (all of them, or only the failing one)1973. Execute in a controlled order:198 - Install deps per job199 - Run unit tests first200 - Start the services for the integration tests2014. If the integration tests fail, summarize:202 - Service health/port conflicts203 - Missing environment variables204 - How the CI configuration differs from the local one
Run npx skillmds@latest add nesnilnehc/automate-tests in your terminal (requires Node.js), paste this page's agent-chat prompt into Claude, Cursor, or any MCP-connected agent, or download the SKILL.md file and copy it into your agent's skills directory.
Discover and execute repository test commands safely with evidence-based command selection and safety guardrails. It is listed under Coding & Dev Tools on SkillMD.
This skill has not completed SkillMD's automated safety review yet. SkillMD never runs a skill's scripts for you; review the SKILL.md before installing.
This skill is tagged as working with Claude Code, Claude.ai, OpenAI Codex. SKILL.md is an open format, so most agents that read a skills directory can load it too.
Yes. Installing skills from SkillMD is free. This skill is licensed under MIT.
nesnilnehc (@nesnilnehc) published this skill. Their other Agent Skills are listed on their SkillMD profile.