metricas
Before/after delta + % comparison — git diff or bookmark mode, tokenization-aware, multi-language
- License 许可
- Apache-2.0
- 最近更新
- 2026-11-10
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- metricas
- triggers
- [ "!metricas", "before after", "delta", "compare", "token count", "size change" ]
- changelog
- 2026-09-18 — dropped !metrics trigger (now auto-metrics scoring); 2026-08-31 — SD 9.9→10 fix
- description
- Before/after delta + % comparison — git diff or bookmark mode, tokenization-aware, multi-language
- token_budget
- 2900
02 资源文件 1
- 脚本assets/tokenize.ps13.5 KB
03 SKILL.md 正文
metricas — Before/After Delta + % Comparison
Measure codebase changes quantitatively — tokenization-aware diff analysis (git diff or bookmark modes), multi-language, percentage deltas.
Trigger: !metricas, "before after", "delta", "compare", "token count", "size change"
Migration: use
!metricasfor before/after deltas —!metricsnow maps to auto-metrics (self-scoring).
Two Modes
| Mode | Use Case | How It Works |
|---|---|---|
| git diff | Compare two commits/branches | git diff <base>..<head> -- <paths> → tokenize → delta |
| bookmark | Working tree vs saved snapshot | Save baseline → work → compare → tokenize → delta |
Tokenization
| Language | Tokenizer | Fallback |
|---|---|---|
| Python | ast nodes → tokenize |
whitespace split |
| TS/JS | acorn/babel |
regex [A-Za-z_$][A-Za-z0-9_$]* |
| Go | go/token |
regex \b\w+\b |
| Rust | syn |
regex [a-zA-Z_][a-zA-Z0-9_]* |
| Generic | whitespace + punctuation | N/A |
AST nodes for structural langs, lexical tokens otherwise. Whitespace/comments excluded.
CLI
metricas [mode] [options]
Modes: git-diff (default) | bookmark
--base <ref> (git-diff) or bookmark name | --head <ref> (default HEAD)
--paths <glob> | --lang <py|ts|js|go|rs|auto> | --tokenizer <ast|lexical|whitespace>
--format <table|json|csv|markdown> | --threshold <pct> (default 10)
--save-baseline <name> | --compare-baseline <name> | --list-baselines | --delete-baseline <name>
Reference
Worked examples, testing patterns, edge cases, anti-patterns → docs/skills/metricas/reference.md
Anti-Rationalization
| Rationalization | Red Flag | Verification |
|---|---|---|
| "delta sin tokenización aware" | conteo por bytes/chars en vez de tokens AST/lexical | usar tokenizer por lenguaje (ast/acorn/go-token) excluyendo whitespace/comments |
| "comparar bookmarks con diff mezclados" | bookmark vs git diff sin aislar baseline | modo bookmark solo vs baseline guardado, git diff solo vs commits |
| "porcentajes sin base" | delta % sin base definida o base 0 | verificar base ≠0 y reportar base/head explícitos file:line |
Red Flags
- Doing work without checking output format → STOP, re-read skill
- Second occurrence of same rationalization → force RED zone
Verification
- Output matches skill ## Output contract + file:line citaton
- cross-ref-check.ps1 → SKILL.md OK
Refs
Cross-Refs: auto-metrics | performance-tracker | automejora-analyzer | recovery-protocol | bitacora
04 同仓库更多 Skills
web-quality-audit
Comprehensive web audit: performance, a11y, SEO, responsive, animation, design tokens.
ui-engine
UI system — Grid/Flexbox/@layer/:has(), container queries, compositor-only animation, OKLCH tokens, component patterns
baseline-ui
Anti-slop UI — layout, typography, responsive, animation, tokens. Use for cleanup or polish.
skill-creator
Create new AI agent skills following Agent Skills spec -- auto-bootstrap unknown tasks, define structure, register in AGENTS.md
senior-engineer
Apply senior engineering competencies — system design, trade-off analysis, delegation, mentoring, and tech debt strategy
prompt-engineering
Design effective prompts using SPEARS framework — scope, principles, examples, assertions, refinements, with ReAct and multi-agent patterns