用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/laicluse/agent-fieldkit --skill run-spec命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
正在显示 SKILL.md
| name | run-spec |
| description | Run one spec/test file with the detected project test runner and report PASS or FAIL. |
Detects the project's test runner and runs a single test or spec file.
Prints a PASS or FAIL summary line plus the runner's own output.
The skill exits with the test runner's exit code so callers can use it
in shell pipelines.
This skill does not record evidence anywhere. Red-then-green: yes in
the commit body is self-attestation; no cache lookup backs it.
/git-discipline:run-spec <test-or-spec-path>
Example:
/git-discipline:run-spec spec/services/session_spec.rb
/git-discipline:run-spec src/__tests__/session.test.ts
/git-discipline:run-spec internal/session/session_test.go
/git-discipline:run-spec tests/test_session.py
PASS or FAIL summary line and the exit code.The implementation in lib/run-spec.sh inspects the project root for marker
files in this order:
| Marker file | Runner used |
|---|---|
go.mod | go test |
Gemfile or .rspec | bundle exec rspec <path> |
package.json with "jest" key | npx jest <path> |
package.json with "vitest" key | npx vitest run <path> |
pyproject.toml or pytest.ini or setup.cfg | pytest <path> |
If multiple markers are present the order above determines priority. When no
marker matches, the skill prints an error asking the operator to set
GIT_DISCIPLINE_TEST_RUNNER (e.g. export GIT_DISCIPLINE_TEST_RUNNER="bundle exec rspec").
PASS spec/services/session_spec.rb (exit 0)
or
FAIL spec/services/session_spec.rb (exit 1)
The implementation lives in lib/run-spec.sh. Runner detection and test
execution are split into testable functions so the BATS test suite can
exercise them without launching a real test run.