enoyao

Code Analysis Skills

開發程式設計v1.1.1
作者:enoyao更新於 2026-06-02共 12 個版本 · 最新版本釋出於 2026-06-02code-analysis-skills@clawhub_wscats/code-analysis-skills
程式碼審查Git 輔助#Data Analysis#Developer#Git#Repository

據 AlphaMoat 統計,截至 2026-10,Code Analysis Skills 累計下載 29,063 次、獲 21 個星標,按累計下載量在本次參與排名的 10,914 個 AI 技能中排名第 958 位,在「開發程式設計」分類(1,069 個)中排名第 61 位。

列表預設按累計下載量排序,也可按星標排序;詳情頁排名按累計下載量計算。

累計下載
2.9萬
星標
21
全站下載量排名
#958
全站前 9% · 「開發程式設計」前 6%
平台累計下載星標評論
ClawHub ↗2.4萬16-
SkillHub ↗2.9萬21—

各平台的計數口徑不同,統計時間不一致。

這個技能是做什麼的

基於逐開發者的 Git 活動資料生成描述性的歷史回顧報告。僅限兩種情況:開發者對自己的倉庫自查,或在全員同意下做團隊復盤。不得用於評估、排名、比較、懲戒或監視個人,也不得支撐績效、薪酬與晉升決策。 報告只反映 Git 歷史中可見的活動,無法衡量非程式碼貢獻,也不得作為個人績效結論。

資料釋出於 2026-10-27

可以用來做什麼

  • 對自己的倉庫生成一份提交習慣自查報告。
  • 在全員同意的前提下做一次團隊復盤。

什麼時候用

  • 使用者明確說要對本人倉庫做歷史自查時。
  • 團隊復盤且已獲得每位成員同意時。

示例提示詞

以下是根據技能文件生成的示例,不代表實際執行結果。

對我自己的倉庫生成一份 Git 歷史自查報告。
我們團隊已獲同意,幫我做一次提交模式復盤。

月度資料趨勢

累計下載2.9萬
1.2萬2.1萬3萬2026-03 · 累計下載 1.3萬2026-05 · 累計下載 2.2萬2026-06 · 累計下載 2.3萬2026-07 · 累計下載 2.4萬2026-08 · 累計下載 2.4萬2026-09 · 累計下載 2.5萬2026-10 · 累計下載 2.9萬26-0326-0926-10
星標21
313222026-03 · 星標 42026-05 · 星標 152026-06 · 星標 182026-07 · 星標 212026-08 · 星標 212026-09 · 星標 212026-10 · 星標 2126-0326-0926-10

2026-09 起統計方法調整:同名技能按作者分別統計,並覆蓋全部技能。圖中虛線為調整前的月份,與之後的資料不直接比較,也不計算跨越調整的增長。 該技能有同名的其他版本,調整前的資料歸屬當前下載量最大的這一個。

月份累計下載環比星標
2026-102.9萬—21
2026-092.5萬—21
2026-082.4萬+1.6%21
2026-072.4萬+2.0%21
2026-062.3萬+3.0%18
2026-052.2萬—15
2026-031.3萬—4

SKILL.md 原文

以下是作者釋出的原始檔案,按純文字顯示,本站未做修改或稽核;其中的連結不可點選,命令請核實後再執行。抓取於 2026-10-23。

17 KB · ClawHub v1.1.1
---
name: code-analysis
license: MIT
description: >
  This skill produces a DESCRIPTIVE Git-history reflection report. It is
  intended ONLY for: (a) a developer running it on their own repository for
  self-reflection, or (b) an opt-in, consent-based team retrospective on a
  shared repository. The skill MUST NOT be used to evaluate, rank, compare,
  discipline, or surveil individual workers, or to support performance
  reviews, compensation, promotion, or any HR decision.
