Code Analysis Skill
📦 GitHub: https://github.com/Wscats/code-analysis-skills
Scan specified repositories or directories containing Git repositories, analyze and compare developers' commit habits, work patterns, development efficiency, code style, code quality, and slacking index. Provide blunt, data-driven evaluations for each developer with scores, grades, strengths, weaknesses, and actionable suggestions. Output structured reports in Markdown / HTML / JSON / PDF.
💬 Natural Language (Recommended)
You don't need to memorize any commands — simply describe what you need in your own language:
🇺🇸 English
CODEBLOCK0
🇨🇳 中文
CODEBLOCK1
🇯🇵 日本語
CODEBLOCK2
🇰🇷 한국어
CODEBLOCK3
🇪🇸 Español
CODEBLOCK4
🇫🇷 Français
CODEBLOCK5
🇩🇪 Deutsch
CODEBLOCK6
Note: You need to provide the repository path (repo_path) — it is a required parameter. If you are already working within a repository context, the agent may infer the path from the conversation, but an explicit path is always recommended for accuracy.
The Skill understands all the languages above. Just describe what you need and it will run the analysis on your repository and return a structured report.
🚀 Quick Start (CLI)
Install Dependencies
CODEBLOCK7
For higher quality PDF output (optional):
CODEBLOCK8
Common Commands
CODEBLOCK9
CLI Parameters
| Parameter | Short | Description | Default |
|---|
| INLINECODE1 | INLINECODE2 | Path to Git repository or parent directory | Required |
| INLINECODE3 |
| Recursively scan all
.git repositories |
false |
|
--author |
-a | Filter by author (repeatable) | All authors |
|
--since |
-s | Start date (ISO format) | None |
|
--until |
-u | End date (ISO format) | None |
|
--branch |
-b | Branch to analyze | Active branch |
|
--format |
-f | Output format:
markdown,
json,
html,
pdf (comma-separated for multiple) |
markdown |
|
--output |
-o | Output file path | stdout |
Use Cases
- - Analyze developer behavior in a Git repository
- Compare team members' commit habits and development efficiency
- Understand code quality trends and style consistency
- Batch-analyze all
.git repositories under a directory - Generate work habit reports (active hours, weekend/late-night coding, streaks, etc.)
- Evaluate each developer's overall capability with scores, strengths, weaknesses, and suggestions
- View the team's "Slacking Index" leaderboard
- Produce formal PDF reports for review
Workflow
Step 1: Confirm Analysis Parameters
Ask the user for the following information:
- - Repository path: A single Git repo path, or a parent directory containing multiple repos
- Scan scope: Whether to scan all
.git repos under the directory (--scan-all) - Target authors: Analyze specific developers (multi-select) or all contributors
- Date range: Optional start/end dates (ISO format, e.g.,
2024-01-01) - Branch: Branch to analyze; defaults to the current active branch
- Output format:
markdown (default), json, html, pdf, or comma-separated combination
Step 2: Run the Analysis
Execute the analysis script with the confirmed parameters (see Quick Start above for command examples).
Step 3: Interpret the Report
The report covers seven dimensions. Walk the user through the key findings for each:
- 1. 🏆 Developer Evaluation — Overall score (S/A/B/C/D/E/F), strengths, weaknesses, improvement suggestions, one-line verdict
- 🐟 Slacking Index — Activity level, trivial commit ratio, disappearance ratio, low output, procrastination signals
- 📝 Commit Habits — Commit frequency, commit size, merge ratio, message quality
- ⏰ Work Habits — Active hour distribution, weekend/late-night coding ratio, consecutive coding streaks
- 🚀 Development Efficiency — Code churn rate, rework rate, Bus Factor, file ownership
- 🎨 Code Style — Language distribution, Conventional Commits compliance, file classification
- 🔍 Code Quality — Bug fix ratio, revert frequency, large commit ratio, test coverage, complexity
For multi-developer analysis, additional sections include:
- - 📋 Cross-comparison summary table
- 🏆 Developer score leaderboard
- 🐟 Slacking Index leaderboard
Step 4: Deep-Dive into Evaluation Results
For each developer's evaluation, deliver a blunt, no-nonsense interpretation to the user:
- 1. Score & Grade: Total score (0-100) and corresponding grade (S/A/B/C/D/E/F)
- Six Dimension Scores: Commit discipline, work consistency, efficiency, code quality, code style, engagement
- Strengths: Each backed by concrete data, not generic praise
- Weaknesses: No sugarcoating — point directly at the problem and its impact
- Suggestions: Actionable improvement measures, each immediately executable
- Slacking Index: Interpret each signal and its meaning
Available Resources
Scripts
- -
src/main.py — Main entry point with CLI argument support, orchestrates the full analysis pipeline and generates reports - INLINECODE32 — Repository scanner, discovers single or recursively scans multiple Git repositories
- INLINECODE33 — Base analyzer class providing Git history traversal and author filtering
- INLINECODE34 — Commit habit analysis (frequency, size, message quality)
- INLINECODE35 — Work habit analysis (active hours, weekends, late nights, streaks)
- INLINECODE36 — Development efficiency analysis (churn, rework, bus factor)
- INLINECODE37 — Code style analysis (language distribution, commit conventions)
- INLINECODE38 — Code quality analysis (bug fixes, reverts, complexity)
- INLINECODE39 — Slacking index analysis (activity, trivial commits, disappearance patterns, procrastination, etc.)
- INLINECODE40 — Developer evaluation engine (overall scoring, strengths/weaknesses, suggestions, verdicts)
- INLINECODE41 — Markdown report generator
- INLINECODE42 — JSON report generator
- INLINECODE43 — HTML report generator (with rich visual styling)
- INLINECODE44 — PDF report generator (supports weasyprint/pdfkit/reportlab fallback)
Reference Documents
- -
references/metrics-guide.md — Metric definitions, calculation methods, and healthy value reference ranges. Read this file when users ask about the meaning of a specific metric.
⚠️ Privacy & Data Security Notice
Important: This tool extracts personal developer activity data from Git commit history, including but not limited to:
- - Commit timestamps (down to the hour)
- Weekend/late-night coding frequency
- Individual commit frequency and output volume
- Code ownership attribution
- Slacking index and behavioral assessments
Before using, you must adhere to the following principles:
- 1. Informed Consent — Obtain informed consent from all relevant developers before analyzing their repositories
- Non-Punitive Use — Analysis results must not be directly used for performance reviews, compensation decisions, or punitive management
- Contextual Understanding — Data must be interpreted within actual work context (e.g., architects naturally commit less; that does not indicate low output)
- Data Protection — Generated reports contain personal information and should be securely stored, not publicly shared
- Compliance — Ensure usage complies with your organization's HR policies and local data protection regulations (e.g., GDPR)
- Local Execution — This tool runs entirely locally and does not transmit any data to external servers
Evaluation System
Overall Score (0-100)
| Grade | Score Range | Meaning |
|---|
| S | 90-100 | Top-tier contributor, excellent across all dimensions |
| A |
80-89 | Outstanding developer, reliable and efficient |
| B | 70-79 | Solid contributor with minor room for improvement |
| C | 60-69 | Adequate, but needs improvement in multiple areas |
| D | 50-59 | Barely passing, has clear weaknesses |
| E | 35-49 | Below expectations, requires serious attention |
| F | 0-34 | Critical issues, needs coaching or intervention |
Six Dimension Weights
| Dimension | Weight | What It Evaluates |
|---|
| 📝 Commit Discipline | 15% | Commit frequency, message quality, convention compliance |
| ⏰ Work Consistency |
15% | Routine regularity, work continuity |
| 🚀 Efficiency | 20% | Code churn rate, rework rate, output volume |
| 🔍 Code Quality | 25% | Bug fix rate, revert rate, test coverage, complexity |
| 🎨 Code Style | 10% | Conventional Commits, issue references |
| 💪 Engagement | 15% | Inverse of slacking index signals |
Slacking Index (0-100)
| Level | Score Range | Meaning |
|---|
| 🔥 Workaholic | 0-20 | Highly engaged, continuous contributions |
| ✅ Normal |
21-40 | Healthy work pattern |
| 😏 Suspicious | 41-60 | Some slacking signals detected |
| 🐟 Slacking Pro | 61-80 | Significant low-engagement indicators |
| 🏆 Slacking Master | 81-100 | Professional-grade slacking |
Notes
- - Analyzing large repositories (100K+ commits) may take a long time; consider limiting the date range
- Python code complexity analysis depends on the
radon library and only works on .py files - Author matching supports fuzzy matching (matches on name or email containing the keyword)
- Directory scanning defaults to a maximum depth of 5 levels to avoid excessive recursion
- PDF generation prefers weasyprint, falls back to pdfkit, and ultimately falls back to reportlab
- Evaluation results are based solely on Git commit history and do not represent a developer's full capability
- The slacking index is for reference only and should be interpreted in actual work context
- This tool runs entirely locally and does not send data to any external server
- Always obtain informed consent before analyzing team repositories
- Report results must not be directly used for performance reviews or punitive management decisions
... EOF
代码分析技能
📦 GitHub: https://github.com/Wscats/code-analysis-skills
扫描指定的仓库或包含 Git 仓库的目录,分析并比较开发者的提交习惯、工作模式、开发效率、代码风格、代码质量和摸鱼指数。为每位开发者提供直白、数据驱动的评估,包含评分、等级、优势、劣势和可操作建议。以 Markdown / HTML / JSON / PDF 格式输出结构化报告。
💬 自然语言(推荐)
无需记忆任何命令——只需用你自己的语言描述需求:
🇺🇸 英文
💬 分析 /path/to/repo 中 Alice 的开发效率
💬 向我展示这个项目中团队的工作习惯
💬 比较 Alice 和 Bob 的代码质量
💬 这个项目的摸鱼指数是多少?
💬 生成一份完整的开发者评估报告
💬 给所有开发者评分,并告诉我谁在摸鱼
💬 Bob 的提交习惯有什么问题?
💬 这是我的仓库,你能分析一下团队吗?
🇨🇳 中文
💬 分析一下这个仓库 Alice 的研发效率
💬 帮我看看团队成员的工作习惯
💬 对比一下 Alice 和 Bob 的代码质量
💬 看看这个项目的摸鱼指数
💬 给所有开发者做个完整评估打分
💬 谁的代码质量最差?帮我分析下
💬 最近一个月团队的提交习惯怎么样?
💬 这个仓库有什么问题?帮我诊断下
🇯🇵 日语
💬 このリポジトリの開発者効率を分析してください
💬 チームメンバーの作業習慣を見せてください
💬 AliceとBobのコード品質を比較してください
💬 このプロジェクトのサボり指数は?
💬 全開発者の評価レポートを作成してください
🇰🇷 韩语
💬 이 레포지토리의 개발 효율성을 분석해줘
💬 팀원들의 작업 습관을 보여줘
💬 Alice와 Bob의 코드 품질을 비교해줘
💬 이 프로젝트의 땡땡이 지수가 뭐야?
💬 모든 개발자에 대한 평가 보고서를 만들어줘
🇪🇸 西班牙语
💬 Analiza la eficiencia de desarrollo de Alice en este repositorio
💬 Muéstrame los hábitos de trabajo del equipo
💬 Compara la calidad del código de Alice y Bob
💬 ¿Cuál es el índice de holgazanería de este proyecto?
💬 Genera un informe de evaluación completo de los desarrolladores
🇫🇷 法语
💬 Analyse lefficacité de développement dAlice dans ce dépôt
💬 Montre-moi les habitudes de travail de léquipe
💬 Compare la qualité du code dAlice et de Bob
💬 Quel est lindice de paresse de ce projet ?
💬 Génère un rapport dévaluation complet des développeurs
🇩🇪 德语
💬 Analysiere die Entwicklungseffizienz von Alice in diesem Repository
💬 Zeig mir die Arbeitsgewohnheiten des Teams
💬 Vergleiche die Codequalität von Alice und Bob
💬 Was ist der Faulenzer-Index dieses Projekts?
💬 Erstelle einen vollständigen Bewertungsbericht für alle Entwickler
注意:你需要提供仓库路径(repo_path)——这是一个必需参数。如果你已经在某个仓库上下文中工作,代理可能会从对话中推断路径,但为了准确性,始终建议提供显式路径。
该技能理解以上所有语言。只需描述你的需求,它就会在你的仓库上运行分析并返回结构化报告。
🚀 快速开始(命令行)
安装依赖
bash
pip install gitpython pydriller radon tabulate jinja2 click reportlab
如需更高质量的 PDF 输出(可选):
bash
pip install weasyprint # 推荐,需要系统 Cairo 库
或
pip install pdfkit # 需要系统 wkhtmltopdf
常用命令
bash
分析单个仓库(所有贡献者)
python -m src.main -r /path/to/repo
扫描目录下的所有仓库
python -m src.main -r /path/to/projects --scan-all
比较特定开发者
python -m src.main -r /path/to/repo -a Alice -a Bob
指定日期范围 + HTML 输出
python -m src.main -r /path/to/repo -s 2024-01-01 -u 2024-12-31 -f html -o report.html
同时生成 Markdown + HTML + PDF
python -m src.main -r /path/to/repo -f markdown,html,pdf -o report
仅生成 PDF 报告
python -m src.main -r /path/to/repo -f pdf -o report.pdf
将报告保存到文件
python -m src.main -r /path/to/repo -o report.md
命令行参数
| 参数 | 简写 | 描述 | 默认值 |
|---|
| --repo-path | -r | Git 仓库或父目录路径 | 必需 |
| --scan-all |
| 递归扫描所有 .git 仓库 | false |
| --author | -a | 按作者筛选(可重复) | 所有作者 |
| --since | -s | 开始日期(ISO 格式) | 无 |
| --until | -u | 结束日期(ISO 格式) | 无 |
| --branch | -b | 要分析的分支 | 当前活动分支 |
| --format | -f | 输出格式:markdown、json、html、pdf(多个格式用逗号分隔) | markdown |
| --output | -o | 输出文件路径 | 标准输出 |
使用场景
- - 分析 Git 仓库中的开发者行为
- 比较团队成员的提交习惯和开发效率
- 了解代码质量趋势和风格一致性
- 批量分析目录下的所有 .git 仓库
- 生成工作习惯报告(活跃时段、周末/深夜编码、连续编码天数等)
- 评估每位开发者的综合能力,包含评分、优势、劣势和建议
- 查看团队的摸鱼指数排行榜
- 生成正式的 PDF 报告供审查
工作流程
步骤 1:确认分析参数
向用户询问以下信息:
- - 仓库路径:单个 Git 仓库路径,或包含多个仓库的父目录
- 扫描范围:是否扫描目录下的所有 .git 仓库(--scan-all)
- 目标作者:分析特定开发者(多选)或所有贡献者
- 日期范围:可选的开始/结束日期(ISO 格式,例如 2024-01-01)
- 分支:要分析的分支;默认为当前活动分支
- 输出格式:markdown(默认)、json、html、pdf,或逗号分隔的组合
步骤 2:运行分析
使用确认的参数执行分析脚本(命令示例请参见上面的快速开始部分)。
步骤 3:解读报告
报告涵盖七个维度。引导用户了解每个维度的关键发现:
- 1. 🏆 开发者评估 — 总体评分(S/A/B/C/D/E/F)、优势、劣势、改进建议、一句话总结
- 🐟 摸鱼指数 — 活跃度、琐碎提交比例、消失比例、低产出、拖延信号
- 📝 提交习惯 — 提交频率、提交大小、合并比例、提交信息质量
- ⏰ 工作习惯 — 活跃时段分布、周末/深夜编码比例、连续编码天数
- 🚀 开发效率 — 代码变更率、返工率、巴士因子、文件所有权
- 🎨 代码风格 — 语言分布、约定式提交合规性、文件分类
- 🔍 代码质量 — Bug 修复比例、回退频率、大提交比例、测试覆盖率、复杂度
对于多开发者分析,还包括以下部分:
- - 📋 交叉比较汇总表
- 🏆 开发者评分排行榜
- 🐟 摸鱼指数排行榜
步骤 4:深入解读评估结果
对于每位开发者的评估,向用户提供直白、不拐弯抹角的解读:
- 1. 评分与等级:总分(0