From cirra-ai-skills
Kugamon CPQ quote and subscription management for Salesforce via Cirra AI MCP Server. Use when creating, verifying, or managing opportunities, quotes, orders, contracts, assets, subscriptions, or renewals with the Kugamon package (kugo2p). Usage: /sf-kugamon [quote|order|contract|renewal|subscription] {details} ...
npx claudepluginhub cirra-ai/skillsThis skill uses the workspace's default tool permissions.
Expert Kugamon CPQ and Subscription Management specialist. Create, verify, and manage Salesforce opportunities, quotes, orders, and the full Order Release lifecycle using the Kugamon package (kugo2p) via the Cirra AI MCP Server. Automatically adapts workflows based on whether the kuga_sub (Kugamon Subscriptions) package is installed.
LICENSEREADME.mdagents/openai.yamlassets/icon-large.pngassets/icon-small.pngreferences/amount-fields-guide.mdreferences/execution-modes.mdreferences/field-reference.mdreferences/mcp-pagination.mdreferences/record-types.mdreferences/renew-field-guide.mdreferences/subscription-management.mdtests/dispatch-tests.mdGuides Next.js Cache Components and Partial Prerendering (PPR) with cacheComponents enabled. Implements 'use cache', cacheLife(), cacheTag(), revalidateTag(), static/dynamic optimization, and cache debugging.
Guides building MCP servers enabling LLMs to interact with external services via tools. Covers best practices, TypeScript/Node (MCP SDK), Python (FastMCP).
Generates original PNG/PDF visual art via design philosophy manifestos for posters, graphics, and static designs on user request.
Expert Kugamon CPQ and Subscription Management specialist. Create, verify, and manage Salesforce opportunities, quotes, orders, and the full Order Release lifecycle using the Kugamon package (kugo2p) via the Cirra AI MCP Server. Automatically adapts workflows based on whether the kuga_sub (Kugamon Subscriptions) package is installed.
This skill supports four execution modes — see
references/execution-modes.md for detection logic and full details,
and references/mcp-pagination.md for handling large MCP responses.
All Kugamon operations go through MCP tools regardless of mode.
Parse $ARGUMENTS to determine the operation:
| First argument or intent | Workflow |
|---|---|
quote, create/manage quote | Quote Management |
order, order release, activate | Order Management |
contract, contract creation | Contract Management |
renewal, renewal opp | Renewal Management |
subscription, asset, subscription lifecycle | Subscription Management |
| (no argument or unclear) | Ask the user (see below) |
When the operation is missing or unclear, you MUST use AskUserQuestion before proceeding:
AskUserQuestion(question="What would you like to do with Kugamon?\n\n1. **Quote** — create or manage a Kugamon quote\n2. **Order** — activate a quote and release an order\n3. **Contract** — create or manage contracts\n4. **Renewal** — manage renewal opportunities\n5. **Subscription** — manage assets and subscriptions")
Do NOT guess the operation or default to one. Wait for the user's answer.
FIRST: Call cirra_ai_init() with no parameters:
cirra_ai_init()
"I've connected to [org]. Would you like me to use the defaults, or do you want to select different options?"
Do not ask for org details before calling cirra_ai_init().
THEN: Detect the kuga_sub package by checking if kuga_sub__Renew__c exists on OpportunityLineItem:
sobject_describe(sObject="OpportunityLineItem")
Set a session flag:
HAS_KUGA_SUB = true if the field existsHAS_KUGA_SUB = false if it does notThis flag determines which workflow to follow throughout the entire process.
THEN: If HAS_KUGA_SUB = true, detect Subscription Management:
SELECT Id, kuga_sub__InitiateOrderSubscriptionManagement__c
FROM kuga_sub__KugamonSettings__c
LIMIT 1
Set a second session flag:
HAS_SUB_MGMT = true if kuga_sub__InitiateOrderSubscriptionManagement__c is NOT nullHAS_SUB_MGMT = false if the field is null, the setting doesn't exist, or the query fails (a query failure means the object/field is not present in the org)This flag determines whether the Order Release lifecycle (Contracts, Assets, Subscriptions, Renewal Opportunities) is active.
Required Fields:
Name — Opportunity name (e.g., "Starbucks - GenWatt Installation")StageName — Use "Qualification" by default when creating with a quote, or another appropriate stageCloseDate — Expected close dateAccountId — Required for Kugamon (links to account)Pricebook2Id — Required if you plan to add products (use standard pricebook or custom)Recommended Optional Fields:
Amount — Total opportunity value (will be overridden by line item totals if products are added). Note: If HAS_KUGA_SUB = true, ignore the standard Amount field — it is a raw Qty × Price sum that does not factor Service Term and may include non-subscription products. Use kuga_sub__OpportunityAmount__c to read the true Opportunity Amount instead.Type — Opportunity type (e.g., "New Business", "Existing Business")RecordTypeId — Set to match quote type if known (New, Renewal, or Expansion)Check your HAS_KUGA_SUB flag before proceeding.
CRITICAL: Always set the kuga_sub__Renew__c field:
Required Fields:
OpportunityId — The opportunity to attach toPricebookEntryId — Links to the product (required, not Product2Id directly)Quantity — Quantity to purchase (required, minimum 1)kuga_sub__Renew__c — CRITICAL for revenue classification (see references/renew-field-guide.md)Important Optional Fields:
UnitPrice — Override the pricebook price if neededServiceDate — Start date for the service/productkuga_sub__ServiceTerm__c — Term length (e.g., 12, 24, 36)kuga_sub__UnitofTerm__c — Term unit ("Month" or "Year")Setting the Renew Field:
kuga_sub__Renew__c = truekuga_sub__Renew__c = false (or omit, defaults to false)Why this matters: The Renew field controls how Kugamon calculates revenue:
Renew = false: Product treated as non-recurring, amount goes to kuga_sub__NonRecurringRevenue__cRenew = true: Product treated as recurring, amount goes to MRR/ARR fieldsRequired Fields:
OpportunityId — The opportunity to attach toPricebookEntryId — Links to the product (required, not Product2Id directly)Quantity — Quantity to purchase (required, minimum 1)Important Optional Fields:
UnitPrice — Override the pricebook price if neededServiceDate — Start date for the service/productNote: Without the kuga_sub package, Kugamon relies on kugo2p__AdditionalProductDetail__c.kugo2p__Service__c to determine whether line items become Quote Product Lines or Quote Service Lines.
When a user requests quote creation, gather complete context. Use soql_query for all data retrieval queries in this phase.
CRITICAL PRE-CREATION CHECKS:
Billing Address Validation:
SELECT Id, Name, BillingStreet, BillingCity, BillingState, BillingPostalCode, BillingCountry
FROM Account
WHERE Id = '<account_id>'
Contact Validation:
SELECT Id, Name, Email, Phone
FROM Contact
WHERE AccountId = '<account_id>'
AND Email != null
LIMIT 10
Query the full opportunity:
SELECT Id, Name, AccountId, Amount, kuga_sub__OpportunityAmount__c, StageName, CloseDate, Pricebook2Id, RecordType.Name,
kuga_sub__MonthlyRecurringRevenue__c, kuga_sub__AnnualContractValueInitial__c,
kuga_sub__TotalContractValue__c, kuga_sub__AnnualRecurringRevenueCommitted__c,
kuga_sub__NonRecurringRevenue__c
FROM Opportunity
WHERE Id = '<opportunity_id>'
If line items exist, verify Renew field is set correctly:
SELECT Id, Product2.Name, Quantity, UnitPrice, TotalPrice,
kuga_sub__Renew__c, kuga_sub__MRR__c, kuga_sub__ARR__c, kuga_sub__NonRecurringRevenue__c
FROM OpportunityLineItem
WHERE OpportunityId = '<opportunity_id>'
SELECT Id, Name, AccountId, Amount, StageName, CloseDate, Pricebook2Id, RecordType.Name
FROM Opportunity
WHERE Id = '<opportunity_id>'
Check for existing quotes (same for both):
SELECT Id, Name, kugo2p__QuoteName__c, kugo2p__TotalAmount__c, kugo2p__IsPrimary__c
FROM kugo2p__SalesQuote__c
WHERE kugo2p__Opportunity__c = '<opportunity_id>'
Prerequisites: Billing address complete, contact identified.
Tool: Use sobject_dml with operation: "insert" to create the quote record (kugo2p__SalesQuote__c).
Use only these createable fields:
RecordTypeId — Match to opportunity type (see references/record-types.md)kugo2p__Account__c — Account lookupkugo2p__Opportunity__c — Opportunity lookupkugo2p__QuoteName__c — Quote name (user-specified or generated)kugo2p__Pricebook2Id__c — Pricebook lookup from opportunitykugo2p__ContactBuying__c — REQUIRED Buying contact lookupkugo2p__ContactBilling__c — Optional billing contact lookupkugo2p__ContactShipping__c — Optional shipping contact lookupkugo2p__IsPrimary__c — Set to true if no other primary quote existskugo2p__DateOfferValidThrough__c — Expiration date (30 days from today if not specified)Never set these auto-managed fields:
Name (auto-generated quote number)kugo2p__Status__c (workflow-managed)kugo2p__TotalAmount__c (calculated)kugo2p__SubtotalAmount__c (calculated)CRITICAL: Query the newly created quote immediately:
SELECT Id, Name, kugo2p__QuoteName__c, kugo2p__TotalAmount__c, kugo2p__SubtotalAmount__c,
kugo2p__Status__c, kugo2p__IsPrimary__c, kugo2p__DateOfferValidThrough__c
FROM kugo2p__SalesQuote__c
WHERE Id = '<quote_id>'
Check for auto-populated line items in BOTH sections:
Quote Service Lines (recurring services with kuga_sub__Renew__c = true):
SELECT Id, kugo2p__Line__c, kugo2p__ServiceName__c, kugo2p__Quantity__c,
kugo2p__SalesPrice__c, kugo2p__TotalAmount__c
FROM kugo2p__SalesQuoteServiceLine__c
WHERE kugo2p__SalesQuote__c = '<quote_id>'
ORDER BY kugo2p__Line__c
Quote Product Lines (one-time products with kuga_sub__Renew__c = false):
SELECT Id, kugo2p__Line__c, kugo2p__Product__r.Name, kugo2p__Quantity__c,
kugo2p__SalesPrice__c, kugo2p__TotalAmount__c
FROM kugo2p__SalesQuoteProductLine__c
WHERE kugo2p__SalesQuote__c = '<quote_id>'
ORDER BY kugo2p__Line__c
Quote Service Lines (products with kugo2p__Service__c = true):
SELECT Id, kugo2p__Line__c, kugo2p__ServiceName__c, kugo2p__Quantity__c,
kugo2p__SalesPrice__c, kugo2p__TotalAmount__c
FROM kugo2p__SalesQuoteServiceLine__c
WHERE kugo2p__SalesQuote__c = '<quote_id>'
ORDER BY kugo2p__Line__c
Quote Product Lines (products with kugo2p__Service__c = false):
SELECT Id, kugo2p__Line__c, kugo2p__Product__r.Name, kugo2p__Quantity__c,
kugo2p__SalesPrice__c, kugo2p__TotalAmount__c
FROM kugo2p__SalesQuoteProductLine__c
WHERE kugo2p__SalesQuote__c = '<quote_id>'
ORDER BY kugo2p__Line__c
Amount Field Interpretation:
If subscription fields exist (any kuga_sub__* fields present on opportunity):
Amount field — it is a raw Qty × Price sum that does not factor Service Term and may include non-subscription productskuga_sub__OpportunityAmount__c for the true Opportunity Amountkugo2p__TotalAmount__c (quote) to kuga_sub__AnnualContractValueInitial__c or kuga_sub__TotalContractValue__c (opportunity)If subscription fields do NOT exist:
kugo2p__TotalAmount__c (quote) to Amount (opportunity)Always show all amount fields in summary to provide complete picture.
Present results with:
Name field value)CRITICAL: Whenever updating quotes OR opportunity line items, ALWAYS check for consistency and synchronize both sides unless explicitly told not to.
Compare the following between Quote Lines and Opportunity Line Items:
For Service Lines (recurring):
kugo2p__ServiceName__c vs Product2.Name)kugo2p__Quantity__c vs Quantity)kugo2p__SalesPrice__c vs UnitPrice)kugo2p__DateServiceStart__c vs ServiceDate)kugo2p__DateServiceEnd__c vs calculated from ServiceDate + Term)kugo2p__ServiceTerm__c vs kuga_sub__ServiceTerm__c)For Product Lines (one-time):
kugo2p__Product__r.Name vs Product2.Name)kugo2p__Quantity__c vs Quantity)kugo2p__SalesPrice__c vs UnitPrice)For Service Lines:
kugo2p__ServiceName__c vs Product2.Name)kugo2p__Quantity__c vs Quantity)kugo2p__SalesPrice__c vs UnitPrice)kugo2p__DateServiceStart__c vs ServiceDate)For Product Lines:
kugo2p__Product__r.Name vs Product2.Name)kugo2p__Quantity__c vs Quantity)kugo2p__SalesPrice__c vs UnitPrice)DEFAULT BEHAVIOR: When updating either quotes or opportunities, automatically update BOTH sides to maintain consistency.
When updating Quote Lines:
When updating Opportunity Line Items:
Exception: Only skip synchronization if user explicitly says:
See references/field-reference.md for complete field details.
| Object | API Name | Purpose |
|---|---|---|
| Quote | kugo2p__SalesQuote__c | Main quote record |
| Service Line | kugo2p__SalesQuoteServiceLine__c | Recurring services |
| Product Line | kugo2p__SalesQuoteProductLine__c | One-time products |
Quote total doesn't match opportunity Amount:
Amount field (raw Qty × Price, unreliable). Compare quote to kuga_sub__OpportunityAmount__c or kuga_sub__AnnualContractValueInitial__c instead.Line items not auto-populating:
Verify opportunity has products/line items and pricebook matches. Check BOTH kugo2p__SalesQuoteProductLine__c and kugo2p__SalesQuoteServiceLine__c.
kugo2p__AdditionalProductDetail__c with kugo2p__Service__c properly set.Cannot create quote — missing billing address: Query account billing fields, inform user which fields are missing, update the account, then proceed.
Cannot create quote — no contact exists: Query contacts for the account, request contact information, create the contact, then proceed.
ACV is double-counting recurring products (HAS_KUGA_SUB = true only):
Update line items to set kuga_sub__Renew__c = true for recurring services/subscriptions. See references/renew-field-guide.md.
kuga_sub fields don't exist / "No such column" errors:
Set HAS_KUGA_SUB = false and follow the non-subscription workflow. The Kugamon CPQ package still works without kuga_sub.
Quote and opportunity line items are out of sync: Follow the Consistency Checking workflow above. Always update BOTH sides unless explicitly told not to.
Order Release did not create expected Assets/Subscriptions/Renewal Opportunity:
kuga_sub__KugamonSettings__c for kuga_sub__InitiateOrderSubscriptionManagement__c — must be NOT nullkugo2p__AdditionalProductDetail__c.kugo2p__CreateAsset__c is NOT nullProduct2.kuga_sub__CreateSubscription__c = Truekuga_sub__Renew__c = TrueContract Number and Renewal Opportunity Name populatedContract Number populatedRenewal Order created a new Contract instead of extending (or vice versa):
Check kuga_sub__ExtendContractOnRenewal__c in KugamonSettings. True = extend Contract; False = create replacement Contract.
PREREQUISITE: HAS_SUB_MGMT = true (Kugamon Subscription Management is active)
When a Kugamon Order is Released, the system triggers different behaviors depending on the Order's Record Type. The Record Type on the Order inherits from the parent Opportunity/Quote Record Type. See references/subscription-management.md for full details.
Key configuration fields that control behavior:
| Object | Field | Controls |
|---|---|---|
kuga_sub__KugamonSettings__c | kuga_sub__InitiateOrderSubscriptionManagement__c | Enables Subscription Mgmt (must be NOT null) |
kuga_sub__KugamonSettings__c | kuga_sub__ExtendContractOnRenewal__c | True = extend Contract on renewal; False = replace |
kugo2p__AdditionalProductDetail__c | kugo2p__CreateAsset__c | If NOT null, Asset created on Order Product Line release |
Product2 | kuga_sub__CreateSubscription__c | If True, Subscription created on Order Service Line release |
| Order Service Line | kuga_sub__Renew__c | If True, generates Renewal Opportunity Line Item |
kugo2p__SalesOrder__c | Contract Number | Links to existing Contract (required for Expansion/Renewal) |
kugo2p__SalesOrder__c | Renewal Opportunity Name | Links to existing Renewal Opp (used by Expansion) |
kugo2p__AdditionalProductDetail__c.kugo2p__CreateAsset__c is NOT nullProduct2.kuga_sub__CreateSubscription__c = Truekuga_sub__Renew__c = True, populated with Opportunity Line ItemsPrerequisites: Order must have Contract Number and Renewal Opportunity Name populated.
Contract Number is amended (NOT a new Contract)Prerequisites: Order must have Contract Number populated.
If ExtendContractOnRenewal = True:
If ExtendContractOnRenewal = False:
| Action | New | Expansion | Renewal (Extend) | Renewal (Replace) |
|---|---|---|---|---|
| Create Contract | Yes (new) | No (amend) | No (extend) | Yes (replacement) |
| Create Assets | Conditional* | Conditional* (to Contract) | Conditional* | Conditional* |
| Create Subscriptions | Conditional** | Conditional** (to Contract) | Conditional** | Conditional** |
| Create Renewal Opp | Conditional*** (new) | No (add lines) | Conditional*** (replacement) | Conditional*** (new) |
kugo2p__AdditionalProductDetail__c.kugo2p__CreateAsset__c is NOT nullProduct2.kuga_sub__CreateSubscription__c = Truekuga_sub__Renew__c = True