Agent skill

Polylith Testing

by DavidVujic in DavidVujic/python-polylith

List Polylith bricks and projects affected by test-code changes since a git tag using poly test diff.

MITAuto-check passedDevelopment

Install Polylith Testing

skills CLI
$ npx skills add DavidVujic/python-polylith --skill polylith-testing -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install DavidVujic/python-polylith polylith-testing --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/DavidVujic/python-polylith.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/polylith/polylith-testing .claude/skills/polylith-testing && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
polylith-testing
GitHub stars
553
Token cost
~1.6k tokens
SKILL.md length
644 words
Files
1
Skills in repo
37
Repo updated
First seen
Licence
MIT

At a glance

List Polylith bricks and projects affected by test-code changes since a git tag using poly test diff.

  • Works in 3 steps: Capture poly test diff --short. → Replace the commas with or to form a… → Pass it to pytest -k. Skip the call when…
  • Selective test runs in CI (which tests do I need to run?)
  • SKILL.md covers Quick command, Tag selection, Command reference and Examples, plus 3 more sections
  • Calls uv, pytest and poetry

What it does

Polylith Testing is an agent skill from DavidVujic/python-polylith. List Polylith bricks and projects affected by test-code changes since a git tag using poly test diff. Use for selective test runs in CI ("which tests do I need to run?"). For implementation-code diffs, use polylith-diff instead.

Its SKILL.md is about 1.6k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Development. It works with Git and pytest. The repository describes itself as: Tooling support for the Polylith Architecture in Python. The licence is MIT.

When your agent uses it

  • Selective test runs in CI (which tests do I need to run?)

Example prompts

  • “which tests do I need to run?”
  • “/polylith-testing”

Workflow steps

3 steps, taken from the first numbered list in SKILL.md.

  1. Capture poly test diff --short.
  2. Replace the commas with or to form a pytest -k expression.
  3. Pass it to pytest -k. Skip the call when the result is empty (no affected bricks).

What it can do on your machine

Read from SKILL.md and the folder at commit a7a80f2. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • uv
    • pytest
    • poetry

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use uv, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Polylith Testing loads about 1.6k tokens when it runs. Until then it costs about 63 tokens; SKILL.md has 644 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~63
When it runs · the whole SKILL.md, loaded when a task matches
~1.6k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from DavidVujic/python-polylith at commit a7a80f2, republished under its MIT licence (© DavidVujic). 644 words, ~1,572 tokens.

