Token导航 LogoToken导航TokenDH.com
前端设计只读github未标认证来源可访问许可证需确认审计通过

metabase-representation-format元数据库表示格式

Agent Skill

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

总安装

1,048

周安装

45

GitHub Stars

12

下载量

367
CodexClaudeCursorGemini CLI

安装说明

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

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

请帮我安装这个 Agent Skill:metabase-representation-format(元数据库表示格式)
来源仓库:https://github.com/metabase/agent-skills
仓库路径:skills/metabase-representation-format
安装命令:
npx skills add https://github.com/metabase/agent-skills --skill metabase-representation-format
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

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

skills.shnpx skills
npx skills add https://github.com/metabase/agent-skills --skill metabase-representation-format

简介

用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中整理协作事项。

  • 适用于围绕仓库状态、代码变更或协作流程进行信息梳理。
  • 通过 npx skills add 命令从指定 GitHub 仓库安装并使用。
  • 安装前需确认权限范围、维护状态,注意是否涉及联网或文件操作。
  • 建议结合原始 README 核验具体用法和功能边界。

SKILL.md

Metabase Representation Format

Metabase represents user-created content as a tree of YAML files. Each file is one entity (a collection, card, dashboard, etc.). The format is portable across Metabase instances: numeric database IDs are replaced with human-readable names and entity IDs.

The format is defined by a spec bundled alongside this file as spec.md (upstream source: the @metabase/representations npm package). The same package ships a CLI (npx @metabase/representations validate-schema) that validates a tree of YAML files against the format.

Entities

The format defines 11 entity types.

EntitySerDes ModelDescription
CollectionCollectionFolder-like container for organizing content. Hierarchy via parent_id. Namespaces: null (main), "snippets", "transforms".
CardCardQuestion, model, or metric. Holds an MBQL or native dataset_query. Display types: table, bar, line, pie, scalar, etc. Card types: "question", "model", "metric".
DashboardDashboardGrid layout (24 columns) of cards with filter parameters and optional tabs. Contains dashcards array for card placement and parameters array for filter controls.
DocumentDocumentRich text page using ProseMirror AST. Can embed cards via cardEmbed nodes and link to entities via smartLink nodes.
SegmentSegmentSaved filter definition scoped to a table. Definition is a pMBQL query with a single stage containing only source-table and filters.
MeasureMeasureSaved aggregation definition scoped to a table. Definition is a pMBQL query with a single stage containing only source-table and exactly one aggregation.
SnippetNativeQuerySnippetReusable SQL fragment referenced in native queries via {{snippet: Name}}.
TransformTransformMaterializes query or Python script results into a database table. Source is either MBQL/native query or Python script.
TransformTagTransformTagLabel for categorizing transforms. Built-in types: "hourly", "daily", "weekly", "monthly", or null for custom.
TransformJobTransformJobScheduled job (cron) that executes transforms matching specific tags.
PythonLibraryPythonLibraryShared Python source file available to Python-based transforms.

Ownership and hierarchy

Critical — folder layout is decorative. Where an entity lands in Metabase is decided entirely by its fields, not by where its YAML file sits in the tree. Moving a file without updating the fields changes nothing. Updating the fields without moving the file still works correctly. Always treat the fields below as the source of truth.

The fields that actually determine placement:

  • collection_id (entity_id of a collection) — places the entity in that collection. null or omitted → root collection.
  • parent_id on a collectionthis, and only this, sets the collection's own parent. A collection's position in the folder tree is ignored on import; without parent_id (or with parent_id: null) the collection becomes a root-level collection, no matter how deep its folder is nested. To nest one collection under another, set parent_id to the parent collection's entity_id.
  • dashboard_id / document_id on a card — nests a card under a dashboard or document. Such a card must also set collection_id to match the parent's collection_id. A card never sets both.

On disk, cards nested under a dashboard or document live in a subfolder next to the parent YAML (e.g. my_dashboard/card.yaml sitting next to my_dashboard.yaml) — but again, this is purely for human navigation; the fields are what Metabase reads.

Import paths

Metabase only imports YAML from these top-level directories; anything outside is ignored:

  • collections/ — all user content (cards, dashboards, documents, snippets, transforms, etc.), partitioned by namespace: main/, snippets/, transforms/.
  • databases/only the segments/ and measures/ subdirectories under each table are imported.
  • python_libraries/ (also accepted as python-libraries/).
  • transforms/ — contains transform_jobs/ and transform_tags/.

serdes/meta

Every entity carries a top-level serdes/meta array that encodes its identity path. Each entry is {id, model, label?}label is the slugified name and is present on entities keyed by NanoID. Example:

serdes/meta:
- id: NDzkGoTCdRcaRyt7GOepg
  label: my_entity_name
  model: Card

validate-schema reads serdes/meta to determine which entity type each file represents. The full rules (including nested entities and composite identity paths) are in spec.md.

Reading the spec

This skill ships with a local snapshot of the spec as spec.md alongside SKILL.md.

Beyond the per-entity shapes summarized in this SKILL, spec.md also covers: MBQL query form (stages, field references, joins, expressions, aggregations, filter/expression operators, temporal bucketing, binning), native queries and template tags (text, number, date, boolean, dimension, temporal-unit, card, snippet, table), visualization settings, click behavior, and dashboard/card parameters. Reach for spec.md whenever edits touch any of those.

Read on demand, not eagerly. Open spec.md only when you are about to read or modify content files for the entities listed above — e.g. the user asks to edit a card, add a dashcard, tweak a transform, or similar work that implies YAML edits. Do not open it at session start or for tasks unrelated to representation YAML.

If the bundled copy looks out of date with the upstream package, the skill's own README.md documents how to refresh it with extract-spec.

Validating

Validate edits with the built-in CLI:

npx @metabase/representations validate-schema --folder <path>

Pass the top-level export folder, or the git repository root. The tool walks the import paths listed above, reads serdes/meta on each file to pick the right validation rules, and exits non-zero on failure. Prefer running this over manually cross-checking field shapes. It's essentially instant, so invoke it whenever useful — after each edit, between edits, whenever the shape of a file feels uncertain. No reason to batch.

Generating entity IDs

Every entity needs a 21-character NanoID for entity_id. Generate one (or several) with the bundled CLI:

npx @metabase/representations generate-entity-id
# → LZfXLFzPPR4NNrgjlWDxn

npx @metabase/representations generate-entity-id --count 5

Generating UUIDs

Some fields in the format require v4 UUIDs rather than NanoIDs — notably lib/uuid on MBQL aggregation clauses (referenced from order-by and later stages) and the id on dashboard/card parameters. Generate them with:

npx @metabase/representations generate-uuid
# → 1d4e9fdf-49ae-4fbe-ae27-05e7c6a5cfe8

npx @metabase/representations generate-uuid --count 3

适合场景

01

用户想查找某类 Agent Skill 时

02

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

03

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

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

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

能力 4

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

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

平台分布

Codex

35.72%
按下载量换算131

Claude

32.33%
按下载量换算119

Cursor

19.26%
按下载量换算71

Gemini CLI

9.12%
按下载量换算33

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

只读

该 Skill 主要提供规则、说明或参考内容,本身偏只读;真正读写文件、联网或执行命令仍取决于宿主 Agent 的任务。

安装前确认

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

来源信息

继续浏览同类 Skills