Skip to content

feat(kiloclaw): update billing pricing and trial duration#1289

Open
jeanduplessis wants to merge 1 commit intomainfrom
kiloclaw-billing-price-changes
Open

feat(kiloclaw): update billing pricing and trial duration#1289
jeanduplessis wants to merge 1 commit intomainfrom
kiloclaw-billing-price-changes

Conversation

@jeanduplessis
Copy link
Contributor

Summary

Updates KiloClaw billing to reflect new pricing and trial conditions. No users have been charged on the current pricing yet.

  • Trial duration: 30 days → 7 days for new users. Existing trials keep their stored trial_ends_at date since it's computed at creation time.
  • Standard plan: $25/mo → $9/mo, with a $4 first month via a Stripe coupon (discounts: [{ coupon }] at checkout). Promotional codes removed from Standard checkout (Stripe doesn't allow discounts and allow_promotion_codes together).
  • Commit plan: $54/6mo → $48/6mo. No discounts or promo codes.
  • Trial warning thresholds: Adjusted from 5-day to 2-day window. Email idempotency key intentionally kept as claw_trial_5d to avoid re-notifying users who already received the old 5-day warning.
  • Migration script: src/scripts/d2026-03-19_migrate-kiloclaw-prices.ts for 14 existing subscribers — updates Stripe subscriptions with proration_behavior: 'none' so new prices take effect at next billing cycle with no immediate charge.
  • Spec: Updated inline rules and added a changelog section preserving historical pricing values.

New env var required: STRIPE_KILOCLAW_STANDARD_FIRST_MONTH_COUPON_ID. Existing env vars STRIPE_KILOCLAW_STANDARD_PRICE_ID and STRIPE_KILOCLAW_COMMIT_PRICE_ID must be updated to new Stripe price IDs at deploy time.

Verification

  • pnpm typecheck — 0 errors
  • oxlint — 0 warnings, 0 errors
  • oxfmt --list-different — no formatting issues
  • Pre-push hooks passed (format, lint, typecheck)
  • Verification against Stripe dashboard pending (new prices + coupon creation)
  • Migration script dry-run against production data pending

Visual Changes

Area Before After
Plan cards (PlanSelectionDialog, WelcomePage) $25/mo Standard, $9/mo Commit, "64% savings" $9/mo Standard ($4 first month), $8/mo Commit
Subscription card "Commit ($9/mo)" / "Standard ($25/mo)" "Commit ($8/mo)" / "Standard ($9/mo)"
Instance creation card "30-day free trial" "7-day free trial"

Reviewer Notes

  • Deployment dependency: New Stripe prices and coupon must be created in the dashboard before deploying. The STRIPE_KILOCLAW_STANDARD_FIRST_MONTH_COUPON_ID env var will hard-fail checkout if missing (intentional — matches existing pattern for price IDs).
  • Email key preserved: The claw_trial_5d email log key is intentionally not renamed to claw_trial_2d to preserve idempotency for existing trial users who already received the 5-day warning.
  • Migration script safety: Uses proration_behavior: 'none' and dry-run by default. Must be run after env vars are updated. Also handles subscriptions with pending schedule changes (plan switches).
  • as cast in test: The test file uses as Record<string, unknown> on mock call args — this is the existing test pattern for accessing untyped mock arguments.

@kilo-code-bot
Copy link
Contributor

kilo-code-bot bot commented Mar 19, 2026

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (17 files)
  • .env.test
  • .specs/kiloclaw-billing.md
  • src/app/(app)/claw/components/CreateInstanceCard.tsx
  • src/app/(app)/claw/components/billing/PlanSelectionDialog.tsx
  • src/app/(app)/claw/components/billing/SubscriptionCard.tsx
  • src/app/(app)/claw/components/billing/WelcomePage.tsx
  • src/app/(app)/claw/components/billing/billing-types.ts
  • src/lib/config.server.ts
  • src/lib/email.ts
  • src/lib/kiloclaw/billing-lifecycle-cron.ts
  • src/lib/kiloclaw/constants.ts
  • src/lib/kiloclaw/price-migration.test.ts
  • src/lib/kiloclaw/price-migration.ts
  • src/routers/kiloclaw-billing-router.test.ts
  • src/routers/kiloclaw-router.ts
  • src/routers/kiloclaw-user-versions-router.test.ts
  • src/scripts/d2026-03-19_migrate-kiloclaw-prices.ts

Reviewed by gpt-5.4-20260305 · 2,064,363 tokens

- Trial: 30 days → 7 days for new users (existing trials keep stored end date)
- Standard plan: $25/mo → $9/mo with $4 first month via Stripe coupon
- Commit plan: $54/6mo → $48/6mo
- Remove promo codes from Standard plan (replaced by first-month coupon)
- Adjust trial warning thresholds from 5 days to 2 days
- Add migration script for existing subscribers (next billing cycle)
- Update spec with changelog preserving historical values
@jeanduplessis jeanduplessis force-pushed the kiloclaw-billing-price-changes branch from dec2dc2 to b19d63b Compare March 20, 2026 05:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants