Per-Rep Commission Statement Generator
Turn an approved commission run into clean, per-rep PDF statements that show every credited deal, the rate applied, attainment, adjustments, and the total payable — so reps get a transparent breakdown instead of a number with no explanation.
A login-protected internal tool that imports an approved commission run, generates a per-rep statement PDF with deal-level detail, holds the batch for finance approval, then distributes statements by email or secure download — with a summary CSV export and full versioning on corrections.
Before you start
- The approved commission run, exported as per-rep, per-deal lines (Google Sheet or CSV is fine)
- A statement layout and your branding (logo, colors, footer text)
- Free Vercel, Supabase, and Resend accounts
The problem this kills
Every month sales ops and finance get the same email: "How did you get my commission?" Reps see a single payout number with no story behind it — which deals counted, what rate applied, how their attainment was calculated, why there's a clawback. So you rebuild the math by hand in a spreadsheet, copy-paste it into an email, and hope you didn't release a draft number by accident.
This tool ends that. It takes the commission run after it's approved, and produces a clean, branded statement for each rep that lays out every credited deal, the rate, attainment, every adjustment, and the total payable. Reps get the breakdown, not the mystery.
What you'll build
An internal web app — only your team can log in — that:
- Imports an approved commission run (per-rep, per-deal lines) from a Google Sheet or CSV.
- Generates a per-rep statement PDF: deals credited, rate applied, attainment, adjustments/clawbacks, and total payable.
- Holds the whole batch behind a finance approval gate — nothing goes out until a person confirms the numbers tie to the approved run.
- Distributes approved statements by email (via Resend) or secure download link.
- Versions any statement that gets corrected, so reps always see the current one and the history is preserved.
- Exports a summary CSV of all statements in the period, in whatever columns your payroll or finance system expects.
What's inside the Implementation Plan
The plan is a runbook you paste into an AI coding agent (Claude Code), which then builds the tool with you step by step.
It opens by interviewing you about your business — your commission structure, your rate tiers, how attainment is figured, what your deal lines actually look like, how adjustments and clawbacks show up, your period naming, your typical and peak rep counts. It reads back a short tailored spec, you confirm it, and only then does it build. You get a tool shaped around your commission plan, not a generic template you have to fight.
Inside you'll find: the discovery interview, the data model, the import + validation steps, the PDF statement builder, the finance approval workflow, the distribution step, versioning on corrections, and the CSV-export fallback so it's fully buildable today even with no integration to your system of record.
The governance it includes (this is the point)
- Login so only your team can use the tool.
- Row-level security so people only see their own organization's data.
- A complete audit trail — who imported, who approved, who distributed, and when.
- A hard human-in-the-loop approval gate: the tool drafts statements, finance reviews that they tie to the approved run, and only then are they released. Draft numbers can never leak to reps.
- Duplicate guards: a rep gets exactly one current statement per period (deduped on rep + period statement id), and corrections create a new version rather than a silent overwrite.
Who it's for
Sales ops and finance teams who own commissions and field "how did you get my number?" every single month — anyone who wants reps to trust the payout because they can see exactly how it was built.
You've got this — paste the first prompt and let the agent interview you.