Add your description here
Project description
goodpr
Generate a professional pull request description from a local git repository using LangChain Deep Agents and Gemini.
Requirements
- Python 3.13+
- uv
- A
GOOGLE_API_KEYfor the Gemini API
Setup
# Clone and install
uv sync
# Add your Gemini API key
echo GOOGLE_API_KEY=your_key_here > .env
Usage
uv run goodpr <path/to/repo> --commit-offset <N>
| Argument | Description |
|---|---|
path/to/repo |
Absolute or relative path to a local git repository |
--commit-offset N |
Number of commits back from HEAD to include (default: 5) |
--log-file PATH |
Log file path (default: goodpr.log) |
Example — describe the last 10 commits:
uv run goodpr C:/projects/myapp --commit-offset 10
Output is written to stdout as Markdown, suitable for pasting directly into a GitHub / GitLab PR.
How it works
flowchart TD
CLI["CLI\nmain.py"]
Git["git format-patch\nHEAD~N..HEAD"]
File["patch_context.txt\nraw patch"]
BuildIndex["build_patch_index()\nchunk by file, BM25"]
Index["BM25 index\nin-memory"]
Main["Main Agent\nGemini 3 Flash"]
SumAgent["summary-agent\nsearch_patch() only"]
ImplAgent["implications-agent\nsearch_patch() only"]
SumOut["TITLE / SUMMARY\nFILES / CHANGE_TYPES"]
ImplOut["BREAKING / MIGRATIONS\nDEPS_CONFIG / TESTING / RISK"]
PR["Final PR\nMarkdown output"]
CLI --> Git
Git --> File
File --> BuildIndex
BuildIndex --> Index
Main -->|"task() STEP 1"| SumAgent
SumAgent -->|"search_patch(query)"| Index
SumAgent --> SumOut
SumOut --> Main
Main -->|"task() STEP 2"| ImplAgent
ImplAgent -->|"search_patch(query)"| Index
ImplAgent --> ImplOut
ImplOut --> Main
Main -->|"STEP 3 compose"| PR
Key design decisions
- Raw patch on disk — the full patch is written to
patch_context.txt(capped at ~500KB fromgit format-patch). Subagents do not read this file directly; they only see patch content via search results. - BM25 search only — at startup, the raw patch is chunked per-file-per-commit and indexed with BM25. Subagents use
search_patch(query)to retrieve relevant chunks (e.g. by file name, function, or keyword) and can analyze the full patch without loading it all at once. - File-based handoff — the patch path is passed in the user message and to
build_pr_agent()so the BM25 index can be built. After that, all patch access is through thesearch_patchtool, not direct file reads. - Structured subagent output — each subagent returns a fixed labeled format (
TITLE:,SUMMARY:,BREAKING:,RISK:, etc.) so the main agent can compose the final PR deterministically. - Skills — PR writing guidelines are loaded from
skills/pr/SKILL.mdat runtime.
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
goodpr-0.1.0.tar.gz
(11.1 kB
view details)
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
goodpr-0.1.0-py3-none-any.whl
(12.8 kB
view details)
File details
Details for the file goodpr-0.1.0.tar.gz.
File metadata
- Download URL: goodpr-0.1.0.tar.gz
- Upload date:
- Size: 11.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.10.4 {"installer":{"name":"uv","version":"0.10.4","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 |
783383e8b51223736e6a2586aa837aa09f619e8f8163471679eeca7bed41a35f
|
|
| MD5 |
129b543f24e47bdbfd1324665d2d789d
|
|
| BLAKE2b-256 |
1e557cf1cc4b0634a3477ce7cd1cf071ec6e641abf3090620917c83586dbf4c3
|
File details
Details for the file goodpr-0.1.0-py3-none-any.whl.
File metadata
- Download URL: goodpr-0.1.0-py3-none-any.whl
- Upload date:
- Size: 12.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.10.4 {"installer":{"name":"uv","version":"0.10.4","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 |
031bfa9c569376d69bdbad37018f4e976887799d97db20d2e3d82a930dfa7d16
|
|
| MD5 |
48550934f3458c7da78fd571dfe96fef
|
|
| BLAKE2b-256 |
6b3f8509d4d68449d809d12854035b8ad9926202c8087279d97421907bc61111
|