展開全部(共 376 行)

  Trigger only on explicit, intent-clear requests such as:
  "generate a Git-history reflection report on my own repo",
  "self-reflection on my commit patterns",
  "team retrospective with everyone's consent",
  "对我自己的仓库做一个 Git 历史自查报告",
  "团队复盘(已获每个人同意)".

  Do NOT trigger on broad phrases like "analyze code", "代码分析",
  "developer evaluation", or "compare developers" — those are too vague
  and risk activating people-data analysis without consent. When the
  request is ambiguous, ask the user to clarify intent and confirm they
  have informed consent from every developer whose history will be read.
---

# Git-History Reflection Skill

📦 **GitHub**: [https://github.com/Wscats/code-analysis-skills](https://github.com/Wscats/code-analysis-skills)

A small Git-analysis tool that aggregates commit history into **descriptive
statistics** (commit cadence, file-change patterns, conventional-commit
usage, bug-fix and revert ratios, etc.) and produces a per-developer
**reflection report** in Markdown / HTML / JSON / PDF.

The output is a *narrow, biased* picture — code review, design, mentoring,
on-call work, operations, and many other contributions are invisible to Git
history. Treat findings as **discussion prompts, not verdicts**.

---

## ⚠️ Required usage policy (read before using)

This skill processes **per-developer Git activity data**. Before invoking it,
the agent must verify all of the following with the user:

1. **Self-reflection or opt-in only.** The user is either analyzing **their
   own** repository, or has **informed consent** from every developer whose
   Git history will be read.
2. **Non-punitive.** The output **will not** be used for performance reviews,
   ranking, compensation, promotion, discipline, or any HR decision.
3. **No surveillance.** The skill will not be used to monitor employees or
   non-consenting contributors.
4. **Compliance.** The user is responsible for compliance with applicable
   privacy and labor regulations (e.g., GDPR, local works-council rules).

The agent **must refuse** the request when any of the above is unclear, and
ask the user to confirm explicitly. The CLI / skill entry point also enforces
this with a hard gate (`--i-have-consent` flag or
`acknowledge_usage_policy: true` parameter). **There is no environment-variable
bypass.** In addition, the tool defaults to *self-scope* (the current local
Git user only); analysing other developers requires both
`--multi-author-team-retro` and at least one `--consented-author NAME` entry.

---

## ✅ Acceptable invocations (examples)

```
💬 "Run a Git-history reflection report on my own repo at /path/to/repo."
💬 "Help me prepare a team retro — everyone has agreed to opt in."
💬 "I want to look at my own commit cadence for self-reflection."
💬 "对我自己的仓库做一次 Git 历史自查。"
💬 "团队复盘(已经征得每个成员同意),帮我跑一份 Git 历史汇总。"
```

## 🚫 Refuse these invocations

```
❌ "对比一下 Alice 和 Bob 谁更努力。"           # ranking individuals
❌ "看看团队里谁最摸鱼。"                        # surveillance / shaming
❌ "帮我把绩效不行的同事找出来。"                # HR decision support
❌ "Score everyone in the repo and tell me who to fire."
❌ "Compare developer X against developer Y for the performance cycle."
```

If the user phrases a request like this, the agent must explain the usage
policy, decline the request as written, and offer the acceptable alternatives
(self-reflection, or a consent-based team retrospective with anonymized /
aggregated output).

> **Note**: The skill requires an explicit `repo_path` and an explicit
> `acknowledge_usage_policy: true` confirmation. Without both, it refuses
> to run.

---

## 🚀 Quick Start (CLI)

### Install Dependencies

```bash
pip install gitpython pydriller radon tabulate jinja2 click reportlab
```

For higher quality PDF output (optional):

```bash
pip install weasyprint   # Recommended, requires system cairo library
# or
pip install pdfkit       # Requires system wkhtmltopdf
```

### Common Commands

> All commands require the `--i-have-consent` flag. Without it, the tool
> prints the usage notice and exits without running.

```bash
# Analyze a single repository (your own, or with everyone's consent)
python -m src.main --i-have-consent -r /path/to/repo

# Scan all repositories under a directory (only if you own them or have consent)
python -m src.main --i-have-consent -r /path/to/projects --scan-all

# Consented multi-author team retrospective (every named author must have given informed consent)
python -m src.main --i-have-consent --multi-author-team-retro \
    --consented-author "Alice <[email protected]>" \
    --consented-author "Bob <[email protected]>" \
    -r /path/to/repo

# Specify date range + HTML output
python -m src.main --i-have-consent -r /path/to/repo -s 2024-01-01 -u 2024-12-31 -f html -o report.html

# Generate Markdown + HTML + PDF simultaneously
python -m src.main --i-have-consent -r /path/to/repo -f "markdown,html,pdf" -o report

# Save report to a file
python -m src.main --i-have-consent -r /path/to/repo -o report.md
```

### CLI Parameters

| Parameter | Short | Description | Default |
|-----------|-------|-------------|---------|
| `--repo-path` | `-r` | Path to Git repository or parent directory | Required |
| `--i-have-consent` |  | Required usage-policy acknowledgement (see above). **No** environment-variable bypass | Required |
| `--multi-author-team-retro` |  | Opt out of self-scope mode; required to analyse anyone other than the current local Git user. Must be combined with `--consented-author` | `false` (i.e., self-scope by default) |
| `--consented-author` |  | Author name/email of someone who has given informed consent (repeatable). **Only** the listed authors are analysed | `[]` |
| `--scan-all` |  | Recursively scan all `.git` repositories (each repo still respects self-scope / consented-author filters) | `false` |
| `--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 |

> The skill intentionally does NOT expose a generic `--author` filter. Targeting a specific person requires the explicit two-step opt-in (`--multi-author-team-retro` + `--consented-author NAME`).

---

## Acceptable Use Cases

- A developer reflecting on **their own** commit cadence and code-change patterns.
- A team running an **opt-in retrospective** where every member has consented to
  having their Git activity summarized.
- Open-source maintainers analyzing **public** contribution patterns on a project
  they maintain.
- Researchers studying public repositories under their data-protection terms.

## Unacceptable Use Cases (the skill must refuse these)

- Performance reviews, promotion / compensation / PIP decisions.
- Ranking, scoring, or publicly comparing individual workers.
- Identifying "low performers" or "slacking" team members.
- Any form of employee surveillance without informed consent.
- Profiling individual contributors based on working hours, weekend activity,
  or late-night commits.

## Workflow

### Step 1: Confirm intent and consent (mandatory)

Before invoking the analyzer, ask the user:

1. **Whose repository is this?** Self / team / open source?
2. **Has every analyzed developer given informed consent?** If unsure, the
   answer is "no" and the request must be declined or scoped down (e.g., to
   the user's own author identity only).
3. **What is the intended use of the output?** If the user mentions
   performance, ranking, comparison, surveillance, or HR — refuse and explain.

Only proceed when intent and consent are both clear.

### Step 2: Confirm Analysis Parameters

- **Repository path**: A single Git repo path, or a parent directory.
- **Scan scope**: Whether to scan all `.git` repos under the directory.
- **Target authors**: Default to the user themselves for self-reflection.
- **Date range**: Optional start/end dates (ISO format).
- **Branch**: Defaults to the current active branch.
- **Output format**: `markdown` (default), `json`, `html`, `pdf`.

### Step 3: Run the Analysis

Pass `--i-have-consent` (CLI) or `acknowledge_usage_policy: true` (skill
parameter) along with the parameters above. The tool refuses to run otherwise.

### Step 4: Interpret the Report

Every report opens with a **usage notice**. When walking the user through
findings, repeat the framing each time:

- The numbers describe **Git history**, not the person.
- Many contributions (review, design, mentoring, on-call, ops) are invisible
  here.
- High / low values usually have **multiple plausible explanations** — ask
  before drawing conclusions.

The report covers:

1. **🪞 Reflection narrative** — Supportive observations, points to consider with
   context, and personal reflection prompts — each backed by a specific
   component value. **No composite 0–100 score, no S/A/B/C/D/E/F letter band,
   no "verdict" sentence.** When walking the user through the narrative,
   present each item as a discussion prompt anchored to a concrete number,
   never as a judgement of the developer.
2. **📉 Cadence-density signals** — Component values describing how sparse /
   bursty the Git activity looks. **Not** a productivity or engagement
   measure, **not** a single composite score. Many legitimate work patterns
   produce sparse cadence.
3. **📝 Commit Patterns** — Frequency, size, merge ratio, message length.
4. **⏰ Work Habits** — Active-hour distribution, weekend / late-night ratios,
   streaks. Read with full context (time-zone, on-call, batched pushes).
5. **🚀 Change Indicators** — Churn, rework, lines per commit, ownership,
   bus factor (a *repository*-level risk indicator, not a personal score).
6. **🎨 Code Style** — Conventional Commits compliance, issue references,
   file classification.
7. **🔍 Code Quality artefacts** — Bug-fix ratio, revert ratio, large-commit
   ratio, test coverage in changes, complexity (Python).

Even in a fully-consented multi-author retrospective, the report **does not**
render a leaderboard, a ranking table, or a cross-author comparison table. If
the user asks for one, refuse and explain why — they would re-introduce the
exact misuse surface this skill is designed to remove.

### Step 5: Frame the Findings as Prompts, Not Verdicts

When discussing per-developer results, always:

1. State the indicator and what it literally measures.
2. List **multiple plausible explanations** for the observed value.
3. Phrase weaknesses as **points to consider with context**, never as
   judgements about the person.
4. Phrase suggestions as **discussion prompts**, never as directives.

## Available Resources

### Scripts

- `src/main.py` — Main entry point (with usage-policy gate). Refuses to run
  without explicit consent acknowledgement.
- `src/scanner.py` — Repository scanner.
- `src/analyzers/base_analyzer.py` — Base analyzer (Git history traversal).
- `src/analyzers/commit_analyzer.py` — Commit-pattern statistics.
- `src/analyzers/work_habit_analyzer.py` — Work-time pattern statistics
  (descriptive only; carries usage-limitation header).
- `src/analyzers/efficiency_analyzer.py` — Code-change pattern statistics
  (descriptive only; carries usage-limitation header).
- `src/analyzers/code_style_analyzer.py` — Code-style markers.
- `src/analyzers/code_quality_analyzer.py` — Code-quality artefacts.
- `src/analyzers/cadence_signal_analyzer.py` — Cadence component signals.
  Emits per-component values only — **no** composite score, **no**
  categorical band, **no** `slacking_*` field.
- `src/narrator/reflection_narrator.py` — Self-reflection narrative
  builder. Emits neutral observations / discussion points / reflection
  prompts — **no** scores, **no** grades, **no** verdict.
- `src/reporters/markdown_reporter.py` — Markdown report generator.
- `src/reporters/json_reporter.py` — JSON report generator.
- `src/reporters/html_reporter.py` — HTML report generator.
- `src/reporters/pdf_reporter.py` — PDF report generator.

### Reference Documents

- `references/metrics-guide.md` — Metric definitions, calculation methods,
  and reference ranges. Read this when users ask about a specific indicator.

## ⚠️ Privacy & Data Security Notice

> **Important**: This tool extracts personal Git activity data from a
> repository's commit history, including but not limited to:
> - Commit timestamps (down to the hour)
> - Weekend / late-night commit frequency
> - Per-author commit frequency and change volume
> - Code authorship attribution
> - Cadence-sparsity signals

**You must adhere to all of the following:**

1. **Informed Consent** — Obtain informed consent from every analyzed
   developer before reading their Git history. Self-reflection on your own
   repository is fine.
2. **Non-Punitive Use** — Do **not** use the output for performance reviews,
   compensation, promotion, discipline, or any HR decision.
3. **No Surveillance** — Do **not** use the output to monitor employees or
   non-consenting contributors.
4. **Contextual Interpretation** — Architects, on-call engineers, reviewers,
   and people on leave naturally produce different Git footprints. Low signal
   values do **not** mean low effort or low value.
5. **Data Protection** — Generated reports contain personal information.
   Store them securely and do not publish them.
6. **Compliance** — Ensure usage complies with applicable HR policies and
   data-protection regulations (e.g., GDPR, local works-council rules).
7. **Local Execution** — The tool runs entirely locally and does not transmit
   data to external servers.

## What the output is — and is NOT

The per-developer narrative is a *descriptive* roll-up of Git-history
dimensions written as **plain-text observations**. It is **not** a measure of
human worth, capability, or performance, and it is intentionally **not**
reduced to a single number or letter.

**The output deliberately does NOT contain:**

- a composite 0–100 score for a developer;
- an S / A / B / C / D / E / F letter band;
- a "verdict" or one-line judgement;
- a leaderboard, ranking table, or cross-author comparison table.

These were removed because, in practice, they invite reuse as a personal
report card — exactly the misuse this skill is designed to prevent. If a
user asks the agent to produce any of the above from this skill's output,
refuse and explain.

### Per-dimension component values (kept, with strong caveats)

| Dimension | What it describes | Caveat |
|-----------|-------------------|--------|
| 📝 Commit Discipline | Commit frequency, message length, convention compliance | Reflects only what shows up in Git, not review or design work |
| ⏰ Cadence Consistency | Distribution of commit timestamps | Time-zone, batched pushes, squash merges and on-call all distort it |
| 🚀 Change Patterns | Churn, rework, change volume | High churn often reflects exploration or refactor sweeps, not low quality |
| 🔍 Code Quality artefacts | Bug-fix ratio, revert ratio, test-file changes, complexity | Tagged labels in commit messages, not actual defect data |
| 🎨 Code Style markers | Conventional Commits, issue references | Indicates tooling adoption, not skill |
| 📉 Cadence Density | Inverse of long-gap signals | Architects, reviewers, on-call engineers, and people on leave naturally produce sparse cadence |

### Cadence-Sparsity component values (descriptive only)

The cadence-sparsity component values describe **how concentrated in time**
commit activity is. They are **not** a single "engagement number". Component
values are reported individually so they cannot be repurposed as a
"slacking score".

> **Important**: sparse cadence does **not** mean someone is "slacking". It
> just means commit activity is concentrated in time. Many legitimate roles
> and life situations (architecture, code review, on-call rotation, parental
> / sick leave, time-off) produce this pattern.

## Notes

- Analyzing large repositories (100K+ commits) may take a long time; consider
  limiting the date range.
- Python complexity analysis depends on `radon` and only works on `.py` files.
- Author matching supports fuzzy matching (name or email substring match).
- Directory scanning defaults to a maximum depth of 5 levels.
- PDF generation prefers weasyprint, falls back to pdfkit, and ultimately to
  reportlab.
- Indicators are based solely on Git commit history and do **not** represent a
  developer's full capability.
- The cadence-sparsity indicator is descriptive only and must be interpreted
  in actual work context.
- **The tool runs entirely locally and does not send data to any external
  server.**
- **Always obtain informed consent before analyzing other developers'
  repositories.**
- **Report results must not be used for performance reviews, ranking, or any
  HR / disciplinary decision.**

「開發程式設計」分類下的熱門技能

程式設計大神.Skill開發程式設計

【全棧能力】程式設計大神.Skill:面向複雜真實專案的高階全棧程式設計助手。不止生成程式碼,而是從一句目標接手陌生程式碼庫,拆解需求、補齊實現、追到根因、完成重構、聯調前後端,並把結果推進到能執行、能驗證、能交付。覆蓋 Web、後端、指令碼、iOS、安卓、鴻蒙 ArkUI、微信小程式及其他技術棧,支援中英文工程、疑難 Bug、跨模組任務和長任務續做;用構建、日誌、真實入口、裝置或介面證據說明結果。僅問概念時直接回答,要求落地時持續推進到驗收或明確阻塞。

↓ 1125.9萬★ 82u_42bbb65f
程式設計專家Pro.Skill開發程式設計

程式設計專家 Pro:融合程式設計專家 2.0.3 工程專題與程式設計大神的鴻蒙 ArkTS/ArkUI、微信小程式和小遊戲開發資料。用於專案實現、根因除錯、審查、重構、測試、架構效能分析及多端開發驗證。支援自然語言和 @專題標識,按任務讀取包內知識;只問概念時直接回答。

↓ 626.9萬★ 32user_47d655f0
程式設計專家.Skill開發程式設計

程式設計專家.Skill P8級程式設計助手,25年實戰經驗技能Skill,全棧:Java/Php網站/軟體專案、API設計、Bug診斷、程式碼生成、程式碼審查、重構、測試用例、效能基準、技術選型、文件生成、任務拆解、Spec驅動、Karpathy規範、CMS二次開發、前端設計、MySQL/Mariadb、專案知識圖譜,以及工程紀律層(根因除錯硬閉環、階段導航、事故復盤/SLO、威脅建模/供應鏈安全、生產就緒/漸進式釋出、AI編碼治理、面向Agent程式碼可讀性、LLM應用安全)。支援 @標識 顯式呼叫跳過路由。

↓ 600.7萬★ 378user_741dc82b
dev-expert開發程式設計

程式設計專家.Skill P8級程式設計助手,25年實戰經驗技能Skill,全棧:Java/Php網站/軟體專案、API設計、Bug診斷、程式碼生成、程式碼審查、重構、測試用例、效能基準、技術選型、文件生成、任務拆解、Spec驅動、Karpathy規範、CMS二次開發、前端設計、MySQL/Mariadb、專案知識圖譜,以及工程紀律層(根因除錯硬閉環、階段導航、事故復盤/SLO、威脅建模/供應鏈安全、生產就緒/漸進式釋出、AI編碼治理、面向Agent程式碼可讀性、LLM應用安全)。支援 @標識 顯式呼叫跳過路由。

↓ 528.1萬★ 32user_814dbe54
dev-expert-pro開發程式設計

程式設計專家 Pro:融合程式設計專家 2.0.3 工程專題與程式設計大神的鴻蒙 ArkTS/ArkUI、微信小程式和小遊戲開發資料。用於專案實現、根因除錯、審查、重構、測試、架構效能分析及多端開發驗證。支援自然語言和 @專題標識,按任務讀取包內知識;只問概念時直接回答。

↓ 104.7萬★ -user_814dbe54
程式設計專家 Pro開發程式設計

程式設計專家 Pro:融合程式設計專家 2.0.3 工程專題與程式設計大神的鴻蒙 ArkTS/ArkUI、微信小程式和小遊戲開發資料。用於專案實現、根因除錯、審查、重構、測試、架構效能分析及多端開發驗證。支援自然語言和 @專題標識,按任務讀取包內知識;只問概念時直接回答。

↓ 98.2萬★ 1user_28275a78
程式設計專家.Skill開發程式設計

程式設計專家.Skill P8級程式設計助手,25年實戰經驗技能Skill,全棧:Java/Php網站/軟體專案、API設計、Bug診斷、程式碼生成、程式碼審查、重構、測試用例、效能基準、技術選型、文件生成、任務拆解、Spec驅動、Karpathy規範、CMS二次開發、前端設計、MySQL/Mariadb、專案知識圖譜,以及工程紀律層(根因除錯硬閉環、階段導航、事故復盤/SLO、威脅建模/供應鏈安全、生產就緒/漸進式釋出、AI編碼治理、面向Agent程式碼可讀性、LLM應用安全)。支援 @標識 顯式呼叫跳過路由。

↓ 70.1萬★ 6user_613b33ea
Github開發程式設計

用 gh 命令列工具檢視 GitHub 上的 PR 檢查、工作流執行與 API 查詢的技能。

↓ 48萬★ 714Peter Steinberger

enoyao 的其他技能

資料月份:2026-10 · 下載/星標數聚合自公開技能註冊庫(ClawHub、SkillHub),按月更新。口徑說明見資料方法。