Agent skill

Create Metric

by harness in harness/harness-skills

Create a Harness FME metric: helps decide what to measure, suggests candidate metrics from application code, resolves traffic type and event type IDs, drafts the payload, then creates.

Apache-2.0Auto-check passed

Install Create Metric

skills CLI
$ npx skills add harness/harness-skills --skill create-metric -a claude-code

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

GitHub CLI
$ gh skill install harness/harness-skills create-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/harness/harness-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/create-metric .claude/skills/create-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
create-metric
GitHub stars
115
Token cost
~3.4k tokens
SKILL.md length
1,586 words
Files
3 (incl. references)
Skills in repo
24
Repo updated
First seen
Licence
Apache-2.0

At a glance

Create a Harness FME metric: helps decide what to measure, suggests candidate metrics from application code, resolves traffic type and event type IDs, drafts the payload, then creates.

  • Works in 12 steps: Establish scope → Understand the intent → Check for an existing metric first → …
  • Phrases: create/define a metric
  • SKILL.md covers Tools, Instructions, Examples and Performance Notes, plus 1 more section
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Create Metric is an agent skill from harness/harness-skills. Create a Harness FME metric: helps decide what to measure, suggests candidate metrics from application code, resolves traffic type and event type IDs, drafts the payload, then creates. Doesn't attach metrics to experiments (manage-experiments) or add the tracking call (instrument-metric). Trigger phrases: create/define a metric, new metric, what metrics should we create, suggest metrics.

Its SKILL.md is about 3.4k tokens, which your agent loads only when the skill is triggered. The skill folder holds 3 other files, including reference files (for example `references/retry-and-troubleshooting.md` and `references/stop-conditions.md`). Compatibility notes: Requires the Harness MCP server or the Harness CLI

It works with Model Context Protocol. The repository describes itself as: A collection of structured AI agent skills that enable Claude Code, Cursor, GitHub Copilot, and other AI coding assistants to create, operate, debug, and govern Harness CI/CD… The licence is Apache-2.0.

When your agent uses it

  • Phrases: create/define a metric
  • What metrics should we create
  • Suggest metrics

Example prompts

  • “/create-metric”

Requirements

  • Compatibility (from SKILL.md): Requires the Harness MCP server or the Harness CLI

Workflow steps

12 steps, taken from the step headings in SKILL.md.

  1. Establish scope
  2. Understand the intent
  3. Check for an existing metric first
  4. Resolve trafficType
  5. Resolve baseEventTypes[].eventTypeId
  6. Decide aggregation, format, isPositive
  7. Name, description, and owners
  8. Optional fields
  9. Draft and confirm
  10. Create
  11. Verify
  12. Hand off if needed

What it can do on your machine

Read from SKILL.md and the folder at commit c25faee. 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.

    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.

  • Compatibility

    Requires the Harness MCP server or the Harness CLI

    From compatibility in the SKILL.md frontmatter.

Context cost

Create Metric loads about 3.4k tokens when it runs, and up to ~5.4k if it reads all its reference files. Until then it costs about 101 tokens; SKILL.md has 1,586 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~101
When it runs · the whole SKILL.md, loaded when a task matches
~3.4k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~5.4k

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 harness/harness-skills at commit c25faee, republished under its Apache-2.0 licence (© harness). 1,586 words, ~3,391 tokens.

