Skip to content
/

prpack

prpack · Lucas2944/prpack · ★ 2 · last commit 2026-05-12

Primitive shape
No installable primitives
00

Summary

prpack — Summary

prpack is a zero-dependency Node.js CLI that packs a pull request into a single markdown file optimized for LLM code review — containing the commit list, the per-file diff, and the full post-change content of every touched file. The author's core insight (documented in THE_TECHNIQUE.md) is that LLM code review fails not because of model quality but because the diff alone lacks the surrounding context the model needs to spot bugs in unchanged lines. prpack solves the context problem by appending the full post-change file contents alongside each diff section, ensuring the model sees "what the file looks like after the change" rather than only what changed. A --review flag directly calls the Anthropic Messages API and streams a focused review (security, performance, tests, architecture, or general) to the terminal. An optional GitHub Action wrapper (prpack-action) enables automatic packed context on every PR. Compared to seeds, prpack has the narrowest scope of all ten batch frameworks — it is a pure context-packaging utility with no behavioral framework, no agent orchestration, and no persistent state, most similar to codesight in intent (reduce token waste for a specific AI task) but different in domain (PR review vs. codebase exploration).

01

Overview

prpack — Overview

Origin

Created by Lucas2944. The technique behind prpack is documented in THE_TECHNIQUE.md — a story of a null-deref bug that Claude Code missed because it only saw the diff, not the surrounding function context. The README states: "This is not a Claude problem. This is a context problem."

Philosophy

From THE_TECHNIQUE.md:

"When you paste a diff into a model, you are asking it to reason about a change in isolation. Diffs are designed for humans who already have the file open in an editor. The human reviewer mentally fills in the surrounding code, the call sites, the types, the invariants. The model does none of this."

"packs exactly the diff plus the full state of every file the diff touches. That's enough context to reason about the change without drowning the model in noise."

"The hit rate on substantive feedback goes from roughly one in five to roughly four in five."

Scope

prpack is intentionally narrow: "It's a single CLI binary." The README explicitly documents what it does NOT do:

  • No network calls in pack mode
  • No hidden AI
  • No web UI
  • No telemetry

Ecosystem

  • prpack-prompts — four focused review prompts (security / performance / tests / architecture) as plain markdown files, usable independently
  • prpack-action — GitHub Action wrapper (5-line workflow YAML)
  • prpack Pro Pack — curated .prpack.yml configs for specific review styles (optional, free/PWYW on itch.io)
  • prpack-demo — browser-side demo at lucas2944.github.io/prpack-demo

Key Design Decisions

  1. Zero dependencies — requires only Node 18+ and git on PATH
  2. Full file content beats targeted extraction — include the whole post-change file, not just adjacent lines
  3. Configurable via YAML.prpack.yml adds preface notes and custom review prompts without changing the CLI
  4. Review angles are first-class — security, performance, tests, architecture are supported as discrete modes, not freeform prompts
02

Architecture

prpack — Architecture

Distribution

  • Type: npm package (global or npx)
  • Binary: prpack (mapped from bin/prpack.js)
  • Version analyzed: 0.2.0
  • Runtime required: Node.js 18+, git on PATH
  • Dependencies: Zero runtime dependencies
  • Language: JavaScript

Install Methods

# One-shot, no install
npx github:Lucas2944/prpack --out ctx.md

# Global install
npm install -g github:Lucas2944/prpack
prpack --out ctx.md

Directory Tree

prpack/
├── bin/
│   └── prpack.js          # CLI entry point (shebang)
├── src/
│   ├── config.js          # Config loading (.prpack.yml)
│   ├── git.js             # Git operations (diff, log, file content)
│   ├── pack.js            # Core packing logic
│   ├── prompts.js         # Review prompt templates
│   └── review.js          # Anthropic API integration
├── schema/
│   └── prpack.schema.json # JSON Schema for .prpack.yml
├── examples/              # Side-by-side comparison examples
├── test/
├── THE_TECHNIQUE.md       # Extended philosophy document
├── CHANGELOG.md
└── package.json

Config File

.prpack.yml (project-level, optional):

