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/HEADmain). 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

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pr_comments-1.0.0.tar.gz (29.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pr_comments-1.0.0-py3-none-any.whl (32.4 kB view details)

Uploaded Python 3

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

Hashes for pr_comments-1.0.0.tar.gz
Algorithm Hash digest
SHA256 1be3c33151034a3921820d99f3539b4c455d81905b23790ecd616fdf5753814b
MD5 b0c0698810e1c035107be9d65451c180
BLAKE2b-256 2713e9033ed0cf0466360c829a22b66eda2d614298986838281af2a3fa4efc68

See more details on using hashes here.

Provenance

The following attestation bundles were made for pr_comments-1.0.0.tar.gz:

Publisher: publish.yml on framedparadox/pr-comments

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for pr_comments-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b1b760fd8ad6b585c6a097a81ee3fb1a6f4406bc6996aec3caa529b93fbd4e67
MD5 077c996eec6fde5fedf0df640878b684
BLAKE2b-256 74c009a61d6c7b5e66604b9c285a1bcd66e2ab49afadef853872f4ab3616424b

See more details on using hashes here.

Provenance

The following attestation bundles were made for pr_comments-1.0.0-py3-none-any.whl:

Publisher: publish.yml on framedparadox/pr-comments

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 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