agents-test

Motoki0705's avatarfrom Motoki0705

Run targeted tests using src.agents.scripts.test after code changes. Use when you need to execute only affected tests, pass a custom pytest command, or collect JSON test summaries with sub-agent fixes.

0stars🔀0forks📁View on GitHub🕐Updated Jan 9, 2026

When & Why to Use This Skill

The agents-test skill is a specialized developer tool designed to streamline the software validation process by running targeted pytest commands. It enables developers and AI agents to execute only the tests affected by recent code changes, providing structured JSON summaries and detailed logs to facilitate rapid debugging and maintain high code quality in agentic workflows.

Use Cases

  • Targeted Regression Testing: Efficiently run specific test suites or individual test cases relevant to recent code modifications to ensure stability without executing the entire test library.
  • Automated Failure Analysis: Generate machine-readable JSON test summaries that allow sub-agents to automatically parse errors and initiate code fixes based on log data.
  • Optimized CI/CD Workflows: Reduce feedback loops in development environments by narrowing the test scope and managing resource-intensive tasks like cache handling and parallel execution.
nameagents-test
descriptionRun targeted tests using src.agents.scripts.test after code changes. Use when you need to execute only affected tests, pass a custom pytest command, or collect JSON test summaries with sub-agent fixes.

Agents Test

Overview

Use this skill to run only the affected tests and capture a JSON summary.

Quick start

Run the default test command (pytest with -q -n auto) through the sub-agent.

uv run python -m src.agents.scripts.test

Targeted tests (required by repo policy)

Always pass a narrowed task.test_cmd for affected files.

uv run python -m src.agents.scripts.test \
  'task.test_cmd=uv run --no-sync pytest -q -n auto tests/unit/test_affected.py'

Use a specific test case when needed.

uv run python -m src.agents.scripts.test \
  'task.test_cmd=uv run --no-sync pytest -q tests/test_example.py::test_case'

Output and logs

The script prints a single-line JSON summary and stores logs under agents_workspace/sub_agents/logs/pytest_*.log.

Cache workaround

If uv cache permissions fail, use a workspace cache:

uv run python -m src.agents.scripts.test \
  'task.test_cmd=uv --cache-dir agents_workspace/tmp_cache/uv_cache run --no-sync pytest -q tests/...'