Download SKILL.mdSave it as .claude/skills/create-metric/SKILL.md (or your agent's skills folder). This skill also uses 2 other files; get the full folder from GitHub.
name
create-metric
description
Create a Harness FME metric: helps decide what to measure, suggests candidate metrics from application code, resolves traffic type and event type IDs, drafts the payload, then creates. Doesn't attach metrics to experiments (manage-experiments) or add the tracking call (instrument-metric). Trigger phrases: create/define a metric, new metric, what metrics should we create, suggest metrics.
compatibility
Requires the Harness MCP server or the Harness CLI
metadata.author
Harness
metadata.version
1.4.1
metadata.mcp-server
harness-mcp
license
Apache-2.0

Create Metric

Create an FME metric definition, with guidance on what makes a good metric and what to measure. Resolves traffic types and events against real data and asks the user to select an owner instead of guessing IDs. Owner existence is validated by the API on creation/readback; the declared tools do not provide an owner-directory lookup. Design guidance lives in metric-design.md. Related: /manage-experiments attaches metrics; /instrument-metric adds tracking calls.

For every phase marked Stop condition, see stop-conditions.md before improvising.

Tools

Works through the Harness MCP server or the Harness CLI; names are from tool-map.md.

OperationMCPCLI
List metricsharness_list · fme_metric · filters: { name?, traffic_type_id?, limit } · compact: falseharness list metric --name <substring> --traffic-type-id <id> --json
List traffic typesharness_list · fme_traffic_type · compact: falseharness list traffic_type --json
List event typesharness_list · fme_event_type · filters: { traffic_type?, name? } · compact: falseharness list event_type --traffic-type <name or id> --name <substring> --json
Get event typeharness_get · fme_event_type · params: { event_type_id }harness get event_type <event-name> --json
Create metricharness_create · fme_metric · body: { name, trafficType, format, aggregation, isPositive, baseEventTypes, owners, description?, filterEventType?, triggerEventType?, cap?, tags? }harness create metric <name> -f metric.json --json (file holds the full confirmed payload, including owners and any nested filterEventType/triggerEventType/cap objects — same fields as the MCP body)
Get metricharness_get · fme_metric · params: { metric_id }harness get metric <id> --json
Delete metricharness_delete · fme_metric · params: { metric_id }harness delete metric <id>

Instructions

Phase 1: Establish scope

See scope-establishment.md. Confirm organization and project before any list or get operation — this is the Harness org/project, independent of the local application repo's name or git remote; never infer scope from the repo you're reading code in. If /choose-metric already ran and found no suitable metric, reuse its context (hypothesis, traffic type).

Phase 2: Understand the intent

What decision does the metric support (experiment primary / guardrail / supporting, or rollout monitoring)? What should change in which direction? Reuse /choose-metric context if it ran. If the user doesn't know what to measure or asks for suggestions, run Suggest metrics from code, show the coverage table, and let them pick one metric per pass. Pick the shape by asking the plain questions from Intent to configuration ("how many times?", "did they at least once?", "how much / how long?"), not by asking for aggregation names.

Phase 3: Check for an existing metric first

List metrics with full definitions, narrowed by name substring and traffic type if known — you need aggregation and baseEventTypes to judge duplicates. Read naming and tag conventions from this list. The backend returns 409 for a duplicate name or duplicate definition (same attribute combination under a different name). Catching this early saves a round trip. Check for auto-created - Split Agents metrics before creating a latency or error metric. If something close exists, confirm a new metric is actually needed rather than reusing/updating the existing one.

Stop condition if the request is vague (e.g. "track checkouts" with no aggregation specified) — see Ambiguous metric intent.

Phase 4: Resolve trafficType

List traffic types and use the traffic type name (immutable after creation, like name itself). Don't ask the user for an ID — resolve it from this list.

Phase 5: Resolve baseEventTypes[].eventTypeId

List event types narrowed by traffic type and event name if the user named one. The event name filter is a case-insensitive substring match; the traffic type filter accepts an ID or exact name, not a substring. Check pagination before treating a list as complete; use Get event type for an agreed exact name and verify the returned trafficTypes includes the intended type. Note: RUM/integration events may flow with no track() in code.

Stop condition if the event isn't in this list, or if several events match and none is an exact match for what the user said — a substring search on a word like purchase routinely returns a dozen variants, so present the real ones and ask instead of picking the shortest or cleanest-looking name. Don't invent an ID and don't silently substitute the closest-looking real event; see Missing or ambiguous event. If instrumentation is needed, settle the aggregation/value contract and applicable property filters below before handing off. Pass scope, environment, exact event name, traffic type, units, value source and required properties; resume here with that same contract plus code-test and delivery evidence, not just a success claim.

Phase 6: Decide aggregation, format, isPositive

Start from the matching row in the intent table. Key details:

  • aggregation: COUNT, TOTAL, AVERAGE, RATE — see intent table for which fits.
  • spread: not part of create body — every new metric is PER. Don't include it.
  • format: NUMBER, DOLLAR, PERCENTAGE, SECONDS, MILLISECONDS, BYTES. RATE+PER coerces to PERCENTAGE.
  • isPositive: true if increase is good. Drives significance-direction interpretation.
  • baseEventTypes[].propertyForValue: for TOTAL/AVERAGE, the value can come from a named property on the event instead of the numeric track() value argument — set this when the user says the value lives in a property (e.g. order_total) rather than being passed positionally.
  • Cap recommended for TOTAL/AVERAGE on unbounded values (revenue, durations) — reduces noise from heavy users.

This is the event contract (trafficType, aggregation, value units, value-vs-propertyForValue, and any required properties) that /instrument-metric must match exactly — if the event isn't instrumented yet, settle this contract now so the tracking call isn't written against a guess.

Phase 7: Name, description, and owners
  • name: must match ^[A-Za-z][-_A-Za-z0-9]*$, max 100 chars, immutable. No spaces — if the user gives a human title, derive a valid name and confirm. Follow observed naming convention from Phase 3.
  • description: what is counted, where event fires, which direction is good.
  • owners: required; {type: "USER", email} or {type: "GROUP", identifier} (group's id field, not display name).

Stop condition if no owner was specified, or one turns out to be invalid — see Missing or invalid owner. Don't claim the owner was directory-verified without an actual lookup.

Show full SKILL.md (637 more words)Show less
Phase 8: Optional fields
  • filterEventType — {eventTypeId, filterAggregation, propertyFilters}, resolved the same way as Phase 5. Two uses, selected by filterAggregation:
    • "RATE" — HAS_DONE filter: only count units that did this event.
    • "COUNT" with aggregation: COUNT — ratio metric ("ratio of two events per unit"): baseEventTypes is the numerator, filterEventType the denominator.
  • triggerEventType — {eventTypeId}, resolved the same way as Phase 5. Before/trigger relationship (HAS_DONE_BEFORE): only count units that did this event before the base event. Use this when the user asks for "only count users who did X before Y", "prior to", or "as a trigger" — don't substitute a plain filterEventType (HAS_DONE, no ordering), since it drops the ordering constraint.

Stop condition if the request is ambiguous between a plain "has done" filter and a before/trigger relationship — see Filter versus ordered trigger.

  • cap — outlier capping; 7 sub-fields (baseEventCountCap, baseEventSumCap, baseEventValueCap, filterEventCountCap, filterEventSumCap, filterEventValueCap, metricValueCap, all default 0 = no cap) plus granularity (MINUTES|HOURS|DAYS|WEEKS, default DAYS) — the time window each cap value is evaluated over. Only the cap field matching the metric's aggregation has any effect — don't set others; ask which cap the user wants if they mention capping without specifying.
  • tags — send each entry as {name: "..."}.
Phase 9: Draft and confirm

Present the full payload before calling anything:

name: <name>
trafficType: <name>
format: <FORMAT>
aggregation: <AGGREGATION>
isPositive: <true|false>
baseEventTypes: [{ eventTypeId: <resolved id>, propertyForValue: null, propertyFilters: [] }]
owners: [{ type: "USER", email: <email> }]
description: <optional>
# + filterEventType / triggerEventType / cap / tags if applicable

Replace the template's property fields with the confirmed value property and filters when used; otherwise include propertyForValue: null and propertyFilters: [] explicitly on each base event for CLI/MCP parity. Write the full approved body as JSON/YAML for CLI -f, or pass it as MCP body; don't combine a file with --set/--add expecting a merge.

Quality check (outside the payload, not part of the body sent to the API): [warnings from good-metric checklist that fail — e.g. no cap on revenue, direction unclear, event not flowing]

STOP HERE. Do not call Create yet. Wait for the user to explicitly confirm the draft.

Phase 10: Create

Create metric with the confirmed payload. See write-safety.md for the confirmation protocol.

On a 409, go back to Phase 9 — every single time, not just the first attempt — and name the specific conflicting metric before drafting a revision. Full protocol: retry-and-troubleshooting.md.

Phase 11: Verify

Get metric using the literal id string from the create response (don't retype it). Read back every field against the confirmed Phase 9 draft, not just format/aggregation: name, trafficType, every event reference (baseEventTypes, and filterEventType/triggerEventType if set — including their propertyForValue/propertyFilters/filterAggregation), aggregation/format/isPositive (direction), owners, cap, tags. Account for documented defaults/normalization (such as omitted cap fields becoming zero). Report any substantive mismatch; don't silently update the metric to fix it. If format was coerced (Phase 6), tell the user. If the response includes a UI link, share that exact link — never construct or guess one. Never report a create as successful without this get succeeding.

Phase 12: Hand off if needed

Creating the metric does not attach it to anything. If this was for an experiment, tell the user the metric ID and that attaching it (via the experiment's keyMetrics / supportingMetrics) is a separate step — /manage-experiments handles attachment; /choose-metric covers which list it belongs in.

Examples

  • "What metrics could we create for checkout?" — Phase 2 code suggestions via coverage table; user picks; resolve, draft, create.
  • "Track average page load time" — Phase 3 checks for auto-created Average Page Load Time - Split Agents metric first; reuse if present.
  • "Create a metric for checkout conversion rate" — resolve traffic type + event, aggregation: RATE, draft, confirm, create.
  • "Add a revenue metric based on the purchase_completed event" — Phase 5 resolves purchase_completed; aggregation: TOTAL, format: DOLLAR.

Performance Notes

  • Resolve traffic type and event type once, not per field.
  • If a create 400s, List metrics by name before retrying — a rejected create can still leave a persisted metric, so don't assume a 400 means nothing happened.
  • Check for metric usage before delete: see tool-map.md.

Troubleshooting

See retry-and-troubleshooting.md for: 409s, 400s, anti-patterns table, owner validation, name pattern failures.

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

Files

SKILL.md and 2 other files (references) in skills/create-metric of harness/harness-skills.

  • SKILL.md
  • references/retry-and-troubleshooting.md
  • references/stop-conditions.md

Open the folder on GitHubat commit c25faee

Compare with similar skills

Create 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.

Create Metric compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Create Metric this skillharness/harness-skills115—~3.4kAutomated safety check: PassApache-2.0
MCP Server Builderanthropics/skills180k64 repos~2.3kAutomated safety check: PassApache-2.0
MCP Server BuildershareAI-lab/learn-claude-code78k5 repos~1.2kAutomated safety check: PassMIT
MCP Integration for Pluginsanthropics/claude-plugins-official38k11 repos~3.1kAutomated safety check: PassApache-2.0
Figma use_figma Plugin API Ruleswarpdotdev/warp65k4 repos~4.4kAutomated safety check: PassAGPL-3.0
Stitch to Remotion Walkthrough Videosgoogle-labs-code/stitch-skills8.4k6 repos~3.2kAutomated safety check: NotesApache-2.0

Similar skills

  • MCP Server Builder

    anthropics/skills

    Official

    Guides the design and implementation of Model Context Protocol servers in TypeScript or Python, from tool naming and error messages to evaluation.

    180k GitHub starsUsed in 64 repos~2.3k tokens
    Agent WorkflowsAuto-check passed
  • MCP Server Builder

    shareAI-lab/learn-claude-code

    Walks through building MCP servers in Python or TypeScript that expose tools, resources and prompts to Claude, with templates, registration and testing.

    78k GitHub starsUsed in 5 repos~1.2k tokens
    Agent WorkflowsAuto-check passed
  • MCP Integration for Plugins

    anthropics/claude-plugins-official

    Official

    Explains how to bundle Model Context Protocol servers in a Claude Code plugin, covering config files, stdio, SSE, HTTP and WebSocket server types, and authentication.

    38k GitHub starsUsed in 11 repos~3.1k tokens
    Agent WorkflowsAuto-check passed
  • Required groundwork before any use_figma call: the rules and reference files for running JavaScript in a Figma file through the Plugin API without common failures.

    65k GitHub starsUsed in 4 repos~4.4k tokens
    Frontend & DesignAuto-check passed
  • Stitch to Remotion Walkthrough Videos

    google-labs-code/stitch-skills

    Official

    Builds walkthrough videos from Stitch design projects using Remotion, with transitions, zoom effects and text overlays on each screen.

    8.4k GitHub starsUsed in 6 repos~3.2k tokens
    Media & CreativeAuto-check: notes
  • MCP Development

    coollabsio/coolify

    A skill your agent uses for Laravel MCP development. An agent skill from coollabsio/coolify.

    63k GitHub starsUsed in 1 repo~949 tokens
    Frontend & DesignAuto-check passed

More from harness/harness-skills

All 24 skills in this repo
  • Audit Report

    harness/harness-skills

    Generate audit reports and compliance trails using Harness audit trail data via MCP v2 tools.

    115 GitHub stars~1.3k tokensUpdated 2 days ago
    Auto-check passed
  • Chaos Dr Test

    harness/harness-skills

    A skill your agent uses when working with Chaos Engineering steps inside a Harness pipeline.

    115 GitHub stars~2.6k tokensUpdated 2 days ago
    Auto-check passed
  • Chaos Experiment

    harness/harness-skills

    A skill your agent uses when the user asks to create, edit, update, design, or configure a Harness Chaos Experiment — including faults, probes, actions, experiment YAML, fault injection, pod-delete…

    115 GitHub stars~1.6k tokensUpdated 2 days ago
    Auto-check passed
  • Cleanup Feature Flags

    harness/harness-skills

    Remove a launched Harness FME feature flag from application code, keeping the treatment FME serves today, and open a pull request.

    115 GitHub stars~2.4k tokensUpdated 2 days ago
    Auto-check passed
  • Configure Repo Scan

    harness/harness-skills

    Configure code scanning in Harness pipelines using STO security scanners.

    115 GitHub stars~2.2k tokensUpdated 2 days ago
    Auto-check passed
  • Create Agent Template

    harness/harness-skills

    Generate Harness Agent Template files for AI-powered automation agents.

    115 GitHub stars~2.2k tokensUpdated 2 days ago
    Auto-check passed

Questions about Create Metric

What does Create Metric do?

Create a Harness FME metric: helps decide what to measure, suggests candidate metrics from application code, resolves traffic type and event type IDs, drafts the payload, then creates. Create Metric is an agent skill from harness/harness-skills. Create a Harness FME metric: helps decide what to measure, suggests candidate metrics from application code, resolves traffic type and event type IDs, drafts the payload, then creates.

When should I use Create Metric?

Create Metric fits situations like: phrases: create/define a metric; what metrics should we create; suggest metrics.

How do I install Create Metric in Claude Code?

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

How do I install Create Metric in Codex?

Run `npx skills add harness/harness-skills --skill create-metric -a codex`. Or copy the skill folder (skills/create-metric in harness/harness-skills) into .agents/skills/create-metric in your project. Codex loads it when a task matches its description.

Can I use Create 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 harness/harness-skills --skill create-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/create-metric, .gemini/skills/create-metric, .github/skills/create-metric and .opencode/skills/create-metric in your project.

What does Create Metric need to run?

SKILL.md names no scripts, command-line tools or credentials: Create Metric is instructions for the agent only. Compatibility (from SKILL.md): Requires the Harness MCP server or the Harness CLI.

Does Create 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 Create 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 Create Metric use?

Create Metric is published under the Apache-2.0 licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Create Metric use?

About 3.4k tokens (SKILL.md is roughly 14k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 2k tokens, read only when the agent opens those files.

What are the alternatives to Create Metric?

Skills that share tags, products or a category with Create Metric: MCP Server Builder (anthropics/skills, 180k stars), MCP Server Builder (shareAI-lab/learn-claude-code, 78k stars), MCP Integration for Plugins (anthropics/claude-plugins-official, 38k stars) and Figma use_figma Plugin API Rules (warpdotdev/warp, 65k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Create Metric?

harness (a GitHub organization) maintains it in harness/harness-skills, which has 115 GitHub stars. The repository holds 24 skills in this directory. The repository was last updated on October 6, 2026.

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