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.0publishedInvalid 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
- For top-ups, start at
src/routes/billing-top-up.ts. It assumes x402 already collected payment and then writescreditPurchases,topUpRequests, andcreditBuckets. - For usage deduction, start at
src/handlers/aggregation.ts. Preserve dependency injection forqueryUsage,now,onNotification, andonAutoTopUp. - Keep budget KV updates through
src/lib/budget-kv.ts; gateway budget checks depend on this cache. - Use threshold helpers in
src/lib/threshold-checker.ts; do not duplicate warning or hard-limit logic in routes. - Preserve UTC weekly/monthly reset behavior and pending top-up expiry handling.
- Add tests that control time explicitly rather than relying on wall-clock Date.
Verification
yarn test __tests__/routes/billing-top-up.test.tsyarn test __tests__/handlers/aggregation.test.ts __tests__/handlers/aggregation-phase4.test.tsyarn test __tests__/lib/budget-kv.test.ts __tests__/lib/threshold-checker.test.tsyarn typecheck
Composition
- Use
flowstate-payment-x402-provisioningwhen 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.
| Skill | Type | Use When | Source Anchors |
|---|---|---|---|
flowstate-payment-x402-provisioning | Workflow | Changing 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-aggregation | Workflow | Changing 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-lifecyclewhen paid provisioning enqueues infrastructure jobs. - Compose with
flowstate-marketplace-developer-and-cronfor 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 ./skillsReplace <target> with your agent target identifier. See the CLI docs for details.