Skip to main content

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

  1. Lists every pull request that targets the main / default branch (open, closed, merged).
  2. Fetches conversation comments, inline review comments, replies, and review summaries.
  3. Keeps humans, bots, and later-deactivated accounts (comment_by=ghost).
  4. Writes comments.csv (commit id, PR date, comment date, comment by, comment body, and related fields).
  5. Writes a self-contained dashboard.html for 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:

  1. Create the projects and add Trusted Publishers for this GitHub repository:
    • PyPI: workflow publish.yml, environment pypi
    • npm: workflow publish.yml, environment npm
  2. Merge the release onto the release branch, tag it v*, 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

Metadata

Release files for pr-comments 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pr-comments 1.0.0
File Size Uploaded
pr_comments-1.0.0.tar.gz 29.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pr-comments 1.0.0
File Interpreter ABI Platform
pr_comments-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 61.9 kB

Release files / pr_comments-1.0.0.tar.gz

Download URL pr_comments-1.0.0.tar.gz
Size 29.5 kB
Tags Source
SHA-256 checksum
How to use checksums
1be3c33151034a3921820d99f3539b4c455d81905b23790ecd616fdf5753814b
BLAKE2b-256 checksum
How to use checksums
2713e9033ed0cf0466360c829a22b66eda2d614298986838281af2a3fa4efc68
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 22, 2026.

Transparency log

Release files / pr_comments-1.0.0-py3-none-any.whl

Download URL pr_comments-1.0.0-py3-none-any.whl
Size 32.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b1b760fd8ad6b585c6a097a81ee3fb1a6f4406bc6996aec3caa529b93fbd4e67
BLAKE2b-256 checksum
How to use checksums
74c009a61d6c7b5e66604b9c285a1bcd66e2ab49afadef853872f4ab3616424b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 22, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page