Token导航 LogoToken导航TokenDH.com
待分类需要联网github未标认证来源可访问许可证需确认审计异常

variable-creation变量创建

Agent Skill

variable-creation 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

768

周安装

33

GitHub Stars

14

下载量

269
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:variable-creation(变量创建)
来源仓库:https://github.com/stahura/domo-ai-vibe-rules
仓库路径:skills/variable-creation
安装命令:
npx skills add https://github.com/stahura/domo-ai-vibe-rules --skill variable-creation
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/stahura/domo-ai-vibe-rules --skill variable-creation

简介

variable-creation 用于处理 GitHub 仓库、Issue 和 Pull Request 协作信息。

  • 它适合围绕代码变更、仓库状态或协作事项进行整理。
  • 通过 npx skills add 命令从指定 GitHub 仓库安装并使用。
  • 安装前建议确认权限范围和是否会触发文件读写操作。
  • 适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。

SKILL.md

Variable Creation

Create Domo card variables (interactive controls) and output curl commands or CLI commands to execute them.

Variables are user-adjustable values that feed into Beast Mode formulas, enabling dynamic what-if analysis. They appear as dropdown, pill, slider, textbox, or date picker controls on cards and dashboards.

When to Use This Skill

  • User asks for a dropdown, slider, or interactive control on a card
  • User mentions "variable", "parameter", or describes wanting dynamic/adjustable values
  • A card needs what-if analysis or user-selectable inputs
  • You're building a card and realize a beast mode needs a user-controlled input

Core Workflow — 3-Step Creation

Variable creation requires three sequential API calls. All three are mandatory — skipping the middle step causes a 400 error on the card save.

1. Check name uniqueness (GET /query/v1/functions/variables/uniqueName)
2. Create the function template WITH embedded control (POST /query/v1/functions/template)
3. Register the variable control (PUT /content/v1/variable/controls)
4. Read the current card definition (PUT /content/v3/cards/kpi/definition)
5. Save the card with the new control (PUT /content/v3/cards/kpi/{cardId})

Prerequisites

ParameterSourceRequired
instanceUrlDomo instance (e.g., domo-gordon-pont.domo.com)Always
devTokenCLI auth / developer tokenAlways
cardIdCard IDAlways
dataSourceIdDataset UUID (from card definition or columns)For validation and card save

Variable Data Types

Data TypeExpression ExamplesCompatible Controls
string'TEST', 'Option A'DROPDOWN, PILL, TEXTBOX
numeric100, 0.5DROPDOWN, PILL, SLIDER, TEXTBOX
dateCURRENT_DATE(), '2024-01-01'DROPDOWN, DATE_PICKER

Variable Control Types

TypeDescriptionBest For
DROPDOWNSelect from a list of predefined valuesCategorical selections, string/numeric/date
PILLInline toggle chipsSmall number of options (2-5)
SLIDERNumeric range sliderNumeric ranges with min/max
TEXTBOXFree-text inputOpen-ended string/numeric input
DATE_PICKERCalendar date selectorDate variables

Expression Types by Data Type

Data TypeexprType
stringSTRING_VALUE
numericNUMERIC_VALUE
dateDATE_VALUE

Values Array

For DROPDOWN and PILL controls, the values array defines the selectable options:

{"expression": {"value": "Option Text", "exprType": "STRING_VALUE"}}

For SLIDER controls, values define the min/max range:

[
  {"expression": {"value": "0", "exprType": "NUMERIC_VALUE"}},
  {"expression": {"value": "100", "exprType": "NUMERIC_VALUE"}}
]

Step 1: Check Name Uniqueness

Endpoint: GET /api/query/v1/functions/variables/uniqueName?name={name}

curl -X GET "https://{instanceUrl}/api/query/v1/functions/variables/uniqueName?name={variableName}" \
  -H "X-DOMO-Developer-Token: {devToken}"

Returns [] if the name is available. Returns an array of function template IDs if the name is already in use. Variable names must be globally unique across the entire Domo instance.


Step 2: Create the Function Template

Endpoint: POST /api/query/v1/functions/template

This creates the variable's function template. The request body must include an embedded control object — this is critical and differs from regular beast mode creation.

