PR comment extractor
An installable Agent Skills pack that documents every pull request comment on a repository — including replies and comments from accounts that were later deactivated — then saves a local CSV and a review dashboard.
It is not a Claude Code or Copilot project layout. Coding agents install the skills into their skill directories.
Install
Any Agent Skills client (Claude Code, Codex, Copilot, Cursor, OpenCode, and others):
npx skills add framedparadox/pr-comments
CLI (PyPI):
pip install pr-comments
# or
uv tool install pr-comments
pr-comments extract --repo owner/name
CLI (npm):
npm install -g pr-comments
# or one-shot
npx pr-comments extract --repo owner/name
The npm CLI still needs Python 3.10+ (and optionally uv) on PATH.
From Git, without waiting for a PyPI release:
uv tool install git+https://github.com/framedparadox/pr-comments
uvx --from git+https://github.com/framedparadox/pr-comments pr-comments extract --repo owner/name
From a checkout of this pack:
uv run pr-comments extract --git-dir /path/to/the/repo
# or
npx . extract --git-dir /path/to/the/repo
What it does
- Lists every pull request that targets the main / default branch (open, closed, merged).
- Fetches conversation comments, inline review comments, replies, and review summaries.
- Keeps humans, bots, and later-deactivated accounts (
comment_by=ghost). - Writes
comments.csv(commit id, PR date, comment date, comment by, comment body, and related fields). - Writes a self-contained
dashboard.htmlfor filtering and reading threads.
Skills
All skill source lives in skills/ (the layout npx skills add discovers). Coding agents load these when you ask to archive PR comments or browse the local dashboard.
extract-pr-comments
Fetches every comment on pull requests that target the repository’s main / default branch and writes a local archive. Use it when documenting PR history, exporting review feedback, or building a comment CSV.
It resolves the repo from --repo owner/name or from origin of --git-dir / the current checkout, then resolves the base branch (--base-branch → GitHub default → origin/HEAD → main). Only PRs targeting that branch are included — open, closed, and merged.
Three GitHub sources are merged:
| Kind | What is kept |
|---|---|
| Conversation | Discussion-tab comments on those PRs |
| Inline review | Diff comments and their replies (commit_id, path, line) |
| Review summary | Non-empty review bodies (empty “reviewed” events are skipped) |
Authors are never filtered. Humans, bots (including Dependabot), and later-deactivated accounts are all kept. When GitHub returns "user": null, the row is stored as comment_by=ghost with author_type=deleted.
pr-comments extract \
[--repo owner/name] [--git-dir PATH] [--host github.com] \
[--base-branch main] [--out DIR] [--since 2024-01-01T00:00:00Z]
Checkout fallback: python3 skills/extract-pr-comments/scripts/extract.py --repo owner/name.
CSV columns always include commit id, PR created date, comment date, comment by, and comment body (see skills/extract-pr-comments/references/fields.md). After the extract, the agent should report the CSV and dashboard paths; browsing is the review-pr-comments skill.
review-pr-comments
Opens the archive produced by extract-pr-comments. It does not call GitHub again unless you ask for a fresh extract. Use it to browse, filter, or re-read comments — including ghost / deleted authors.
dashboard.html is self-contained (comment data is embedded) and works offline. Prefer opening that file in a browser. If file:// is blocked, serve the export directory:
pr-comments serve --out pr-comments-export/<host>--<owner>--<repo>
Then open http://127.0.0.1:8765/dashboard.html. Checkout fallback: python3 skills/review-pr-comments/scripts/serve.py --out DIR.
In the dashboard you can:
- Filter by comment by, author type (
user/bot/deleted), kind, PR, and comment date - Search text, path, and commit SHA
- Expand a row for the full body, commit SHA, PR created date, links, and thread replies
- Toggle light and dark mode from the sun / moon control at the bottom of the sidebar
- Download the current filtered view as CSV (the full archive remains
comments.csv)
Artifacts
Default directory: pr-comments-export/<host>--<owner>--<repo>/
| File | Role |
|---|---|
comments.csv |
Spreadsheet archive (UTF-8 BOM, Excel-safe) |
comments.json / comments.jsonl |
Full records including diff hunks |
dashboard.html |
Local review UI (data embedded; works offline) |
meta.json |
Extract timestamp and counts |
pr-comments serve --out pr-comments-export/github.com--owner--repo
Credentials
| Host | Preferred CLI | Environment fallback |
|---|---|---|
| GitHub | gh |
GH_TOKEN / GITHUB_TOKEN |
GitHub Enterprise: pass --host your.ghe.example.
Future Enhancements
- Support extracting and reviewing comments for multiple projects in one run, with dashboard support across those projects.
- Update an existing extract in place when the export is already present, instead of always writing a full new archive.
Tests
python3 -m unittest discover -s tests -v
Publish to PyPI and npm
The project name is pr-comments on both PyPI and npm. Maintainers:
- Create the projects and add Trusted Publishers for this GitHub repository:
- PyPI: workflow
publish.yml, environmentpypi - npm: workflow
publish.yml, environmentnpm
- PyPI: workflow
- Merge the release onto the
releasebranch, tag itv*, and push both:
git checkout release
git merge --ff-only main # or your release commit
git tag v1.0.0
git push origin release
git push origin v1.0.0
The Publish workflow runs only for v* tags whose commit is on release. It builds and uploads the Python sdist/wheel and the npm package with OIDC (no tokens in the repo). Pushes to release without a v* tag, or v* tags on other branches, do not publish.
Locally:
uv build
uv publish
npm publish --access public
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 pr_comments-1.0.0.tar.gz.
File metadata
- Download URL: pr_comments-1.0.0.tar.gz
- Upload date:
- Size: 29.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1be3c33151034a3921820d99f3539b4c455d81905b23790ecd616fdf5753814b
|
|
| MD5 |
b0c0698810e1c035107be9d65451c180
|
|
| BLAKE2b-256 |
2713e9033ed0cf0466360c829a22b66eda2d614298986838281af2a3fa4efc68
|
Provenance
The following attestation bundles were made for pr_comments-1.0.0.tar.gz:
Publisher:
publish.yml on framedparadox/pr-comments
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pr_comments-1.0.0.tar.gz -
Subject digest:
1be3c33151034a3921820d99f3539b4c455d81905b23790ecd616fdf5753814b - Sigstore transparency entry: 2557452170
- Sigstore integration time:
-
Permalink:
framedparadox/pr-comments@33ae7312ed9676c9d98f2d331b190a025c8c2932 -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/framedparadox
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@33ae7312ed9676c9d98f2d331b190a025c8c2932 -
Trigger Event:
push
-
Statement type:
File details
Details for the file pr_comments-1.0.0-py3-none-any.whl.
File metadata
- Download URL: pr_comments-1.0.0-py3-none-any.whl
- Upload date:
- Size: 32.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b1b760fd8ad6b585c6a097a81ee3fb1a6f4406bc6996aec3caa529b93fbd4e67
|
|
| MD5 |
077c996eec6fde5fedf0df640878b684
|
|
| BLAKE2b-256 |
74c009a61d6c7b5e66604b9c285a1bcd66e2ab49afadef853872f4ab3616424b
|
Provenance
The following attestation bundles were made for pr_comments-1.0.0-py3-none-any.whl:
Publisher:
publish.yml on framedparadox/pr-comments
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pr_comments-1.0.0-py3-none-any.whl -
Subject digest:
b1b760fd8ad6b585c6a097a81ee3fb1a6f4406bc6996aec3caa529b93fbd4e67 - Sigstore transparency entry: 2557452298
- Sigstore integration time:
-
Permalink:
framedparadox/pr-comments@33ae7312ed9676c9d98f2d331b190a025c8c2932 -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/framedparadox
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@33ae7312ed9676c9d98f2d331b190a025c8c2932 -
Trigger Event:
push
-
Statement type: