Codebase intelligence for AI and humans: code health scores, auto-generated docs, git analytics, dead code detection, and architectural decisions via MCP.
Python aicode-complexitycode-healthcode-intelligencecode-qualitydead-codedeveloper-toolsdocumentationgit-analyticsmcpopen-sourcepythonrefactoringstatic-analysistechnical-debt
description: Print the tests whose coverage intersects a change's changed lines — for a commit, base..head range, or staged diff. allowed-tools: Bash(repowise impacted-tests:*), Read
Repowise Impacted Tests
Map a change to the tests that actually exercise its changed lines, using the
per-test coverage map from repowise coverage add. No LLM, no network —
an index lookup. Useful as a pre-merge / CI gate ("run these 40, not all 4,000").
Steps
- If
.repowise/doesn't exist: "This repo isn't indexed yet. Run/repowise:initfirst." Stop. - Resolve the target from
$ARGUMENTS, runrepowise impacted-tests, and present the test ids. Be honest about gaps (see Notes).
Choosing the revspec
- No args →
repowise impacted-tests(staged changes; same as--staged) - A commit SHA →
repowise impacted-tests <sha> - A range / PR / branch →
repowise impacted-tests <base>..<head>(e.g.repowise impacted-tests main..HEAD) - "staged" →
repowise impacted-tests --staged
Useful flags:
--format list— test ids one per line (pipe toxargs pytest)--format json— full report--format args— one line of runner arguments, or:allwhen the whole suite must run; reasons go to stderr.--runner pytest|go|jest|files|autopicks the argument shape--path <dir>— point at a different repo
repowise impacted-tests main..HEAD --format list | xargs pytest
Notes
- Line-precise answers need a per-test map from
repowise coverage addon a report with contexts. If none is ingested, the command still prompts to run/repowise:coverage/repowise coverage add. It does not invent an empty "no tests needed" result. - A changed file with no coverage rows gets candidates instead, in a table
headed "NOT coverage-backed", each carrying a
viamarker:changed-test(the changed file is itself a test),call-graphorimport-graph(a test file that reaches it, no ingest needed), orfilename-pattern(a name-shaped guess). Report them as candidates. Onlyvia: coverageproves a test executed the change. - A file none of those can speak to is "unknown, run the full suite".
- In CI,
--format argsprints:allwhenever the selection is not certain (lockfiles, build or CI config, a changed file no test reaches, an index built at neither end of the change). Run everything when you see it. - For a whole-change repo-relative review priority, use
/repowise:risk. For per-file blast radius /tests_to_run, use theget_riskMCP tool.