Mine PR History
What it does
Section titled “What it does”Surfaces recurring PR review feedback that lacks rule coverage. Anvil fetches merged PR review comments, clusters them by theme, and highlights the highest-frequency patterns.
bunx @lambdacurry/anvil mine-pr owner/repoRequires GITHUB_TOKEN in your environment:
export GITHUB_TOKEN=ghp_...bunx @lambdacurry/anvil mine-pr my-org/my-repoHow it works
Section titled “How it works”- Fetch — retrieves merged PR review comments via GitHub API
- Cluster — groups comments by theme (error handling, naming, security, etc.)
- Score — ranks clusters by frequency and recurrence
- Cross-reference — checks which clusters lack rule coverage
- Report — outputs candidates with frequency, examples, and suggested rule text
Output
Section titled “Output”Each rule candidate includes:
- Theme — what pattern keeps coming up in reviews
- Frequency — how often this feedback appears
- Example quotes — representative review comments
- Suggested rule — draft rule text you can adapt
- Coverage status — whether any existing rule already covers this
When to use
Section titled “When to use”- After onboarding — mine recent PRs to capture institutional knowledge as rules
- Periodically — surface new patterns as the codebase evolves
- Before audits — use mined candidates to fill coverage gaps before running a full audit