Download SKILL.mdSave it as .claude/skills/polylith-testing/SKILL.md (or your agent's skills folder).
name
polylith-testing
description
List Polylith bricks and projects affected by **test-code** changes since a git tag using `poly test diff`. Use for selective test runs in CI ("which tests do I need to run?"). For implementation-code diffs, use `polylith-diff` instead.

Testing Skill

Quick command

bash
# Human-readable (default)
uv run poly test diff

# Pipe-friendly: comma-separated list of affected bricks (use this in scripts)
uv run poly test diff --short

Agent rule of thumb: when the goal is to do something with the result (run pytest, drive CI), reach for --short first. The default output is for human readers.

Command prefix: If you do not know the package manager, list lock files with ls uv.lock poetry.lock pdm.lock 2>/dev/null (a pyproject.toml is always present, so it tells you nothing on its own). Use uv run poly (uv), poetry poly (poetry), pdm run poly (pdm), hatch run poly (hatch), or poly (activated venv). Examples below use uv run.

⚠ poly test diff reports only — it does not execute tests. Pipe its output into pytest / unittest. poly test diff vs poly diff:

  • poly test diff → which test files changed (drives test runs).
  • poly diff → which brick implementations changed (drives releases). Load polylith-diff.

Tag selection

  • Default: latest git tag matching [tool.polylith.tag.patterns].stable from workspace.toml (e.g. stable-*).
  • --since <ref> — pin a tag/branch/commit. The output line Test diff based on stable-4 shows the tag the CLI selected.

Command reference

OptionDefaultDescription
--sincelatest matching tagReference tag (or branch/commit) to diff against.
--shortfalsePipe-friendly output: a comma-separated list of affected brick names — nothing else.
--bricksfalsePrint the affected bricks as a human-readable report (⚙ Changes affecting <name> lines).
--projectsfalsePrint the affected projects as a human-readable report.

💡 For piping into pytest use --short. It emits just the brick names separated by commas, with no headers, prefixes, or decoration — exactly what a script needs. --bricks is meant for humans reading the output.

Examples

bash
# Default: against latest stable-* tag
uv run poly test diff

# Pipe-friendly bricks list (best for scripts / agents)
uv run poly test diff --short

# Pin a tag, then pipe affected bricks into pytest
uv run poly test diff --since stable-4 --short

# Human-readable list of affected bricks
uv run poly test diff --bricks
Sample output (default, no flags)
Projects and bricks affected by changes in tests
Test diff based on stable-4

Affected projects: 5
Affected components: 1
Affected bases: 0

  brick   consumer_project   message-api   aws lambda   my_fastapi_project   gcp function
 ────────────────────────────────────────────────────────────────────────────────────────
  log            ✔                ✔            ✔                ✔                 ✔

✔ = the column project is affected by the row brick's test changes.

Sample output (--short)
log,message

Just the brick names, comma-separated. No header, no prefix, no namespace. Empty result = no affected bricks.

Sample output (--bricks)

--bricks is a human-readable variant; one line per affected brick:

⚙ Changes affecting log
⚙ Changes affecting message

Use --short instead when piping into another tool.

Executing tests for affected bricks

💡 Most common case — "I changed code, run the tests for it": that's driven by poly diff (implementation diff), not poly test diff. Load polylith-diff for the canonical recipe; the same pytest -k pattern shown below works there.

poly test diff only reports — you drive the test runner yourself. The established Polylith pattern is to feed --short straight into pytest -k: brick names become an or-expression that pytest matches against test IDs, so you don't need to know the namespace, the theme, or whether each brick is a base or a component.

Show full SKILL.md (241 more words)Show less
  1. Capture poly test diff --short.
  2. Replace the commas with or to form a pytest -k expression.
  3. Pass it to pytest -k. Skip the call when the result is empty (no affected bricks).
Shell one-liner (uv)
bash
changes="$(uv run poly test diff --short)"
[ -n "$changes" ] && uv run pytest -k "${changes//,/ or }"

Example: --short outputs log,message → pytest is invoked as pytest -k "log or message", which collects every test whose ID contains log or message (the brick directory name appears in the test path, so this matches both test/components/<ns>/log/... and test/bases/<ns>/log/... automatically).

Caveat — substring matching

pytest -k matches substrings of test IDs, so a brick named log will also pull in tests whose name happens to contain log (e.g. tests for an unrelated brick called logger or a function test_login). If a brick name is short or generic and produces unwanted matches, fall back to passing explicit test directories instead.

Running targeted tests for a single brick

If you are iteratively debugging or just created a single brick, you do not need to use poly test diff. You can run the test runner directly against the brick's test folder.

Check workspace.toml to determine the theme and namespace:

  • For the loose theme (recommended): pytest test/components/<namespace>/<basename> or pytest test/bases/<namespace>/<basename>.
  • For the tdd theme: pytest components/<basename>/test or pytest bases/<basename>/test.

Notes for the agent

  • Always exits 0 — informational, never a CI gate.
  • If no matching tag exists and --since isn't passed, prints No matching tags or commits found in repository. and exits 0. Handle this in scripts.

© DavidVujic, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .agents/skills/polylith/polylith-testing of DavidVujic/python-polylith.

Open the folder on GitHubat commit a7a80f2

Compare with similar skills

Polylith Testing next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Polylith Testing compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Polylith Testing this skillDavidVujic/python-polylith553—~1.6kAutomated safety check: PassMIT
Skyvern Version BumpSkyvern-AI/skyvern23k—~1kAutomated safety check: NotesAGPL-3.0
Worktree Env Setupmeta-pytorch/attention-gym1.3k—~858Automated safety check: PassBSD-3-Clause
Adk Setupgoogle/adk-python22k—~993Automated safety check: NotesApache-2.0
Compare Codegenhw-native-sys/pypto125—~1.4kAutomated safety check: PassCustom licence
Running Unit TestsPSBrew/MkPFS169—~429Automated safety check: PassGPL-3.0

Similar skills

  • Skyvern Version Bump

    Skyvern-AI/skyvern

    Walks through a Skyvern open-source release bump: update the version, rebuild the Python and TypeScript SDKs with Fern, commit, and open a pull request.

    23k GitHub stars~1k tokensUpdated today
    DevelopmentAuto-check: notes
  • Worktree Env Setup

    meta-pytorch/attention-gym

    Sets up an isolated per-worktree Python environment for attention-gym development using nightly PyTorch and the CI-mirroring uv flow.

    1.3k GitHub stars~858 tokensUpdated yesterday
    DevelopmentAuto-check passed
  • Adk Setup

    google/adk-python

    Official

    Sets up a local ADK Python development environment in a git clone of the open-source adk-python repository: a uv virtual environment, all dependency extras, pre-commit hooks, and a first unit-test…

    22k GitHub stars~993 tokensUpdated today
    DevelopmentAuto-check: notes
  • Compare Codegen

    hw-native-sys/pypto

    Compare codegen output (.pto files and pass dumps) between origin/main and the current branch for a given test case.

    125 GitHub stars~1.4k tokensUpdated 7 days ago
    DevelopmentAuto-check passed
  • Running Unit Tests

    PSBrew/MkPFS

    Run formatting, linting, and tests; then iteratively fix failures until the branch is green.

    169 GitHub stars~429 tokensUpdated 4 days ago
    Testing & QAAuto-check passed
  • Smoke Test ML Pipeline

    probabl-ai/skills

    Owns one experiment's smoke test: a small pytest that fits on part of real data/ and predicts on a disjoint slice with no pre-history buffer.

    135 GitHub stars~6k tokensUpdated today
    Testing & QAAuto-check passed

More from DavidVujic/python-polylith

All 37 skills in this repo
  • Polylith Base Creation

    DavidVujic/python-polylith

    Create a Polylith base with poly create base — the entry point of a deployable application (HTTP API, CLI, message-queue consumer, AWS Lambda handler, GCP Cloud Function, scheduled job).

    553 GitHub stars~757 tokensUpdated 2 days ago
    Auto-check passed
  • Polylith Check

    DavidVujic/python-polylith

    Validate a Polylith workspace with poly check — the canonical CI gate.

    553 GitHub stars~972 tokensUpdated 2 days ago
    Auto-check passed
  • Polylith Component Creation

    DavidVujic/python-polylith

    Create a Polylith component with poly create component — a reusable, isolated brick implementing business logic, a feature, a domain module, or a capability.

    553 GitHub stars~800 tokensUpdated 2 days ago
    Auto-check passed
  • Polylith Dependency Management

    DavidVujic/python-polylith

    Add or manage third-party dependencies in a Polylith workspace.

    553 GitHub stars~643 tokensUpdated 2 days ago
    Auto-check passed
  • Polylith Dependency Visualization

    DavidVujic/python-polylith

    Visualize brick × brick dependencies with poly deps — find circular dependencies, inspect a brick's public interface, and detect interface-bypass violations.

    553 GitHub stars~906 tokensUpdated 2 days ago
    Auto-check passed
  • Polylith Diff

    DavidVujic/python-polylith

    List Polylith bricks whose implementation changed since a git tag using poly diff.

    553 GitHub stars~1.1k tokensUpdated 2 days ago
    Auto-check passed

Works with

Categories

Questions about Polylith Testing

What does Polylith Testing do?

List Polylith bricks and projects affected by test-code changes since a git tag using poly test diff. Polylith Testing is an agent skill from DavidVujic/python-polylith. List Polylith bricks and projects affected by test-code changes since a git tag using poly test diff.

When should I use Polylith Testing?

Polylith Testing fits situations like: selective test runs in CI (which tests do I need to run?).

How do I install Polylith Testing in Claude Code?

Run `npx skills add DavidVujic/python-polylith --skill polylith-testing -a claude-code`. Or copy the skill folder (.agents/skills/polylith/polylith-testing in DavidVujic/python-polylith) into .claude/skills/polylith-testing in your project. Claude Code loads it when a task matches its description.

How do I install Polylith Testing in Codex?

Run `npx skills add DavidVujic/python-polylith --skill polylith-testing -a codex`. Or copy the skill folder (.agents/skills/polylith/polylith-testing in DavidVujic/python-polylith) into .agents/skills/polylith-testing in your project. Codex loads it when a task matches its description.

Can I use Polylith Testing in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add DavidVujic/python-polylith --skill polylith-testing -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/polylith-testing, .gemini/skills/polylith-testing, .github/skills/polylith-testing and .opencode/skills/polylith-testing in your project.

What does Polylith Testing need to run?

Going by SKILL.md and its folder, Polylith Testing needs the command-line tools its instructions call (uv, pytest and poetry).

Does Polylith Testing access the network?

SKILL.md contains no URLs. Its commands use uv, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Polylith Testing safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Polylith Testing use?

Polylith Testing is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Polylith Testing use?

About 1.6k tokens (SKILL.md is roughly 6.3k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Polylith Testing?

Skills that share tags, products or a category with Polylith Testing: Skyvern Version Bump (Skyvern-AI/skyvern, 23k stars), Worktree Env Setup (meta-pytorch/attention-gym, 1.3k stars), Adk Setup (google/adk-python, 22k stars) and Compare Codegen (hw-native-sys/pypto, 125 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Polylith Testing?

DavidVujic (a GitHub user) maintains it in DavidVujic/python-polylith, which has 553 GitHub stars. The repository holds 37 skills in this directory. The repository was last updated on October 4, 2026.

Source: DavidVujic/python-polylith on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.