Distill code review patterns from GitHub PRs into Claude Code skill files
Project description
dstl-code-review
CLI tool that distills GitHub PR review comments into reusable skill files for Claude Code. Powered by pydstl.
The Problem
Your team's best code review feedback is buried across hundreds of PRs. New contributors don't benefit from it, and AI assistants don't know your team's standards.
The Solution
dstl-code-review extracts review comments from your repos, filters out noise (bots, "LGTM", short comments), and distills the meaningful ones into a structured skill file that Claude Code can reference during development.
Install
You need uv — a fast Python package manager. If you don't have it:
# macOS / Linux
curl -LsSf https://astral.sh/uv/install.sh | sh
# Windows
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
That's it. No cloning, no virtual environments — uvx handles everything.
Setup
Before running, export your API keys:
# GitHub — use a fine-grained token (https://github.com/settings/tokens?type=beta)
# "Public repositories (read-only)" scope is enough for public repos
export GITHUB_TOKEN=ghp_your_token_here
# LLM — set the key for whichever provider you're using
export GEMINI_API_KEY=your_key # Google Gemini
export OPENAI_API_KEY=your_key # OpenAI
export ANTHROPIC_API_KEY=your_key # Anthropic
Usage
Navigate to your project directory and run the command — the skill file will be created relative to where you run it:
cd ~/projects/my-app
uvx dstl-code-review \
--repo your-org/your-repo \
--model google-gla:gemini-3-flash-preview
This creates .claude/skills/code-review/SKILL.md inside your project, ready for Claude Code to pick up.
Quick example
Try it with real public repos:
uvx dstl-code-review \
--repo encode/httpx \
--repo Textualize/rich \
--model google-gla:gemini-3-flash-preview \
--limit 20
Single repo
uvx dstl-code-review \
--repo your-org/your-repo \
--model google-gla:gemini-3-flash-preview
Fetches all PR review comments, filters noise, and distills them into .claude/skills/code-review/SKILL.md.
Multiple repos
Pass --repo multiple times to distill comments from several repos into a single consolidated skill file:
uvx dstl-code-review \
--repo your-org/frontend \
--repo your-org/backend \
--repo your-org/shared-lib \
--model google-gla:gemini-3-flash-preview
Each repo is distilled independently first, then the results are consolidated into one unified document. Patterns from each repo are preserved without being diluted.
Incremental runs
Re-running the same command only fetches new comments since the last run. Evidence accumulates in a local SQLite DB, so you can run it periodically to keep the skill file up to date:
# First run — fetches everything
uvx dstl-code-review --repo your-org/api --model google-gla:gemini-3-flash-preview
# Later — only fetches new comments, re-distills with all evidence
uvx dstl-code-review --repo your-org/api --model google-gla:gemini-3-flash-preview
Custom output location
uvx dstl-code-review \
--repo your-org/your-repo \
--model google-gla:gemini-3-flash-preview \
--output ./my-project/.claude/skills/code-review
Output is always SKILL.md inside the specified directory.
How It Works
GitHub PRs ──► Fetch comments ──► Filter noise ──► Store as evidence
│
┌──────────┴──────────┐
▼ ▼
Per-repo distill Per-repo distill
│ │
└──────────┬──────────┘
▼
Consolidate
│
▼
.claude/skills/code-review/SKILL.md
Filtering — automatically drops bot comments (dependabot, copilot, etc.), low-signal phrases ("LGTM", "+1", "looks good"), and comments shorter than 30 characters.
Options
--repo GitHub repo (owner/name), repeatable [required]
--model LLM model string [required]
--limit Max comments per repo (default: 100)
--min-length Min comment length to keep (default: 30)
--db-path SQLite database path (default: .claude/dstl-code-review.db)
--output Output skill directory (default: .claude/skills/code-review)
--token GitHub token (or set GITHUB_TOKEN env var)
Supported LLM models
Any model supported by pydantic-ai:
--model google-gla:gemini-3-flash-preview # Google Gemini
--model openai:gpt-4o # OpenAI
--model anthropic:claude-sonnet-4-20250514 # Anthropic
Development
uv sync --all-extras
uv run pytest tests/ -v
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file dstl_code_review-0.1.0.tar.gz.
File metadata
- Download URL: dstl_code_review-0.1.0.tar.gz
- Upload date:
- Size: 177.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.10.7 {"installer":{"name":"uv","version":"0.10.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bc9bd18fee9ec4bed8209f9cfb06f5e2e72502e3ce36903f78e630d2dd87f735
|
|
| MD5 |
a06d46290f914b8082eb27b57b57e3f4
|
|
| BLAKE2b-256 |
99d9a36072c325664769cfc5880a6a8e6a53b1823adb68b5456dfd47d6a4c0f6
|
File details
Details for the file dstl_code_review-0.1.0-py3-none-any.whl.
File metadata
- Download URL: dstl_code_review-0.1.0-py3-none-any.whl
- Upload date:
- Size: 7.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.10.7 {"installer":{"name":"uv","version":"0.10.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
da294ae0a828b068f621aa8fc101c11cdd25dd2e383b59adc005d7ecefb87325
|
|
| MD5 |
63ed11b0752eb3cc63aa0c8533f86a56
|
|
| BLAKE2b-256 |
3946b44f86501600e0a97232e91f43ba73755e1cada8c9901b50d939051f7fa6
|