跳到正文
cccskills
免费在 GitHub 公开

statistics-infographic

Turns collected repository statistics into an eight-panel PNG infographic. It shows pull request outcomes, timing, code changes, and human versus agent activity, with scripts to recalculate figures and check them against available source records.

中文简介正在准备中。当前显示英语简介。

原文查看原文说明

Generate an eight-panel repository statistics infographic with individual-PR diff histograms and human/agent comment and commit comparisons.

查看安装方法

适用场景

  • Combining repository statistics into one image
  • Updating an infographic with newer collected data
  • Comparing human and agent contributions to pull requests
  • Checking displayed figures against cached source records

包含的文件(11)

  • SKILL.md8.8 KB
  • examples/example.json4.3 KB
  • references/data-contract.md12.9 KB
  • requirements-dev.txt55 B
  • requirements.txt17 B
  • scripts/audit_sources.py16.6 KB
  • scripts/compute_pr_activity.py2.5 KB
  • scripts/compute_pr_changes.py3.2 KB
  • scripts/render_infographic.py20.7 KB
  • scripts/statistics_data.py22.8 KB
  • tests/test_statistics.py31.1 KB

SKILL.md(原文)

安装前可以查看交给 AI 代理的指令内容。

Repository statistics infographic

Use when asked to consolidate repository-statistics slides into one image, regenerate the infographic with updated data, or verify its calculations. This is a reusable eight-panel statistical template, not an arbitrary PowerPoint screenshot collage.

The panels cover inferred PR initiation, merge/closed outcomes, start-to-merge durations, community issue outcomes, Go/JavaScript code composition, and weekly first-parent code changes, plus overlapping histograms of lines added and removed for individual PRs, and mean comments/commits per PR for human versus agent/bot comment-writer and primary-commit-author accounts. Repository names, dates, counts, proportions, and weeks come from the input, never from this skill's original dataset.

Generate

Prefer already collected source evidence. Do not fetch repository data, trigger workflows, or invent missing statistics. Keep raw data and generated images out of the repository. Use a temporary or session artifact directory.

Create a Python 3.9+ virtual environment and install the runtime manifest:

python3 -m venv /tmp/statistics-infographic-venv
/tmp/statistics-infographic-venv/bin/python -m pip install \
  -r .github/skills/statistics-infographic/requirements.txt

Supply either one JSON object following examples/example.json, or a directory of existing summaries:

/tmp/statistics-infographic-venv/bin/python \
  .github/skills/statistics-infographic/scripts/render_infographic.py \
  --input .github/skills/statistics-infographic/examples/example.json \
  --output /tmp/statistics-infographic.png

For real data, replace --input with --data-dir /path/to/summaries. See references/data-contract.md for schemas and statistical definitions. The example is explicitly synthetic, not a gh-aw report.

Optional arguments: --title, --font-regular, and --font-bold. Supply both font paths together. Automatic discovery supports Arial on macOS/Windows and Liberation Sans or DejaVu Sans on Linux. Missing fonts fail explicitly; no bitmap fallback is used.

The output is a static, RGB, 2560 x 5040 PNG with 300-DPI metadata. A successful render atomically replaces the explicit output path. Invalid data, unreadable layout, or invalid fonts leave an existing output intact. Counts too large for their slots, more than 10 duration bands, or more than 260 weeks require a different layout; do not silently truncate, rescale text to illegibility, or aggregate data.

Recompute individual PR change sizes

The seventh panel counts individual PRs, never weeks, commits, or files. Each census PR contributes its GitHub additions value to one bin of the added series and its deletions value to one bin of the removed series, including zeros. The x-axis is lines per PR; the y-axis is number of PRs. Both series use the same equal-width integer bins; bars overlap with transparency, not stacking or mirroring. The population includes merged, closed-unmerged, and open census PRs across all files, unlike the Go/JS-only weekly history panel.

To recompute pr-change-histogram.json and a standalone image from cached raw records containing individual PR number, additions, deletions, state, and createdAt fields:

/tmp/statistics-infographic-venv/bin/python \
  .github/skills/statistics-infographic/scripts/compute_pr_changes.py \
  --raw-dir /path/to/raw-records \
  --census /path/to/summaries/pr-initiation-assumption-summary.json \
  --output-dir /path/to/summaries

This writes pr-change-histogram.json and pr-change-histogram.png (2560 x 1180). The summary is the required pr_changes section in the combined input, or the sixth canonical file for --data-dir. Re-render the complete image with all seven summaries. Missing per-PR additions/deletions fail explicitly; never substitute weekly Git totals, merge-commit churn, or missing values as zero. The command never fetches or refreshes API snapshots. If raw PR diff statistics are unavailable, disclose that real-data recomputation is blocked. Keep any rendered synthetic example clearly labelled and separate.

Compare human and agent PR activity

Panel 08 counts who wrote each comment and authored each commit, never who created the PR. Each PR can contain both human and agent/bot contributions. For each author group, divide its total comments and primary-authored commits by the same entire PR census, including PRs with no contributions in that group. Use exact-rational means rounded half up to one decimal. No human contributions means zero, not an undefined or excluded PR population.

/tmp/statistics-infographic-venv/bin/python \
  .github/skills/statistics-infographic/scripts/compute_pr_activity.py \
  --raw-dir /path/to/raw-records \
  --census /path/to/summaries/pr-initiation-assumption-summary.json \
  --output-dir /path/to/summaries

