usage-consumption

Build, rate, verify, and reset metered Salesforce Revenue Cloud consumption demos.

33|12|Updated Sep 24, 2024
One-click install
npx skills add https://github.com/bgaldino/rlm-base-dev --skill usage-consumption-bgaldino
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: usage-consumption
Source: https://github.com/bgaldino/rlm-base-dev/tree/main/.cursor/skills/usage-consumption
Command: npx skills add https://github.com/bgaldino/rlm-base-dev --skill usage-consumption-bgaldino

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Metered usage failures in Revenue Cloud are silent: a wrong ordering produces a zero rated summary or a plausible-but-wrong price with no error. This Skill encodes the correct build-record-orchestrate-verify pipeline so usage entitlements, commitments, and rating actually settle as configured. ## Core Features & Use Cases - Asset building: Create backdated usage-entitled assets via scripts/build_quote_to_asset.py, including commitment products linked through UsageCmtAssetRelatedObj and Pack products bound to anchors. - Usage recording and orchestration: Record usage into past periods and drive multi-pass rating orchestration with scripts/qb_usage.py, branching on exit codes rather than output text. - Verification and reset: Validate rated arithmetic with offline invariants, CCI live checks, and validateRatedUsage.apex, then tear down usage graphs with convergent delete loops. - Use Case: A rated summary comes back zero with no error — walk the ordering checklist (usage recorded before orchestration, past-period date, anchor not commitment, first-pass period closure) before touching any rates. ## Quick Start Ask the agent to read the usage-consumption SKILL.md and diagnose why the rated usage for a QuantumBit demo account is zero after recording usage and orchestrating.

Frequently Asked Questions about usage-consumption

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
Why is my Salesforce usage rated summary zero with no error?

A zero rated summary is almost always an ordering problem, not a rating problem. Check that usage was recorded before that period was orchestrated, that the usage date falls in a past period, and that journals were uploaded to the anchor asset rather than the commitment.

How do I add a commitment product to a Revenue Cloud usage demo?

Add the product with UsageModelType Commit, give its PURP only a UsageCommitmentPolicyId, load it surgically into a live org, then sell it in three steps: anchor, commitment, and a UsageCmtAssetRelatedObj link. Without the link the commitment is inert.

Can I re-record usage into the same period after clearing usage data?

No. Clearing usage data drains the summaries but the period stays closed, so new journals strand as Pending forever. Re-testing the same period requires a full account reset and an asset rebuild.

How do I verify a consumption build actually rated correctly?

Run the offline invariant suite, then the live CCI validation task, and finally validateRatedUsage.apex after orchestration settles. The Apex check asserts TotalAmount equals OverageQuantity times NetUnitRate rather than relying on eyeballing numbers.

What does a non-zero OverageQuantity mean in usage rating?

On ordinary rows OverageQuantity mirrors TierQuantity and means usage beyond the included allowance, not commitment exhaustion. Do not read it as evidence the commitment was consumed.