/pigment:choosing-formula-patternsfrom Pigment
Planning skill that maps business requirements to formula pattern combinations before writing formulas. Covers aggregation, driver-based forecasting, balance roll-forwards, time offsets, and allocation patterns.
Ships in Pigment. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Load this skill before writing formulas. It maps business requirements to the pattern combinations you need, then points you to the execution skills for implementation.
| Business Requirement | Patterns to Combine | Key Modifiers / Functions | When to use / why |
|---|---|---|---|
| Pull actuals from transaction data | TL aggregation via the list's Month property | BY SUM/AVG over 'TL'.'Month' + ITEM | Standard way to turn transactional rows into dimensional (per Month) values |
| Actual vs Plan in one metric | Version time windows + unified reporting | IF('Is_Actual', ..., ...) with Is_Actual/Is_Plan booleans | Standard setup for any planning and reporting: one metric holds both, switched by version time windows |
| Driver-based forecasting | SWITCH engine + growth assumptions | SWITCH on method ID + Is_Plan guard | Each forecast method lives in its own independent metric, so logic can differ per method (typical for OPEX planning) |
| Single-metric roll-forward (cash, one balance line) | Compounding chain in one metric | PREVIOUS(Month) + IFDEFINED seed | Use when a single metric rolls forward on itself and has an opening value. Not for cross-metric chains (see next row) |
| Multi-metric balance roll-forward (inventory, cash, loan balances) | Cross-metric iterative chain — load skill:iterating-with-previous-and-cycles, create the cycle before writing PREVIOUSOF formulas | Prior-period ending via PREVIOUSOF('Ending …'); ending = beginning + inflows − outflows — not PREVIOUS(Month) or [SELECT: Month - 1] | Use when ending balance depends on other metrics that depend on the prior ending: needs a cycle, which a plain PREVIOUS(Month) cannot provide |
| Prior year baseline | Time offset lookup | [SELECT: Month-12] (not PREVIOUS) | Reading a past period is a lookup, not a recursion, so SELECT is cheaper and clearer than PREVIOUS |
| Grow a prior-year baseline by a rate on top on data by Month | Time-dimensioned assumption + broadcast | [SELECT: Month-12] × (1 + 'Growth %'[BY CONSTANT: Month.Year]) | Use when the growth rate is set per year but applied to monthly data: broadcast the rate to every month |
| Allocate annual total to months | Period allocation | [BY SPLIT: Month.Year] (not BY CONSTANT) | Use for amounts: BY SPLIT divides the annual total across months. BY CONSTANT would repeat it in every month and overcount |
| Replicate a rate/flag to all months | Constant broadcast | [BY CONSTANT: Month.Year] | Use for rates and flags that apply identically to every month, not amounts (see previous row) |
| Override-first staging | Manual override priority | IFBLANK('Override', 'Calculated') | Performant way to let users override a calculated value; blank override falls back to the calculation |
| Gate values to plan periods only | Plan gating | IF('Is_Plan', expr, BLANK) | Restricts the calculation to plan periods, avoiding useless data points on high-volume metrics |
| Date-range presence (active periods) | Temporal presence | PRORATA(Month, Start, End+1) + ISDEFINED | Simplifies active-period logic (start/end dates) into one function instead of nested date comparisons |
| Aggregate by property hierarchy | Dimensional rollup | [BY: Dimension.'ParentProperty'] | Use when the rollup follows a property of the dimension (e.g. Product to its parent Category) |
| Aggregate with mapping metric | Mapped allocation/rollup | [BY Method: SourceDim -> MappingMetric] | Use when the rollup needs a mapping metric between two dimensions (multi-dimensional mapping) |
| Cross-app data consumption | Library references | 'SourceApp'::'Metric' + RESETACCESSRIGHTS on PULL | Inter-app formula syntax. RESETACCESSRIGHTS is not always necessary |
| Fill gaps in time series | Forward fill | FILLFORWARD('Input', Month) as cleaning layer | Makes user inputs simpler (enter a value once, it carries forward); combine with a formula override |
| "In/for a specific period or item" (target keeps that dimension) | Point-in-time lookup, sparse | [FILTER: Dim = 'Dim'."Item"] — not [SELECT: ...][ADD CONSTANT: ...], | Use to restrict to one period or item while keeping the dimension. [SELECT][ADD CONSTANT] would broadcast the value to every item instead |
| Collapse a dimension entirely by a flag (target drops that dimension) | Selective extraction | [SELECT: Account.'IsRevenue'] | Use when a flag decides which items to keep and the target drops that dimension |
| Tiered/banded lookup (tax brackets, commissions) | Segmentation pattern | IF + [REMOVE FIRSTNONBLANK: Tier] | Use for any bracket logic: tax, social charges, ramp-up |
| Access rights metric | Security formula | IFDEFINED('Users roles', ACCESSRIGHTS(...)) with BLANK for denied | Returns BLANK for denied users so the metric works as an access-rights filter |
| Compound a base by several % growth rates | Closed-form compounding instead of a recursive PREVIOUS chain | 'Base' * EXP(CUMULATE(LN(1+'% Growth'), Month)) | Use only if growth is purely multiplicative (no adds, caps or resets), the base is constant and 1+g > 0. Avoids the iterative PREVIOUS chain; otherwise keep PREVIOUS(Month) |
| Combine separate per-item calculations onto one dimension (e.g. WFP/OPEX → P&L by Account) | Additive BY onto target items instead of an IF chain, with a VAR metric holding each item | 'Calc 1'[BY SUM: Account."account1"] + 'Calc 2'[BY SUM: Account."account2"] | Use instead of an IF chain when each calculation belongs to one item of the target dimension (e.g. payroll costs to chart of accounts, OPEX values to OPEX accounts, usually for another app) |
For domain-specific pattern combinations (OPEX, Workforce, Revenue, P&L, FX, Balance Sheet), see skill:solving-financial-planning and skill:solving-workforce-planning. For inventory and supply chain roll-forwards, read skill:solving-supply-chain before writing formulas.
skill:writing-pigment-formulas — syntax referenceskill:using-formula-modifiers — modifier mechanicsskill:using-formula-functions — function signaturesskill:writing-performant-formulas — pre-delivery checklistskill:iterating-with-previous-and-cycles — PREVIOUS/PREVIOUSOF cyclesWhat SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
39 skills in this plugin
/aggregating-view-dataExecution skill. Use when a View needs totals or subtotals, when a value must roll up with something other than Sum (average, min, max, count, last), when a snapshot metric adds up across time instead of holding, or when a ratio, percentage, margin, growth or variance metric is added to a Table View or shows a wrong total (e.g. a row for margin as a percent of revenue). Covers metric default aggregators, pivot versus hidden-dimension aggregation, the aggregator reference per value type, and Advanced Aggregators on Table Views./architecting-multi-application-solutionsPlanning skill. Use when deciding how to split work across Pigment applications, designing Hub-and-spoke data flows, or planning Test & Deploy across environments./auditing-a-pigment-applicationExecution skill. Use when auditing, reviewing, or health-checking a Pigment application. Covers the structured audit checklist, severity classification, and output format. Also triggers on requests to clean up, find unused blocks, assess model quality, or find what is wrong with an application./building-a-full-applicationPlanning skill. Use when building a complete Pigment application from scratch or when the request spans multiple modeling phases. This skill, together with any other planning skill the request calls for, is sufficient to produce the full architecture spec; do not load execution skills until the spec is approved and you begin building blocks./building-pigment-framesUse this skill whenever you're building, updating, or troubleshooting a Pigment Frame — a full-page, custom-coded visualisation (JavaScript, canvas, or inline SVG) that reads Pigment data through the PigmentSDK. Reach for it any time a native View (Grid, Chart, KPI) or Board can't produce what's being asked for - a bespoke chart, a custom canvas drawing, an interactive widget, or a standalone page in the left navigation that behaves like a small app. Also use it if a Frame you've already built shows up blank or broken and needs debugging./building-versions-and-planning-cyclesExecution skill. Use when implementing versions, planning cycles, or actuals vs forecast separation, and whenever realized data is extended into a plan or budget — loading actuals then planning the remaining periods, forecasting forward from actuals, Actual/Budget/Plan layering, plan vs actual variance — even when the request never uses the word version. Covers Version Dimensions, Switchover patterns, Actual/Forecast layering, Native Scenarios, and Snapshots.Other plugins' skills for the same job
npx claudepluginhub gopigment/ai-plugins --plugin pigment