Raw PRs need fully paginated comments { totalCount nodes { id author { login __typename } } } and commits { totalCount nodes { commit { oid author { user { login __typename } } } } } alongside number, state, and creation date. Counts-only records are insufficient. Every connection total must match its complete, distinct node inventory. The command writes pr-activity-summary.json (the required pr_activity section) and standalone pr-activity.png (2560 x 1180). Classify each comment's author and each commit's linked primary author.user. User accounts without bot/machine-user naming are human proxies; Bot actors, [bot] logins, and known Copilot accounts are agent/bot accounts. Unknown/deleted comment authors, unlinked commit authors, and other machine-user accounts stay unattributed. Disclose unknown comment and commit counts separately. Do not use the PR creator, committer, coauthor trailer, name, or email as a fallback. Agent/bot includes non-AI automation; account attribution is not proof of AI use. Comments exclude inline review comments and review submissions. Count each commit once per PR by its primary author, not once per coauthor or globally across PRs. The summary declares group_by: contribution-author; legacy PR-creator summaries must fail rather than being silently reused.

Verify accuracy

Input validation proves internal reconciliation, not correctness of the evidence. When cached raw API records are available, independently recompute the displayed statistics before delivery:

/tmp/statistics-infographic-venv/bin/python \
  .github/skills/statistics-infographic/scripts/audit_sources.py \
  --data-dir /path/to/summaries \
  --raw-dir /path/to/raw-records \
  --repo /path/to/local-checkout

The auditor also accepts --input instead of --data-dir. Omit --repo only if local Git evidence is unavailable, and disclose that code/history were not audited. For a repository migration, explicitly supply a repeatable --repository-alias previous-owner/previous-name only when issue numbering is known to be shared.

The Git audit reads immutable objects at the full input commit, not the worktree. It requires complete local history, disables lazy object fetching, and never requests credentials or performs network operations. Missing objects or shallow history fail explicitly. Large repositories may require substantial memory for the batched blob inventory.

Open the resulting image and inspect all eight panels at normal viewing size: titles, axes, labels, footnotes, chart proportions, and snapshot metadata. Automated text-bound and overlap checks complement but do not replace visual inspection.

Deliver the image with its path and disclose missing independent checks or evidence limitations. In particular, inferred source issues do not prove who initiated an agent session or which device they used. The no-issue human assumption must be explicitly authorized for the dataset.

Maintain

Install the development manifest only for validation work:

/tmp/statistics-infographic-venv/bin/python -m pip install \
  -r .github/skills/statistics-infographic/requirements-dev.txt
HYPOTHESIS_STORAGE_DIRECTORY=/tmp/statistics-infographic-hypothesis \
  /tmp/statistics-infographic-venv/bin/python -m unittest discover \
  -s .github/skills/statistics-infographic/tests -v
/tmp/statistics-infographic-venv/bin/python -m mypy --strict \
  .github/skills/statistics-infographic/scripts

The implementation uses immutable typed records, explicit invariants, exact rational count ratios with half-up rounding, Decimal-oracle property tests, source-mutation regressions, deterministic rendering, safe CLI output tests, and pinned-object Git fixtures. These are rigorous software checks, not a mathematical proof of the whole program or of causal attribution.

评价

还没有评价。欢迎分享你的使用感受。

评论

无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。

还没有评论。来写第一条吧。

提交后会立即公开。请勿填写邮箱、电话等个人信息。URL 最多 2 个。

0 / 1000 字

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

同一仓库的技能

Coordinate work across AI agents with shared rules for locating team files, recording decisions and their reasons, and requesting help. It also defines who owns revisions after a reviewer rejects an artifact.

中文简介正在准备中。当前显示英语简介。

  • Locate team files across separate working directories
  • Record decisions that affect other agents
  • Request input from another specialist
github/gh-aw54242026年10月20日 更新

Set shared development rules for an agent team: keep specific agent names out of product code, tests, and CI configuration, verify affected tests before finishing, and record lessons learned from mistakes.

中文简介正在准备中。当前显示英语简介。

  • Share development rules across multiple agents
  • Keep team-specific agent names out of code and tests
  • Check affected tests before declaring work complete
github/gh-aw54242026年10月20日 更新

Routes requests to design, create, update, debug, or upgrade GitHub Agentic Workflows to the appropriate instructions. It helps the agent select a workflow-specific procedure and apply any additional rules defined for the repository.

中文简介正在准备中。当前显示英语简介。

  • Designing a new workflow through questions
  • Investigating failed runs and recurring errors
  • Upgrading workflows and addressing deprecations
github/gh-aw54242026年10月20日 更新

Prepare architecture proposals before implementation so the team can agree on a direction. Organize evidence, technical choices, effects on existing work, risks, and the first release’s scope into a document with clear recommendations and decision owners.

中文简介正在准备中。当前显示英语简介。

  • Proposing a major architecture change
  • Replanning milestones after a foundation change
  • Comparing technical options before seeking approval
github/gh-aw54242026年10月20日 更新

Update the gh-aw-firewall version used by gh-aw, rebuild generated files, and review release notes and configuration schemas, which define valid settings. It guides related code and test updates while identifying follow-up work that remains.

中文简介正在准备中。当前显示英语简介。

  • Updating the firewall version used by gh-aw
  • Reviewing release notes for integration changes
  • Checking configuration schema differences
github/gh-aw54242026年10月20日 更新

Review git and gh operations in gh-aw workflows to check credential availability for each repository. Identify missing token handoffs, risky expansions of limited checkouts, and error handling needed where credentials are intentionally unavailable.

中文简介正在准备中。当前显示英语简介。

  • Reviewing git operations after repository checkout
  • Checking tokens for private cross-repository access
  • Reviewing sparse and shallow checkout changes
github/gh-aw54242026年10月20日 更新

查看 github 的全部技能

报告此技能的问题