context-service

Inspect, author, deploy, and debug Salesforce Revenue Cloud Context Definitions and runtime instances.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve? Salesforce Revenue Cloud Context Definitions are the canonical data layer that pricing, expression sets, the configurator, DocGen, and billing bind to at runtime, but authoring and debugging them involves a confusing split between Connect API and SObject REST endpoints, silent failure modes, and activation rules that are easy to get wrong. This Skill gives an AI agent the routing rules, gotchas, helper scripts, and reference docs needed to extend, apply, validate, and debug context definitions safely. ## Core Features & Use Cases - Design-time authoring and lifecycle: Extend standard contexts, apply additive attribute/tag/mapping plans, create new definitions, and manage activation, versioning, and upgrade/Sync across releases. - Inspection and drift tooling: Run helper scripts to list, describe, trace, diff, patch, and export context definitions across orgs, with an offline plan validator for preflight checks. - Runtime instance lifecycle: Build hydration payloads, hydrate, query by tag, update attributes, and persist values back to mapped SObjects, with guidance on request-scoped contextIds, pilot gates, and the Apex/Flow path for GA orgs. - Use Case: You need to surface a new custom field to a pricing procedure. The Skill routes you to add an attribute plus tag plus mapping to the extended Sales Transaction context, lint the plan offline, dry-run it against the org, and verify the binding landed. ## Quick Start Ask the agent to inspect the RLM_SalesTransactionContext definition on your Salesforce org and trace how a specific Quote field maps to a context tag.

Frequently Asked Questions about context-service

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

FAQPage Schema
How do I extend a Salesforce Revenue Cloud context definition?

Use the extend_context_* CCI tasks or the generic extend_standard_context task with a name and baseReference to add a custom layer on a standard base. Extended definitions auto-upgrade via Sync and preserve the base's mandatory mappings, unlike cloned definitions.

How do I add a custom field to a pricing context in Revenue Cloud?

Add an attribute plus a tag plus a mapping rule to the existing node, one mapping per lens such as QuoteEntitiesMapping and OrderEntitiesMapping. Lint the plan offline with validate_context_plan.py, then apply it with manage_context_definition using validate_only first.

Why does my context hydration succeed but persist no data?

Hydration silently no-ops when the mapped SObject field does not exist on the org, returning success with nothing persisted. Verify the field with FieldDefinition, and note that missing FLS on the field hides the binding from the Connect GET even when the rows exist.

Can I query a runtime context instance from the Salesforce REST API?

The query-record and query-tags endpoints are pilot-gated and a default contextId is request-scoped, so multi-call REST fails on normal GA orgs. Drive the full lifecycle in one Apex transaction using Context.IndustriesContext or a single Flow instead.

Why does deactivating a context definition fail with RECORD_UPDATE_FAILED?

Deactivation is blocked while an active consumer such as an ExpressionSet, ContextRules, PricingActionParameters, or decision table references the definition. Query ExpressionSetDefinitionContextDefinition to find linked expression sets, unlink or deactivate consumers first, then deactivate.

What are the limits for nodes and attributes in a context definition?

The offline validator enforces at most 30 nodes per definition, 50 attributes per node, 250 total attributes, and hierarchy depth of 5, while Salesforce Help quotes higher ceilings such as 50 nodes and 1000 attributes. Tags per node above 10 is only an informational guideline.