Agent skill

Semantic Metric

by larry-zy in larry-zy/cognida

语义指标取数技能,先查治理好的指标语义模型,再按统一口径取指标,避免对物理表猜测. An agent skill from larry-zy/cognida.

MITAuto-check passed

Install Semantic Metric

skills CLI
$ npx skills add larry-zy/cognida --skill semantic-metric -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install larry-zy/cognida semantic-metric --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/larry-zy/cognida.git skills-src && mkdir -p .claude/skills && cp -r skills-src/services/cognida-go/skills/semantic-metric .claude/skills/semantic-metric && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
semantic-metric
GitHub stars
182
Token cost
~329 tokens
SKILL.md length
30 words
Files
1
Skills in repo
9
Repo updated
First seen
Licence
MIT

At a glance

语义指标取数技能,先查治理好的指标语义模型,再按统一口径取指标,避免对物理表猜测. An agent skill from larry-zy/cognida.

  • SKILL.md covers 何时用 / 何时不用, 标准流程, 工具 and 约束
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Semantic Metric is an agent skill from larry-zy/cognida. 语义指标取数技能,先查治理好的指标语义模型,再按统一口径取指标,避免对物理表猜测。

Its SKILL.md is about 330 tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

The repository describes itself as: 不止是能问数据的助手——受治理、可审计、可度量的企业级「数据+知识」Agent 平台. The licence is MIT.

Example prompts

  • “/semantic-metric”

What it can do on your machine

Read from SKILL.md and the folder at commit bf76257. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are json).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Semantic Metric loads about 329 tokens when it runs. Until then it costs about 14 tokens; SKILL.md has 30 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~14
When it runs · the whole SKILL.md, loaded when a task matches
~329

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from larry-zy/cognida at commit bf76257, republished under its MIT licence (© larry-zy). 30 words, ~329 tokens.

