From aiobotocore-bot
Detects new Pyright type errors introduced by PR changes in touched files by comparing pyright runs on HEAD and origin/main baseline via git worktree.
npx claudepluginhub aio-libs/aiobotocore --plugin aiobotocore-botThis skill is limited to using the following tools:
aiobotocore has a long-standing baseline of pyright errors (intentional async-overriding-sync
Performs diff-based PR reviews across code quality, test coverage, silent failures, type design, and comment quality with severity-ranked findings on git diffs or specified PRs.
Reviews only code changes since last commit using graph-based impact analysis and blast radius detection. Provides token-efficient context for focused reviews of bugs, style, tests, and affected files/functions.
Reviews GitHub PRs: fetches diff via gh CLI, runs repo-specific checks, launches 3 parallel agents for correctness/conventions/efficiency, validates findings, drafts review.
Share bugs, ideas, or general feedback.
aiobotocore has a long-standing baseline of pyright errors (intentional async-overriding-sync patterns plus legacy type gaps). Absolute counts are not a gate — what we care about is drift introduced by the current changes, especially in files the changes touched.
This skill captures the delta using git worktree rather than git stash: a throwaway worktree
at origin/main provides the baseline without touching the primary tree. An earlier version of
this flow used git stash push/pop (inherited from the pre-refactor inline sync-prompt); that
approach is fragile because a failed git stash pop leaves the primary tree in a half-applied
state just before the MCP commit step runs. Worktrees sidestep that class of failure entirely.
--path=<path> (optional, default aiobotocore/): path to run pyright against--base=<ref> (optional, default origin/main): git ref to use as the baseline--touched-files=<file1,file2,...> (optional): restrict the delta report to these files. If
omitted, derived from git diff --name-only <base>.Bind the args (or their defaults) into shell variables used by later steps:
PYRIGHT_PATH="${PATH_ARG:-aiobotocore/}" # --path value
BASE="${BASE_ARG:-origin/main}" # --base value
Then resolve touched files:
git diff --name-only "$BASE"
Call this TOUCHED. If --touched-files is set, use it instead. If the result is empty, return
delta: no changes to compare and exit — there is nothing to measure.
git fetch origin main --quiet
WORKTREE=$(mktemp -d -t pyright-baseline-XXXXXX)
git worktree add --detach "$WORKTREE" "$BASE"
Use --detach so the worktree is not tied to a branch (the caller may already have origin/main
checked out as a branch somewhere). mktemp -d gives a unique path that can't collide under
concurrent invocations — /tmp/pyright-baseline-$$ (PID) would collide for two shells with the
same PID on different hosts or in edge cases.
uv run --with pyright pyright "$WORKTREE/$PYRIGHT_PATH" > /tmp/pyright-before.txt 2>&1
tail -1 /tmp/pyright-before.txt
The baseline runs against the baseline worktree's files. uv run resolves Python dependencies
from the caller's venv, which is fine — pyright typechecks files by path, and the baseline's
dependencies are the same ones pinned at $BASE.
git worktree remove --force "$WORKTREE"
--force ensures removal even if pyright left __pycache__ dirs behind. Because the worktree
lives under /tmp and was never branch-tracking, there is nothing to lose.
uv run --with pyright pyright "$PYRIGHT_PATH" > /tmp/pyright-after.txt 2>&1
tail -1 /tmp/pyright-after.txt
Compare the two outputs. A new error counts toward the delta only if its filename (after stripping
the $WORKTREE/ prefix from baseline paths) matches a file in TOUCHED. Errors in untouched
files are pre-existing baseline noise — ignore them.
Output:
Baseline: <N> errors, <W> warnings
With changes: <N'> errors, <W'> warnings
Touched files: <list>
New errors in touched files:
<path>:<line>: <message>
...
No new errors: <true|false>
git fetch fails (network): retry once, then return error: could not fetch $BASE. The
caller should treat this like any other transient failure.git worktree add fails (e.g. $BASE not resolvable): return error: could not create baseline worktree at $BASE — never fall back to running only the "after" pyright, since a
one-sided run cannot produce a delta.no new errors. A crashed run is not a passing run.git worktree remove --force "$WORKTREE" in a final cleanup to avoid orphaned worktree
entries. Safe to call even if the worktree is already gone.