Help us improve
Share bugs, ideas, or general feedback.
From ai-sdlc-harness
Reads timestamp stamps from a per-workflow tracker, computes six workflow aggregate metrics, and writes them to `metrics-report.md` (per-workflow) plus appends one row to workspace-level `ai/_metrics-log.csv`.
npx claudepluginhub mostashraf/ai-sdlc-harness --plugin ai-sdlc-harnessHow this skill is triggered — by the user, by Claude, or both
Slash command
/ai-sdlc-harness:metrics-collectorThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
<!-- Created by: dev-workflow-plan.md [M-17] [IMPL-17-02..04]
Guides technical evaluation of code review feedback: read fully, restate for understanding, verify against codebase, respond with reasoning or pushback before implementing.
Share bugs, ideas, or general feedback.
Pure data aggregator over a single per-workflow tracker. Reads timestamp stamps from the tracker's Metrics block + the per-task Task Metrics rows, computes the six required workflow aggregates, and writes them to metrics-report.md (per-workflow) and ai/_metrics-log.csv (workspace-level append-only log).
No agent reasoning — the skill never invokes an LLM. It is invoked by the orchestrator as a pure subprocess.
commands/create-pr.md final step, with --round 0 (PR creation timestamp captured).commands/review-response.md end of each cycle, with --round <n> (1-indexed review round).commands/reconcile.md after archive, with --round final (terminal row)./dev-workflow metrics <work-item-id> [--round <n>|final] for ad-hoc backfill.ai/<YYYY-MM-DD>-<work-item-id>/ exists and contains a tracker (tracker.md or tracker.archived.md post-T3).## Metrics block with the expected stamps per tracker-field-schema.YYYY-MM-DD HH:MM UTC strings.| Name | Type | Description |
|---|---|---|
workflow_dir | arg | Path to the per-workflow dir per workflow-paths. |
round | arg | 0 (PR creation) / 1..N (review cycle) / final (reconcile). |
Authoritative references: timestamp, workflow-paths, tracker-field-schema, tracker-transition-rules
workflow_dir, locate tracker.md (or tracker.archived.md). Refuse with exit 2 if neither exists.Plan approved, Development started, PR created, etc.) using the canonical field names from tracker-field-schema.md. Pre-2.0 trackers may still carry the legacy names (Approved-Impl, PR-Opened, Comments resolved, Test-hardening completed); the collector accepts both shapes.Completed stamp precedes its Started counterpart for the same task, refuse with exit 1 + .error.md describing the inconsistency. Do not append to the CSV on validation failure.PR created − Plan approved (legacy PR-Opened accepted for old trackers).Review Rounds summed.Coverage final value (from P5 hardening output) vs. pre-existing baseline (if available).pr-comment-analysis-report-<n>.md files in the workflow dir.[S<n>] comments in any pr-comment-analysis-report-*.md file that route to source-code changes (vs. test-coverage gaps).metrics-report.md at <workflow_dir>/metrics-report.md (CC-05.7 path).ai/_metrics-log.csv with the schema below.Metrics collected <ts> — round <n> using the canonical UTC timestamp.ai/_metrics-log.csv schema (IMPL-17-04, IMPL-25-03)| Column | Added | Required | Notes |
|---|---|---|---|
schema_version | v1.0.0 | ✅ | Current 1.1.0. First column — drives mixed-version reads. |
work_item_id | v1.0.0 | ✅ | Post-safe_id() story identifier. |
round | v1.0.0 | ✅ | 0 / 1..N / final. |
timestamp_utc | v1.0.0 | ✅ | Row write time. |
cycle_time_minutes | v1.0.0 | ✅ | Minutes between Plan approved and PR created. |
p3_duration_minutes | v1.0.0 | ✅ | Phase 3 development duration. |
p5_duration_minutes | v1.0.0 | ✅ | Phase 5 test-hardening duration. |
p7_duration_minutes | v1.0.0 | optional | Phase 7 review-response duration (per round). |
reviewer_rework_rounds | v1.0.0 | ✅ | Aggregated Review Rounds across tasks. |
pr_review_rounds | v1.0.0 | ✅ | Count of P7 cycles. |
coverage_pct | v1.0.0 | ✅ | Final per-story coverage. |
defect_escape_count | v1.0.0 | ✅ | [S<n>] source-code comments. |
tokens_input | v1.1.0 | optional | Input tokens for this story (ADR-002). Empty until metrics-token-collector.sh lands (US-E02-003). Render as "tokens unavailable" not 0 when empty. |
tokens_output | v1.1.0 | optional | Output tokens. Same null policy as tokens_input. |
tokens_cache_read | v1.1.0 | optional | Cache read tokens. Same null policy. |
tokens_cache_write | v1.1.0 | optional | Cache write tokens. Same null policy. |
mode | v1.1.0 | ✅ | Workflow mode: quick or full (FR-1.7). Default full for pre-v2.1 trackers. |
Schema evolution policy (CC-04.6): bump minor when adding columns; bump major + ship a migration script when removing columns. Older rows keep their original schema_version ("1.0.0") — downstream BI handles mixed-version reads. The collector auto-migrates v1.0.0 files to v1.1.0 on the first v1.1.0 append (idempotent).
| Destination | Content |
|---|---|
<workflow_dir>/metrics-report.md | Per-workflow aggregated report (markdown). |
ai/_metrics-log.csv | Append-only workspace-level log; one row per invocation. |
| Tracker Metrics block | Metrics collected <ts> — round <n> stamp. |
| Exit code | 0 (success) / 1 (validation failure — bad timestamps) / 2 (precondition unmet). |
metrics-report.md exists at the canonical path.ai/_metrics-log.csv (or the lock guarded retry path completed cleanly).Metrics collected <ts> — round <n> stamp.| Failure | Detection | Response |
|---|---|---|
| Tracker missing | Step 1 path resolution | Exit 2 with .error.md. |
| Timestamp inconsistency | Step 3 ordering check | Exit 1; emit .error.md describing the bad pair; do not append to CSV. |
| CSV lock contention | Step 6 file-lock acquisition | Retry once (1s); on second failure emit .error.md and exit 1. |
| Coverage data missing | Step 4 coverage extraction | Best-effort: leave coverage_pct empty; surface advisory; do not block. |
commands/metrics.md — orchestrator entry point that invokes this skill.coverage-report — produces the per-repo coverage values that this skill aggregates.