base: develop
includeTests: true
exclude:
  - dist/**
  - "*.lock"
preface: |
  This PR introduces a new payment flow. Focus on input validation.
reviewPrompt: |
  You are a senior engineer reviewing this PR. Flag bugs...

GitHub Action

# .github/workflows/prpack.yml (5-line integration)
- uses: Lucas2944/prpack-action@v1
  with:
    anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
    review_angle: general

Target AI Tools

  • Claude (primary — has native --review integration)
  • Cursor
  • Any LLM accepting markdown context (paste ctx.md)
03

Components

prpack — Components

CLI Options

Option Purpose
--base <ref> Base ref to diff against (default: origin/main, fallback: main)
--head <ref> Head ref (default: HEAD)
--out <path> Output file path (default: stdout)
--config <path> Load preset from .prpack.yml
--include-tests Include test file siblings even if not changed
--include-untracked Include untracked files in diff
--no-content Only include diff, not full file contents
--max-bytes <n> Skip files larger than n bytes (default: 200000)
--exclude <glob> Exclude paths matching glob (repeatable)
--review [angle] Call Anthropic API for streamed review
--api-key <key> Anthropic API key (overrides ANTHROPIC_API_KEY)
--model <id> Anthropic model for --review
--yes Skip cost-estimate confirmation in TTY review mode
--quiet Suppress stderr progress logs

Review Angles

Angle Focus
security Auth, injection, credential leakage
performance Complexity, memory allocation, N+1 queries
tests Coverage gaps, missing edge cases
architecture Design patterns, coupling, interfaces
general (default) Balanced pass across all four

Source Modules

Module Purpose
src/git.js Execute git diff/log/show, resolve file contents
src/pack.js Core packaging: diff + full file content per changed file
src/config.js Load and merge .prpack.yml config
src/prompts.js Review prompt templates per angle
src/review.js Anthropic Messages API call + streaming output

Output Shape

# Pull Request Context
**Repo:** `org/repo`
**Branch:** `feature/...`
**Base:** `main` → **Head:** `HEAD`
**Commits:** 3
**Files changed:** 7

## Commits
- `abc1234` 2026-05-10 — Add Stripe webhook handler

## Files changed
- `src/payments/webhook.ts` _(added)_

---
## `src/payments/webhook.ts` _(added)_

### Diff
```diff
...

Full content (post-change)

...

## No Hooks, No Skills, No MCP

prpack ships zero hooks, skills, subagents, or MCP servers. It is a pure CLI tool.
05

Prompts

prpack — Prompts

Context Engineering Technique

prpack's prompting philosophy is documented in THE_TECHNIQUE.md: the key insight is that diff-only context fails because models cannot see unchanged lines. prpack's "prompt" is structural: pack [diff] + [full post-change file content] for every touched file.

Excerpt 1 — Review Prompt (General Angle)

From src/prompts.js (inferred from README/THE_TECHNIQUE examples):

Review this PR. The diff and full file contents are below. Flag bugs, missing
edge cases, and anything that would make a reviewer pause.

Technique: Minimal directive. The heavy lifting is in the context structure, not the instruction. The prompt assumes the model will find issues if given the right input.

Excerpt 2 — Security Review Angle

You are a security engineer reviewing this PR. The diff and full file contents are below.

Focus specifically on:
- Authentication and authorization gaps
- Input validation and injection vulnerabilities
- Sensitive data exposure (credentials, PII in logs)
- Dependency vulnerabilities introduced
- Error handling that might leak internal state

Be specific. Cite file and line number. If unsure, say so.

Technique: Role + focus + output format directive. Assigns a persona and narrows scope to prevent generic "looks good" responses.

Excerpt 3 — .prpack.yml Custom Prompt Pattern

preface: |
  This PR introduces a new payment flow. Focus on input validation and
  error paths around the Stripe webhook handler.
reviewPrompt: |
  You are a senior engineer reviewing this PR. Flag bugs, missing edge
  cases, and security issues. Quote line numbers when you do.

Technique: Author intent injection. The preface field adds reviewer notes near the top of the packed context (before the diff), giving the model the author's perspective on what to scrutinize. This mimics the "PR description as review guide" pattern used in human code review.

Excerpt 4 — THE_TECHNIQUE.md Sample Review Output

From the README, an example of the review quality prpack enables:

"In formatInvoice (src/invoice.ts:48), after the refactor to sumLineItems, the function unconditionally accesses invoice.customer.email. Previously the .reduce on lineItems returned early on the empty-array path, which masked cases where invoice.customer is null (seen at the call site in src/jobs/billing.ts:112). Recommend guarding invoice.customer explicitly."

This represents the target output: specific, file-and-line-anchored, reasoning about unchanged context.

09

Uniqueness

prpack — Uniqueness

differs_from_seeds

prpack has no direct analog among the 11 seeds — none of them address PR-level context packaging for LLM review. The closest parallel is codesight (in this batch), which solves the analogous "session-start context" problem by pre-compiling codebase structure. prpack solves the "PR review context" problem by packaging git diff + full file contents. Both are pre-session static packagers with zero behavioral framework components. Among seeds, agent-os is the most philosophically similar (produce files that agents read) but agent-os focuses on long-lived project conventions while prpack is ephemeral (one file per PR). Unlike spec-kit, claude-conductor, or superpowers, prpack has no skills, hooks, commands, or agent workflow instructions whatsoever — it is purely a context formatter.

Positioning

  • Primary differentiator: The only framework in the batch that targets PR review specifically, and the only one with a formal manifesto (THE_TECHNIQUE.md) explaining the context engineering insight behind the tool.
  • Secondary differentiator: Zero dependencies is unusual for a Node.js CLI — no bundled LLM SDK at install time; the Anthropic SDK is called only if --review is used, and only the ANTHROPIC_API_KEY env var is needed.
  • Target user: Developers who do code review with Claude/LLMs and are frustrated by missed bugs in unchanged context.

Observable Failure Modes

  1. Large PRs hit token limits: Very large PRs (many files, large files) will produce ctx.md that exceeds model context windows. --no-content and --max-bytes mitigate this but degrade review quality.
  2. Generated files bloat output: Without careful --exclude configuration, build artifacts and lock files inflate ctx.md significantly.
  3. Review mode is Anthropic-only: --review requires ANTHROPIC_API_KEY — no provider abstraction, no local model support.
  4. No semantic understanding: prpack is entirely syntactic — it does not understand code semantics, so file selection is purely "files touched by the diff" rather than "files relevant to understanding the change."
  5. Stars indicate early-stage adoption: 2 stars (as of analysis date) suggests very early community adoption despite a well-articulated problem statement.
04

Workflow

prpack — Workflow

Execution Pattern

prpack is a one-shot CLI invoked per PR review. No continuous loop, no agent lifecycle.

Primary Workflow: Pack + Paste

# Step 1: Pack PR context
prpack --out ctx.md

# Step 2: Paste ctx.md into Claude/Cursor/any LLM
# Step 3: Ask for review

Artifact produced: ctx.md (single markdown file, ~6K–24K tokens depending on PR size)

Variant: Native API Review

prpack --review security --api-key "$ANTHROPIC_API_KEY"
  • Packs PR context
  • Appends focused review prompt
  • Calls Anthropic Messages API
  • Streams response to terminal
  • Writes ctx.md + ctx.md.review.md if --out ctx.md is also passed

Phase-to-Artifact Map

Phase Artifact
Pack PR ctx.md (diff + full file contents)
Native review (optional) ctx.md.review.md (streamed review response)

Approval Gates

One optional gate: cost estimate confirmation before API call.

Estimated cost: ~0.003 tokens. Proceed? [y/N]

Bypassed with --yes.

Common Recipes

# Default: pack vs origin/main
prpack --out ctx.md

# Diff against different base
prpack --base develop --out ctx.md

# Pack last 3 commits
prpack --base HEAD~3 --head HEAD --out ctx.md

# Diff-only (no full contents, smaller output)
prpack --no-content --out ctx.md

# Include adjacent test files
prpack --include-tests --out ctx.md

# Exclude lock files
prpack --exclude 'pnpm-lock.yaml' --exclude 'dist/**' --out ctx.md

# Pipe to clipboard (macOS)
prpack | pbcopy

# Use preset config
prpack --config security.prpack.yml --out audit.md

CI/CD Integration

Via prpack-action (GitHub Action):

- uses: Lucas2944/prpack-action@v1
  with:
    anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}

Auto-runs on every PR, posts packed markdown + review as PR comment.

06

Memory Context

prpack — Memory & Context

State Storage

prpack maintains no persistent state. Each invocation is independent.

Produced Artifacts

File Persistence Notes
ctx.md (or --out path) Until user deletes Packed PR context
ctx.md.review.md Until user deletes API review response (only with --review --out)

Context Compaction

Not applicable — prpack is not an agent and does not maintain a session context.

Cross-Session Handoff

Not applicable — prpack is invoked per PR, produces a file, and exits.

Git Integration

prpack reads git history via subprocess calls (git diff, git log, git show) but writes no git artifacts. It is read-only with respect to the repository.

Config File Persistence

.prpack.yml is a project-level config file that persists between invocations, allowing teams to standardize base branch, excluded files, and review prompts without CLI arguments.

07

Orchestration

prpack — Orchestration

Multi-Agent Pattern

None. prpack is a single-process CLI tool.

Orchestration Pattern

none — prpack packs context for a human to paste into an AI, or calls the Anthropic API directly. No agent coordination.

Execution Mode

one-shot — invoked per PR review, exits after writing output.

Isolation Mechanism

none — reads git, writes a file, no sandboxing.

Multi-Model Usage

No — one optional API call to Anthropic's Messages API using the user's configured model. Not a multi-model routing system.

Subagent Definition Format

None.

Consensus Mechanism

None.

Prompt Chaining

Minimal — when --review is used, the packed context (output of the pack step) is concatenated with the review prompt and sent as input to the API call. This is a two-step pipeline but not a multi-stage chaining system.

Cross-Tool Portability

High — the packed ctx.md is standard markdown, pasteable into any AI tool. The --review flag is Anthropic-specific (uses ANTHROPIC_API_KEY), but the pack step is model-agnostic.

08

Ui Cli Surface

prpack — UI & CLI Surface

CLI Binary

  • Binary name: prpack
  • Is thin wrapper: No — pure Node.js runtime (no LLM proxy)
  • Install: npm install -g github:Lucas2944/prpack or npx github:Lucas2944/prpack
prpack [options]

  --base <ref>          Base ref (default: origin/main)
  --head <ref>          Head ref (default: HEAD)
  --out <path>          Output file (default: stdout)
  --config <path>       .prpack.yml preset
  --include-tests       Include sibling test files
  --include-untracked   Include untracked files
  --no-content          Diff only (no full contents)
  --max-bytes <n>       File size limit (default: 200000)
  --exclude <glob>      Exclude glob (repeatable)
  --review [angle]      Call Anthropic API (security|performance|tests|architecture|general)
  --api-key <key>       Anthropic API key
  --model <id>          Model for --review
  --yes                 Skip cost confirm
  --quiet               Suppress progress logs

Local UI

  • Exists: No
  • Web demo: lucas2944.github.io/prpack-demo (browser-only, client-side, no install)

MCP Server

None.

IDE Integration

None native. Works with any IDE that allows pasting file content into an AI panel.

Observability

  • Stderr progress log (prpack: base=origin/main head=HEAD merge-base=4f8a91c)
  • Token count estimate in stderr output (wrote ctx.md (24.6 KB, ~6,150 tokens))
  • Cost estimate before API call in review mode

GitHub Action

prpack-action — a separate repository providing a 5-line GitHub Actions workflow:

- uses: Lucas2944/prpack-action@v1
  with:
    anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
    review_angle: general

Runs prpack on every PR and posts results.

Related frameworks

same archetype · same primary tool · same memory type

claude-mem (thedotmack) ★ 78k

Background worker service captures every tool call as an observation, AI-compresses sessions, and auto-injects relevant past…

pi (badlogic/earendil) ★ 55k

A minimal, hackable, multi-provider terminal coding agent that adapts to your workflows via npm-installable TypeScript Extensions…

Agent Skills (Addy Osmani) ★ 46k

Encodes senior-engineer software development lifecycle as 23 auto-routed skills and 7 slash commands for any AI coding agent.

wshobson/agents Plugin Marketplace ★ 36k

Single Markdown source for 83 domain-specialized plugins that auto-generates idiomatic artifacts for five AI coding harnesses.

TabbyML/Tabby ★ 34k

Self-hosted AI coding assistant server (alternative to GitHub Copilot) with admin dashboard, RAG-based completions, and multi-IDE…

Compound Engineering ★ 17k

Make each unit of engineering work compound into easier future work via brainstorm→plan→execute→review→learn cycles.