Loading...
Loading...
Compare original and translation side by side
echo "COMMITS=$(git rev-list --count HEAD)" && \
echo "FIRST_COMMIT=$(git log --reverse --format='%ad' --date=short | head -1)" && \
echo "LATEST_COMMIT=$(git log --format='%ad' --date=short | head -1)" && \
echo "BRANCHES=$(git branch -a | wc -l | tr -d ' ')"| Repo Size | Commits | | |
|---|---|---|---|
| Small | <500 | (omit --since) | 10 |
| Medium | 500-10k | | 20 |
| Large | >10k | | 30 |
Repo Vitals: Age: [FIRST_COMMIT to LATEST_COMMIT] | Commits: [COMMITS] | Branches: [BRANCHES] | Analysis window: [WINDOW or "all time"]echo "COMMITS=$(git rev-list --count HEAD)" && \
echo "FIRST_COMMIT=$(git log --reverse --format='%ad' --date=short | head -1)" && \
echo "LATEST_COMMIT=$(git log --format='%ad' --date=short | head -1)" && \
echo "BRANCHES=$(git branch -a | wc -l | tr -d ' ')"| 代码库规模 | 提交次数 | | |
|---|---|---|---|
| 小型 | <500 | (省略--since) | 10 |
| 中型 | 500-10k | | 20 |
| 大型 | >10k | | 30 |
Repo Vitals: Age: [FIRST_COMMIT to LATEST_COMMIT] | Commits: [COMMITS] | Branches: [BRANCHES] | Analysis window: [WINDOW or "all time"]WINDOWN--sinceWINDOWN--sincegit log --format=format: --name-only --since="WINDOW" | sort | uniq -c | sort -nr | head -Ngit log --format=format: --name-only --since="WINDOW" | sort | uniq -c | sort -nr | head -Ngit shortlog -sn --no-mergesgit shortlog -sn --no-mergesgit log -i -E --grep="fix|bug|broken" --name-only --format='' --since="WINDOW" | sort | uniq -c | sort -nr | head -Ngit log -i -E --grep="fix|bug|broken" --name-only --format='' --since="WINDOW" | sort | uniq -c | sort -nr | head -Ngit log --format='%ad' --date=format:'%Y-%m' | sort | uniq -cgit log --format='%ad' --date=format:'%Y-%m' | sort | uniq -cgit log --oneline --since="WINDOW" | grep -iE 'revert|hotfix|emergency|rollback'git log --oneline --since="WINDOW" | grep -iE 'revert|hotfix|emergency|rollback'git log --diff-filter=A --since="WINDOW" --name-only --format='' | sort | uniq -c | sort -nr | head -Ngit log --diff-filter=A --since="WINDOW" --name-only --format='' | sort | uniq -c | sort -nr | head -Ngit shortlog -sn --no-merges --since="3 months ago" | wc -lgit shortlog -sn --no-merges --since="3 months ago" | wc -lgit shortlog -sn -- <file>git shortlog -sn -- <file>═══ Codebase Recon Report ═══
Repo Vitals
Age: [first commit] to [latest commit] | Commits: N | Branches: N | Analysis window: WINDOW
1. Code Hotspots (most-changed files)
[ranked list: count filepath]
2. Bug Magnets (files with fix/bug/broken commits)
[ranked list: count filepath]
3. High-Risk Files (appear in BOTH hotspots AND bug magnets)
[list with: filepath — hotspot rank #X, bug magnet rank #Y, primary owner: NAME]
If none overlap, state: "No files appear in both lists — good sign."
4. Bus Factor
[top 10 contributors: count name]
Active (last 3 months): X of Y total contributors
[If active < 30% of total: "Warning: low active contributor ratio — knowledge concentration risk"]
5. Team Momentum
[monthly commit counts, most recent 12 months or all if fewer]
Trend: [rising / stable / declining / erratic]
6. Firefighting Frequency
[list of revert/hotfix/emergency commits, or "None found"]
Rate: N emergency commits out of M total in window (X%)
7. Recently Added Files
[ranked list: count filepath]
8. Recommendations
- Start reading: [top 3 high-risk files, or top 3 hotspots if no high-risk files]
- Talk to: [primary owner of the #1 high-risk or hotspot file]
- Watch out: [any trend warnings — declining momentum, low bus factor, high firefighting rate]"Want me to save this report to a markdown file? (e.g.,)"docs/codebase-recon-report.md
═══ 代码库侦察报告 ═══
代码库关键指标
存续时间:[首次提交日期] 至 [最新提交日期] | 提交次数:N | 分支数量:N | 分析窗口:WINDOW
1. 代码热点(变更最频繁的文件)
[排名列表:变更次数 文件路径]
2. Bug高发文件(关联fix/bug/broken提交的文件)
[排名列表:关联次数 文件路径]
3. 高风险文件(同时出现在热点和Bug高发列表中)
[列表格式:文件路径 — 热点排名#X,Bug高发排名#Y,主要负责人:姓名]
如果没有重叠文件,说明:"无重叠文件——良好信号。"
4. 关键人员风险(Bus Factor)
[前10名贡献者:提交次数 姓名]
活跃贡献者(近3个月):总Y人中的X人
[如果活跃人数<总人数的30%:"警告:活跃贡献者占比低——知识集中风险"]
5. 团队开发势头
[月度提交统计,最近12个月或全部(如果不足12个月)]
趋势:[上升 / 稳定 / 下降 / 波动]
6. 紧急修复频率
[回滚/热修复/紧急提交列表,或"未发现"]
占比:窗口内M次总提交中的N次紧急提交(X%)
7. 近期新增文件
[排名列表:新增次数 文件路径]
8. 建议
- 优先阅读:[前3个高风险文件,若无则为前3个代码热点文件]
- 沟通对象:[排名第1的高风险或热点文件的主要负责人]
- 注意事项:[任何趋势警告——开发势头下降、关键人员风险高、紧急修复频率高]"是否需要将此报告保存为markdown文件?(例如:)"docs/codebase-recon-report.md