atomic

flowstate-flowstate-platform-epicdm-flowstate-payment

Package-local agent skill for @epicdm/flowstate-payment.

Tags

Publisher

Versions

1 version published — latest: 0.1.0

  • 0.1.0
    publishedInvalid Date

Skill

flowstate-payment Package Skill

Package: @epicdm/flowstate-payment Repository: flowstate-platform Path: packages/worker-payment Version: 0.1.0

Use this published Dojo skill as the package-level entrypoint. For detailed workflows, use the package-local skills listed below.

Primary Package Workflow

Payment Billing Aggregation

Status: Active Purpose: Keep credit accounting and gateway budget state correct. Scope: packages/worker-payment Trigger: Billing top-up, usage aggregation, spending limit, threshold, or budget KV changes. Input: Credit accounting change and expected tenant behavior. Output: Deterministic billing update with tests.


Workflow

  1. For top-ups, start at src/routes/billing-top-up.ts. It assumes x402 already collected payment and then writes creditPurchases, topUpRequests, and creditBuckets.
  2. For usage deduction, start at src/handlers/aggregation.ts. Preserve dependency injection for queryUsage, now, onNotification, and onAutoTopUp.
  3. Keep budget KV updates through src/lib/budget-kv.ts; gateway budget checks depend on this cache.
  4. Use threshold helpers in src/lib/threshold-checker.ts; do not duplicate warning or hard-limit logic in routes.
  5. Preserve UTC weekly/monthly reset behavior and pending top-up expiry handling.
  6. Add tests that control time explicitly rather than relying on wall-clock Date.

Verification

  • yarn test __tests__/routes/billing-top-up.test.ts
  • yarn test __tests__/handlers/aggregation.test.ts __tests__/handlers/aggregation-phase4.test.ts
  • yarn test __tests__/lib/budget-kv.test.ts __tests__/lib/threshold-checker.test.ts
  • yarn typecheck

Composition

  • Use flowstate-payment-x402-provisioning when credits are purchased through paid route middleware.

Package Skill Inventory

worker-payment Skill Inventory

Package: @epicdm/flowstate-payment Purpose: x402 payment gates, provisioning purchase flows, subscriptions, billing credits, usage aggregation, admin payment operations, and MCP payment tools.

SkillTypeUse WhenSource Anchors
flowstate-payment-x402-provisioningWorkflowChanging paid provision, renew, course purchase, compliance, wallet, or MCP provisioning behavior.src/index.ts, src/middleware/x402.ts, src/routes/provision*.ts, src/routes/renew.ts, src/routes/course-purchase.ts, src/mcp/server.ts
flowstate-payment-billing-aggregationWorkflowChanging credit top-up, usage aggregation, spending limits, budget KV, thresholds, or auto top-up.src/routes/billing-*.ts, src/handlers/aggregation.ts, src/lib/budget-kv.ts, src/lib/threshold-checker.ts

Composition

  • Compose with flowstate-provisioning-queue-lifecycle when paid provisioning enqueues infrastructure jobs.
  • Compose with flowstate-marketplace-developer-and-cron for course purchases or marketplace payment records.

Review Gate

worker-payment Skill Review

Reviewed: 2026-06-30 Result: Pass for local agent use.

Checks

  • Skills are source-backed and centered on payment-specific workflows, not route lists.
  • Verification commands match package scripts.
  • Composition notes identify provisioning and marketplace boundaries.

Usage

Start with this skill to understand the package purpose, then use the package-local focused skills for specific workflows. Keep this Dojo version aligned with packages/worker-payment/package.json. Do not treat generated feature lists as lessons; use workflow evidence from CODE-REVIEW.md, SKILL-INVENTORY.md, and REVIEW.md.

Install

Run this in your project to install via CLI:

fscloud dojo skill install flowstate-flowstate-platform-epicdm-flowstate-payment --target <target> --out ./skills

Replace <target> with your agent target identifier. See the CLI docs for details.