Billing Kit is a Stripe subscription paywall that your coding agent ports into your own codebase. It handles the failures that cost real money, such as lost webhooks, out-of-order events and double checkouts.
What your agent builds
- Checkout and Customer Portal. Hosted by Stripe, with redirect URLs built on the server so they cannot be turned into open redirects.
- A webhook that checks every event with Stripe. The signature is verified over the raw body, and every delivery re-reads the subscription from Stripe, so retries, replays and out-of-order events are harmless.
- Double-charge guards. Checkout refuses an account that already has access, and a stale "no access" row is re-checked with Stripe before the paywall is shown.
- A server-side paywall. A 402 gate on every route that holds paid data, whatever the browser shows.
- An owner grant. You reach your own product without paying, and without a fake Stripe customer.
- Provisioning. An idempotent script that creates the product, price, portal configuration and webhook in test or live mode, without printing secrets.
What's in the box
SKILL.mdandPORTING.md: 14 invariants and the step-by-step port.reference/: the working implementation (Hono API, Drizzle/PostgreSQL, Vue SPA).- Integration tests against a real database, including race tests for concurrent webhooks.
- Playwright flows and a mutation check that proves every guard survived the port.
Install
curl -fsSL https://shop.appforgelabs.com/install.sh | bash
afl login # paste a licence key from your library
afl install port-billing
Billing Kit works on signed-in accounts. If your app has no sign-in yet, Auth Kit adds it.
Questions
Does it handle one-time payments?
No. It is built for subscriptions: Checkout, the Customer Portal and a server-side paywall. One-time purchases are a different flow.
Do I need Auth Kit?
Billing is tied to signed-in accounts. If your app already has sign-in, your agent connects billing to it. If it does not, your agent needs to port Auth Kit first.
Can I try it without real money?
Yes. The provisioning script creates the product, price, portal configuration and webhook in Stripe test mode or live mode, so you can run the whole flow with test cards first.
What do I actually get?
You get a folder that your coding agent reads. It holds SKILL.md (what must survive the port), PORTING.md (the steps) and a working reference implementation, with its tests and a mutation check: a script that breaks each safeguard in turn and confirms that the tests catch it. It is source code and instructions, not a hosted service or a package you depend on.
Which coding agents does it work with?
It is written in the skill format Claude Code loads from ~/.claude/skills, and that is what it is built and tested with. Other agents, such as Codex or Cursor, can use it too: install it with afl install port-billing --dir <path> and point the agent at SKILL.md.
Will it work with my stack?
The reference implementation uses Stripe, Hono, Postgres. SKILL.md separates what must survive (the invariants, each pinned by a test) from what is specific to the reference, and tells your agent how to adapt the rest. The closer your stack, the less your agent has to translate.
How do updates work?
Run afl update. It merges each new release into your installed copy: files you did not touch are replaced, your edits are kept, and where you and the release changed the same lines it marks the conflict for you or your agent to resolve. The changelog marks security fixes, so you know when to carry a release into code you already ported.
Is this a one-time payment?
Yes. You pay once and get every future update of this skill. The All-Access Pass ($99/yr) is the yearly option that covers every skill.
Why does the price go up?
This skill has launch pricing. It costs $39 for the first 25 buyers, $49 up to 100 buyers, $59 after that. The price never goes down, and the price shown when you open checkout is the price you pay.
Can I use it in client work?
Yes. The licence (LICENSE.md, in the download) lets you use and modify the code in any number of your own and your clients’ projects, and code that ends up in a project ships with it. What you cannot do is resell or redistribute the skill itself.
What do I need to install it?
macOS or Linux (on Windows, use WSL) with bash, curl and tar. git is used to merge updates with your edits. You can also download the files from your library without the CLI.
Can I get a refund?
Sales are final, because the files are delivered the moment you pay. If something does not work, for example the install fails, email hello@appforgelabs.com and we will fix it.
Is it in the All-Access Pass?
Yes. Members get this skill and every other one, with all updates, while their pass is active ($99/yr).