Download SKILL.mdSave it as .claude/skills/semantic-metric/SKILL.md (or your agent's skills folder).
name
semantic-metric
description
语义指标取数技能,先查治理好的指标语义模型,再按统一口径取指标,避免对物理表猜测。
when_to_use
当用户问的是有口径的经营指标(如 GMV、营收、客单价、复购率、客户数、转化率)时使用;优先走语义层拿到一致口径,而非直接拼物理表 SQL。
category
data
tags
semantic-layer, metric, governance, kpi
version
1.0.0
author
Cognida Team

语义指标取数

面向「按治理口径取经营指标」的场景:先看有哪些已治理的指标/维度,再用语义名提交结构化取数请求,口径由语义层保证一致。

何时用 / 何时不用

  • ✅ 用:问的是指标(GMV、营收、客单价、复购率、客户数、转化率、留存……),需要一致口径、可复用、可对齐报表。
  • ❌ 不用:
    • 只是查一条明细/清单、没有口径概念 → text2sql-adhoc
    • 要整合成多维度报告 → report-composition(其内部也可调用语义取数)

标准流程

1. semantic_models 列出受治理的指标/维度目录(含口径、同义词)
   ↓
2. 对齐术语:把用户口语(“营业额”)映射到语义名(“GMV”)
   ↓
3. semantic_query 用语义名提交 metrics/dimensions 结构化取数
   ↓
4. 结果注明口径来源(语义模型名 + 指标口径)

工具

semantic_models — 列出指标语义目录
json
{ "tool": "semantic_models", "parameters": { "model": "" } }

model 留空列出全部生效模型;拿到目录后按 name/synonyms 对齐术语。

semantic_query — 结构化取数
json
{
  "tool": "semantic_query",
  "parameters": {
    "model": "电商销售模型",
    "metrics": ["GMV", "订单数"],
    "dimensions": ["月份"]
  }
}

约束

  • 一定先 semantic_models 确认指标存在且口径匹配,再 semantic_query。
  • 目标指标不在语义目录里时,回退到 text2sql-adhoc(get_schema + sql_execute)走词法 NL2SQL,并在回答里说明“无治理口径,按物理表推断”。
  • 计算型指标(如客单价=GMV/订单数)优先取语义层已定义口径,其次才手工推导并标注公式。

© larry-zy, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in services/cognida-go/skills/semantic-metric of larry-zy/cognida.

Open the folder on GitHubat commit bf76257

Compare with similar skills

Semantic Metric next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Semantic Metric compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Semantic Metric this skilllarry-zy/cognida182—~329Automated safety check: PassMIT
Metric Semantic Layermohitagw15856/pm-claude-skills1.4k—~956Automated safety check: PassMIT
North Star Metricphuryn/pm-skills27k—~1kAutomated safety check: PassMIT
Investigate MetricPostHog/posthog40k—~1.9kAutomated safety check: PassCustom licence
Product Metrics Dashboard Designphuryn/pm-skills27k—~1.3kAutomated safety check: PassMIT
CI Metricspytorch/pytorch104k—~1.1kAutomated safety check: PassCustom licence

Similar skills

  • Metric Semantic Layer

    mohitagw15856/pm-claude-skills

    Define a metric in a semantic layer so it means one thing everywhere.

    1.4k GitHub stars~956 tokensUpdated yesterday
    Data & AnalyticsAuto-check passed
  • North Star Metric

    phuryn/pm-skills

    Define a North Star Metric and 3-5 supporting input metrics that form a metrics constellation.

    27k GitHub stars~1k tokensUpdated yesterday
    Product & Project ManagementAuto-check passed
  • Investigate Metric

    PostHog/posthog

    Official

    Diagnose why a product metric changed (dropped, spiked, or plateaued) by orchestrating breakdowns, actors, paths, lifecycle, retention, and annotations queries.

    40k GitHub stars~1.9k tokensUpdated today
    Product & Project ManagementAuto-check passed
  • Designs a product metrics dashboard: a North Star and input metrics, a definition table with data sources, chart types and alert thresholds, and a screen layout.

    27k GitHub stars~1.3k tokensUpdated yesterday
    Product & Project ManagementAuto-check passed
  • CI Metrics

    pytorch/pytorch

    Query PyTorch CI, GitHub Actions, HUD, Grafana, and infrastructure metrics.

    104k GitHub stars~1.1k tokensUpdated today
    AI & LLM EngineeringAuto-check passed
  • Track, calculate, and optimize key performance metrics for SaaS, marketplace, consumer, and B2B startups from seed through Series A, including unit economics, growth efficiency, and cash management.

    40k GitHub stars~2.5k tokensUpdated 6 days ago
    Business, Finance & HRAuto-check passed

More from larry-zy/cognida

All 9 skills in this repo
  • Attribution Analysis

    larry-zy/cognida

    归因/根因分析技能,把指标的期间变化拆解到候选维度,定位驱动因子并给出置信与下钻建议. An agent skill from larry-zy/cognida.

    182 GitHub stars~524 tokensUpdated 1 mo ago
    Auto-check passed
  • Report Composition

    larry-zy/cognida

    综合报告生成技能,把多段取数(总览+趋势+分群等)整合成一份带洞察的结构化报告. An agent skill from larry-zy/cognida.

    182 GitHub stars~397 tokensUpdated 1 mo ago
    Auto-check passed
  • Generate a comprehensive report of core e-commerce operating metrics (GMV, orders, average order value, repurchase)

    182 GitHub stars~470 tokensUpdated 1 mo ago
    Auto-check passed
  • Graph Retrieval

    larry-zy/cognida

    图谱与血缘检索技能,查询实体之间的关系、上下游依赖与数据血缘。

    182 GitHub stars~236 tokensUpdated 1 mo ago
    Auto-check passed
  • Text2sql Adhoc

    larry-zy/cognida

    即席取数技能,把一句话的具体数据问题翻译成 SQL 并执行返回结果。

    182 GitHub stars~390 tokensUpdated 1 mo ago
    Auto-check passed
  • Trend Analysis

    larry-zy/cognida

    趋势分析技能,取带时间维度的序列并量化其增长/变化幅度与异常点。

    182 GitHub stars~428 tokensUpdated 1 mo ago
    Auto-check passed

Questions about Semantic Metric

What does Semantic Metric do?

语义指标取数技能,先查治理好的指标语义模型,再按统一口径取指标,避免对物理表猜测. An agent skill from larry-zy/cognida. Semantic Metric is an agent skill from larry-zy/cognida.

How do I install Semantic Metric in Claude Code?

Run `npx skills add larry-zy/cognida --skill semantic-metric -a claude-code`. Or copy the skill folder (services/cognida-go/skills/semantic-metric in larry-zy/cognida) into .claude/skills/semantic-metric in your project. Claude Code loads it when a task matches its description.

How do I install Semantic Metric in Codex?

Run `npx skills add larry-zy/cognida --skill semantic-metric -a codex`. Or copy the skill folder (services/cognida-go/skills/semantic-metric in larry-zy/cognida) into .agents/skills/semantic-metric in your project. Codex loads it when a task matches its description.

Can I use Semantic Metric in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add larry-zy/cognida --skill semantic-metric -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/semantic-metric, .gemini/skills/semantic-metric, .github/skills/semantic-metric and .opencode/skills/semantic-metric in your project.

What does Semantic Metric need to run?

SKILL.md names no scripts, command-line tools or credentials: Semantic Metric is instructions for the agent only.

Does Semantic Metric access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Semantic Metric safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Semantic Metric use?

Semantic Metric is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Semantic Metric use?

About 329 tokens (SKILL.md is roughly 1.3k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Semantic Metric?

Skills that share tags, products or a category with Semantic Metric: Metric Semantic Layer (mohitagw15856/pm-claude-skills, 1.4k stars), North Star Metric (phuryn/pm-skills, 27k stars), Investigate Metric (PostHog/posthog, 40k stars) and Product Metrics Dashboard Design (phuryn/pm-skills, 27k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Semantic Metric?

larry-zy (a GitHub user) maintains it in larry-zy/cognida, which has 182 GitHub stars. The repository holds 9 skills in this directory. The repository was last updated on August 31, 2026.

Source: larry-zy/cognida on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.