curl -X POST "https://{instanceUrl}/api/query/v1/functions/template" \
  -H "X-DOMO-Developer-Token: {devToken}" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "{variableName}",
    "formula": "{defaultExpression}",
    "status": "VALID",
    "dataType": "{dataType}",
    "persistedOnDataSource": false,
    "isAggregatable": true,
    "bignumber": false,
    "owner": null,
    "nonAggregatedColumns": [],
    "legacyId": "calculation_{uuid}",
    "variable": true,
    "isCalculation": true,
    "initialPersistedOnDataSource": false,
    "saved": true,
    "query": "{defaultExpression}",
    "control": {
      "format": {"type": "default"},
      "controlType": "VARIABLE",
      "function": {
        "name": "{variableName}",
        "dataType": "{dataType}",
        "expression": "{defaultExpression}",
        "id": -201
      },
      "saveOverride": true,
      "description": "",
      "values": [
        {"expression": {"value": "{value1}", "exprType": "{exprType}"}},
        {"expression": {"value": "{value2}", "exprType": "{exprType}"}}
      ],
      "type": "{controlType}",
      "unsaved": true,
      "name": "{variableName}",
      "id": -101
    },
    "description": "",
    "locked": false,
    "cacheWindow": "non_dynamic",
    "containsAggregation": false,
    "containsAnalytic": false,
    "invalidColumns": [],
    "nonAggregatedExpressions": [],
    "formulaTemplateDependencies": [],
    "columnPositions": [],
    "formulaId": "calculation_{another_uuid}",
    "formulaDependencies": [],
    "isControlled": false,
    "global": true,
    "unsaved": true,
    "expression": "{defaultExpression}"
  }'

Key fields:

  • variable: true — marks this as a variable function (not a regular beast mode)
  • control — the embedded control definition with placeholder IDs (-201, -101)
  • legacyId and formulaId — generate unique UUIDs in the format calculation_{uuid}
  • global: true — variables are instance-wide
  • owner: null — server assigns the owner

Response — save the id (numeric function template ID):

{
  "id": 1172,
  "name": "{variableName}",
  "legacyId": "calculation_{uuid}",
  "variable": true,
  ...
}

Step 3: Register the Variable Control

Endpoint: PUT /api/content/v1/variable/controls

This step registers the control with the Domo control system. Without this step, the card save will return 400.

curl -X PUT "https://{instanceUrl}/api/content/v1/variable/controls" \
  -H "X-DOMO-Developer-Token: {devToken}" \
  -H "Content-Type: application/json" \
  -d '[
    {
      "format": {"type": "default"},
      "controlType": "VARIABLE",
      "function": {
        "name": "{variableName}",
        "dataType": "{dataType}",
        "expression": "{defaultExpression}",
        "id": {functionTemplateId from Step 2}
      },
      "saveOverride": true,
      "description": "",
      "values": [
        {"expression": {"value": "{value1}", "exprType": "{exprType}"}},
        {"expression": {"value": "{value2}", "exprType": "{exprType}"}}
      ],
      "type": "{controlType}",
      "unsaved": false,
      "name": "{variableName}"
    }
  ]'

Key differences from Step 2's control:

  • function.id is now the real template ID from Step 2 (not -201)
  • unsaved: false (not true)
  • No id: -101 at the control level
  • Body is an array of control objects

Response — returns an array with the registered control, including server-assigned id:

[
  {
    "id": 145,
    "function": {"id": 1172, ...},
    "type": "DROPDOWN",
    "values": [...],
    "controlType": "VARIABLE",
    ...
  }
]

Step 4: Read the Current Card Definition

curl -X PUT "https://{instanceUrl}/api/content/v3/cards/kpi/definition" \
  -H "X-DOMO-Developer-Token: {devToken}" \
  -H "Content-Type: application/json" \
  -d '{
    "dynamicText": true,
    "variables": true,
    "urn": "{cardId}"
  }'

Save the full response. You need definition.subscriptions, definition.controls, definition.charts, definition.modified, etc.

Get the dataSourceId from columns[].sourceId in the response.


Step 5: Save the Card with the New Control

Endpoint: PUT /api/content/v3/cards/kpi/{cardId}

Build the update payload by merging the new control into the card definition.

curl -X PUT "https://{instanceUrl}/api/content/v3/cards/kpi/{cardId}" \
  -H "X-DOMO-Developer-Token: {devToken}" \
  -H "Content-Type: application/json" \
  -d '{
    "definition": {
      "subscriptions": {existing subscriptions from card def — do NOT add dataSourceId here},
      "formulas": {"dsUpdated": [], "dsDeleted": [], "card": []},
      "annotations": {"new": [], "modified": [], "deleted": []},
      "conditionalFormats": {"card": [], "datasource": []},
      "controls": [{existing controls with saveOverride: true}, {new control}],
      "segments": {"active": [], "create": [], "update": [], "delete": []},
      "charts": {existing charts},
      "dynamicTitle": {existing dynamicTitle},
      "dynamicDescription": {"text": []},
      "chartVersion": "{existing chartVersion}",
      "allowTableDrill": true,
      "inputTable": false,
      "modified": {existing modified timestamp},
      "title": "{card title}",
      "description": ""
    },
    "dataProvider": {"dataSourceId": "{dataSourceId}"},
    "variables": true,
    "columns": false
  }'

