metrics
Collect agent usage metrics from git history and generate health reports. Use when measuring agent adoption, reviewing system health, or producing periodic dashboards.
- License 许可
- MIT
- 最近更新
- 2026-03-11
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- metrics
- model
- claude-haiku-4-5
- agents
- [ "analyst", "devops" ]
- license
- MIT
- metadata
- { "version": "1.0.0" }
- description
- Collect agent usage metrics from git history and generate health reports. Use when measuring agent adoption, reviewing system health, or producing periodic dashboards.
02 资源文件 148
- 其他.build-trigger24 B
- 其他articles/.gitkeep—
- 参考文档articles/27-extreme-celebrity-movie-makeovers-transformations.md5.1 KB
- 参考文档articles/5-best-classical-music-albums-to-stream-right-now.md1.4 KB
- 参考文档articles/affleck-garner-movie-reunion.md4.7 KB
- 参考文档articles/ahsoka-season-2-teaser-jedi-legacy.md4.9 KB
- 参考文档articles/amazon-sampeel-two-piece-set-travel-outfit-quiet-luxury.md6.8 KB
- 参考文档articles/analyzing-prince-harrys-journey-beyond-royal-turmoil-at-the-beyonce-concert.md4.6 KB
- 参考文档articles/anya-taylor-joys-stunning-tiffany-co-red-carpet-look.md4.6 KB
- 参考文档articles/ariana-grande-career-break-planned-not-reaction.md4.5 KB
- 参考文档articles/ariana-grandes-iconic-wicked-tour-fashion-highlights.md4.6 KB
- 参考文档articles/ashley-naylors-new-album-alexandria-sunset-exclusive-listening-party.md5.0 KB
- 参考文档articles/avatars-upcoming-album-release-date-announced-by-johannes-eckerstrom.md4.6 KB
- 参考文档articles/best-books-movies-call-the-midwife-fans-season-15.md5.4 KB
- 参考文档articles/best-bras-small-busts-2026-expert-guide.md5.0 KB
- 参考文档articles/best-tv-moments-2026-standout-scenes.md5.1 KB
- 参考文档articles/best-tv-shows-like-the-morning-show.md4.1 KB
- 参考文档articles/best-war-shows-beyond-combat.md4.6 KB
- 参考文档articles/best-womens-lifestyle-subscription-boxes-2026.md5.0 KB
- 参考文档articles/black-crowes-chris-robinson-tampa-usa-chant-clash.md5.1 KB
- 参考文档articles/blake-lively-skips-taylor-swift-wedding-amid-rift.md6.1 KB
- 参考文档articles/boards-of-canada-unveil-first-inferno-album-track.md9.4 KB
- 参考文档articles/boundary-pushing-tv-shows-refuse-to-apologize.md5.5 KB
- 参考文档articles/bts-announces-march-comeback-with-new-album-release.md4.4 KB
- 参考文档articles/bts-announces-massive-world-tour-and-new-album-release.md4.6 KB
- 参考文档articles/bud-rokesky-unveils-new-album-dusk-and-tour-dates.md4.4 KB
- 参考文档articles/butch-vig-discusses-garbages-new-album-and-last-spokane-show.md5.1 KB
- 参考文档articles/cannes-2025-bans-naked-dresses-and-long-trains.md3.8 KB
- 参考文档articles/cannes-2026-day-2-red-carpet-best-fashion-moments.md9.7 KB
- 参考文档articles/cannes-film-festival-2025-exciting-debuts-and-heightened-anticipation.md4.1 KB
- 参考文档articles/cannes-film-festival-enforces-new-celebrity-dress-code.md4.8 KB
- 参考文档articles/carey-mulligan-celine-two-piece-london-film-festival.md4.7 KB
- 参考文档articles/catherine-paiz-reveals-bombshell-insights-on-austin-mcbroom.md3.7 KB
- 参考文档articles/chappell-roan-transforms-2026-grammys-red-carpet-fashion.md4.5 KB
- 参考文档articles/cma-fest-2026-transportation-guide-parking-transit-nashville.md5.9 KB
- 参考文档articles/colin-hay-explores-5-songs-from-new-solo-album.md4.9 KB
- 参考文档articles/colin-jost-leaving-snl-rumored-cast-exits-explained.md5.4 KB
- 参考文档articles/cynthia-erivo-stuns-in-givenchy-lace-at-wicked-event.md5.6 KB
- 参考文档articles/dave-mustaine-reveals-insights-as-megadeth-counts-down-to-extinction.md4.5 KB
- 参考文档articles/de-la-soul-performs-new-album-live-on-kimmel.md5.0 KB
- 参考文档articles/dealing-with-hidden-debt-and-awkward-wedding-situations-a-reddit-story.md3.7 KB
- 参考文档articles/dua-lipa-stuns-in-sheer-chanel-dress-on-red-carpet.md5.0 KB
- 参考文档articles/elon-musk-confirms-daughter-transition-sparked-political-shift.md5.1 KB
- 参考文档articles/euphoria-nate-jacobs-dies-season-3-snake-attack.md5.8 KB
- 参考文档articles/euphoria-season-3-episode-7-nate-death-recap.md5.6 KB
- 参考文档articles/exploring-dangelos-impactful-last-albums-in-music-history.md4.7 KB
- 参考文档articles/far-right-groups-fracture-makerfield-election-defeat.md5.0 KB
- 参考文档articles/fbi-warning-online-predators-targeting-kids-video-games.md5.3 KB
- 参考文档articles/federal-judge-flock-surveillance-indiscriminate.md4.7 KB
- 参考文档articles/foo-fighters-renamed-album-to-avoid-wicked-conflict.md8.4 KB
- 参考文档articles/game-changer-episode-8-recap-sweet-prizes-turn-sour.md5.2 KB
- 参考文档articles/game-of-thrones-almost-didnt-happen.md4.8 KB
- 参考文档articles/geese-rocks-brooklyn-paramount-for-tour-finale-celebration.md4.9 KB
- 参考文档articles/gq-bowl-2026-red-carpet-fashion-highlights-and-awards.md4.5 KB
- 参考文档articles/gypsy-rose-blanchard-ken-urker-viewing-daughter-aurora.md4.6 KB
- 参考文档articles/highlights-from-abc-world-news-tonight-with-david-muir-key-updates-from-may-21-2025.md3.2 KB
- 参考文档articles/house-of-the-dragon-season-3-world-premiere-london.md4.5 KB
- 参考文档articles/how-to-wear-capri-leggings-beyond-the-gym-2026.md5.7 KB
- 参考文档articles/hurray-for-the-riff-raff-new-album-and-winter-songwriting-charm.md5.9 KB
- 参考文档articles/illits-new-album-release-and-asia-tour-announcement.md4.6 KB
- 参考文档articles/jack-quaid-shuts-down-fantastic-four-casting-rumors.md9.1 KB
- 参考文档articles/jacob-elordis-bold-style-evolution-at-wuthering-heights-press-tour.md4.6 KB
- 参考文档articles/jaguar-wrights-attempt-at-covering-diddy-trial-and-cassie-venturas-revelations.md3.3 KB
- 参考文档articles/james-gunn-unveils-truth-behind-wonder-woman-casting-rumors.md4.7 KB
- 参考文档articles/jenelle-evans-sends-son-jace-to-live-with-biological-father-after-court-decision.md4.1 KB
- 参考文档articles/jennifer-lawrence-cool-girl-comfort-revolution.md4.6 KB
- 参考文档articles/jennifer-lawrence-slip-on-vans-fall-sneaker-trend.md5.1 KB
- 参考文档articles/jessica-alba-kitten-heel-style.md4.2 KB
- 参考文档articles/jo-firestone-chaotic-charm-late-night.md4.8 KB
- 参考文档articles/joe-keerys-viral-golden-globes-look-sparks-mcu-speculation.md5.4 KB
- 参考文档articles/john-dolmayan-reveals-system-of-a-downs-new-album-strategy.md4.7 KB
- 参考文档articles/jon-m-chu-discusses-britney-biopic-rumors-and-wicked-2-update.md4.6 KB
- 参考文档articles/katy-perry-justin-trudeau-red-carpet-debut-nyc-premiere.md4.6 KB
- 参考文档articles/kfcs-giant-snack-pack-a-fresh-take-on-a-classic.md2.9 KB
- 参考文档articles/kim-kardashian-lewis-hamilton-couple-rumors.md4.1 KB
- 参考文档articles/kylie-minogue-shines-in-stella-mccartney-at-earthshot-prize.md4.7 KB
- 参考文档articles/laufey-drops-new-album-a-matter-of-time-with-tough-luck.md4.7 KB
- 参考文档articles/lindsey-buckingham-announces-new-solo-album-after-fleetwood-reunion.md5.4 KB
- 参考文档articles/lisa-rinna-kylie-jenner-halloween-costume.md4.2 KB
- 参考文档articles/live-coverage-of-diddy-trial-first-witness-testifies.md2.3 KB
- 参考文档articles/logan-pauls-ex-reacts-to-his-baby-with-nina-agdal.md4.7 KB
- 参考文档articles/love-island-usa-beatriz-hatz-age-gap-relationship-revelation.md5.2 KB
- 参考文档articles/mandalorian-movie-opens-below-solo-star-wars-box-office.md4.9 KB
- 参考文档articles/maren-morris-dreamsicle-surprising-album-insights-revealed.md5.4 KB
- 参考文档articles/matteo-bocelli-unveils-new-album-and-wedding-performance-insights.md5.1 KB
- 参考文档articles/megan-thee-stallion-pilates-hottie-looks-tiktok.md4.3 KB
- 参考文档articles/meghan-markle-burgundy-turtleneck-amazon-dupe.md5.2 KB
- 参考文档articles/michelle-obamas-prada-style-on-the-sherri-show.md4.2 KB
- 参考文档articles/milly-alcock-supergirl-premiere-backlash-fashion.md5.9 KB
- 参考文档articles/morgan-wallen-been-by-now-production-analysis.md4.3 KB
- 参考文档articles/multiverse-rumors-swirl-around-avengers-secret-wars-cast.md5.1 KB
- 参考文档articles/nashville-nepo-wife-controversy.md4.7 KB
- 参考文档articles/netflix-one-piece-breaks-live-action-anime-curse.md5.5 KB
- 参考文档articles/north-west-kimokawaii-tour-canceled.md4.6 KB
- 参考文档articles/olivia-burgess-joshua-jackson-spotted-holding-hands-nyc.md5.4 KB
- 参考文档articles/olivia-rodrigo-releases-new-album-what-critics-and-fans-are-saying.md13.5 KB
- 参考文档articles/olsen-twins-full-house-fashion-privacy.md6.0 KB
- 参考文档articles/outlander-blood-of-my-blood-season-2-premiere-recap.md4.7 KB
- 参考文档articles/pamela-andersons-vintage-style-takes-over-madison-avenue.md6.1 KB
- 参考文档articles/paul-marinaros-new-jazz-album-debuts-in-evanston-celebration.md5.1 KB
- 参考文档articles/paul-ryans-new-album-eyes-of-an-enemy-review.md4.4 KB
- 参考文档articles/pearl-and-the-oysters-announce-monkey-mind-album.md7.6 KB
- 参考文档articles/phaedra-parks-ct-tamburello-dating.md4.8 KB
- 参考文档articles/scott-pelley-accuses-bari-weiss-murdering-60-minutes.md4.7 KB
- 参考文档articles/slashs-blues-ball-unveils-legendary-live-album-performance.md4.5 KB
- 参考文档articles/spielberg-close-encounters-ufo-relevance-2026.md5.6 KB
- 参考文档articles/spinal-tap-releases-new-album-alongside-upcoming-movie.md4.6 KB
- 参考文档articles/streamer-johnny-somali-faces-serious-jail-time-in-south-korea.md5.1 KB
- 参考文档articles/stunning-2026-baftas-red-carpet-fashion-highlights.md5.1 KB
- 参考文档articles/style-olivia-wilde-affordable-black-retro-sneakers.md5.0 KB
- 参考文档articles/summer-house-jesse-solomon-teases-brutal-reunion-drama.md5.1 KB
- 参考文档articles/taylor-swift-chiefs-game-day-style.md4.5 KB
- 参考文档articles/taylor-swift-i-knew-you-were-trouble-evolution.md5.1 KB
- 参考文档articles/taylor-swift-metallic-date-night-look-breakdown.md5.0 KB
- 参考文档articles/taylor-swift-new-haircut-new-era.md3.9 KB
- 参考文档articles/taylor-swift-skips-travis-kelce-new-heights-live-la-show.md6.0 KB
- 参考文档articles/taylor-swift-velvet-minidress-nashville-songwriters-hall-of.md5.0 KB
- 参考文档articles/the-diplomat-season-4-finale-grace-penn-nato.md6.4 KB
- 参考文档articles/the-hara-unveils-new-album-the-fallout.md4.4 KB
- 参考文档articles/the-neighbourhoods-ultrasound-album-review-fans-mixed-reactions.md4.5 KB
- 参考文档articles/top-10-new-christmas-albums-for-2025-holidays.md5.1 KB
- 参考文档articles/top-12-albums-of-2025-by-lamar-ramos.md5.0 KB
- 参考文档articles/top-5-classical-music-albums-to-stream-today.md3.9 KB
- 参考文档articles/top-album-releases-this-week-florence-the-machine-highlights.md4.8 KB
- 参考文档articles/top-artists-releasing-highly-anticipated-albums-in-2026.md5.3 KB
- 参考文档articles/top-cannes-red-carpet-fashion-moments-of-the-last-50-years.md5.4 KB
- 参考文档articles/top-celebrity-red-carpet-looks-of-2025-revealed.md5.5 KB
- 参考文档articles/top-chef-season-23-episode-13-recap-plate-expectations.md6.0 KB
- 参考文档articles/trump-nicki-minaj-alliance.md5.4 KB
- 参考文档articles/trump-nicki-minaj-hot-white-house-luncheon.md5.9 KB
- 参考文档articles/trump-unveils-new-health-care-records-system-for-consumers.md5.3 KB
- 参考文档articles/tv-casting-directors-reveal-hidden-talent-pipeline-procedurals.md5.2 KB
- 参考文档articles/tv-schedule-major-finales-sports-converge-june-7-13.md5.3 KB
- 参考文档articles/unreleased-waylon-jennings-album-songbird-arrives-in-october.md5.0 KB
- 参考文档articles/unveiling-diddys-trial-insights-into-his-disturbing-behavior.md3.6 KB
- 参考文档articles/unveiling-the-alleged-fbi-cover-up-of-trumps-past.md3.3 KB
- 参考文档articles/vampire-lestat-season-3-musical-reinvention-amc.md5.4 KB
- 参考文档articles/wasted-wine-explores-world-music-fusion-on-new-album.md3.7 KB
- 参考文档articles/wayv-unveils-new-winter-album-eternal-white-release.md5.2 KB
- 参考文档articles/weekly-world-news-tv-show-robert-ben-garant.md5.4 KB
- 参考文档articles/widows-bay-creators-break-down-game-changing-flashback-episodes.md5.5 KB
- 参考文档articles/x-men-reboot-debunks-popular-mcu-casting-rumors.md4.6 KB
- 参考文档articles/yeonjun-from-txt-responds-to-fans-most-unrestrained-tweets.md3.2 KB
- 参考文档articles/zach-bryans-with-heaven-on-top-reviewed-hits-and-misses.md5.0 KB
- 资产文件assets/.gitkeep—
- 参考文档dedup-index.json22.8 KB
- 脚本scripts/collect_metrics.ts10.7 KB
- 参考文档site.yaml5.6 KB
03 SKILL.md 正文
Agent Metrics Collection Utility
Purpose
This utility collects and reports metrics on agent usage from git history. It implements the 8 key metrics defined in docs/agent-metrics.md for measuring agent system health, effectiveness, and adoption.
Triggers
| Trigger Phrase | Operation |
|---|---|
collect agent metrics |
Run collect_metrics.ts with default 30-day window |
generate metrics dashboard |
Run with markdown output for reporting |
check agent adoption rate |
Run and highlight Metric 2 (agent coverage) |
weekly metrics report |
Run with 7-day window, markdown output |
export metrics as JSON |
Run with JSON output for automation |
When to Use
Use this skill when:
- Measuring agent system health or adoption trends
- Producing periodic dashboards or reports
- Evaluating whether agent usage is balanced across types
- Checking infrastructure review coverage
Use manual git log inspection instead when:
- Investigating a single commit's agent attribution
- Debugging a specific CI run's metrics workflow
Process
- Run the metrics collection script for the desired time range
- Review generated reports for agent usage patterns
- Identify trends and anomalies in adoption metrics
Anti-Patterns
| Avoid | Why | Instead |
|---|---|---|
| Running without specifying time window | Default 30 days may not match your intent | Use --since with explicit day count |
| Comparing metrics across different time windows | Misleading trends | Normalize to same window size |
| Ignoring zero agent coverage | Indicates broken detection patterns | Verify commit message conventions match patterns |
| Manual commit counting | Error-prone, misses patterns | Use the script for consistent detection |
| Storing JSON output without markdown | Loses human-readable context | Generate both formats for archival |
Verification
After execution:
- [ ] Script exits with code 0
- [ ] Output contains all 4 collected metrics (Invocation Rate, Coverage, Infrastructure Review, Distribution)
- [ ] Agent coverage percentage is plausible (not 0% unless truly no agent commits)
- [ ] Time window matches intended period
- [ ] For markdown output: report file created at expected path
Available Scripts
| Script | Platform | Usage |
|---|---|---|
scripts/collect_metrics.ts |
Bun | Cross-platform |
Quick Start
# Basic usage (30 days, summary output)
bun run .claude/skills/metrics/scripts/collect_metrics.ts
# Last 90 days as markdown
bun run .claude/skills/metrics/scripts/collect_metrics.ts --since 90 --output markdown
# JSON output for automation
bun run .claude/skills/metrics/scripts/collect_metrics.ts --output json
Metrics Collected
The utility collects the following metrics:
| Metric | Description | Target |
|---|---|---|
| Metric 1: Invocation Rate | Agent usage distribution | Proportional to task types |
| Metric 2: Agent Coverage | % of commits with agent involvement | 50% |
| Metric 4: Infrastructure Review | % of infra changes with security review | 100% |
| Metric 5: Usage Distribution | Agent utilization patterns | Balanced distribution |
Detection Patterns
Agent Detection
The utility detects agents in commit messages using these patterns:
- Direct agent names:
orchestrator,analyst,architect, etc. - Review attribution:
Reviewed by: security - Agent tags:
agent: implementeror[security-agent]
Infrastructure Files
Infrastructure commits are identified by these patterns:
.github/workflows/*.yml.githooks/*Dockerfile**.tf,*.tfvars.env*.agents/*
Commit Types
Conventional commit prefixes are classified:
feat:- Featurefix:- Bug fixdocs:- Documentationci:- CI/CDrefactor:- Refactoring
Output Formats
Summary (Default)
Human-readable console output with key metrics highlighted.
Markdown
Formatted markdown suitable for dashboards and reports. Can be saved directly to .agents/metrics/ for archival.
JSON
Structured data for programmatic consumption and CI integration.
CI Integration
See .github/workflows/agent-metrics.yml for automated weekly metrics collection.
The workflow:
- Runs weekly on Sundays
- Collects metrics for the previous 7 days
- Generates a markdown report
- Creates a PR with the report (if significant changes)
Manual Report Generation
To generate a monthly dashboard report:
# Generate report
bun run .claude/skills/metrics/scripts/collect_metrics.ts \
--since 30 \
--output markdown \
> .agents/metrics/report-$(date +%Y-%m).md
# Review and commit
git add .agents/metrics/
git commit -m "docs(metrics): add monthly metrics report"
Extending the Utility
Adding New Metrics
- Define the metric in
docs/agent-metrics.md - Add collection logic to both scripts
- Update the output formatters
- Add tests if applicable
Adding New Agent Patterns
Update the AGENT_PATTERNS / $AgentPatterns arrays to detect new agent references.
Adding Infrastructure Patterns
Update the INFRASTRUCTURE_PATTERNS / $InfrastructurePatterns arrays for new infrastructure file types.
Troubleshooting
No Agents Detected
- Ensure commit messages reference agents explicitly
- Check that conventional commit format is used
- Verify the patterns match your team's conventions
Git Errors
- Confirm you're in a git repository
- Check that the repository has commits in the date range
- Verify git is available in PATH
Related Documents
04 同仓库更多 Skills
validation-authority
Treat upstream validators as authoritative. Align local config to them. Use when validation fails unexpectedly, before modifying validator behavior, or when tempted to change upstream tool code.
using-brain-memory
Guidance for using Brain semantic memory effectively. Applies Zettelkasten atomic note principles with observations and relations. Use when deciding whether to query or create notes, structuring note content, or understanding the semantic knowledge graph.
threat-modeling
Structured security analysis using OWASP Four-Question Framework and STRIDE methodology. Generates threat matrices with risk ratings, mitigations, and prioritization. Use for attack surface analysis, security architecture review, or when asking what can go wrong.
taste-lints
Custom lints with agent-readable remediation instructions. Enforces taste invariants (file size, naming conventions, structured logging, complexity) and surfaces errors that agents can act on directly. Use when writing or reviewing code to catch style violations early.
style-enforcement
Validate code against style rules from .editorconfig, StyleCop.json, and Directory.Build.props. Detects line ending violations, naming convention issues, indentation problems, and charset mismatches across C#, Python, TypeScript, and JavaScript. Produces JSON reports for pre-commit hooks and CI pipelines.
steering-matcher
Match file paths against steering file glob patterns to determine applicable steering guidance. Use when orchestrator needs to inject context-aware guidance based on files being modified.