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.1.tar.gz
(11.2 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.1-py3-none-any.whl
(13.0 kB
view details)
File details
Details for the file goodpr-0.1.1.tar.gz.
File metadata
- Download URL: goodpr-0.1.1.tar.gz
- Upload date:
- Size: 11.2 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 |
da998028688959ce34bd8985bfe1b52f1e1c35bb0ce3be48fe06c6636b129232
|
|
| MD5 |
a14894ca54ed5b39b02bb09f5205639d
|
|
| BLAKE2b-256 |
c30d561c8146482c7bf2fa7786af9bad9425be6dfc87051221cd3c64442bd970
|
File details
Details for the file goodpr-0.1.1-py3-none-any.whl.
File metadata
- Download URL: goodpr-0.1.1-py3-none-any.whl
- Upload date:
- Size: 13.0 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 |
50df5fc302fdbf29505b25fb38c8609af212fbdd93bcfb455232a7a875423be9
|
|
| MD5 |
d837cf316b7f80d95c1d9e0a1f399770
|
|
| BLAKE2b-256 |
38fad45745f20fbbd9e451ccd3e53fbd66636f715e9ffe942932838dd42bf8b5
|