add-metric
Add a new calculated metric to the VSM dashboard with test-first development
Best use case
add-metric is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Add a new calculated metric to the VSM dashboard with test-first development
Teams using add-metric should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/add-metric/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How add-metric Compares
| Feature / Agent | add-metric | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Add a new calculated metric to the VSM dashboard with test-first development
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
# Skill: Add New Metric
Add a new calculated metric to the VSM dashboard.
## Usage
```
/add-metric <MetricName>
```
## Prerequisites
Create a feature file first using `/new-feature` that describes:
- What the metric measures
- How it's calculated (from user perspective)
- What values indicate good/warning/critical status
## Process
1. **Feature file** - Define metric behavior in Gherkin
2. **Review** - Get approval on the metric definition
3. **Step definitions** - Write failing acceptance tests
4. **Implementation** - Build the metric
## Example Feature File
```gherkin
Feature: Flow Efficiency Metric
As a team lead
I want to see flow efficiency percentage
So that I understand how much time is spent on actual work vs waiting
Scenario: Display flow efficiency for a value stream
Given a value stream with the following steps:
| name | processTime | leadTime |
| Development | 60 | 240 |
| Testing | 30 | 120 |
| Deployment | 10 | 40 |
When I view the metrics dashboard
Then I should see flow efficiency of "25%"
Scenario: Flag low flow efficiency as warning
Given a value stream with flow efficiency below 15%
When I view the metrics dashboard
Then the flow efficiency card should show warning status
Scenario: Handle empty value stream
Given an empty value stream map
When I view the metrics dashboard
Then flow efficiency should show "N/A"
```
## Implementation Steps
1. Implement calculation logic in `src/utils/calculations/{metric}.js`
2. Add to the metrics store selector in `src/stores/metricsStore.js`
3. Create dashboard card in `src/components/metrics/{MetricName}Card.jsx`
4. Add educational tooltip explaining the metric
5. Write unit tests for the calculation
## Calculation Pattern
```javascript
// src/utils/calculations/{metric}.js
/**
* Calculate {MetricName} for a value stream map
* @param {Object} vsm - The value stream map
* @returns {Object} - The metric result
*/
export function calculate{MetricName}(vsm) {
if (!vsm.steps || vsm.steps.length === 0) {
return {
value: null,
unit: '%',
status: 'neutral',
displayValue: 'N/A'
};
}
// Perform calculation
const value = /* calculation */;
// Determine status based on thresholds
let status;
if (value > 0.25) {
status = 'good';
} else if (value > 0.15) {
status = 'warning';
} else {
status = 'critical';
}
return {
value,
unit: '%',
status,
displayValue: `${(value * 100).toFixed(0)}%`
};
}
```
## Dashboard Card Pattern
```jsx
// src/components/metrics/{MetricName}Card.jsx
import PropTypes from 'prop-types';
import { useMetricsStore } from '../../stores/metricsStore';
import MetricTooltip from '../ui/MetricTooltip';
function {MetricName}Card() {
const metric = useMetricsStore((state) => state.{metricName});
const statusClasses = {
good: 'bg-green-50 border-green-200 text-green-800',
warning: 'bg-amber-50 border-amber-200 text-amber-800',
critical: 'bg-red-50 border-red-200 text-red-800',
neutral: 'bg-gray-50 border-gray-200 text-gray-800'
};
return (
<div
className={`metric-card border rounded-lg p-4 ${statusClasses[metric.status]}`}
data-testid="{metric-name}-card"
data-status={metric.status}
>
<MetricTooltip term="{MetricName}">
<h3 className="metric-card__title text-sm font-medium">
{MetricName}
</h3>
</MetricTooltip>
<div className="metric-card__value text-2xl font-bold">
{metric.displayValue}
</div>
</div>
);
}
export default {MetricName}Card;
```
## Common VSM Metrics
- **Flow Efficiency**: Process Time / Lead Time
- **Throughput**: Items completed per time period
- **Cycle Time**: End-to-end time for one item
- **WIP**: Current work in progress count
- **Queue Time**: Time spent waiting
- **Rework Rate**: Percentage of items requiring rework
- **First Pass Yield**: Items passing without reworkRelated Skills
adding-new-metric
Guides systematic implementation of new sustainability metrics in OSS Sustain Guard using the plugin-based metric system. Use when adding metric functions to evaluate project health aspects like issue responsiveness, test coverage, or security response time.
whisper-transcribe
Transcribes audio and video files to text using OpenAI's Whisper CLI, enhanced with contextual grounding from local markdown files for improved accuracy.
chrome-debug
This skill empowers AI agents to debug web applications and inspect browser behavior using the Chrome DevTools Protocol (CDP), offering both collaborative (headful) and automated (headless) modes.
ontopo
An AI agent skill to search for Israeli restaurants, check table availability, view menus, and retrieve booking links via the Ontopo platform, acting as an unofficial interface to its data.
lets-go-rss
A lightweight, full-platform RSS subscription manager that aggregates content from YouTube, Vimeo, Behance, Twitter/X, and Chinese platforms like Bilibili, Weibo, and Douyin, featuring deduplication and AI smart classification.
grail-miner
This skill assists in setting up, managing, and optimizing Grail miners on Bittensor Subnet 81, handling tasks like environment configuration, R2 storage, model checkpoint management, and performance tuning.
astro
This skill provides essential Astro framework patterns, focusing on server-side rendering (SSR), static site generation (SSG), middleware, and TypeScript best practices. It helps AI agents implement secure authentication, manage API routes, and debug rendering behaviors within Astro projects.
modal-deployment
Run Python code in the cloud with serverless containers, GPUs, and autoscaling using Modal. This skill enables agents to generate code for deploying ML models, running batch jobs, serving APIs, and scaling compute-intensive workloads.
vly-money
Generate crypto payment links for supported tokens and networks, manage access to X402 payment-protected content, and provide direct access to the vly.money wallet interface.
tech-blog
Generates comprehensive technical blog posts, offering detailed explanations of system internals, architecture, and implementation, either through source code analysis or document-driven research.
ux
This AI agent skill provides comprehensive guidance for creating professional and insightful User Experience (UX) designs, covering user research, information architecture, interaction design, visual guidance, and usability evaluation. It aims to produce actionable, user-centered solutions that avoid generic AI aesthetics.
thor-skills
An entry point and router for AI agents to manage various THOR-related cybersecurity tasks, including running scans, analyzing logs, troubleshooting, and maintenance.