gstack Retro
by @garrytan
Weekly engineering retrospective. Analyzes commit history, work patterns, and code quality metrics with persistent history and trend tracking. Team-aware wit...
clawhub install gstack-openclaw-retroπ About This Skill
name: gstack-openclaw-retro description: Weekly engineering retrospective. Analyzes commit history, work patterns, and code quality metrics with persistent history and trend tracking. Team-aware with per-person contributions, praise, and growth areas. Use when asked for weekly retro, what shipped this week, or engineering retrospective. version: 1.0.0 metadata: { "openclaw": { "emoji": "π" } }
Weekly Engineering Retrospective
Generates a comprehensive engineering retrospective analyzing commit history, work patterns, and code quality metrics. Team-aware: identifies the user running the command, then analyzes every contributor with per-person praise and growth opportunities.
Arguments
24h: last 24 hours14d: last 14 days30d: last 30 dayscompare: compare current window vs prior same-length windowInstructions
Parse the argument to determine the time window. Default to 7 days. All times should be reported in the user's local timezone.
Midnight-aligned windows: For day units, compute an absolute start date at local midnight. For example, if today is 2026-03-18 and the window is 7 days, the start date is 2026-03-11. Use --since="2026-03-11T00:00:00" for git log queries. For hour units, use --since="N hours ago".
Step 1: Gather Raw Data
First, fetch origin and identify the current user:
git fetch origin main --quiet
git config user.name
git config user.email
The name returned by git config user.name is "you" ... the person reading this retro. All other authors are teammates.
Run ALL of these git commands (they are independent):
# All commits with timestamps, subject, hash, author, files changed
git log origin/main --since="" --format="%H|%aN|%ae|%ai|%s" --shortstatPer-commit test vs total LOC breakdown with author
git log origin/main --since="" --format="COMMIT:%H|%aN" --numstatCommit timestamps for session detection and hourly distribution
git log origin/main --since="" --format="%at|%aN|%ai|%s" | sort -nFiles most frequently changed (hotspot analysis)
git log origin/main --since="" --format="" --name-only | grep -v '^$' | sort | uniq -c | sort -rnPR numbers from commit messages
git log origin/main --since="" --format="%s" | grep -oE '[#!][0-9]+' | sort -t'#' -k1 | uniqPer-author file hotspots
git log origin/main --since="" --format="AUTHOR:%aN" --name-onlyPer-author commit counts
git shortlog origin/main --since="" -sn --no-mergesTest file count
find . -name '*.test.*' -o -name '*.spec.*' -o -name '*_test.*' -o -name '*_spec.*' 2>/dev/null | grep -v node_modules | wc -lTest files changed in window
git log origin/main --since="" --format="" --name-only | grep -E '\.(test|spec)\.' | sort -u | wc -l
Step 2: Compute Metrics
Calculate and present these metrics in a summary:
Then show a per-author leaderboard immediately below:
Contributor Commits +/- Top area
You (garry) 32 +2400/-300 browse/
alice 12 +800/-150 app/services/
bob 3 +120/-40 tests/
Sort by commits descending. The current user always appears first, labeled "You (name)".
Step 3: Commit Time Distribution
Show hourly histogram in local time:
Hour Commits ββββββββββββββββ
00: 4 ββββ
07: 5 βββββ
...
Identify:
Step 4: Work Session Detection
Detect sessions using 45-minute gap threshold between consecutive commits.
Classify sessions:
Calculate:
Step 5: Commit Type Breakdown
Categorize by conventional commit prefix (feat/fix/refactor/test/chore/docs). Show as percentage bar:
feat: 20 (40%) ββββββββββββββββββββ
fix: 27 (54%) βββββββββββββββββββββββββββ
refactor: 2 ( 4%) ββ
Flag if fix ratio exceeds 50% ... signals a "ship fast, fix fast" pattern that may indicate review gaps.
Step 6: Hotspot Analysis
Show top 10 most-changed files. Flag:
Step 7: PR Size Distribution
Estimate PR sizes and bucket them:
Step 8: Focus Score + Ship of the Week
Focus score: Percentage of commits touching the single most-changed top-level directory. Higher = deeper focused work. Lower = scattered context-switching.
Ship of the week: The single highest-LOC PR in the window. Highlight PR number, LOC changed, and why it matters.
Step 9: Team Member Analysis
For each contributor (including the current user), compute:
1. Commits and LOC ... total commits, insertions, deletions, net LOC 2. Areas of focus ... which directories/files they touched most (top 3) 3. Commit type mix ... their personal feat/fix/refactor/test breakdown 4. Session patterns ... when they code (peak hours), session count 5. Test discipline ... their personal test LOC ratio 6. Biggest ship ... their single highest-impact commit or PR
For the current user ("You"): Deepest treatment. Include all session analysis, time patterns, focus score. Frame in first person.
For each teammate: 2-3 sentences covering what they shipped and their pattern. Then:
If solo repo: Skip team breakdown.
AI collaboration: If commits have Co-Authored-By AI trailers, track "AI-assisted commits" as a separate metric.
Step 10: Week-over-Week Trends (if window >= 14d)
Split into weekly buckets and show trends:
Step 11: Streak Tracking
Count consecutive days with at least 1 commit, going back from today:
# Team streak
git log origin/main --format="%ad" --date=format:"%Y-%m-%d" | sort -uPersonal streak
git log origin/main --author="" --format="%ad" --date=format:"%Y-%m-%d" | sort -u
Display both:
Step 12: Load History & Compare
Check for prior retro history in memory/:
If prior retros exist, load the most recent one and calculate deltas:
Last Now Delta
Test ratio: 22% β 41% β19pp
Sessions: 10 β 14 β4
LOC/hour: 200 β 350 β75%
Fix ratio: 54% β 30% β24pp (improving)
If no prior retros exist, note "First retro recorded, run again next week to see trends."
Step 13: Save Retro History
Save a JSON snapshot to memory/retro-YYYY-MM-DD.json with metrics, authors, version range, streak, and tweetable summary.
Step 14: Write the Narrative
Format for Telegram (bullets, bold, no markdown tables in the final output).
Structure:
Tweetable summary (first line): > Week of Mar 1: 47 commits (3 contributors), 3.2k LOC, 38% tests, 12 PRs, peak: 10pm | Streak: 47d
Then sections:
Compare Mode
When the user says "compare":
Important Rules
TZ.memory/ for trend tracking.