详细分析 ▾
运行时依赖
版本
Initial release — weekly engineering retrospective with team analysis
安装命令 点击复制
技能文档
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
- 默认: 最后的 7 days
24h: 最后的 24 hours14d: 最后的 14 days30d: 最后的 30 dayscompare: compare current window vs prior 相同-length window
Instructions
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: 对于 day units, compute absolute 开始 日期 在 local midnight. 对于 示例, 如果 today 2026-03-18 和 window 7 days, 开始 日期 2026-03-11. 使用 --since="2026-03-11T00:00:00" 对于 git log queries. 对于 hour units, 使用 --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" --shortstat# Per-commit test vs total LOC breakdown with author
git log origin/main --since="" --format="COMMIT:%H|%aN" --numstat
# Commit timestamps for session detection and hourly distribution
git log origin/main --since="" --format="%at|%aN|%ai|%s" | sort -n
# Files most frequently changed (hotspot analysis)
git log origin/main --since="" --format="" --name-only | grep -v '^$' | sort | uniq -c | sort -rn
# PR numbers from commit messages
git log origin/main --since="" --format="%s" | grep -oE '[#!][0-9]+' | sort -t'#' -k1 | uniq
# Per-author file hotspots
git log origin/main --since="" --format="AUTHOR:%aN" --name-only
# Per-author commit counts
git shortlog origin/main --since="" -sn --no-merges
# Test file count
find . -name '.test.' -o -name '.spec.' -o -name '_test.' -o -name '_spec.' 2>/dev/null | grep -v node_modules | wc -l
# Test 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:
- Commits 到 main: N
- Contributors: N
- PRs merged: N
- 总计 insertions: N
- 总计 deletions: N
- Net LOC added: N
- Test LOC (insertions): N
- Test LOC ratio: N%
- Version range: vX.Y.Z → vX.Y.Z
- 活跃 days: N
- Detected sessions: N
- Avg LOC/会话-hour: N
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 时间 Distribution
Show hourly histogram in local time:
Hour Commits ████████████████
00: 4 ████
07: 5 █████
...
Identify:
- Peak hours
- Dead zones
- Bimodal pattern (morning/evening) vs continuous
- Late-night coding clusters (之后 10pm)
Step 4: Work 会话 Detection
Detect sessions using 45-minute gap threshold between consecutive commits.
Classify sessions:
- Deep sessions (50+ min)
- Medium sessions (20-50 min)
- Micro sessions (<20 min, single-commit)
Calculate:
- 总计 活跃 coding 时间
- 平均值 会话 length
- LOC per hour 的 活跃 时间
Step 5: Commit 类型 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:
- Files changed 5+ 乘以 (churn hotspots)
- Test files vs production files 在...中 hotspot 列表
- VERSION/CHANGELOG frequency
Step 7: PR Size Distribution
Estimate PR sizes and bucket them:
- Small (<100 LOC)
- Medium (100-500 LOC)
- Large (500-1500 LOC)
- XL (1500+ LOC)
Step 8: Focus Score + Ship 的 Week
Focus score: Percentage 的 commits touching single 最多-changed top-level directory. Higher = deeper focused work. Lower = scattered context-switching.
Ship 的 week: single highest-LOC PR 在...中 window. Highlight PR 数字, LOC changed, 和 为什么 matters.
Step 9: Team Member Analysis
For each contributor (including the current user), compute:
- Commits 和 LOC ... 总计 commits, insertions, deletions, net LOC
- Areas 的 focus ... 哪个 directories/files 它们 touched 最多 (top 3)
- Commit 类型 mix ... personal feat/fix/refactor/test breakdown
- 会话 patterns ... 当...时 它们 code (peak hours), 会话 计数
- Test discipline ... personal test LOC ratio
- Biggest ship ... single highest-impact commit 或 PR
对于 current 用户 ("您"): Deepest treatment. Include 所有 会话 analysis, 时间 patterns, focus score. Frame 在...中 第一个 person.
对于 每个 teammate: 2-3 sentences covering 什么 它们 shipped 和 pattern. 然后:
- Praise (1-2 specific things): Anchor 在...中 actual commits. 不 "great work" ... say exactly 什么 是 good.
- Opportunity 对于 growth (1 specific thing): Frame 作为 leveling-up, 不 criticism. Anchor 在...中 actual data.
如果 solo repo: Skip team breakdown.
AI collaboration: 如果 commits 有 Co-Authored-由 AI trailers, track "AI-assisted commits" 作为 separate metric.
Step 10: Week-在...上-Week Trends (如果 window >= 14d)
Split into weekly buckets and show trends:
- Commits per week (总计 和 per-author)
- LOC per week
- Test ratio per week
- Fix ratio per week
- 会话 计数 per week
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 -u# Personal streak
git log origin/main --author="" --format="%ad" --date=format:"%Y-%m-%d" | sort -u
Display both:
- "Team shipping streak: 47 consecutive days"
- " shipping streak: 32 consecutive days"
Step 12: 加载 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: 保存 Retro History
Save a JSON snapshot to memory/retro-YYYY-MM-DD.json with metrics, authors, version range, streak, and tweetable summary.
Step 14: 写入 Narrative
格式 对于 Telegram (bullets, bold, 否 markdown tables 在...中 final 输出).
Structure:
Tweetable summary (第一个 line):
Week of Mar 1: 47 commits (3 contributors), 3.2k LOC, 38% tests, 12 PRs, peak: 10pm | Streak: 47d
Then sections:
- Summary ... 键 metrics
- Trends vs 最后的 Retro ... deltas (skip 如果 第一个 retro)
- 时间 & 会话 Patterns ... 当...时 team codes, 会话 lengths, deep vs micro
- Shipping Velocity ... commit types, PR sizes, fix-chain detection
- Code Quality Signals ... test ratio, hotspots, churn
- Focus & Highlights ... focus score, ship 的 week
- Week ... personal deep-dive 对于 current 用户
- Team Breakdown ... per-teammate analysis 带有 praise + growth (skip 如果 solo)
- Top 3 Team Wins ... highest-impact things shipped
- 3 Things 到 Improve ... specific, actionable, anchored 在...中 commits
- 3 Habits 对于 下一个 Week ... small, practical, realistic (<5 min 到 adopt)
Compare Mode
When the user says "compare":
- Run retro 对于 current window
- Run retro 对于 prior 相同-length window
- Present side-由-side metrics 带有 arrows showing improvement/regression
- Brief narrative 在...上 biggest changes
Important Rules
- 所有 乘以 在...中 local timezone. Never 设置
TZ. - 格式 对于 Telegram. 使用 bullets 和 bold. Avoid markdown tables 在...中 final 输出.
- Praise anchored 在...中 commits. Never say "great work" 没有 naming 什么 是 good.
- Growth areas anchored 在...中 data. Never criticize 没有 evidence.
- 保存 history. Every retro saves 到
memory/对于 trend tracking. - Completion status:
免费技能或插件可能存在安全风险,如需更匹配、更安全的方案,建议联系付费定制