potiuk opened a new pull request, #65698: URL: https://github.com/apache/airflow/pull/65698
Adds a new Claude Code skill, `pr-stats`, that produces the two backlog-summary tables that `breeze pr stats` prints, grouped by `area:*` label, read-only. It's the statistical complement of the `pr-triage` skill (#65648): same repo, same triage-detection logic, no mutations. > Depends on #65648 — once that lands, this PR's diff against `main` reduces to just the new `.github/skills/pr-stats/` tree and the small `.gitignore` / `.pre-commit-config.yaml` changes. Until then, the diff here will include both skills because this branch is stacked. ## Output shape Two Markdown tables plus a short legend and a one-line summary: 1. **Triaged PRs — Final State since `<cutoff>`** — closed / merged PRs that had a triage comment posted at some point, broken down by area label. Columns: Triaged Total, Closed / %Closed, Merged / %Merged, Responded / %Responded (author replied before close). 2. **Triaged PRs — Still Open** — every currently-open PR, broken down by area. Columns: Total, Draft / %Draft, Non-Draft, Contrib. / %Contrib., Triaged, Responded / %Responded, Ready / %Ready, Drafted by triager, plus "Drafted" age-bucket histograms (`<1d`, `1-3d`, `3-7d`, `1-2w`, `2-4w`, `>4w`) and "Author resp" age-bucket histograms on the same bucket boundaries. A bold `TOTAL` row on each table counts every PR exactly once (not the column-wise sum of per-area rows — a PR with two `area:*` labels would otherwise double-count). The one-line summary at the end is the format a maintainer can paste into a weekly status update. ## Shape Follows the existing `airflow-translations` / `pr-triage` convention: - `.github/skills/pr-stats/` holds the canonical content — `SKILL.md` as entry point plus four topic files: `fetch.md` (paginated GraphQL shapes for open + closed-since-cutoff), `classify.md` (triage marker detection, age buckets, drafted-by-triager), `aggregate.md` (area grouping, TOTAL row, percentage rules), `render.md` (exact column order, Markdown alignment, legend, summary line). - `.claude/skills/pr-stats` is a committed symlink so Claude Code picks it up without per-developer setup; `.gitignore` is updated to let the symlink through. - `.pre-commit-config.yaml` adds `pr-stats/SKILL.md` to the agentic-markdown license-header exclusion (same treatment as `pr-triage/SKILL.md`). ## Design choices - **Triage-detection is delegated, not duplicated.** The "is this PR triaged" test reuses the canonical `Pull Request quality criteria` marker from `pr-triage/comment-templates.md`, and `pr-stats/classify.md` explicitly references `pr-triage/classify.md#c4-already_triaged` as the single source of truth. Any rule change in one skill must ship simultaneously in the other — that coupling is intentional. - **No mutations, no per-PR drill-in, no trend charts.** A single snapshot per invocation. If the maintainer wants to act on what they see, the follow-up is `pr-triage label:area:<X>`. - **Budget: ~10 GraphQL calls regardless of backlog size.** 6 paginated calls for ~300 open PRs at `batchSize=50`, 2 for the closed-since cutoff, 1 pre-flight, 1 viewer login. No per-PR REST calls — the triage-marker scan is satisfied by `comments(last: 10)` in the open-PR query and `comments(last: 25)` for closed PRs. - **15-minute cache freshness** at `/tmp/pr-stats-cache-<repo-slug>.json` so re-running the skill inside a single interactive session (e.g. stats → triage → stats) is cheap, with explicit `clear-cache` invalidation. ## Test plan - [x] Skill structure mirrors `pr-triage` — `SKILL.md` frontmatter, golden rules, detail-file split — so the skill catalog stays consistent. - [x] `prek run codespell` passes on the new files (caught one "reponded" typo in the process). - [x] `prek run markdownlint` passes on the new files. - [x] License-header hook does not try to insert a header into `pr-stats/SKILL.md` (mirrors the `pr-triage/SKILL.md` exclusion). --- ##### Was generative AI tooling used to co-author this PR? - [X] Yes — Claude Opus 4.7 (1M context) Generated-by: Claude Opus 4.7 (1M context) following [the guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
