run-spec

Runs a single test file with the detected project test runner and reports PASS or FAIL.

4|Updated Jun 9, 2026
One-click install
npx skills add https://github.com/laicluse/agent-fieldkit --skill run-spec-laicluse
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: run-spec
Source: https://github.com/laicluse/agent-fieldkit/tree/main/.agents/plugins/generated/git-discipline/skills/run-spec
Command: npx skills add https://github.com/laicluse/agent-fieldkit --skill run-spec-laicluse

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Verifying a change often means remembering which test command a project uses and typing the right invocation for one file. This Skill detects the project's test runner automatically and executes a single spec or test file, returning a clear PASS or FAIL summary with the runner's exit code. ## Core Features & Use Cases - Automatic runner detection: Inspects marker files (go.mod, Gemfile, .rspec, package.json, pyproject.toml, pytest.ini, setup.cfg) to select go test, rspec, jest, vitest, or pytest. - Manual override: Set the GIT_DISCIPLINE_TEST_RUNNER environment variable when heuristics do not match your setup. - Pipeline-friendly output: Prints a PASS or FAIL summary line and exits with the test runner's exit code, so it composes in shell scripts and CI checks. - Use Case: After editing a Ruby service, run the skill against spec/services/session_spec.rb to confirm the change is green before committing, without looking up the project's test command. ## Quick Start Ask the agent to run the test file spec/services/session_spec.rb and report whether it passes or fails.

Frequently Asked Questions about run-spec

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I run a single test file without knowing the project's test command?▼

Invoke the skill with the test file path, for example /git-discipline:run-spec spec/services/session_spec.rb. It detects the runner from project marker files, executes the file, and prints a PASS or FAIL line with the exit code.

Which test runners does automatic detection support?▼

Detection supports go test via go.mod, rspec via Gemfile or .rspec, jest and vitest via package.json keys, and pytest via pyproject.toml, pytest.ini, or setup.cfg. When multiple markers exist, a fixed priority order decides.

Can I override the detected test runner?▼

Yes, set the GIT_DISCIPLINE_TEST_RUNNER environment variable to the command prefix you want, such as export GIT_DISCIPLINE_TEST_RUNNER="bundle exec rspec". The override takes priority over all marker-file heuristics.

What happens when no test runner can be detected?▼

The skill prints an error explaining that no runner was detected and asks you to set GIT_DISCIPLINE_TEST_RUNNER, then exits with a non-zero status. It does not guess or fall back to a default runner.

Does run-spec record test results or evidence anywhere?▼

No, the skill performs no caching or evidence recording. A Red-then-green note in a commit body is self-attestation only; the skill just runs the file and propagates the runner's exit code.