autumn-integrate

Installation
SKILL.md

Integrate

Before using this skill, first load the autumn-concepts skill — it defines the objects these calls operate on — customers, plans, balances, entities.

STRICT RULES

  1. Everything is backend. All Autumn calls run in the app's server code with AUTUMN_SECRET_KEY — never in the browser. The frontend gets billing data only through the app's own endpoints.
  2. The old frontend layer is deprecated — never use or suggest it: autumnHandler mounts, React hooks (useCustomer, useEntity, AutumnProvider), shadcn components. If an app already uses them, don't rip them out unasked — but build new work backend-only.
  3. Resolve the customer before anything else. Every handler that checks, tracks, or attaches must serve a brand-new user: customers.getOrCreate with the app's own stable id (user or org id from auth — whoever pays — never an email). Never assume the customer exists.
  4. An error response is a failure. A 4xx/5xx from any Autumn call is never "working" — read the error, fix the call.

Order of operations

Work these in order; each step names what to settle and where the details live. Read the referenced doc before implementing the step — the snippets and parameters are there, not here.

1 — Discover the app. Framework, server entry points, where auth lives, which existing routes handle the actions being billed. Settle the customer id: the app's stable user or org id — whoever pays. If the product bills per workspace/project/seat, those are entities under one customer, not separate customers.

2 — Settle the level. Before writing any flow, ask the user how their plans and features actually work: what does a plan get bought for — the whole account, or each workspace/deployment/seat under it? And where does each feature's balance live — shared across the account, or per unit? The catalog hints (entity-scoped items, license plans) but doesn't decide — a plan can attach per deployment while credit packs stay account-wide. The answers flow through everything: billing.attach takes entityId for entity-level plans, check/track take entityId for entity-scoped balances, billing controls set at the matching level. Mixing levels silently misbills — an account-wide check against a per-seat balance always passes. For entities, entity-scoped balances, when to use which level, read references/feature-entities.md. For plans that attach per entity, read references/entity-plans.md.

Installs
11
GitHub Stars
1
First Seen
11 days ago
autumn-integrate — useautumn/skills