Critical payload notes:

  • variables: true and columns: false at the top level
  • dataSourceId goes in dataProvider only — NOT in subscriptions.main
  • formulas uses the {dsUpdated, dsDeleted, card} structure (not the array format from the read response)
  • Existing controls must be passed in their full server format with saveOverride: true added
  • The new control uses the simplified format with function.id = the template ID from Step 2
  • The modified timestamp must match the card definition's value

Optional: Validate the Variable Formula

Endpoint: POST /api/query/v1/functions/validateFormulas

Validation is optional but recommended before creating. The formula entry must have "variable": true.

curl -X POST "https://{instanceUrl}/api/query/v1/functions/validateFormulas" \
  -H "X-DOMO-Developer-Token: {devToken}" \
  -H "Content-Type: application/json" \
  -d '{
    "dataSourceId": "{dataSourceId}",
    "columns": [{column schema array}],
    "formulas": {
      "{formulaId}": {
        "id": "{formulaId}",
        "name": "{variableName}",
        "formula": "{defaultExpression}",
        "status": "valid",
        "dataType": "{dataType}",
        "variable": true,
        "templateId": null,
        "legacyId": "{formulaId}",
        "formulaDependencies": []
      }
    }
  }'

Using the Variable in a Beast Mode

A variable has no effect on a card unless it's referenced in a Beast Mode formula:

CASE
  WHEN `My Variable` = 'Option A' THEN `column_a`
  WHEN `My Variable` = 'Option B' THEN `column_b`
  ELSE `column_a`
END

Variables are referenced by name in backticks, just like dataset columns.


Three-Tier Control Hierarchy

Variables have three levels of override:

  1. Default Control — Set in Beast Mode Editor (or via API). Baseline value.
  2. Card Variable Control — Override in Analyzer for a specific card. Does NOT transfer to dashboards.
  3. Dashboard Variable Control — Override on a specific dashboard. Resets on page refresh.

Using the CLI

The community-domo-cli handles the full 3-step flow automatically:

# Check if a variable name is available
community-domo-cli variables check-name "My Variable"

# List variables on a card
community-domo-cli variables list {cardId}

# Create a variable (handles all 3 steps internally)
community-domo-cli variables create {cardId} --body-file variable.json

# Validate a variable formula
community-domo-cli variables validate --body-file validate-payload.json

# Read full card definition (includes controls)
community-domo-cli cards definition {cardId}

Example: Create a string dropdown variable via CLI

variable.json:

{
  "name": "Region Selector",
  "type": "DROPDOWN",
  "function": {
    "name": "Region Selector",
    "dataType": "string",
    "expression": "'North'"
  },
  "description": "Select a region to filter by",
  "values": [
    {"expression": {"value": "North", "exprType": "STRING_VALUE"}},
    {"expression": {"value": "South", "exprType": "STRING_VALUE"}},
    {"expression": {"value": "East", "exprType": "STRING_VALUE"}},
    {"expression": {"value": "West", "exprType": "STRING_VALUE"}}
  ]
}
community-domo-cli variables create 1810280719 --body-file variable.json --yes

The CLI automatically:

  1. Checks name uniqueness
  2. Creates the function template with embedded control
  3. Registers the control via PUT /content/v1/variable/controls
  4. Reads the card definition
  5. Merges and saves the card

Troubleshooting

ProblemCauseFix
Variable not visible on cardNot referenced in any beast modeCreate a beast mode that uses the variable
Card save returns 400Missing PUT /content/v1/variable/controls stepMust register the control before saving the card
Card save returns 400dataSourceId in subscriptions.mainRemove it — only put dataSourceId in dataProvider
Card save returns 400Existing controls not in full server formatPass existing controls as-is from card def with saveOverride: true
500 Internal database errorDuplicate variable nameCheck name with GET /query/v1/functions/variables/uniqueName first
Validation returns INVALIDBad expression syntaxCheck quotes for strings, function syntax for dates
Dashboard doesn't show variable controlCard-level override doesn't propagateSet the control at dashboard level
Variable resets on dashboard refreshExpected behaviorDashboard controls reset to default on page load

Output Format

When generating commands for the user, provide:

  1. What it does — one sentence explaining the variable
  2. The variable definition — name, type, default, control type, options
  3. Numbered commands — in execution order (all 3 steps), ready to copy/paste
  4. What to do with each response — especially saving the function template ID from Step 2
  5. Beast mode integration — show the formula that references the variable
  6. Verify — tell them to check the card in Domo after running

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

35.63%
按下载量换算96

Claude

29.69%
按下载量换算80

Cursor

18.1%
按下载量换算49

Gemini CLI

8.42%
按下载量换算23

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

未通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills