agentleFS
bbvch-aibbvch-ai/aihub-core/.claude/skills/test-scope/SKILL.md

test-scope

Skill16 starsChanged 3 days agoApache-2.0View on GitHub

Detect affected scopes from git changes and run their tests in dependency order. Use when user says 'run tests', 'test my changes', 'check what broke', 'verify scopes', 'test affected packages', or 'make sure tests pass'. Supports explicit scope names or auto-detection from git diff. Reports PASS/FAIL per scope. Do NOT use for linting or formatting (use /lint), full PR preparation (use /create-pr), or debugging test failures (use /debug-agent or /debug-pipeline).

We split this skill into the rules it gives an agent

5 rules. About 0 are common, 3 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

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

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

    Run tests only for scopes affected by current changes.

    line 9
  2. Very specific:

    If $ARGUMENTS specifies scope names (e.g., packages/api packages/agent), use those directly.

    line 26
  3. Distinctive:

    Run git diff --name-only HEAD to list staged + unstaged changed files

    line 28
  4. Distinctive:

    Add downstream scopes that depend on any changed scope:

    line 38
  5. Distinctive:

    "No changes detected": Ensure you have uncommitted changes.

    line 77

≈ “Common” is an estimate: at least 1 in 5 of the 308,232 skill files we read have a rule of the same kind, not the same words. “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

Smart Scoped Test Runner

Run tests only for scopes affected by current changes. Scope names can be provided via $ARGUMENTS or auto-detected from git diff.

Scope Dependency Graph

packages/core ──→ packages/agent ──→ packages/process
    │              │
    ├──→ packages/api ┘
    ├──→ packages/bot
    ├──→ packages/sysadmin-api
    ├──→ packages/backup
    └──→ packages/pipeline

Step 1: Detect Affected Scopes

If $ARGUMENTS specifies scope names (e.g., packages/api packages/agent), use those directly. Otherwise auto-detect:

  1. Run git diff --name-only HEAD to list staged + unstaged changed files
  2. Map each changed file to its scope by extracting the first path component
  3. Valid scopes: packages/core, packages/agent, packages/api, packages/bot, packages/pipeline, packages/process, packages/sysadmin-api, packages/backup, packages/web, packages/sysadmin-web
  4. Ignore files not in a valid scope (e.g., root configs, docs)

Expected output: A list like Detected affected scopes: packages/core, packages/api

Step 2: Expand Downstream Dependencies

Add downstream scopes that depend on any changed scope:

  • packages/core changed → add ALL other scopes (it is the foundation)
  • packages/agent changed → also add packages/process (process depends on agent)

Step 3: Run Tests in Dependency Order

Execute make test in each affected scope's directory, following this order:

  1. packages/core (foundation — test first)
  2. packages/agent
  3. packages/pipeline
  4. packages/process (depends on agent)
  5. packages/api
  6. packages/bot
  7. packages/sysadmin-api, packages/backup
  8. packages/web / packages/sysadmin-web — run make -C <scope> pr-ready (ESLint, no pytest for frontend)

Skip scopes not in the affected set. If a scope fails, continue running remaining scopes to collect all failures.

Step 4: Report Results

Produce a summary table:

ScopeStatusDetails
packages/corePASS42 tests passed
packages/apiFAIL2 failures in test_auth.py
packages/webSKIPNot affected

Examples

  • /test-scope — Auto-detect from git diff and run all affected
  • /test-scope packages/api — Run tests only for packages/api
  • /test-scope packages/core — Run tests for packages/core AND all downstream scopes
  • /test-scope packages/agent packages/api — Run tests for both specified scopes

Troubleshooting

  • "No changes detected": Ensure you have uncommitted changes. Run git status to verify.
  • "make test fails with ModuleNotFoundError": Dependencies may not be installed. Run uv sync --all-packages from the workspace root.
  • Root make test runs every Python scope plus check-env; this skill runs only the affected scopes via make -C <scope> test.
  • Agent/API tests that need NATS or the API require the Docker dev stack, and no locally running agent of the same class (it shares the test runner's queue group and eats its events).
  • Frontend scopes: packages/web and packages/sysadmin-web have no tests — make -C <scope> pr-ready runs ESLint instead.

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.