save-metric
Codify an ad-hoc metric query as a permanent seeknal/metrics/{name}.yml definition reusable via query_metric
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Codify an ad-hoc metric query as a permanent seeknal/metrics/{name}.yml definition reusable via query_metric
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
On-demand time-series forecasting. CAPTURE params from project context, call run_forecast, present deterministic engine results.
Use when helping initialize, configure, or prepare a Seeknal project like a coding agent
Translate business questions into metrics, SQL evidence, and actionable recommendations
Run multi-step SQL plus Python/statistics/ML analysis while keeping tools thin and evidence grounded
Answer business questions from read-only connected databases using deterministic schema discovery and SQL evidence
Run Python code in an isolated subprocess for statistical/ML/visualization work beyond what SQL can express
| name | save-metric |
| description | Codify an ad-hoc metric query as a permanent seeknal/metrics/{name}.yml definition reusable via query_metric |
| tags | ["semantic-layer","metrics","codification"] |
| version | 1.0.0 |
Use this workflow when the user wants to codify an ad-hoc metric query as
a reusable metric definition. The tool writes a YAML file under
seeknal/metrics/ that future query_metric calls can reference by name.
save_metric (gated by confirmed=True)Trigger when the user says things like:
query_metric exploration that revealed a useful
combination of measures the user wants to formalize.save_metric supports two types:
A single measure from a semantic model. Use this for direct aggregations.
Required arg: measure (e.g. "total_revenue")
Example: a gross_revenue metric that wraps the total_revenue measure.
A ratio of two measures. Use this for rates, conversion percentages, or
any derived metric expressed as numerator / denominator.
Required args: numerator, denominator (both measure names)
Example: conversion_rate = purchases / visitors.
Always call save_metric(..., confirmed=False) FIRST to see the YAML that
will be written. The tool returns a preview block showing:
seeknal/metrics/{name}.yml)confirmed=TrueShow the preview to the user verbatim so they can verify the structure BEFORE committing.
When the user approves, call save_metric(..., confirmed=True). The tool:
^[a-zA-Z_][a-zA-Z0-9_]*$ — Python-identifier rules)simple or ratio)measure for simple;
numerator + denominator for ratio)seeknal/metrics/{name}.yml under fs_lockAfter successful save, your final answer MUST include:
seeknal/metrics/{name}.yml)query_metric call that uses the new metricname: Metric identifier (Python-identifier rules).metric_type: "simple" (default) or "ratio".measure: Required if metric_type="simple".numerator, denominator: Required if metric_type="ratio".description (optional): Human-readable doc string.confirmed: Must be True to actually write.Invalid metric name → name must start with letter/underscore, alphanumeric + underscore onlyUnsupported metric_type → must be simple or ratioMissing measure → simple metrics need a measureMissing numerator/denominator → ratio metrics need bothA metric named 'X' already exists → delete the existing YAML or pick a different name