Swarma
glitch-rabin/swarma
Agent teams that run growth experiments and build their own playbook.
Define any metric completely with a standardized template: calculation, denominator, time window, filters, interpretation.
$ npx skills add ai-analyst-lab/ai-analyst --skill metric-spec -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install ai-analyst-lab/ai-analyst metric-spec --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/ai-analyst-lab/ai-analyst.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.claude/skills/metric-spec .claude/skills/metric-spec && rm -rf skills-srcUse ~/.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/
Install the "metric-spec" agent skill from https://github.com/ai-analyst-lab/ai-analyst/tree/main/.claude/skills/metric-spec into .claude/skills/metric-spec/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "metric-spec", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/ai-analyst-lab/ai-analyst/tree/main/.claude/skills/metric-specType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add ai-analyst-lab/ai-analyst --skill metric-spec -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install ai-analyst-lab/ai-analyst metric-spec --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/ai-analyst-lab/ai-analyst.git skills-src && mkdir -p .agents/skills && cp -r skills-src/.claude/skills/metric-spec .agents/skills/metric-spec && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "metric-spec" agent skill from https://github.com/ai-analyst-lab/ai-analyst/tree/main/.claude/skills/metric-spec into .agents/skills/metric-spec/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "metric-spec", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add ai-analyst-lab/ai-analyst --skill metric-spec -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install ai-analyst-lab/ai-analyst metric-spec --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/ai-analyst-lab/ai-analyst.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/.claude/skills/metric-spec .cursor/skills/metric-spec && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "metric-spec" agent skill from https://github.com/ai-analyst-lab/ai-analyst/tree/main/.claude/skills/metric-spec into .cursor/skills/metric-spec/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "metric-spec", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/ai-analyst-lab/ai-analyst.git --path .claude/skills/metric-spec--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add ai-analyst-lab/ai-analyst --skill metric-spec -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install ai-analyst-lab/ai-analyst metric-spec --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/ai-analyst-lab/ai-analyst.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/.claude/skills/metric-spec .gemini/skills/metric-spec && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "metric-spec" agent skill from https://github.com/ai-analyst-lab/ai-analyst/tree/main/.claude/skills/metric-spec into .gemini/skills/metric-spec/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "metric-spec", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install ai-analyst-lab/ai-analyst metric-specInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add ai-analyst-lab/ai-analyst --skill metric-spec -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/ai-analyst-lab/ai-analyst.git skills-src && mkdir -p .github/skills && cp -r skills-src/.claude/skills/metric-spec .github/skills/metric-spec && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "metric-spec" agent skill from https://github.com/ai-analyst-lab/ai-analyst/tree/main/.claude/skills/metric-spec into .github/skills/metric-spec/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "metric-spec", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add ai-analyst-lab/ai-analyst --skill metric-spec -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install ai-analyst-lab/ai-analyst metric-spec --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/ai-analyst-lab/ai-analyst.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/.claude/skills/metric-spec .opencode/skills/metric-spec && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "metric-spec" agent skill from https://github.com/ai-analyst-lab/ai-analyst/tree/main/.claude/skills/metric-spec into .opencode/skills/metric-spec/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "metric-spec", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
metric-specDefine any metric completely with a standardized template: calculation, denominator, time window, filters, interpretation.
Metric Spec is an agent skill from ai-analyst-lab/ai-analyst. Define any metric completely with a standardized template: calculation, denominator, time window, filters, interpretation. Trigger on "define this metric", "how should we measure X?", "what's the right way to calculate Y?", "document our metrics", "create a metric definition", "different teams are measuring this differently", or when a metric is used in analysis without a clear specification.
Its SKILL.md is about 4.9k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.
It sits in Product & Project Management, covering Product metrics. The repository describes itself as: AI Product Analyst — Claude Code-powered data analysis toolkit. The licence is MIT.
5 steps, taken from the first numbered list in SKILL.md.
Read from SKILL.md and the folder at commit 52c0744. It shows what the files ask for, not the result of running them.
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.
No scripts in the folder and no shell commands in SKILL.md (its code samples are markdown, sql and yaml).
From the folder's file list and the shell code blocks in SKILL.md.
No URLs in SKILL.md.
From URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Metric Spec loads about 4.9k tokens when it runs. Until then it costs about 102 tokens; SKILL.md has 808 words of instructions outside code blocks.
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.
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.
The full file from ai-analyst-lab/ai-analyst at commit 52c0744, republished under its MIT licence (© ai-analyst-lab). 808 words, ~4,891 tokens.
.claude/skills/metric-spec/SKILL.md (or your agent's skills folder).Define any metric clearly and completely using a standardized template so there is no ambiguity about what is being measured, how it's calculated, or how to interpret it.
Apply this skill when defining a new metric, when a metric is referenced without a clear definition, or when different people are using the same metric name to mean different things. Every metric used in an analysis should have a spec.
## Metric: [Name]
### Definition
**Plain English:** [One sentence a non-technical person can understand]
**Formula:** [Exact calculation]
**Owner:** [team or person accountable for this metric]
**Granularity:** [the grain it is reported at: per user / per order / daily / weekly ...]
### Components
| Component | Definition | Source |
|-----------|-----------|--------|
| **Numerator** | [What's being counted/summed in the top] | [Table.column] |
| **Denominator** | [What's being counted in the bottom (if ratio)] | [Table.column] |
| **Unit of analysis** | [What does one row represent?] | [e.g., per user, per session, per order] |
### Segmentation Dimensions
| Dimension | Values | Why |
|-----------|--------|-----|
| [e.g., Device type] | [mobile, desktop, tablet] | [Different UX → different conversion] |
| [e.g., Acquisition channel] | [organic, paid, referral] | [Different intent → different behavior] |
| [e.g., Geography] | [US, EU, APAC] | [Different markets → different baselines] |
### Data Source
- **Primary table:** [schema.table_name]
- **Key columns:** [list]
- **Refresh cadence:** [real-time / hourly / daily / weekly]
- **Latency:** [how delayed is the data?]
- **Reference query:** [SQL query that computes this metric — the canonical implementation]
### Guardrails
| Condition | Value | Action |
|-----------|-------|--------|
| **Healthy** | [e.g., >3.5%] | No action needed |
| **Watch** | [e.g., 2.5-3.5%] | Monitor weekly, investigate if persists >2 weeks |
| **Investigate** | [e.g., <2.5%] | Root cause analysis within 48 hours |
| **Alert** | [e.g., <1.5%] | Escalate to leadership, immediate investigation |
**Typical range:** [the band the metric normally lives in, with its basis: "3.4-4.2% over the last 6 months"]
### Known Limitations
- [Limitation 1: e.g., "Does not include guest checkouts — only registered users"]
- [Limitation 2: e.g., "Affected by bot traffic; filter using is_bot flag"]
- [Limitation 3: e.g., "Denominator changes when new markets launch — compare like-for-like"]
### Related Metrics
- [Upstream: what drives this metric?]
- [Downstream: what does this metric drive?]
- [Alternative: other ways to measure the same concept]
### Driver Decomposition (Optional)
If this is a key business metric, decompose it into its drivers to enable faster diagnosis when the metric changes.
**Decomposition type:** [Multiplicative / Additive]
| Driver | Formula | Relationship | Data Source |
|--------|---------|-------------|-------------|
| [driver 1] | [formula] | [× / +] | [table.column] |
| [driver 2] | [formula] | [× / +] | [table.column] |
| [driver 3] | [formula] | [× / +] | [table.column] |
**Diagnostic rule:** If [parent metric] drops, check these drivers in order:
1. [driver 1] — [why this is the most likely cause / highest leverage]
2. [driver 2] — [what changes in this driver would look like]
3. [driver 3] — [least common but possible]
**Verification:** [parent metric] = [driver 1] × [driver 2] × [driver 3] (for multiplicative)
or [parent metric] = [driver 1] + [driver 2] + [driver 3] (for additive)After writing the spec, register it to the knowledge system so it is discoverable and reusable (steps below).
Registration Steps (execute these immediately after completing the metric spec):
Read active dataset ID: Read .knowledge/active.yaml to get the active dataset name
Check metrics directory: Verify .knowledge/datasets/{active}/metrics/ directory exists. If not, create it.
Generate metric ID: Convert metric name to ID format: lowercase, hyphens, no spaces
checkout-conversion-rateCheck for existing entry: Read .knowledge/datasets/{active}/metrics/index.yaml. If the metric ID exists, you're updating. If not, you're creating new.
Write metric YAML: Create .knowledge/datasets/{active}/metrics/{id}.yaml with exactly the fields the metrics skill displays:
name: The metric's display nameowner: Copy from the Owner field (null if not stated)definition.plain_english: Copy from Plain English fielddefinition.formula: Copy from Formula fielddefinition.unit: Infer from formula (%, count, currency, ratio)definition.direction: Infer from guardrails (higher_is_better / lower_is_better)definition.granularity: Copy from the Granularity field (fall back to Unit of analysis)source.tables: List primary table(s) from Data Source sectionsource.sql: Copy reference query if provideddimensions: Array of dimension column names from Segmentation Dimensionsguardrails: Map guardrail conditions to values (the field is named guardrails, not thresholds)typical_range: Copy from the Typical range line (null if unknown)validation_status: draft on first registration; set to validated once the reference query has been run against the data and its result checkedlast_validated: the date the reference query was last verified against the data (null until then)limitations: Array of strings from Known LimitationsUpdate index: Update .knowledge/datasets/{active}/metrics/index.yaml with an entry:
- id: checkout-conversion-rate
name: Checkout Conversion Rate
category: conversion # infer: conversion, engagement, revenue, retention, etc.
direction: higher_is_better
validation_status: draft
created: YYYY-MM-DD
updated: YYYY-MM-DD(direction and validation_status are in the index because the metrics skill's list view displays them.)
Add a compile: block when the metric is a single aggregate (recommended).
If the metric is one measure over one table with named dimensions and filters
(not a join, a window function, or multi-metric arithmetic), add a compile:
block so the metric compiler can compute it deterministically (Tier A). This
is what turns a defined metric from "the model writes SQL from the definition"
into "the same number every run." Shape:
compile:
measure: "AVG(Volume)" # aggregate expression over columns of `table`
table: sp500_daily
time_column: Date # optional; enables date filters
grain: day # documentation of what one input row represents
grain_key: [Date] # columns that uniquely identify a row; the fan-out guard
# halts if the table has more rows than distinct grain keys
dimensions: # public name -> column/expression; whitelisted group-bys
year: "extract(year from Date)"
filters: # public name -> WHERE fragment with :params (bound, not interpolated)
year: "extract(year from Date) = :year"
denominator: "SUM(SUM(Volume)) OVER ()" # set only for a ratio
value_bounds: [0, 1] # valid range for a ratio; the guard halts outside it (default [0,1])
requires_columns: [Volume, Date]Set the index entry's compilable: true. If the metric needs a join, a window
over rows, or more than one measure, do NOT add a compile: block; it stays on
the generate-and-validate path, which is correct. Full spec and guards:
helpers/data/metric_compiler.py.
Why this matters: Registering metrics to the knowledge system enables:
## Metric: Checkout Conversion Rate
### Definition
**Plain English:** The percentage of users who visit the checkout page and complete a purchase.
**Formula:** (Users who completed purchase) / (Users who viewed checkout page) × 100
### Components
| Component | Definition | Source |
|-----------|-----------|--------|
| **Numerator** | Distinct users with a `purchase_completed` event within 24h of checkout view | events.event_type = 'purchase_completed' |
| **Denominator** | Distinct users with a `checkout_viewed` event | events.event_type = 'checkout_viewed' |
| **Unit of analysis** | Per user per day (deduplicated — a user counts once even with multiple checkout views) |
### Segmentation Dimensions
| Dimension | Values | Why |
|-----------|--------|-----|
| Device type | mobile, desktop, tablet | Mobile checkout has different UX friction |
| Payment method | credit card, PayPal, Apple Pay | Different failure rates by method |
| New vs returning | first purchase, repeat | Different conversion baselines |
### Data Source
- **Primary table:** analytics.events
- **Key columns:** user_id, event_type, event_timestamp, device_type, properties.payment_method
- **Refresh cadence:** Hourly
- **Latency:** ~2 hours from event to availability
### Guardrails
| Condition | Value | Action |
|-----------|-------|--------|
| **Healthy** | >3.5% | No action |
| **Watch** | 2.5-3.5% | Monitor; check if specific segment is dragging |
| **Investigate** | <2.5% | Root cause within 48h; check payment processor, page load times |
| **Alert** | <1.5% | Immediate escalation; likely a bug or outage |
### Known Limitations
- Does not include guest checkouts (only logged-in users)
- 24h attribution window means some slow purchasers are excluded
- Bot filtering depends on `is_bot` flag accuracy (~95% reliable)## Metric: Monthly Recurring Revenue (MRR)
### Definition
**Plain English:** The total monthly revenue from all active subscriptions, normalized to a monthly rate.
**Formula:** SUM(active_subscriptions × monthly_equivalent_price) as of the last day of the month
### Components
| Component | Definition | Source |
|-----------|-----------|--------|
| **Numerator** | Sum of monthly-equivalent price for all subscriptions with status='active' on the measurement date | subscriptions.price / (billing_interval_months) |
| **Denominator** | N/A (absolute metric, not a ratio) | — |
| **Unit of analysis** | Per month, measured on last calendar day |
### Segmentation Dimensions
| Dimension | Values | Why |
|-----------|--------|-----|
| Plan tier | free, starter, pro, enterprise | Different ARPU and churn dynamics |
| Billing interval | monthly, annual | Annual has lower churn but deferred revenue |
| Cohort month | signup month | Tracks retention and expansion by cohort |
### Guardrails
| Condition | Value | Action |
|-----------|-------|--------|
| **Healthy** | MoM growth >3% | On track for annual targets |
| **Watch** | MoM growth 0-3% | Dig into new vs expansion vs churn components |
| **Investigate** | MoM growth <0% | Net churn exceeding new business — root cause urgently |
### Known Limitations
- Annual subscriptions are divided by 12 for monthly equivalent; actual cash flow differs
- Does not include one-time fees, implementation fees, or overages
- Enterprise custom pricing may lag in system — verify against finance for board reporting## Metric: DAU/MAU Ratio (Stickiness)
### Definition
**Plain English:** The percentage of monthly users who use the product on any given day. Higher = more habitual usage.
**Formula:** (Average daily active users in the month) / (Monthly active users) × 100
### Components
| Component | Definition | Source |
|-----------|-----------|--------|
| **Numerator** | Average of daily distinct users with ≥1 meaningful action, averaged across all days in the month | AVG(daily_active_users) where action ∈ meaningful_actions |
| **Denominator** | Distinct users with ≥1 meaningful action in the entire month | COUNT(DISTINCT user_id) for the month |
| **Unit of analysis** | Per month |
### Segmentation Dimensions
| Dimension | Values | Why |
|-----------|--------|-----|
| User tenure | <30d, 30-90d, 90-365d, >365d | New users have different patterns |
| Plan tier | free, paid | Paid users should be stickier |
| Platform | web, iOS, Android | Mobile tends to be stickier |
### Guardrails
| Condition | Value | Action |
|-----------|-------|--------|
| **Healthy** | >25% | Strong daily habit (comparable to social apps) |
| **Watch** | 15-25% | Typical for B2B SaaS; look for improvement opportunities |
| **Investigate** | <15% | Weak daily habit; investigate activation and feature adoption |
### Known Limitations
- "Meaningful action" definition matters enormously — login alone should NOT count
- Weekday/weekend patterns affect daily averages; consider business-day-only variant for B2B
- Bots and automated API calls must be excluded or this metric is inflated## Metric: Revenue
### Definition
**Plain English:** Total revenue from completed orders in a period.
**Formula:** COUNT(orders) × AVG(order_value)
### Components
| Component | Definition | Source |
|-----------|-----------|--------|
| **Numerator** | Sum of total_amount for orders with status='completed' | orders.total_amount WHERE status='completed' |
| **Denominator** | N/A (absolute metric) | — |
| **Unit of analysis** | Per month |
### Driver Decomposition
**Decomposition type:** Multiplicative
Revenue = Active Users × Orders per User × Average Order Value
| Driver | Formula | Relationship | Data Source |
|--------|---------|-------------|-------------|
| Active Users | COUNT(DISTINCT user_id) with ≥1 order in period | × | orders.user_id |
| Orders per User | COUNT(orders) / COUNT(DISTINCT user_id) | × | orders |
| Average Order Value | SUM(total_amount) / COUNT(orders) | × | orders.total_amount |
**Diagnostic rule:** If Revenue drops, check these drivers in order:
1. Active Users — did fewer users place orders? (acquisition or retention problem)
2. Orders per User — did users buy less frequently? (engagement or value problem)
3. Average Order Value — did users spend less per order? (pricing, mix shift, or promo problem)
**Verification:** Revenue = Active Users × Orders per User × AOVUse these canonical SQL patterns when computing standard metrics. Replace {schema} with the active dataset schema (e.g., your_dataset).
-- Conversion rate: % of users who performed action B after action A
SELECT
COUNT(DISTINCT CASE WHEN b.user_id IS NOT NULL THEN a.user_id END) * 1.0
/ NULLIF(COUNT(DISTINCT a.user_id), 0) AS conversion_rate
FROM {schema}.events a
LEFT JOIN {schema}.events b
ON a.user_id = b.user_id
AND b.event_type = '{{TARGET_EVENT}}'
AND b.timestamp >= a.timestamp
AND b.timestamp <= a.timestamp + INTERVAL '{{WINDOW}}'
WHERE a.event_type = '{{SOURCE_EVENT}}'
AND a.timestamp BETWEEN '{{START_DATE}}' AND '{{END_DATE}}';-- Total revenue and order count for a period
SELECT
COUNT(DISTINCT order_id) AS total_orders,
SUM(total_amount) AS total_revenue,
AVG(total_amount) AS avg_order_value,
COUNT(DISTINCT user_id) AS purchasing_users
FROM {schema}.orders
WHERE status = 'completed'
AND order_date BETWEEN '{{START_DATE}}' AND '{{END_DATE}}';-- Daily/Weekly/Monthly active users
SELECT
DATE_TRUNC('{{GRANULARITY}}', timestamp) AS period,
COUNT(DISTINCT user_id) AS active_users
FROM {schema}.events
WHERE event_type IN ({{QUALIFYING_EVENTS}})
AND timestamp BETWEEN '{{START_DATE}}' AND '{{END_DATE}}'
GROUP BY 1
ORDER BY 1;-- Cohort retention: % of users active in period N after signup
WITH cohorts AS (
SELECT
user_id,
DATE_TRUNC('{{GRANULARITY}}', signup_date) AS cohort
FROM {schema}.users
),
activity AS (
SELECT DISTINCT
user_id,
DATE_TRUNC('{{GRANULARITY}}', timestamp) AS active_period
FROM {schema}.events
)
SELECT
c.cohort,
DATE_DIFF('{{GRANULARITY}}', c.cohort, a.active_period) AS period_number,
COUNT(DISTINCT a.user_id) * 1.0
/ NULLIF(COUNT(DISTINCT c.user_id), 0) AS retention_rate
FROM cohorts c
LEFT JOIN activity a ON c.user_id = a.user_id
GROUP BY 1, 2
ORDER BY 1, 2;-- Net Promoter Score: % promoters - % detractors
SELECT
COUNT(CASE WHEN score >= 9 THEN 1 END) * 100.0 / NULLIF(COUNT(*), 0)
- COUNT(CASE WHEN score <= 6 THEN 1 END) * 100.0 / NULLIF(COUNT(*), 0) AS nps,
COUNT(CASE WHEN score >= 9 THEN 1 END) AS promoters,
COUNT(CASE WHEN score BETWEEN 7 AND 8 THEN 1 END) AS passives,
COUNT(CASE WHEN score <= 6 THEN 1 END) AS detractors,
COUNT(*) AS total_responses
FROM {schema}.nps_responses
WHERE submitted_at BETWEEN '{{START_DATE}}' AND '{{END_DATE}}';Usage notes:
{schema} with the active dataset's schema prefix{{VARIABLE}} placeholders with actual values for the analysis© ai-analyst-lab, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
Just SKILL.md in .claude/skills/metric-spec of ai-analyst-lab/ai-analyst.
Open the folder on GitHubat commit 52c0744
Metric Spec 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.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Metric Spec this skillai-analyst-lab/ai-analyst | 304 | — | ~4.9k | Automated safety check: Pass | MIT | |
| Swarmaglitch-rabin/swarma | 173 | — | ~4.4k | Automated safety check: Notes | MIT | |
| Prdjuanandresgs/claude-ctrl | 193 | — | ~2.9k | Automated safety check: Pass | None | |
| AI Product Strategy InterviewerPrepLabsAI/InterviewMentor | 112 | — | ~4.5k | Automated safety check: Pass | MIT | |
| Investigate MetricPostHog/posthog | 40k | — | ~1.9k | Automated safety check: Pass | Custom licence | |
| Weekly Creative Reportreal-simple-labs/parker-brain | 102 | — | ~4.7k | Automated safety check: Pass | Custom licence |
glitch-rabin/swarma
Agent teams that run growth experiments and build their own playbook.
juanandresgs/claude-ctrl
Write structured feature specifications with problem statements, user journeys, use cases, functional requirements, and success metrics.
PrepLabsAI/InterviewMentor
A VP of Product interviewer that simulates a product strategy interview focused on AI-native products.
PostHog/posthog
Diagnose why a product metric changed (dropped, spiked, or plateaued) by orchestrating breakdowns, actors, paths, lifecycle, retention, and annotations queries.
real-simple-labs/parker-brain
Build the brand's weekly creative report, a polished, shareable page an agency can send straight to the brand's CMO and team.
andreaskelm/pm-brain
Define, sharpen, or audit a North Star metric and its input metrics tree, and decide which product metrics actually matter (leading vs.
ai-analyst-lab/ai-analyst
Never present a metric or number in isolation; anchor every number to a comparison (prior period, benchmark, or another segment) or state that none is available.
ai-analyst-lab/ai-analyst
Retrieve proven SQL patterns, table cheatsheets, and join patterns from .knowledge/query-archaeology/ so past work gets reused.
ai-analyst-lab/ai-analyst
Save completed analyses to the knowledge system's analysis archive for future reference.
ai-analyst-lab/ai-analyst
Verify Google Workspace MCP authentication at the start of any session that needs Google APIs (Docs, Slides, Drive).
ai-analyst-lab/ai-analyst
Causal inference toolkit for when experiments are not possible: estimate treatment effects from observational data with assumption checks and mandatory caveats.
ai-analyst-lab/ai-analyst
Standardized workflow for uploading local chart PNGs to Google Drive and making them available for insertion into Google Docs and Slides.
Categories
Define any metric completely with a standardized template: calculation, denominator, time window, filters, interpretation. Metric Spec is an agent skill from ai-analyst-lab/ai-analyst. Define any metric completely with a standardized template: calculation, denominator, time window, filters, interpretation.
Metric Spec fits situations like: define this metric; how should we measure X?; whats the right way to calculate Y?; document our metrics.
Run `npx skills add ai-analyst-lab/ai-analyst --skill metric-spec -a claude-code`. Or copy the skill folder (.claude/skills/metric-spec in ai-analyst-lab/ai-analyst) into .claude/skills/metric-spec in your project. Claude Code loads it when a task matches its description.
Run `npx skills add ai-analyst-lab/ai-analyst --skill metric-spec -a codex`. Or copy the skill folder (.claude/skills/metric-spec in ai-analyst-lab/ai-analyst) into .agents/skills/metric-spec in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add ai-analyst-lab/ai-analyst --skill metric-spec -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/metric-spec, .gemini/skills/metric-spec, .github/skills/metric-spec and .opencode/skills/metric-spec in your project.
SKILL.md names no scripts, command-line tools or credentials: Metric Spec is instructions for the agent only.
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.
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.
Metric Spec is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
About 4.9k tokens (SKILL.md is roughly 20k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.
Skills that share tags, products or a category with Metric Spec: Swarma (glitch-rabin/swarma, 173 stars), Prd (juanandresgs/claude-ctrl, 193 stars), AI Product Strategy Interviewer (PrepLabsAI/InterviewMentor, 112 stars) and Investigate Metric (PostHog/posthog, 40k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
ai-analyst-lab (a GitHub organization) maintains it in ai-analyst-lab/ai-analyst, which has 304 GitHub stars. The repository holds 43 skills in this directory. The repository was last updated on September 30, 2026.
Source: ai-analyst-lab/ai-analyst on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.