/repomatic:repomatic-deps [graph [--level N]|review [all|runtime|dev|policy]|explore [<package>]|modernize [--no-bump] [<package>]]from Repomatic
Generates dependency graphs, audits pyproject.toml against version policy, finds unused dependency APIs, and modernizes code for upgraded dependencies.
Ships in Repomatic. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
![ -f uv.lock ] && echo "uv.lock exists" || echo "No uv.lock found"
![ -f pyproject.toml ] && head -5 pyproject.toml || echo "No pyproject.toml found"
!grep -c '".*>=\|".*~=\|".*<\|".*==' pyproject.toml 2>/dev/null || echo "0"
![ -f repomatic/__init__.py ] && echo "CANONICAL_REPO" || echo "DOWNSTREAM"
!grep -rhoE 'kdeldycke/repomatic/[^@ ]+@[0-9a-f]{40} # v[0-9.]+' .github/workflows 2>/dev/null | grep -oE '[0-9]+\.[0-9]+\.[0-9]+$' | sort -u | sed 's/^/WORKFLOW_PIN=/'
You help users understand and maintain their project's dependencies. This skill has four modes: graph (visualize the resolved dependency tree), review (audit pyproject.toml declarations against version policy), explore (find unused dependency APIs that could simplify existing code), and modernize (refactor code to adopt features from recently-upgraded dependencies, applying the changes).
CANONICAL_REPO, use uv run --frozen repomatic: without --frozen, an edit to pyproject.toml makes the local uv relock uv.lock.uvx --exclude-newer '{window}' --exclude-newer-package repomatic=P0D --from 'repomatic==X.Y.Z' -- repomatic, with X.Y.Z the WORKFLOW_PIN the context shows. Read {window}, here and in every command below, from the workflow-level UV_EXCLUDE_NEWER of .github/workflows/tests.yaml or release.yaml, which repomatic init renders from [tool.repomatic] minimum-release-age. --exclude-newer-package exempts repomatic itself, so a fresh release stays installable while its dependency tree stays gated. The pin runs update-dep-graph at the version the update-dep-graph job runs, so a local graph does not churn against the next CI refresh. Drop the --from clause only when the context shows no WORKFLOW_PIN.graph and review all.graph: Generate and analyze the dependency graph only.review [all|runtime|dev|policy]: Audit pyproject.toml declarations only.explore [<package>]: Search for unused dependency APIs that could simplify existing code, and flag thin dependencies that in-house code could replace.modernize [--no-bump] [<package>]: Refactor code to adopt new features from upgraded dependencies, applying and test-gating each change. With --no-bump, it adopts only what the declared floors provide and moves no version.$ARGUMENTS starts with --level or a number, treat it as graph mode with those arguments.The autofix.yaml workflow's update-dep-graph job regenerates the dependency graph on every push, for packages and uv virtual projects alike. This mode is useful for interactive analysis — understanding the graph, spotting concerns, or generating it before pushing.
With [tool.repomatic] dependency-graph.update = false, the update-dep-graph command exits without writing a graph, and the job opens no pull request. Tell the user so, and skip this mode.
<cmd> update-dep-graph.<cmd> update-dep-graph with no arguments.<cmd> lint-deps decides everything readable from pyproject.toml and uv.lock: upper bounds in [project] dependencies and extras, missing specifiers, extras that install nothing, unsorted lists, type stubs outside the typing group, floors with no comment above them, and floor comments running past [tool.repomatic] lint-deps.comment-word-threshold words (40 by default). Run it first and let it own those rows. CI runs it from the release lane's lint-deps job (_release-build.yaml, reached through release.yaml), which fires on every push but annotates with --no-fatal until a release commit makes the blocking shippability findings fatal. A floor inside the cooldown blocks only in [project] dependencies and extras, which reach the published metadata. In a dependency group, it stays a warning. These policy rows never block either way, so no CI gate will catch them for you.
What is left is the part no parser settles, and it is the reason this mode exists: whether a floor is justified by the APIs the code actually calls, whether a comment is stale or weak, and whether a rationale contradicts its conditional marker. Spend the review there.
all (default when no sub-argument): Run all checks below.runtime: Review [project].dependencies only.dev: Review [dependency-groups] and [project.optional-dependencies] only.policy: Print the policy summary without auditing.These conventions are derived from the pyproject.toml files across all kdeldycke/* repositories. User-facing documentation of the same content is in docs/dependencies.md.
[project].dependencies)Every version bound needs a comment tying the floor to a concrete code dependency. The comment goes on the line above the dependency and states which feature, method, or API from that version the project actually uses. Prefer referencing the call site or module that depends on it:
dependencies = [
# wcmatch 10.0 changed globbing semantics; our sync_gitignore() relies on
# the new symlink-aware matching behavior.
"wcmatch>=10",
]
A good floor comment answers: "if someone installed an older version, what would break and where?" If you cannot point to a concrete usage, the floor may be unnecessarily high.
A floor comment documents the floor as it stands, in one short paragraph. When raising a floor, rewrite the comment rather than extending it: keep what the new version buys (API, fix, requires-python alignment, the call site consuming it, a CVE or upstream issue identifier), delete every superseded floor (git log -- pyproject.toml keeps that history), and move out what is not about this floor (usage detail belongs in the module using it, a comparison against an alternative package in an XXX pointer to the upstream ticket). lint-deps warns past 40 words, which is the ceiling to write to even where it is not run.
Security fixes are also a valid floor bump reason. A CVE or advisory in an older version justifies raising the floor even when the API is unchanged. The comment should cite the CVE or advisory:
dependencies = [
# requests 2.32.0 fixes CVE-2024-35195 (session credential leak on redirects).
"requests>=2.32",
]
Python version support is not a valid reason to bump a floor. The dependency resolver already picks the right version via requires-python metadata. If mango>=2 works and mango 5 merely adds Python 3.13 support, keep >=2 — the resolver handles it. Exception: when a dependency drops a Python version your project still supports (or your project drops one, aligning minimum requires-python), that alignment is a valid floor bump reason. The comment should state the version range alignment, not the Python support:
dependencies = [
# papaya 7.11.0 dropped Python 3.10, matching our requires-python >= 3.11.
"papaya>=7.11",
]
Use conditional markers for Python-version-gated deps. Example: "tomli>=2; python_version<'3.11'". When a dep has a version marker, the floor rationale must make sense for the Python versions where the dep is actually installed — not for versions excluded by the marker.
[dependency-groups])[dependency-groups] (uv standard) over [project.optional-dependencies] for test, typing, and docs groups.>= is preferred for dev deps, but ~= is acceptable when stricter pinning reduces CI randomness. If a package also appears in runtime deps, the dev entry must use the same specifier style. The relaxation is about specifier style (~= allowed), not about floor accuracy — dev dep floors still need to be grounded in actual API or compatibility requirements, not adoption timestamps.test, typing, docs (lowercase, alphabetical)."pytest-xdist[psutil]>=3.7".Read the full pyproject.toml. For each dependency entry, check what lint-deps cannot:
| Check | What to flag |
|---|---|
| Weak comment | Comment cites Python version support instead of a concrete code dependency. Flag unless it documents a requires-python alignment or a Python version drop |
| Stale comment | Comment references a reason that no longer applies (the cited method was replaced, or the Python version left the support matrix) |
| Accreted comment | Comment narrates superseded floors beside the declared one. Rewrite it around the version in force; lint-deps catches only the long ones |
| Inflated floor | Floor higher than the oldest version providing the APIs actually used (see floor verification below) |
| Understated floor | Floor lower than the oldest version the code runs on (see lowest-version check below) |
| Marker/rationale mismatch | Floor rationale contradicts the conditional marker (e.g., "Python 3.14 wheels" on a dep gated by python_version<'3.11' — that dep is never installed on 3.14) |
| Section style | [project.optional-dependencies] used where [dependency-groups] would be appropriate |
| Conditional markers | Missing Python version marker for backport packages |
| Stale cooldown exceptions | exclude-newer-package entries in [tool.uv] for packages that no longer need them (see below) |
Comments and changelogs can lie; the codebase is the source of truth. For each dependency with a weak or suspicious comment, verify the floor against actual usage:
pip index versions <pkg> to see what exists on PyPI. A floor that rests on a behavior (comments kept, output formatting) needs a bisect instead, since a changelog can credit it to a later release than the one that shipped it. Run one probe per release with uv run --no-project --exclude-newer '{window}' --with '<pkg>==<version>' python probe.py, and compare each output byte for byte with the locked release.uv lock after any floor change to verify the lock still resolves. Run it with the uv version the workflows pin on their setup-uv steps, like uvx --exclude-newer '{window}' --from 'uv==X.Y.Z' uv lock: a newer local uv rewrites the lockfile revision and adds tables that CI never writes. After a floor raised in one dependency group only, add --upgrade-package <pkg>: a group with its own requires-python resolves as a separate fork, and a plain uv lock keeps the old pin in the other one.A floor can also be too low: the code calls an API that the declared version lacks. The lockfile holds the newest release of each dependency, so no ordinary test run shows it, and the first to see it is a user on an old environment.
uv pip compile pyproject.toml --resolution lowest-direct --exclude-newer '{window}' --python-version <floor>, with the lowest Python the project supports. It prints the set and installs nothing.git worktree, uv sync --resolution lowest-direct --all-extras --group test installs it and uv run --frozen -- pytest tests it. The sync rewrites uv.lock, so keep it out of the main checkout. When the test matrix carries a lowest-direct cell, read its last CI result instead.packaging. A mocked client hides the library behind it. For each one, write a script that makes the call the code makes, and run it against the floor: uv run --no-project --exclude-newer '{window}' --with '<pkg>==<floor>' python probe.py.To test one floor alone, build an environment from the lockfile and swap that package in with uv pip install --exclude-newer '{window}' --no-deps '<pkg>==<floor>'. uv run --with resolves the package's own dependencies again, so a failure there can come from another package. When [tool.uv] exclude-newer-package exempts a package whose locked or floor release is still inside the window, add --exclude-newer-package '<pkg>=0 day' to each install: without it, uv finds no release to install.
backports-strenum, tomli, exceptiongroup) exist solely to provide a stdlib class to older Python versions. Their entire API is the backported class itself, available in all versions. The floor is typically >=1 (or the first release) unless a specific bug fix is needed for the Python versions where the dep is actually installed.pytest-randomly, pytest-github-actions-annotate-failures) have low effective floors — their basic functionality has been stable across major versions. Set the floor at the major version introducing the current plugin interface, not at the latest release.A floor bump is justified when a newer version of an existing dependency provides an API that replaces hand-rolled code in the project. This is the flip side of floor verification: instead of checking whether the floor is too high, check whether it could be raised to unlock a simplification.
A valid simplification bump must:
When explore mode identifies a candidate, the review output should include it as an Info-level suggestion with the current code, the replacement, and the version that introduced the API.
These comment patterns typically signal a floor set at adoption or auto-bump time, not at an API boundary:
Check git log when a floor looks suspiciously high.
exclude-newer-package cooldown auditThe [tool.uv] section may contain exclude-newer-package entries that exempt specific packages from the global exclude-newer cooldown window. They arrive from two places: written by hand (the package is published by the same maintainer, or is developed in-repo), or written by audit --fix, which reaches a CVE fix still inside the window through an entry rather than lifting exclude-newer for the whole tree.
Expiry is mechanical, so do not audit for it. sync-uv-lock owns the lifecycle of every entry and reports each move in its PR body: it rewrites a relative span ("0 day") into a fixed cutoff pinned to the locked version's upload time, which holds the package instead of letting it track latest, then prunes the entry outright once that held version ages past the global cooldown and the package rejoins normal resolution. A live fixed cutoff is therefore a freeze doing its job, not a leftover: proposing its deletion un-holds a package the freeze was deliberately pinning. A surviving relative span means the freeze has not run yet, except on a package with no upload time in the lockfile: one consumed from a git or path source, or one the lockfile does not hold. That span stays as written.
What is left for this audit is the part no schedule settles:
[project].dependencies and all [dependency-groups], a relative span on it is dead weight that no prune will ever reach. A fixed cutoff needs no audit there: sync-uv-lock prunes it once the cooldown window has passed the cutoff itself.Flag those as warnings. Never flag an entry merely for existing or for looking old.
When the context shows DOWNSTREAM, also compare the dependency list against the canonical repomatic pyproject.toml, fetched at the version this repo has adopted rather than at the tip of main: take the tag from the uses: pins in .github/workflows/, then run gh api "repos/kdeldycke/repomatic/contents/pyproject.toml?ref=vX.Y.Z" --jq '.content' | base64 -d. An unpinned fetch resolves to main, whose floors may have moved for a release the downstream repo cannot use yet, turning unreleased work into a phantom "downstream is behind" finding. Use it to identify:
Produce:
Search for unused APIs in existing dependencies that could replace hand-rolled code. This is purely analytical: it produces recommendations, not changes.
<package>: explore a single dependency (like explore papaya).For each dependency in scope:
Catalog current usage. Grep the source tree (not tests) for all imports from the package. List every function, class, and constant actually used, with file locations.
Catalog available APIs. Using your knowledge of the library (and its docs if needed via WebFetch), list the public APIs the project does NOT currently use. Focus on utilities, helpers, and data structures: the kind of thing that replaces 3-10 lines of hand-rolled code.
Search for replacement candidates. For each unused API, grep the source tree for code patterns it could replace. Be specific about what constitutes a match.
Verify each candidate. Read the actual code at each location. Discard false positives:
next() on a generator is idiomatic Python; first() adds a dependency import for no clarity gain.Path.write_text() is fine when the file is immediately committed by CI or when partial writes are harmless.TableFormat.GITHUB hardcoded in functions that generate markdown for PR bodies is correct: the --table-format CLI option is for terminal output only.glob.glob() with recursive=True is fine when no extended glob features (brace expansion, negation) are needed.packaging.markers.Marker only helps if the public API exposes the structure you need. Its primary public method is evaluate(), not AST inspection.Check version requirements. For each surviving candidate, determine which version of the dependency introduced the API. Compare against the current floor. If a bump is needed, it must satisfy the floor bump criteria.
Produce a table of findings:
| Dependency | Unused API | Location | Current code (summary) | Replacement | Version needed | Verdict |
|---|---|---|---|---|---|---|
| papaya | ripe | orchard/harvest.py:42 | comprehension keeping the ripe fruits | ripe(basket) | any (available since 2.x) | Skip: one-liner, no clarity gain |
| mango | Forecast.rainfall | weather/report.py:118 | data.get("forecast", {}).get("rainfall") | forecast.rainfall | current floor sufficient | Adopt: parsed object already available |
Only recommend changes where the replacement is a genuine simplification: fewer lines, better error handling, or elimination of a manual reimplementation.
Most dependencies are already well-used. Expect the majority of candidates to be discarded during verification. A run that produces zero recommendations is a valid outcome: it means the codebase is already leveraging its dependencies effectively.
The usage catalog of step 1 also shows when the project uses a dependency so little that in-house code can replace it. A plain explore reports these verdicts; the --deep pass of /repomatic-ship applies them.
uv tree per line of code written. Run uv tree --invert --package {pkg} first. A package that another dependency still installs leaves nothing: keep declaring it, with its type stubs, since a rewrite that frees no package only adds an undeclared import.certifi into a binary all stay.Any, so the drop exposes type errors the stub hid: read them as findings.{todo} naming the release that lets it go.requires-python raise. A stdlib API the new floor provides turns a keep into a drop: datetime.fromisoformat for a date library, glob on Python 3.13 for a glob library.explore finds simplifications hiding in any installed dependency and only reports them. modernize is narrower and active: it works from the dependencies that changed version recently, reads what those versions added, and applies the resulting simplifications, gated by the test suite.
[!WARNING] This is the one mode that edits code on its own, and it acts on third-party changelogs it can misread. Every change must be behavior-preserving and verified against the local test suite before it stays. Run it where you can review the diff, and treat a failing test as a veto, never something to "fix" by loosening the test.
<package>: a single dependency (e.g., modernize click-extra).--no-bump: keep every version where it is, as /repomatic-ship does. It combines with <package>. See Keeping every version for what changes.Find the version deltas. Determine which dependencies changed, and from and to which version, cheapest source first:
sync-uv-lock PR — its body lists every bump with its old and new version and a changelog or compare link per package. Find it with gh pr list --search 'head:sync-uv-lock' --state all --limit 1, then gh pr view <number> --json body. That body covers one sync only: when several merged since the last release tag, diff the lockfile against the tag to get the whole range.git tag --sort=-v:refname | head -1) and diff the lockfile against it (git diff <tag> -- uv.lock), reading the version pairs.pyproject.toml floor.Read each changelog for the delta. Fetch the release notes covering that version range from the link in the bump table (GitHub releases via gh api repos/{owner}/{repo}/releases, or WebFetch on the compare URL; the PyPI project page otherwise). A release body that only links to a docs page, as Sphinx's does, has its notes in the repository: read the changelog file at the tag with gh api 'repos/{owner}/{repo}/contents/{file}?ref={tag}' -H "Accept: application/vnd.github.raw". Extract only what is new or changed in the range: added public APIs, fixed bugs our code works around, and deprecations of APIs we still call. Degrade gracefully: if WebFetch is unavailable and the package is not on GitHub, fall back to your own knowledge of the library's release history and lower your confidence accordingly.
Map deltas to our code. For each new or changed item, grep the source tree (not tests) for code it touches, reusing the false-positive filters from Explore mode:
work around, TODO, and version-guarded branches.{todo} admonition naming the package. Check each one against the new floor, not only those the changelog of the range mentions: a trigger met before the range still counts. git tag --contains {sha} names the first release carrying a change. Confirm that release covers the case the todo describes before you act on it.Apply one dependency at a time. Make the edits for a single package, keeping each behavior-preserving. If adopting an API needs a higher floor, raise it and rewrite the comment per Floor bumps to adopt new APIs, then run uv lock. Under --no-bump, report it instead.
Verify before moving on. Run the project's tests, mypy, and ruff (the same fast local channel /babysit-ci and /repomatic-ship rely on). If anything fails, fix it within the same change or revert that package's edits. Only move to the next dependency once green. A change that cannot be made green is reverted, not forced.
Report. Summarize per dependency: the version delta, what was adopted or dropped, the files touched, and anything skipped with the reason. A dependency whose changelog offers nothing actionable is a valid no-op.
--no-bump runs the procedure above without moving a version, and it is the form /repomatic-ship runs. A release then ships the dependency set the cycle tested, and no [project] floor raised inside the cooldown blocks it at lint-deps. These rules replace the matching steps:
pyproject.toml and the versions in uv.lock stay as they are.git diff <tag> -- pyproject.toml names them. Read the changelog from the old floor to the new one: a release that the lock held before the raise falls outside the lock delta.[project] floor or the floor of its extra. A dependency group that declares a higher floor raises it only for the code that group runs, like docs/conf.py.uv run --no-project --exclude-newer '{window}' --with '<pkg>==<floor>' python probe.py.ImportError fallback or a bug workaround for a release below the floor. The search is cheap, so cover every floor the project declares.--no-bump.Suggest the user run:
/repomatic-deps review all to audit version floors and specifier policy./repomatic-deps modernize after a sync-uv-lock PR lands, to fold the freshly-upgraded dependencies' new features into the code./repomatic-upgrade for an alignment check beyond dependencies, in a downstream repository.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub kdeldycke/repomatic --plugin repomatic18 skills in this plugin
/av-false-positiveScan a release on VirusTotal. Write submission instructions for each AV vendor that flags a false positive./awesome-triageTriage new issues and PRs on awesome-list repos. Apply the curation criteria drawn from past decisions./babysit-ciMonitor the CI tests, lint, autofix, docs and Nuitka binary-build workflows. Diagnose each failure, fix the code, commit, and loop until every stable job passes. Ignore unstable failures./benchmark-updateCreate or update the competitive benchmark page (docs/benchmark.md) that compares this project against its alternatives. Check maintenance status, feature accuracy, new candidates and badge health./brand-assetsCreate project logo and banner SVGs, then export them to light and dark PNG variants. Use when you design a logo or banner, or regenerate the PNGs from their SVG source files./file-bug-reportWrite a bug report for an upstream project, or a reply on an existing issue. Read its contribution guidelines, issue templates and community norms first, then produce a markdown file ready to paste.Other plugins' skills for the same job