harness-metrics

harness-metrics is a command for Claude Code from hahaxiang27/FlowHarness. It costs 28 tokens per session (928 once invoked), scanned A, original, MIT.

A reporting command that calculates five groups of Sprint measures from progress files and creates a health report. A Sprint is a fixed period of development work.

In plain words
What is it for?
Use it to generate a report for one Sprint or compare several Sprints, including health indicators, trends, blocked work, and improvement suggestions.
Why use it?
It turns scattered progress information into figures about rule compliance, information coverage, verification, repairs, and delivery efficiency.

Command for Claude Code

Written for Claude Code: $ARGUMENTS substitution.

Good fit Use it to generate a report for one Sprint or compare several Sprints, including health indicators, trends, blocked work, and improvement suggestions.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/hahaxiang27/flowharness/harness.metrics
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/hahaxiang27/FlowHarness

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for harness-metrics

README.md
[![agentmods](https://agentmods.dev/badge/commands/hahaxiang27/flowharness/harness.metrics/github.svg)](https://agentmods.dev/commands/hahaxiang27/flowharness/harness.metrics)
Your own site
<a href="https://agentmods.dev/commands/hahaxiang27/flowharness/harness.metrics"><img src="https://agentmods.dev/badge/commands/hahaxiang27/flowharness/harness.metrics/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for harness-metrics

Your own site · 80×15
<a href="https://agentmods.dev/commands/hahaxiang27/flowharness/harness.metrics"><img src="https://agentmods.dev/badge/commands/hahaxiang27/flowharness/harness.metrics.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 28 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 928 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00028 $0.00928
Opus 5 $0.00014 $0.00464
Sonnet 5 $0.00006 $0.00186
Haiku 4.5 $0.00003 $0.00093

Measured 10d ago against content hash 345e60258d32, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

harness-metrics scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 10d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

commands/harness.metrics.md · 93 lines

How it starts

The opening of the file, as written. The whole thing — 93 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Harness Sprint 度量报告

上下文管理: 🔄 清空上下文 — 使用子代理执行,纯粹基于进度文件生成数据

指令

生成当前 Sprint 的五维度量报告。

输入参数

$ARGUMENTS — 可选:

  • Sprint 编号(如 "1")
  • "trend" — 生成跨 Sprint 趋势分析

执行步骤

使用 Agent 工具启动子代理,传入以下任务:

你是 Harness 度量分析师。基于进度数据生成度量报告。

1. 读取 `.harness/sprints/sprint-{N}-progress.md`
2. 读取 `.harness/prompts/metrics.md` 了解度量指标定义和计算公式
3. 基于进度文件中的数据,计算五维度量:
   - 约束层: 硬/软约束违反次数、约束遵守率
   - 信息层: 契约覆盖率、模型覆盖率、模板使用率
   - 验证层: 首次通过率、验证分数、E2E通过率
   - 修正层: 修正收敛率、平均轮次、人工介入次数
   - 执行质量: Sprint完成率、平均任务耗时、有效代码率
4. 生成健康度仪表盘(🟢/🟡/🔴)
5. 提出 Top 3 改进建议

输出:
a. 终端显示度量摘要
b. 写入完整报告到 `.harness/metrics/sprint-{N}.json`

如果参数为 "trend":
a. 读取 .harness/metrics/ 下所有 sprint-*.json
b. 生成跨 Sprint 趋势对比表
c. 识别改善和恶化的指标
d. 输出预测和建议

Dashboard 观测面板更新

metrics 完成后,按 .harness/prompts/dashboard-updater.md 中 Step 17 规则更新 specs/{feature}/dashboard.html

  • 填充 #panel-metrics 面板:五维健康度色块 + 统计数字卡片(3x2)+ 全部阻塞项列表 + Top 3 改进建议 + Sprint 评级
  • metrics 节点侧边栏状态改为 done + ok,同时更新 .topbar 中的评级

Memory 更新

如果本次 Sprint 暴露出可复用模式、踩坑、评审反馈或团队规则变化,直接更新 .ai-dev/context/ 下的对应文件:

  • .ai-dev/context/mistakes.md
  • .ai-dev/context/known-patterns.md
  • .ai-dev/context/review-feedback.md
  • .ai-dev/context/reusable-patterns.md
  • .ai-dev/context/team-rules.md

SDD Step Gate

When specs/{REQUIREMENT_ID}/dashboard-state.json exists (SDD workflow active), after this command completes follow .harness/prompts/command-step-gate.md:

  1. Update dashboard-state.json and dashboard.html when applicable.
  2. Mark this command done, next step next, workflow_plan.phase = awaiting_user.
  3. Stop immediately - do not chain the next internal command in the same turn.
  4. Hand off with .harness/prompts/step-gate-handoff.md.

Skip only for standalone invocation without dashboard state, or when the user explicitly asks to batch remaining steps.

Requirement Artifact Path Convention

For a requirement id {REQUIREMENT_ID}, keep all delivery artifacts bucketed by that id:

Read the full file on GitHub · 93 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 10d ago First seen · 93 lines · 28 tokens per session scan A 345e60258d32

Subscribe to this mod's changes

harness-metrics is a command published in the GitHub repository hahaxiang27/FlowHarness (4 stars, last pushed 2mo ago), licensed MIT. It adds 28 tokens to every session and 928 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.