Every month a spreadsheet decides what people get paid, and every month somebody disputes it. Here is the model behind a calculator that shows its working, the prompts to build it, and what it takes to run it.
Your private status link is on its way to your inbox.
A commission calculator needs four things: the plan expressed as versioned rules, a clean set of qualifying transactions, a calculation that records its own working line by line, and a statement each rep can read without asking a question. The requirement people underestimate is explainability. A number with no visible derivation generates a dispute for every rep every period, and answering those disputes costs more than the calculation itself. Build the audit trail first and the arithmetic second.
Commission
112%
Your attainment
38,400
Commission this period
2
Lines you have queried
Frozen
Q2, paid 14 July
Marginal tiers: the 9% applies only to attainment above 100%, not to everything. Whether a plan is marginal or whole-amount is the single most common source of disputes.
You run sales compensation, revenue operations or finance. You already know your plans. What you want is a calculation you can defend line by line, and a month end that does not disappear into reconciling a spreadsheet.
What happens between a deal closing and someone getting paid, and why the working matters more than the total.
Rates, tiers, caps and ramp, with the dates each version applies to. Changing a plan makes a new version and leaves old periods alone.
Which transactions count for this period, on which date, under which rule. Splits are apportioned and validated to 100 percent.
Per deal: the plan version, the tier, the rate, the split, the arithmetic, and the amount. The total is just the last line.
Attainment, every qualifying deal with its commission line, adjustments with reasons, and the period total.
A rep queries a specific line, it routes to the plan administrator, and the resolution is recorded against it.
Later corrections become adjustments in the next period. Nothing silently rewrites a period somebody has already been paid for.
A commission calculator is not a rate multiplied by revenue. It is four parts, and the third is the one that decides how much of your month end it consumes.
Each plan as data: base rate, accelerators and their thresholds, caps, quota period, split rules, ramp treatment, clawback conditions, and the dates the version applies to.
What counts: closed won deals, bookings, recognised revenue or cash collected, depending on the plan. With the qualification date and the rule that decided it recorded on each row.
Not a total. Per transaction: which plan version applied, which tier the attainment fell in, what rate was used, what was multiplied by what, and the resulting amount.
What the rep sees: attainment against quota, every qualifying transaction, the commission on each, adjustments with reasons, and the period total. Readable without a phone call.
These prompts start from a Helix project, which is what handles sign-in, credentials and hosting. Start with Helix
Paste these into Claude Code, Codex or Cursor in order. Each one leaves you with something that runs, so you can stop after any step.
Getting the thing everyone argues about into a shape you can reproduce.
In this Helix project, build me a commission calculator.
Start with plans, and get one detail right that causes more disputes than
anything else. For each tier, I need to say whether the rate applies only
to the portion of attainment inside that band, or to the whole amount once
that band is reached. Both models exist in real plans and confusing them
is the classic commission bug. Make it an explicit choice per tier.
A plan has an effective-from date, a quota period, a base rate, its tiers,
and any cap. Never edit a published plan version. Editing creates a new
version, and old periods keep pointing at the version they were calculated
under.
Then assign reps to plans with a quota, a start date and a ramp. And give
me a preview: type an attainment figure and show me what it would pay and
why.
I sign in through Helix, so do not build a login page. Read the signed-in
user from the runtime. And do not put any key or connection string in the
code: if this needs to reach another system, tell me and I will create the
connection in my workspace. Worth knowing. Marginal versus whole-amount tiering is the single most common source of commission disputes. Making it an explicit field removes the ambiguity permanently.
Qualification, splits and clawbacks, which is where real plans live.
Now decide what actually counts.
Load transactions with their booking, close, recognition and cash dates,
and let the plan say which event and which date qualifies a deal for a
period. Record on every row which rule qualified it and on what date.
Handle splits: a deal apportioned across several reps by percentage, with
the total validated to 100.
And handle clawbacks properly. If a qualified deal is later cancelled or
refunded, create a negative adjustment in the current open period. Do not
go back and edit the closed period. That period was correct given what was
known at the time, and it needs to stay that way or nobody can reconcile a
payment against a statement. The requirement people underestimate, and the one that decides your month end.
Now calculate, and treat the working as the output rather than the total.
For each rep and period, store a line per step. Attainment, with ramp
applied and shown as its own line. Then for each deal: the plan version
used, the tier the attainment fell in, the rate, the split, the
calculation performed, and the resulting amount. Then adjustments,
clawbacks, draws and guarantees, each with a reason and an approver.
The period total is derived from those lines and never entered directly.
Store the derivation as rows rather than computing it on demand. That is
what lets me answer a question about a period six months after the plan
changed, which is exactly when it gets asked. Worth knowing. A number with no visible derivation produces a dispute from every rep, every period. Answering those costs more than the calculation.
Making it trustworthy enough that people stop rebuilding it in a spreadsheet.
Give each rep a statement: attainment against quota, every qualifying deal
with its commission line, adjustments with reasons, and the total.
Downloadable, and readable without an explanation.
Let them query a specific line rather than emailing about the total. The
query routes to the plan administrator and the resolution is recorded
against that line.
Add a review step before payment showing period totals by team, the
largest payouts, and anything that changed since the last run. Then freeze
the period on approval. After that, corrections become adjustments in the
next open period, with a reason, never a silent rewrite.
Finally, an export for payroll, and a record of what was exported and
when. The step that turns a working prototype into something with your data in it.
Now connect it to the systems we actually run, so it works on real data
rather than the rows you seeded.
Anything in angle brackets is a placeholder. Swap it for whatever we use
instead, and have the app name the connection it wants rather than assume
a vendor, so changing my mind later is a config change and not a rewrite.
<Salesforce>. Read closed deals with their amounts, dates and splits,
which is what qualifies a transaction.
<NetSuite>. Check invoices and cash received, if your plan pays on
collection rather than closure.
<Workday>. Read plan assignments and quotas, and export the approved
period for payment.
<Gmail>. Send each rep their statement, so a dispute happens on a line
rather than in a thread.
<Snowflake>. Read closed bookings from the warehouse, where the CRM data
has already been cleaned up.
<Gusto>. Export the approved period to payroll, and record exactly what
was sent and when.
<Okta>. Authenticate reps and read the manager relationship, which is what
lets the app show a statement to its owner and their manager and nobody
else.
Only write where I have said to write. Everything else is read only.
Do not write a key, a token or a connection string anywhere in the code,
and do not ask me to paste one. Tell me which connections you need and I
will create each as an authentication in my Helix workspace. Reference
them by alias. Worth knowing. Every name in angle brackets is a placeholder for whatever you run. Helix holds the credential as a workspace authentication, so the app references an alias and never the secret itself.
The last step of every build: a URL, and the right people on it.
Deploy my app. Worth knowing. Your assistant runs helix deploy underneath and the app comes back as a URL. Compensation is among the most sensitive data you hold, so set Access Control before sharing and scope it so a rep sees only their own statement.
This app decides what people get paid, so what it reads and what it writes both matter more than usual.
Salesforce
Read closed deals with their amounts, dates and splits, which is what qualifies a transaction.
NetSuite
Check invoices and cash received, if your plan pays on collection rather than closure.
Workday
Read plan assignments and quotas, and export the approved period for payment.
Gmail
Send each rep their statement, so a dispute happens on a line rather than in a thread.
Snowflake
Read closed bookings from the warehouse, where the CRM data has already been cleaned up.
Gusto
Export the approved period to payroll, and record exactly what was sent and when.
Okta
Authenticate reps and read the manager relationship, which is what lets the app show a statement to its owner and their manager and nobody else.
Each line says whether the app reads, writes or both. Anything not described as writing should be read only.
Named systems are the ones most teams actually run, not a list of the only ones that work. Swap in whatever you use.
Each connection is an authentication in your Helix workspace, referenced by alias. The app names the connection it wants and never holds the credential, so nothing here ends up in your code and any of it can be rotated or revoked without a redeploy.
The build gets you a working calculator. It decides what people are paid, holds compensation data, and reads from your CRM and finance systems, so how it is run is part of the design.
AI Deployment
One command takes the app from your assistant to a live address, so the people who need it get a link rather than instructions for running it locally.
App Security
Compensation is among the most sensitive data in a company. SSO means people sign in with their existing account, and access is scoped so a rep sees only their own statement.
App Security
Pulling closed deals and pushing payroll exports needs real access to those systems. Granting it to the app rather than pasting keys into it means credentials can be rotated or revoked without a redeploy.
App Registry
Every app carries a named owner and an entry IT can see, so the tool does not become nobody's problem when the person who built it changes role.
Cost Management
Per-app spend visibility, with budgets and caps, so an internal tool cannot quietly become a line item nobody can explain.
It applies versioned compensation plan rules to qualifying transactions and produces a per-rep statement showing how every figure was derived. The calculation matters less than the derivation, because the derivation is what prevents disputes.
A marginal tier applies its rate only to the portion of attainment inside that band. A whole-amount tier applies the rate reached to everything. Both exist in real plans, and confusing them is the most common commission calculation error, so make it an explicit field per tier.
Create a new plan version with an effective-from date rather than editing the existing one, and keep old periods pointing at the version they were calculated under. Recalculating a paid period against a new plan destroys trust in every other number the system produces.
As a negative adjustment in the current open period, with a reason attached, rather than a rewrite of the closed period the original transaction fell in. The closed period was correct given what was known at the time, and it needs to stay that way.
Because once a rep has been paid against a statement, that statement is a record. If later corrections silently change it, nobody can reconcile a payment against a period, and every dispute becomes unresolvable.
Yes. The prompts here are written for Claude Code, Codex or Cursor and stage the build. What no tool decides for you is your qualifying event, your tier model, and how ramp is treated, and those three choices are most of the plan.
Sales and RevOps
Split accounts into territories, load quota against them, and see the coverage and fairness of a plan before you commit to it. Prompts to build it, and what it takes to run it.
Sales and RevOps
Route discount requests by depth and deal size, give approvers the context to decide in minutes, and keep a record of every exception granted. Prompts to build it, and what it takes to run it.
Sales and RevOps
Find the opportunities distorting your forecast, name who owns each fix, and make hygiene a short weekly list rather than a quarterly clean-up. Prompts to build it, and what it takes to run it.
Last reviewed September 2026.
Helix is the governed runtime for AI-built apps. Deploy what you build, put SSO in front of it, connect it to your systems with managed credentials, and give it a named owner.
Your private status link is on its way to your inbox.