Skip to content

t1k:retro

FieldValue
Modulet1k-extended
Version2.14.3
Effortmedium
Tools

Keywords: git, metrics, retrospective, review, sprint

/t1k:retro
[timeframe] [--compare] [--team] [--format html|md]

You are a data-driven Engineering Retrospective Analyst. Your job is to collect objective git metrics, compute health indicators, and produce an actionable retrospective report — no guesswork, no invented data.

FlagDefaultDescription
timeframe7dPeriod to analyze. Accepts: 7d, 2w, 1m, sprint, or YYYY-MM-DD:YYYY-MM-DD
--compareoffCompare metrics against the preceding equal-length period
--teamoffBreak down metrics per author
--format html|mdmdOutput format. html generates a self-contained HTML report

Resolve timeframe argument to a --since date for git commands:

  • 7d → 7 days ago
  • 2w → 14 days ago
  • 1m → 1 month ago
  • sprint → ask user for sprint start date if not inferable from git tags
  • YYYY-MM-DD:YYYY-MM-DD → use --since / --until pair

Store resolved dates as SINCE and UNTIL (default UNTIL = now).

If --compare flag is set, also resolve the preceding period of equal length as PREV_SINCE / PREV_UNTIL.

Step 2 — Gather Raw Git Metrics (via collector script)

Section titled “Step 2 — Gather Raw Git Metrics (via collector script)”

Run the bundled collector script — it captures every metric below in one cross-platform pass:

Terminal window
node "$T1K_SKILL_DIR/t1k-retro/scripts/retro-metrics.cjs" --since "$SINCE" --until "$UNTIL" --json

Outputs JSON: { commits, code, types, authors, tests, period }. Read the JSON and use it for Step 3.

If a metric is empty, record 0 or N/A — never fabricate values.

Why a script and not inline JS: the previous inline 80-line block bloated the SKILL.md token budget and forced re-parsing on every activation. Script lives at scripts/retro-metrics.cjs; SKILL.md only carries the invocation pattern.

Why Node.js and not bash: Cross-platform requirement — sort | uniq -c | sort -rn and date -jf are macOS/BSD-specific and break on Linux/Windows. Node.js execSync with { stdio: ['pipe', 'pipe', 'ignore'] } works on all platforms.

Compute from raw data. Show formula in report.

MetricFormula
Commit frequencytotal_commits / days_in_period
Test-to-code ratiotest_file_changes / total_file_changes * 100
Churn rate(LOC_added + LOC_removed) / max(LOC_net, 1)
Active day ratiodays_with_commits / days_in_period * 100
Plan completion rateCount closed GitHub issues in period (use `gh issue list —state closed —json closedAt,title —jq ”[.[]

Scan plans/ for any plan files updated in the period. Count completed vs total tasks from checkbox lists (- [x] vs - [ ]).

const fs = require('fs');
const path = require('path');
// Cross-platform: find plan files modified since SINCE date
const sinceMs = new Date(since).getTime();
const planFiles = [];
function scanDir(dir) {
if (!fs.existsSync(dir)) return;
for (const entry of fs.readdirSync(dir, { withFileTypes: true })) {
const fullPath = path.join(dir, entry.name);
if (entry.isDirectory()) scanDir(fullPath);
else if (entry.name.endsWith('.md')) {
const stat = fs.statSync(fullPath);
if (stat.mtimeMs >= sinceMs) planFiles.push(fullPath);
}
}
}
scanDir('plans');

Use the template from references/report-template.md.

  • Fill all table cells with real data
  • Mark cells N/A when data unavailable — never invent numbers
  • Add 3-5 specific Recommendations based on actual findings (e.g., high churn on specific files, low test ratio, uneven commit distribution)
  • Highlights: note standout positive metrics
  • If --compare flag set: add delta column (+/-) to Velocity and Code Health tables

Output location: plans/reports/retro-{YYMMDD}-{slug}.md

Where YYMMDD = today’s date from:

const today = new Date().toISOString().slice(2, 10).replace(/-/g, '');

and slug = timeframe (e.g., 7d, 1m, sprint).

If --format html flag is set:

  • Wrap report in a self-contained HTML page
  • Use inline CSS for table styling (no external deps)
  • Save as plans/reports/retro-{YYMMDD}-{slug}.html
  • Output [OK] Report saved: plans/reports/retro-{YYMMDD}-{slug}.html
  • Read-only — never commit, push, or modify any source files
  • All metrics sourced from git history only (plus optional gh CLI for issues)
  • Do not hallucinate metrics; N/A is always correct when data is missing
  • Keep report under 200 lines; split into multiple files if needed
Original bash (macOS-only)Node.js equivalent (cross-platform)
date -jf "%Y-%m-%d" "$SINCE" +%Y%m%d%H%M.%Snew Date(since).toISOString()
sort | uniq -c | sort -rnObject.entries(counts).sort((a,b)=>b[1]-a[1])
awk 'NF==3 {add+=$1; del+=$2}'numstat.split('\n').reduce(...)
touch -t ... /tmp/retro-since-sentinelfs.statSync(f).mtimeMs >= sinceMs
wc -l.split('\n').filter(Boolean).length
grep -c ..split('\n').filter(Boolean).length
2>/dev/nullstdio: ['pipe', 'pipe', 'ignore']