Understanding Pigment Modeling

作者 gopigment6fec49f4ce9d无许可证22 个星标收录于 2026年10月8日更新于 2026年10月8日仓库2天前更新

Foundational skill. Read first before any modeling task. Provides the mental model (in-memory sparse multidimensional engine), block-type taxonomy, engine vocabulary, common decision mistakes, and hard rules.

AI 生成的概览

Pigment 建模引擎的基础参考:块类型、硬性规则与常见决策错误。

功能
该技能提供 Pigment 建模的概念性参考。它解释内存中的稀疏多维引擎,定义块类型分类(维度列表、日历、版本维度、指标、事务列表、表格、看板、视图、文件夹),并列出涵盖结构、命名、构建顺序、公式安全性和结构变更的硬性规则。它还给出代理最常出错的决策对照表,例如维度与事务列表、维度类型属性与简单属性的选择。
适用场景
按照技能本身的说明,在任何 Pigment 建模任务开始前使用,以建立心智模型和术语体系。在需要判断块类型或在进行结构变更前核对硬性规则时也适用。
运行要求
无需脚本或工具,仅为纯说明性参考文档。文中按名称引用其他技能和 Pigment 工具,但不执行任何操作。

Understanding Pigment Modeling

Read this before any modeling task.

Mental Model

Pigment is an in-memory, sparse, multidimensional engine. An Application is a collection of typed blocks. Two orthogonal layers (Native Scenarios for what-if sandboxes, Snapshots for frozen copies) apply across all blocks.

Block typeWhat it isWhen to use
Dimension listAnalysis axis with unique items (rows) and typed properties (columns: Number / Date / Text / Bool / Dimension). A dimension placed in a metric's grid is a structural dimension.Anything you slice metrics by: Country, Product, Employee, Account
CalendarBuilt-in time dimensions: Month, Quarter, Year, Date.Always reuse. Never recreate time lists.
Version DimensionDimension holding Budget / Actual / Forecast items, with switchover and gating properties.Any planning cycle. See skill:building-versions-and-planning-cycles.
MetricMultidimensional sparse grid (Number / Date / Text / Dim / Bool). Each cell = one value at one combination of structural items. Blank cells are not stored (sparsity). Formulas evaluate within a dimensional context called scope.Anything you compute, plan, or report
Transaction ListHigh-volume row store. Items not unique. Never structural.Granular events (GL, orders, HRIS) to aggregate into metrics with BY
TableGroups metrics sharing dimensions, with calculated rows/columns.P&L, Balance Sheet, multi-metric reporting
BoardContainer page of Widgets.Dashboards, reports, input screens
ViewConfigured visual of a Metric or Table (pivots, filters, sort, display mode: Grid / Chart / KPI). Reusable across Boards.Any reusable data presentation
FolderOrganizational only. No logic.Sorting and governance

Invariants

These are never negotiable.

Structure

  1. Only dimension lists can be structural. Transaction lists never. Aggregate with BY.
  2. A metric cell = one item per structural dimension. Blank cells are not stored (sparsity).
  3. Every app with planning metrics gets a Version Dimension. Do not skip or defer.
  4. List Subsets delete data irreversibly on membership change. Prefer filters unless the use case is clear.

Naming and organization

  1. Never use ., :, ', or " in block names. Prefer ASCII.
  2. Never place a block at the root level. Use numbered folders.
  3. Folders are inert. They affect discovery, not calculation.

Build order

  1. Calendar (verify/configure) → Dimensions → Version Dimension → Transaction Lists → Metrics (input, then calculated) → Tables → Boards. Always create prerequisites before dependents.
  2. Never recreate time dimensions. Reuse the app calendar.

Formula safety

  1. Never hard-code dimension item references for Time, Version, countries, or planning periods. Use a Dimension-typed input metric. Stable type/class/category items (e.g. 'FX Rate Types'."AVG") may stay hard-coded.
  2. Never use DATE() with literal year/month for period bounds. Use a Date-typed input metric.
  3. When T&D is active: never use a disconnected dimension as the property type on a connected dimension. Ask the user about connectivity if unknown.

Structural changes on existing blocks

  1. A structural change (adding/removing a dimension, changing type) does not automatically propagate to the metrics that reference the changed one. Pigment aligns mismatched dimensions silently (broadcast/collapse) instead of failing, which can produce wrong numbers with no visible error. Before editing, use tool:get_data_dependency_tree (direction Sources) to trace back to the originating metric(s) and transaction list, so you know what grain of detail already exists upstream. Before declaring such a change done, use tool:get_data_dependency_tree (direction Usages) to find dependent formulas, then tool:validate_formula (with target.metric_id) on each to catch a silent mismatch — see skill:writing-pigment-formulas ("Structural Dimension Changes") for the full workflow.
  2. Removing a dimension from a metric's structure is lossy and irreversible. Unlike adding a dimension, once the metric no longer stores that grain the historical detail cannot be recovered from the metric itself. Say so explicitly when proposing the change, even if the detail still exists upstream (e.g. on a source metric or transaction list).

Decisions the Agent Gets Wrong Most Often

DecisionChoose A whenChoose B when
Dimension vs Transaction ListUnique items you slice byHigh-volume events, no uniqueness, not structural
Dimension-typed property vs simple propertyValues form a finite set you may slice or aggregate by (create a dimension list, reference it as property type)Free text, measure, date, or boolean that is never a slicing axis
Metric vs Transaction ListAggregated planning / reporting valuesAtomic events from ERP / CRM (then aggregate with BY)

When unsure about property types: do not default categorical fields to Text. If the values form a finite set that could become a slicing axis, make it a Dimension.

来源与署名

来源:gopigment/ai-plugins位于skills/understanding-pigment-modeling提交6fec49f

许可证: 无许可证

内容归原作者所有。SourceWeft 从公开仓库中收录这些内容。

举报或申请下架