[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6C2AW2ZQKGH543TSPB1RKYZ":3,"skill-same:01M6C2AW2ZQKGH543TSPB1RKYZ":69},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":8,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":13,"sourceHtmlUrl":17,"categories":18,"keywords":29,"publishedAt":43,"linkOnly":44,"markdownContent":45,"markdownBody":46,"frontMatter":47,"refName":48,"commitSha":49,"skillDirectory":50,"forksCount":51,"repositoryHtmlUrl":52,"repositoryHomepageUrl":13,"ownerHtmlUrl":53,"ownerBlogUrl":13,"ownerDescription":13,"updatedAt":54,"install":55,"resources":68},"01M6C2AW2ZQKGH543TSPB1RKYZ","pr-efficiency-audit","PR 交付效率审计","Audit PR throughput, creation-to-merge duration, and stage dwell using exact UTC windows, full pagination, and mechanical event histories.","使用精确的 UTC 时间窗口、完整分页和机械式事件历史，审计 PR 吞吐量、从创建到合并的时长以及各阶段停留时间。","jleechanorg\u002Fjleechan-skills","jleechanorg","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F221404966?v=4","01M6C1VJ99XG950X1DWPEBCBGX",null,"01M6C1VJDK5YVDNT3362RT5WSB",6,"MIT","https:\u002F\u002Fgithub.com\u002Fjleechanorg\u002Fjleechan-skills\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fpr-efficiency-audit\u002FSKILL.md",[19,24],{"categoryNo":20,"categoryName":21,"taxonomyType":22,"taxonomyTypeDesc":23},"01M8BR5V701HCN066VEP7H4812","代码仓库协作管理","SCENARIO","使用场景",{"categoryNo":25,"categoryName":26,"taxonomyType":27,"taxonomyTypeDesc":28},"01M8C31AVFVV99RWJEGF9PS85F","项目经理","PROFESSION","适用职业",[30,31,32,33,34,35,36,37,38,39,40,41,42],"pr","audit","pr efficiency audit","efficiency","merge","windows","creation","event","mechanical","stage","pagination","throughput","full","2026-11-10 10:12:30",false,"---\nname: pr-efficiency-audit\ndescription: Audit PR throughput, creation-to-merge duration, and stage dwell using exact UTC windows, full pagination, and mechanical event histories.\n---\n\n# PR Efficiency Audit (\u002Fefficiency)\n\nAudits pull request throughput, lifecycle duration, and stage dwell across exact equal UTC windows without flawed sampling, artificial conversion metrics, or crude string-similarity heuristics.\n\n## Measurement Protocol\n\n### 1. Window Definition & Full Pagination\n- **Exact UTC windows**: Define equal, non-overlapping or comparable windows using ISO-8601 timestamps (e.g. `[YYYY-MM-DDTHH:MM:SSZ, YYYY-MM-DDTHH:MM:SSZ)`).\n- **Full pagination via GraphQL**: `gh pr list` does not support `--paginate`. Use `gh api graphql --paginate` with `$endCursor: String` and `pageInfo { hasNextPage, endCursor }` to traverse all results sequentially:\n  ```bash\n  # Query PRs created within window using cursor pagination\n  gh api graphql --paginate -f query='\n    query($q: String!, $endCursor: String) {\n      search(query: $q, type: ISSUE, first: 100, after: $endCursor) {\n        issueCount\n        pageInfo {\n          hasNextPage\n          endCursor\n        }\n        nodes {\n          ... on PullRequest {\n            number\n            title\n            state\n            createdAt\n            closedAt\n            mergedAt\n            labels(first: 20) {\n              nodes { name }\n            }\n          }\n        }\n      }\n    }\n  ' -f q=\"repo:\u003Cowner>\u002F\u003Crepo> is:pr created:\u003CWINDOW_START>..\u003CWINDOW_END>\"\n  ```\n  Query merged PRs in the same window separately if measuring merge events:\n  ```bash\n  # Query PRs merged within window using cursor pagination\n  gh api graphql --paginate -f query='\n    query($q: String!, $endCursor: String) {\n      search(query: $q, type: ISSUE, first: 100, after: $endCursor) {\n        issueCount\n        pageInfo {\n          hasNextPage\n          endCursor\n        }\n        nodes {\n          ... on PullRequest {\n            number\n            title\n            state\n            createdAt\n            closedAt\n            mergedAt\n            labels(first: 20) {\n              nodes { name }\n            }\n          }\n        }\n      }\n    }\n  ' -f q=\"repo:\u003Cowner>\u002F\u003Crepo> is:pr is:merged merged:\u003CWINDOW_START>..\u003CWINDOW_END>\"\n  ```\n- **Search-count and cap checks**: Verify `issueCount` on the first response page. GitHub Search caps results at 1,000 items. If `issueCount >= 1000`, the query hits the cap and will truncate; split the time window into narrower sub-windows (e.g. daily slices) to ensure complete data retrieval.\n- **Half-open exact timestamp postfilters**: GitHub search date syntax (`created:START..END`, `merged:START..END`, `closed:START..END`) operates on day\u002Fminute resolution with inclusive boundaries. Apply an exact postfilter on ISO-8601 timestamps matched to the specific measured event to maintain half-open `[WINDOW_START, WINDOW_END)` boundaries:\n  * When filtering created PRs (`created:...`), postfilter on `createdAt`: `createdAt >= WINDOW_START && createdAt \u003C WINDOW_END`.\n  * When filtering merged PRs (`merged:...`), postfilter on `mergedAt`: `mergedAt >= WINDOW_START && mergedAt \u003C WINDOW_END`. Never filter merge events on `createdAt`, which drops backlog PRs created prior to the window start that merged inside the window.\n  * When filtering closed unmerged PRs (`closed:...`), postfilter on `closedAt`: `closedAt >= WINDOW_START && closedAt \u003C WINDOW_END`.\n\n### 2. Throughput & Cohort Metrics\n- **Equal weekly window stratification**:\n  * Compare equal weekly windows stratified by **repository**, **selected route\u002Frisk** (e.g. instruction-only, bounded-code, UI\u002Fevidence; extracted mechanically from the PR Review Ledger's declared route or repository file-path classification via repo tooling, recording `UNKNOWN` when neither is present), and **size** (e.g. small\u002Fcompact vs medium\u002Flarge).\n  * For each stratum, report **median**, **p75**, sample count (**n**), observational telemetry **coverage** (percentage of PRs with complete event telemetry), and **still-open work** (in-flight PRs at window cutoff).\n  * Keep **backlog separate** from intra-window delivery to avoid confounding historical backlog aging with current-window execution velocity.\n- **Separate event counts & explicit denominators**:\n  * PRs created within the window ($N_{\\text{created}}$, denominator for creation cohort).\n  * PRs merged within the window ($N_{\\text{merged}}$, denominator for merge delivery cohort).\n  * PRs closed unmerged within the window ($N_{\\text{closed\\_unmerged}}$).\n- **Window scenario & censoring rules**:\n  * **Backlog merges**: A PR created before `WINDOW_START` and merged inside `[WINDOW_START, WINDOW_END)` MUST count toward window merges ($N_{\\text{merged}}$).\n  * **Right-censored in-flight PRs**: A PR created inside `[WINDOW_START, WINDOW_END)` and merged after `WINDOW_END` (or still open at cutoff) is right-censored \u002F unmerged at cutoff; it counts toward $N_{\\text{created}}$ but is excluded from completed intra-window cohort duration.\n- **Completed PR lifecycle duration**:\n  * Distinguish **merged-event cohort latency** from **both-created-and-merged cohort latency**, always reporting distinct metrics and naming explicit denominators:\n    - *Merged-event cohort duration* ($N_{\\text{merged}}$ denominator): Duration from `createdAt` to `mergedAt` for all PRs merged within `[WINDOW_START, WINDOW_END)`. Reflects total delivery cycle time including historical backlog aging.\n    - *Both-created-and-merged cohort duration* ($N_{\\text{created\\_and\\_merged}}$ denominator): Duration from `createdAt` to `mergedAt` strictly for PRs both created and merged within `[WINDOW_START, WINDOW_END)`. Reflects turnaround time for intra-window cycles; document right-censoring bias (longer tasks initiated in the window remain in flight).\n  * Report distribution statistics: **median** and **p75** duration alongside sample size (**n**).\n  * Document caveats: backlog aging, task mix (e.g. large refactors vs small fixes), and right-censoring of in-progress work.\n- **Derived handoff and lead-time metrics**:\n  * Where observational runtime telemetry (`run.stats.json`) or attempt receipts exist, derive the lifecycle and closeout intervals:\n    - *PR lead time*: `merged_at` minus `created_at`.\n    - *Pre-publication time*: PR `created_at` minus task `accepted_at`.\n    - *Task-to-merge*: `merged_at` minus task `accepted_at` (exposes delays hidden by late PR creation).\n    - *Authorized closeout delay*: `merged_at` minus `authority_ready_at` (or `UNKNOWN` when `authority_ready_at` is `null` or unrecorded).\n- **No mixed-event conversion claims**: Do not compute a naive \"merge rate\" by dividing merged PRs by created PRs within the same window. PRs merged during a window include backlog items created earlier, while PRs created near the window end are right-censored (still in flight). Never present mixed event counts as a causal speed or cohort conversion rate.\n- **No unsupported productivity or causal claims**: Do not attribute duration or throughput changes to tooling or developer speed without controlled task mix, backlog normalization, and explicit confounding factor documentation.\n\n### 3. Stage Dwell & Title Parsing\n- **Mechanical stage tracking**: Extract stage entry and exit timestamps from mechanical labels (e.g. `stage:*`), execution records in the PR description, or timeline commit events.\n- **Title parsing and operational status compatibility**:\n  * **Legacy stage titles**: Historical PRs may carry legacy two-letter stage prefixes (e.g. `[fa]`, `[sp]`, `[ev]`, `[cd]`, `[rv]`, `[cr]`) or trailing stage suffixes (e.g. `[final approval]`, `[spec]`). Preserve legacy stage-title parsing for historical PR dwell calculations.\n  * **Operational status titles**: Migrated repositories adopt `[status][short detail] \u003Csubstantive change> [\u003Ccli>][\u003Cmodel>]` (e.g. `[working][fixing review]`, `[waiting][CI]`, `[queued][source review]`, `[ready][needs approval]`, `[blocked][user pause]`). Status tokens reflect the current active execution state or dependency; NEVER reinterpret operational status tokens like `[working]`, `[waiting]`, `[queued]`, `[ready]`, `[blocked]`, or `[unknown]` as stage transitions. Lifecycle stages remain tracked exclusively by mechanical labels (`stage:*`) and PR review ledgers.\n- **Stage event uncertainty**: When stage transitions are missing, non-linear, or contradictory across labels and commit timestamps, record stage dwell status as `UNKNOWN` or `CONFLICT` with explicit uncertainty notes rather than assuming sequence or guessing timestamps.\n- **Handoff metrics and interval analysis**:\n  * Extract granular handoff metrics from observational Scratch runtime telemetry (`run.stats.json`) and review receipts:\n    - *Evidence dispatch delay*: `review_requested_at` minus `evidence_ready_at` (interval between required proof being complete, readable, and available at candidate SHA and actual review dispatch). Both endpoints and proof applicability required.\n    - *Reviewer pickup delay*: `actual_review_started_at` minus `review_requested_at` (time until the reviewer actually initiates substantive inspection; an acknowledged message or `queued_at` is not review start).\n    - *Review execution time*: `review_return_at` minus `actual_review_started_at`.\n    - *Driver response delay*: `next_substantive_action_started_at` minus `review_return_at` (time from review return to driver resuming substantive action; may contain legitimate work or waits).\n    - *Authorized closeout delay*: `merged_at` minus `authority_ready_at` (time between `FINAL_READY` + merge authority being verified and actual merge execution).\n    - *Eligible unattended interval*: Derived classification column computed only from recorded receipt\u002Fprocess timestamps (`review_return_at` to `next_substantive_action_started_at` when an executable authorized action existed with no active owner\u002Fjob or legitimate hold; otherwise `UNKNOWN` or an identified waiting category).\n- **Censoring and waiting rules**:\n  * **Interval censoring on invalidation**: If proof is invalidated before reviewer pickup (e.g. candidate head SHA moved or claims changed), close\u002Fcensor that interval with the explicit reason rather than counting the whole period as reviewer neglect.\n  * **Waiting category separation**: Treat active execution, CI\u002Fprovider waits, explicit user holds, authority waits, and unknown periods separately.\n  * **No inferred idleness from quiet periods**: Never infer uninterrupted idleness from missing GitHub writes (e.g. periods without comment or push events).\n- **Dwell breakdown**:\n  * Record time spent per stage, repeated stage cycles, merge-conflict holds, and CI wait times.\n  * Clearly distinguish **GitHub quiet time** (periods without comment or push events) from an agent being idle or forgotten.\n  * Distinguish automated CI delays or human review holds from agent stall or neglect.\n\n### 4. Time Semantics & Active Effort Model\n\nTo prevent conflating total elapsed calendar time with agent effort or wasted time, adhere strictly to the following semantic distinctions:\n\n| Metric | Definition | Measurement Constraints & Bounds |\n|---|---|---|\n| **PR elapsed** | `merged_at - created_at` | Total delivery cycle time; open PRs at collection cutoff are right-censored. Includes parked\u002Fdraft time. |\n| **Task elapsed** | `endpoint_at - original_accepted_at` | Total task cycle from acceptance to verified completion. Missing original acceptance is strictly `UNKNOWN`. `closure_sprint_elapsed` is measured separately. |\n| **Observed operation elapsed** | `queued_at -> completed_at` for CLI or API operations | Span encompassing local setup, remote provider queue time, execution, and network I\u002FO. When inner process\u002FCPU boundaries are absent, this MUST be labeled *observed operation elapsed*, not pure model reasoning or CPU active time. |\n| **Observed active wall time** | Interval union ($\\bigcup [t_{\\text{start}}, t_{\\text{end}}]$) of evidenced substantive agent\u002Fmodel\u002Ftool execution intervals for this PR | Wall-clock span where at least one agent or tool was actively executing on this PR. Never gap-filled from message timestamps; endpoint verification required. |\n| **Agent effort** | Sum ($\\sum (t_{\\text{end}} - t_{\\text{start}})$) of per-agent evidenced active intervals | Cumulative worker execution time across all parallel agents\u002Fsubagents. Can exceed *Observed active wall time* and *PR elapsed*. **Never sum agent effort together with active wall time.** |\n| **Waiting time** | Observed CI\u002Fprovider\u002Fdependency\u002Fhuman-hold intervals | Segregated into distinct categories (CI queue, provider rate limit, external dependency, human review\u002Fhold); use interval union for aggregate waiting time. |\n| **Avoidable unattended time** | Disjoint evidenced intervals with an executable authorized action, no executing owner\u002Fjob, and no legitimate hold | Requires positive eligibility, authority, and continuity evidence. If active worker or hold state is unobserved, evaluates strictly to `UNKNOWN`. |\n\n#### Essential Accounting Rules\n- **Residual Rule**: Residual duration (`PR elapsed - observed_active_wall_time`) is **NOT** wasted time. It contains observed waiting times (CI runs, external dependencies), legitimate human review and design reflection, authorized pauses, and unobserved periods. Incomplete telemetry yields observed lower bounds and explicit `UNKNOWN` duration, never a speculative decomposition into waste.\n- **Active Wall Time vs. Agent Effort**: Wall time answers \"how long was the clock running while work occurred?\" whereas agent effort answers \"how many worker-hours were consumed across all lanes?\". They answer orthogonal questions and must never be combined or confused.\n- **Four-Hour Sampling Uncertainty**: Four-hour snapshot cadences observe state periodically; they cannot certify continuous inactivity between samples. Snapshots must never fabricate continuous idleness between observations.\n\n### 5. Human Interactions per PR & Episode Annotation\n\nHuman interventions must be tracked accurately to identify genuine agent failures versus routine collaboration and new product guidance.\n\n#### 1. Message Count vs. Deduplicated Episodes\n- **Raw human message count**: Total count of inbound human messages in the task\u002FPR context.\n- **Deduplicated intervention episodes**: One distinct human contribution or issue plus its immediate clarifying follow-ups constitutes exactly **one episode** (e.g. three consecutive messages from the operator clarifying a single spec ambiguity count as 3 messages but 1 episode).\n- **Auditability**: For every episode, record the exact episode boundaries, source conversation runtime, and source `message_id`s so grouping is fully inspectable.\n\n#### 2. Rigorous Origin Filtering & Bot Exclusion\n- **Exclude Non-Human Triggers**: Initial task assignments, automated bots, background agents, quota\u002Fresume watchdogs, scheduled reminders, and copied\u002Fmirrored transcripts are strictly excluded from human intervention counts.\n- **Origin Verification**: A message delivered with `role=user` or in a user channel is not automatically a genuine human intervention. Inspect transport metadata, sender IDs, and context. Unclear origins MUST remain `UNKNOWN` and be excluded from confident human interaction counts.\n\n#### 3. Four Semantic Episode Categories\nClassification must be authored by the PR driver, an independent human reviewer, or a bounded retrospective model pass citing specific evidence, model\u002Fversion, and confidence. **NEVER use keyword matching, substring rules, or regex heuristics to classify human interactions.**\n\n| Category | Operational Meaning | Evidenced Examples |\n|---|---|---|\n| **good** (*value-adding*) | Intended human review, domain judgment, design pivot, or changed requirement. | Human reviews valid visual video evidence and updates spec; operator supplies an authorized merge or scope decision upon request. |\n| **bad** (*avoidable*) | Human effort caused by an evidenced agent error, rule violation, or missed authorized follow-through. | Agent ignored existing repository rule; agent stopped with an executable, authorized next action and the human had to manually nudge\u002Fresume it. Root-cause investigations (`\u002Fharness`) to address the same failure belong to the same episode, not a separate `good` episode. |\n| **mixed** | One episode contains both useful new domain judgment and correction of an agent error. | Operator approves an architectural direction while also pointing out an agent test regression introduced in the same turn. |\n| **unknown** | Insufficient context, unclear responsibility, or uncertain PR association. | Bare prompt like `\"continue\"` or `\"proceed\"` with ambiguous prior task activity or absent hold state. |\n\n#### 4. Attribution, Population Rates & Calibration\n- **Preserve Unassigned Episodes**: Task-level episodes that cannot be definitively linked to a specific PR must be recorded with `pr_attribution: \"unassigned\"`. Never artificially force a task-level intervention into a specific PR.\n- **No Conflated Population Rates**: Never divide a selected incident sample by the total count of repository PRs to claim an overall human-intervention or error rate.\n- **Channel Coverage Invariant**: Never claim a PR or task is `\"zero-touch\"` unless all applicable human communication channels (e.g. Dot history, direct CLI sessions, Slack threads) were explicitly audited and covered.\n- **Post-Merge Corrections**: Interventions that address regressions after PR merge must be recorded with timing `post_merge`, not excluded or hidden from the PR's historical audit.\n- **Cross-Annotator Calibration**: When evaluating human interaction quality, run calibration on a shared sample of episodes across independent annotators. If annotators disagree on attribution or category, record the resolution as `mixed` or `unknown`; never resolve disagreements by arbitrary majority vote.\n\n### 6. Qualitative Duplicate & Code Classification\n- **Substantive duplicate detection**: Do not use naive title-string similarity heuristics. Flag duplicate or abandoned attempts only through agent inspection of actual evidence: identical goals, overlapping diffs, or explicit PR closure notes referencing superseding work.\n- **Duplicate full review tracking**:\n  * Track duplicate full reviews only when unchanged claim coverage is established (e.g. re-running an entire review suite on a candidate where existing receipts already verified valid claim coverage without head or contract drift).\n- **Quality safeguards and regression tracking**:\n  * Optimize the largest measured wait or repeated work, but always track post-approval P0 discoveries\u002Freverts alongside duration and throughput metrics so speed does not conceal lower quality or bypassed standards.\n- **Repository-native code classification**: If tracking LOC, use the target repository's real classification tooling and definitions (e.g. pygount or repo language configs), rather than crude title prefixes (`fix\u002Ffeat`) or hardcoded path exclusions.\n\n## Storage & Reporting\n\n- **Scheduled collection & dashboard:** `scripts\u002Fprw_metrics.py` (and `scripts\u002Frun_prw_metrics.sh`) implements the scheduled 4-hour rolling collector and private dashboard renderer following this skill's window, handoff, and `UNKNOWN` idle rules.\n- **Reuse existing records**: Leverage `history`, `ms`, and existing PR timeline receipts. Do not introduce new enforcement frameworks, background scorers, or ledgers.\n- **Audit reports**: Save human-readable summary reports to `~\u002Froadmap\u002F` (e.g. `~\u002Froadmap\u002Fpr-efficiency-\u003Crepo>-\u003Cwindow>.md`).\n- **Private telemetry retention**: Retain underlying observational telemetry under `dashboards\u002Fprw\u002Ftelemetry\u002F` in the private `roadmap` repository (`\u003Corg>\u002Froadmap`) to guarantee reproducible audit studies and deterministic rebuilds even when local Scratch directories are rotated.\n- **Bulky evidence**: Save large raw JSON dumps, event logs, and paginated query payloads to Scratch space (`diskm scratch-new` or host scratch), never in the primary repository tree.\n","# PR Efficiency Audit (\u002Fefficiency)\n\nAudits pull request throughput, lifecycle duration, and stage dwell across exact equal UTC windows without flawed sampling, artificial conversion metrics, or crude string-similarity heuristics.\n\n## Measurement Protocol\n\n### 1. Window Definition & Full Pagination\n- **Exact UTC windows**: Define equal, non-overlapping or comparable windows using ISO-8601 timestamps (e.g. `[YYYY-MM-DDTHH:MM:SSZ, YYYY-MM-DDTHH:MM:SSZ)`).\n- **Full pagination via GraphQL**: `gh pr list` does not support `--paginate`. Use `gh api graphql --paginate` with `$endCursor: String` and `pageInfo { hasNextPage, endCursor }` to traverse all results sequentially:\n  ```bash\n  # Query PRs created within window using cursor pagination\n  gh api graphql --paginate -f query='\n    query($q: String!, $endCursor: String) {\n      search(query: $q, type: ISSUE, first: 100, after: $endCursor) {\n        issueCount\n        pageInfo {\n          hasNextPage\n          endCursor\n        }\n        nodes {\n          ... on PullRequest {\n            number\n            title\n            state\n            createdAt\n            closedAt\n            mergedAt\n            labels(first: 20) {\n              nodes { name }\n            }\n          }\n        }\n      }\n    }\n  ' -f q=\"repo:\u003Cowner>\u002F\u003Crepo> is:pr created:\u003CWINDOW_START>..\u003CWINDOW_END>\"\n  ```\n  Query merged PRs in the same window separately if measuring merge events:\n  ```bash\n  # Query PRs merged within window using cursor pagination\n  gh api graphql --paginate -f query='\n    query($q: String!, $endCursor: String) {\n      search(query: $q, type: ISSUE, first: 100, after: $endCursor) {\n        issueCount\n        pageInfo {\n          hasNextPage\n          endCursor\n        }\n        nodes {\n          ... on PullRequest {\n            number\n            title\n            state\n            createdAt\n            closedAt\n            mergedAt\n            labels(first: 20) {\n              nodes { name }\n            }\n          }\n        }\n      }\n    }\n  ' -f q=\"repo:\u003Cowner>\u002F\u003Crepo> is:pr is:merged merged:\u003CWINDOW_START>..\u003CWINDOW_END>\"\n  ```\n- **Search-count and cap checks**: Verify `issueCount` on the first response page. GitHub Search caps results at 1,000 items. If `issueCount >= 1000`, the query hits the cap and will truncate; split the time window into narrower sub-windows (e.g. daily slices) to ensure complete data retrieval.\n- **Half-open exact timestamp postfilters**: GitHub search date syntax (`created:START..END`, `merged:START..END`, `closed:START..END`) operates on day\u002Fminute resolution with inclusive boundaries. Apply an exact postfilter on ISO-8601 timestamps matched to the specific measured event to maintain half-open `[WINDOW_START, WINDOW_END)` boundaries:\n  * When filtering created PRs (`created:...`), postfilter on `createdAt`: `createdAt >= WINDOW_START && createdAt \u003C WINDOW_END`.\n  * When filtering merged PRs (`merged:...`), postfilter on `mergedAt`: `mergedAt >= WINDOW_START && mergedAt \u003C WINDOW_END`. Never filter merge events on `createdAt`, which drops backlog PRs created prior to the window start that merged inside the window.\n  * When filtering closed unmerged PRs (`closed:...`), postfilter on `closedAt`: `closedAt >= WINDOW_START && closedAt \u003C WINDOW_END`.\n\n### 2. Throughput & Cohort Metrics\n- **Equal weekly window stratification**:\n  * Compare equal weekly windows stratified by **repository**, **selected route\u002Frisk** (e.g. instruction-only, bounded-code, UI\u002Fevidence; extracted mechanically from the PR Review Ledger's declared route or repository file-path classification via repo tooling, recording `UNKNOWN` when neither is present), and **size** (e.g. small\u002Fcompact vs medium\u002Flarge).\n  * For each stratum, report **median**, **p75**, sample count (**n**), observational telemetry **coverage** (percentage of PRs with complete event telemetry), and **still-open work** (in-flight PRs at window cutoff).\n  * Keep **backlog separate** from intra-window delivery to avoid confounding historical backlog aging with current-window execution velocity.\n- **Separate event counts & explicit denominators**:\n  * PRs created within the window ($N_{\\text{created}}$, denominator for creation cohort).\n  * PRs merged within the window ($N_{\\text{merged}}$, denominator for merge delivery cohort).\n  * PRs closed unmerged within the window ($N_{\\text{closed\\_unmerged}}$).\n- **Window scenario & censoring rules**:\n  * **Backlog merges**: A PR created before `WINDOW_START` and merged inside `[WINDOW_START, WINDOW_END)` MUST count toward window merges ($N_{\\text{merged}}$).\n  * **Right-censored in-flight PRs**: A PR created inside `[WINDOW_START, WINDOW_END)` and merged after `WINDOW_END` (or still open at cutoff) is right-censored \u002F unmerged at cutoff; it counts toward $N_{\\text{created}}$ but is excluded from completed intra-window cohort duration.\n- **Completed PR lifecycle duration**:\n  * Distinguish **merged-event cohort latency** from **both-created-and-merged cohort latency**, always reporting distinct metrics and naming explicit denominators:\n    - *Merged-event cohort duration* ($N_{\\text{merged}}$ denominator): Duration from `createdAt` to `mergedAt` for all PRs merged within `[WINDOW_START, WINDOW_END)`. Reflects total delivery cycle time including historical backlog aging.\n    - *Both-created-and-merged cohort duration* ($N_{\\text{created\\_and\\_merged}}$ denominator): Duration from `createdAt` to `mergedAt` strictly for PRs both created and merged within `[WINDOW_START, WINDOW_END)`. Reflects turnaround time for intra-window cycles; document right-censoring bias (longer tasks initiated in the window remain in flight).\n  * Report distribution statistics: **median** and **p75** duration alongside sample size (**n**).\n  * Document caveats: backlog aging, task mix (e.g. large refactors vs small fixes), and right-censoring of in-progress work.\n- **Derived handoff and lead-time metrics**:\n  * Where observational runtime telemetry (`run.stats.json`) or attempt receipts exist, derive the lifecycle and closeout intervals:\n    - *PR lead time*: `merged_at` minus `created_at`.\n    - *Pre-publication time*: PR `created_at` minus task `accepted_at`.\n    - *Task-to-merge*: `merged_at` minus task `accepted_at` (exposes delays hidden by late PR creation).\n    - *Authorized closeout delay*: `merged_at` minus `authority_ready_at` (or `UNKNOWN` when `authority_ready_at` is `null` or unrecorded).\n- **No mixed-event conversion claims**: Do not compute a naive \"merge rate\" by dividing merged PRs by created PRs within the same window. PRs merged during a window include backlog items created earlier, while PRs created near the window end are right-censored (still in flight). Never present mixed event counts as a causal speed or cohort conversion rate.\n- **No unsupported productivity or causal claims**: Do not attribute duration or throughput changes to tooling or developer speed without controlled task mix, backlog normalization, and explicit confounding factor documentation.\n\n### 3. Stage Dwell & Title Parsing\n- **Mechanical stage tracking**: Extract stage entry and exit timestamps from mechanical labels (e.g. `stage:*`), execution records in the PR description, or timeline commit events.\n- **Title parsing and operational status compatibility**:\n  * **Legacy stage titles**: Historical PRs may carry legacy two-letter stage prefixes (e.g. `[fa]`, `[sp]`, `[ev]`, `[cd]`, `[rv]`, `[cr]`) or trailing stage suffixes (e.g. `[final approval]`, `[spec]`). Preserve legacy stage-title parsing for historical PR dwell calculations.\n  * **Operational status titles**: Migrated repositories adopt `[status][short detail] \u003Csubstantive change> [\u003Ccli>][\u003Cmodel>]` (e.g. `[working][fixing review]`, `[waiting][CI]`, `[queued][source review]`, `[ready][needs approval]`, `[blocked][user pause]`). Status tokens reflect the current active execution state or dependency; NEVER reinterpret operational status tokens like `[working]`, `[waiting]`, `[queued]`, `[ready]`, `[blocked]`, or `[unknown]` as stage transitions. Lifecycle stages remain tracked exclusively by mechanical labels (`stage:*`) and PR review ledgers.\n- **Stage event uncertainty**: When stage transitions are missing, non-linear, or contradictory across labels and commit timestamps, record stage dwell status as `UNKNOWN` or `CONFLICT` with explicit uncertainty notes rather than assuming sequence or guessing timestamps.\n- **Handoff metrics and interval analysis**:\n  * Extract granular handoff metrics from observational Scratch runtime telemetry (`run.stats.json`) and review receipts:\n    - *Evidence dispatch delay*: `review_requested_at` minus `evidence_ready_at` (interval between required proof being complete, readable, and available at candidate SHA and actual review dispatch). Both endpoints and proof applicability required.\n    - *Reviewer pickup delay*: `actual_review_started_at` minus `review_requested_at` (time until the reviewer actually initiates substantive inspection; an acknowledged message or `queued_at` is not review start).\n    - *Review execution time*: `review_return_at` minus `actual_review_started_at`.\n    - *Driver response delay*: `next_substantive_action_started_at` minus `review_return_at` (time from review return to driver resuming substantive action; may contain legitimate work or waits).\n    - *Authorized closeout delay*: `merged_at` minus `authority_ready_at` (time between `FINAL_READY` + merge authority being verified and actual merge execution).\n    - *Eligible unattended interval*: Derived classification column computed only from recorded receipt\u002Fprocess timestamps (`review_return_at` to `next_substantive_action_started_at` when an executable authorized action existed with no active owner\u002Fjob or legitimate hold; otherwise `UNKNOWN` or an identified waiting category).\n- **Censoring and waiting rules**:\n  * **Interval censoring on invalidation**: If proof is invalidated before reviewer pickup (e.g. candidate head SHA moved or claims changed), close\u002Fcensor that interval with the explicit reason rather than counting the whole period as reviewer neglect.\n  * **Waiting category separation**: Treat active execution, CI\u002Fprovider waits, explicit user holds, authority waits, and unknown periods separately.\n  * **No inferred idleness from quiet periods**: Never infer uninterrupted idleness from missing GitHub writes (e.g. periods without comment or push events).\n- **Dwell breakdown**:\n  * Record time spent per stage, repeated stage cycles, merge-conflict holds, and CI wait times.\n  * Clearly distinguish **GitHub quiet time** (periods without comment or push events) from an agent being idle or forgotten.\n  * Distinguish automated CI delays or human review holds from agent stall or neglect.\n\n### 4. Time Semantics & Active Effort Model\n\nTo prevent conflating total elapsed calendar time with agent effort or wasted time, adhere strictly to the following semantic distinctions:\n\n| Metric | Definition | Measurement Constraints & Bounds |\n|---|---|---|\n| **PR elapsed** | `merged_at - created_at` | Total delivery cycle time; open PRs at collection cutoff are right-censored. Includes parked\u002Fdraft time. |\n| **Task elapsed** | `endpoint_at - original_accepted_at` | Total task cycle from acceptance to verified completion. Missing original acceptance is strictly `UNKNOWN`. `closure_sprint_elapsed` is measured separately. |\n| **Observed operation elapsed** | `queued_at -> completed_at` for CLI or API operations | Span encompassing local setup, remote provider queue time, execution, and network I\u002FO. When inner process\u002FCPU boundaries are absent, this MUST be labeled *observed operation elapsed*, not pure model reasoning or CPU active time. |\n| **Observed active wall time** | Interval union ($\\bigcup [t_{\\text{start}}, t_{\\text{end}}]$) of evidenced substantive agent\u002Fmodel\u002Ftool execution intervals for this PR | Wall-clock span where at least one agent or tool was actively executing on this PR. Never gap-filled from message timestamps; endpoint verification required. |\n| **Agent effort** | Sum ($\\sum (t_{\\text{end}} - t_{\\text{start}})$) of per-agent evidenced active intervals | Cumulative worker execution time across all parallel agents\u002Fsubagents. Can exceed *Observed active wall time* and *PR elapsed*. **Never sum agent effort together with active wall time.** |\n| **Waiting time** | Observed CI\u002Fprovider\u002Fdependency\u002Fhuman-hold intervals | Segregated into distinct categories (CI queue, provider rate limit, external dependency, human review\u002Fhold); use interval union for aggregate waiting time. |\n| **Avoidable unattended time** | Disjoint evidenced intervals with an executable authorized action, no executing owner\u002Fjob, and no legitimate hold | Requires positive eligibility, authority, and continuity evidence. If active worker or hold state is unobserved, evaluates strictly to `UNKNOWN`. |\n\n#### Essential Accounting Rules\n- **Residual Rule**: Residual duration (`PR elapsed - observed_active_wall_time`) is **NOT** wasted time. It contains observed waiting times (CI runs, external dependencies), legitimate human review and design reflection, authorized pauses, and unobserved periods. Incomplete telemetry yields observed lower bounds and explicit `UNKNOWN` duration, never a speculative decomposition into waste.\n- **Active Wall Time vs. Agent Effort**: Wall time answers \"how long was the clock running while work occurred?\" whereas agent effort answers \"how many worker-hours were consumed across all lanes?\". They answer orthogonal questions and must never be combined or confused.\n- **Four-Hour Sampling Uncertainty**: Four-hour snapshot cadences observe state periodically; they cannot certify continuous inactivity between samples. Snapshots must never fabricate continuous idleness between observations.\n\n### 5. Human Interactions per PR & Episode Annotation\n\nHuman interventions must be tracked accurately to identify genuine agent failures versus routine collaboration and new product guidance.\n\n#### 1. Message Count vs. Deduplicated Episodes\n- **Raw human message count**: Total count of inbound human messages in the task\u002FPR context.\n- **Deduplicated intervention episodes**: One distinct human contribution or issue plus its immediate clarifying follow-ups constitutes exactly **one episode** (e.g. three consecutive messages from the operator clarifying a single spec ambiguity count as 3 messages but 1 episode).\n- **Auditability**: For every episode, record the exact episode boundaries, source conversation runtime, and source `message_id`s so grouping is fully inspectable.\n\n#### 2. Rigorous Origin Filtering & Bot Exclusion\n- **Exclude Non-Human Triggers**: Initial task assignments, automated bots, background agents, quota\u002Fresume watchdogs, scheduled reminders, and copied\u002Fmirrored transcripts are strictly excluded from human intervention counts.\n- **Origin Verification**: A message delivered with `role=user` or in a user channel is not automatically a genuine human intervention. Inspect transport metadata, sender IDs, and context. Unclear origins MUST remain `UNKNOWN` and be excluded from confident human interaction counts.\n\n#### 3. Four Semantic Episode Categories\nClassification must be authored by the PR driver, an independent human reviewer, or a bounded retrospective model pass citing specific evidence, model\u002Fversion, and confidence. **NEVER use keyword matching, substring rules, or regex heuristics to classify human interactions.**\n\n| Category | Operational Meaning | Evidenced Examples |\n|---|---|---|\n| **good** (*value-adding*) | Intended human review, domain judgment, design pivot, or changed requirement. | Human reviews valid visual video evidence and updates spec; operator supplies an authorized merge or scope decision upon request. |\n| **bad** (*avoidable*) | Human effort caused by an evidenced agent error, rule violation, or missed authorized follow-through. | Agent ignored existing repository rule; agent stopped with an executable, authorized next action and the human had to manually nudge\u002Fresume it. Root-cause investigations (`\u002Fharness`) to address the same failure belong to the same episode, not a separate `good` episode. |\n| **mixed** | One episode contains both useful new domain judgment and correction of an agent error. | Operator approves an architectural direction while also pointing out an agent test regression introduced in the same turn. |\n| **unknown** | Insufficient context, unclear responsibility, or uncertain PR association. | Bare prompt like `\"continue\"` or `\"proceed\"` with ambiguous prior task activity or absent hold state. |\n\n#### 4. Attribution, Population Rates & Calibration\n- **Preserve Unassigned Episodes**: Task-level episodes that cannot be definitively linked to a specific PR must be recorded with `pr_attribution: \"unassigned\"`. Never artificially force a task-level intervention into a specific PR.\n- **No Conflated Population Rates**: Never divide a selected incident sample by the total count of repository PRs to claim an overall human-intervention or error rate.\n- **Channel Coverage Invariant**: Never claim a PR or task is `\"zero-touch\"` unless all applicable human communication channels (e.g. Dot history, direct CLI sessions, Slack threads) were explicitly audited and covered.\n- **Post-Merge Corrections**: Interventions that address regressions after PR merge must be recorded with timing `post_merge`, not excluded or hidden from the PR's historical audit.\n- **Cross-Annotator Calibration**: When evaluating human interaction quality, run calibration on a shared sample of episodes across independent annotators. If annotators disagree on attribution or category, record the resolution as `mixed` or `unknown`; never resolve disagreements by arbitrary majority vote.\n\n### 6. Qualitative Duplicate & Code Classification\n- **Substantive duplicate detection**: Do not use naive title-string similarity heuristics. Flag duplicate or abandoned attempts only through agent inspection of actual evidence: identical goals, overlapping diffs, or explicit PR closure notes referencing superseding work.\n- **Duplicate full review tracking**:\n  * Track duplicate full reviews only when unchanged claim coverage is established (e.g. re-running an entire review suite on a candidate where existing receipts already verified valid claim coverage without head or contract drift).\n- **Quality safeguards and regression tracking**:\n  * Optimize the largest measured wait or repeated work, but always track post-approval P0 discoveries\u002Freverts alongside duration and throughput metrics so speed does not conceal lower quality or bypassed standards.\n- **Repository-native code classification**: If tracking LOC, use the target repository's real classification tooling and definitions (e.g. pygount or repo language configs), rather than crude title prefixes (`fix\u002Ffeat`) or hardcoded path exclusions.\n\n## Storage & Reporting\n\n- **Scheduled collection & dashboard:** `scripts\u002Fprw_metrics.py` (and `scripts\u002Frun_prw_metrics.sh`) implements the scheduled 4-hour rolling collector and private dashboard renderer following this skill's window, handoff, and `UNKNOWN` idle rules.\n- **Reuse existing records**: Leverage `history`, `ms`, and existing PR timeline receipts. Do not introduce new enforcement frameworks, background scorers, or ledgers.\n- **Audit reports**: Save human-readable summary reports to `~\u002Froadmap\u002F` (e.g. `~\u002Froadmap\u002Fpr-efficiency-\u003Crepo>-\u003Cwindow>.md`).\n- **Private telemetry retention**: Retain underlying observational telemetry under `dashboards\u002Fprw\u002Ftelemetry\u002F` in the private `roadmap` repository (`\u003Corg>\u002Froadmap`) to guarantee reproducible audit studies and deterministic rebuilds even when local Scratch directories are rotated.\n- **Bulky evidence**: Save large raw JSON dumps, event logs, and paginated query payloads to Scratch space (`diskm scratch-new` or host scratch), never in the primary repository tree.\n",{"name":5,"description":7},"main","2d92c349286cf4e1cfed8cdec1773e71f6c601d2",".claude\u002Fskills\u002Fpr-efficiency-audit",0,"https:\u002F\u002Fgithub.com\u002Fjleechanorg\u002Fjleechan-skills","https:\u002F\u002Fgithub.com\u002Fjleechanorg","2026-11-14 14:55:35",{"source":9,"skillName":5,"commands":56,"prompt":66,"zipAvailable":67},[57,60,63],{"tool":58,"command":59},"npx","npx skills add jleechanorg\u002Fjleechan-skills --skill pr-efficiency-audit",{"tool":61,"command":62},"bunx","bunx skills add jleechanorg\u002Fjleechan-skills --skill pr-efficiency-audit",{"tool":64,"command":65},"pnpm","pnpm dlx skills add jleechanorg\u002Fjleechan-skills --skill pr-efficiency-audit","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fjleechanorg\u002Fjleechan-skills\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fpr-efficiency-audit\u002FSKILL.md",true,[],[70,78,85,92,100,109],{"skillNo":71,"name":72,"nameZh":13,"description":73,"descriptionZh":13,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":13,"sourceHtmlUrl":74,"categories":75,"keywords":76,"publishedAt":77},"01M7DRVZXXMGY4G81K5GVF4V20","disk-reclaim-playbook","Use Disk Magician to diagnose disk growth or qualify cleanup on macOS or Linux.","https:\u002F\u002Fgithub.com\u002Fjleechanorg\u002Fjleechan-skills\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fdisk-reclaim-playbook\u002FSKILL.md",[],[],"2026-11-15 14:19:17",{"skillNo":79,"name":80,"nameZh":13,"description":81,"descriptionZh":13,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":13,"sourceHtmlUrl":82,"categories":83,"keywords":84,"publishedAt":77},"01M7B63PNTT2TY78RFKHD8SP3X","claudea-bench","Compare `claudea` and normal `claude` on a fair split of comparable work by default; use `--strict` for duplicate runs of the exact same task.","https:\u002F\u002Fgithub.com\u002Fjleechanorg\u002Fjleechan-skills\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fclaudea-bench\u002FSKILL.md",[],[],{"skillNo":86,"name":30,"nameZh":13,"description":87,"descriptionZh":13,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":13,"sourceHtmlUrl":88,"categories":89,"keywords":90,"publishedAt":91},"01M7622KQJ32AV4K5BXEMVSSEB","Alias for the canonical pr-lifecycle PR workflow skill (\u002Fpr-workflow, \u002Fprw).","https:\u002F\u002Fgithub.com\u002Fjleechanorg\u002Fjleechan-skills\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fpr\u002FSKILL.md",[],[],"2026-11-12 13:55:43",{"skillNo":93,"name":94,"nameZh":13,"description":95,"descriptionZh":13,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":13,"sourceHtmlUrl":96,"categories":97,"keywords":98,"publishedAt":99},"01M7432W92AKC4D1TKJ00VCMMT","whisper","OpenAI's general-purpose speech recognition model. Supports 99 languages, transcription, translation to English, and language identification. Six model sizes from tiny (39M params) to large (1550M params). Use for speech-to-text, podcast transcription, or multilingual audio processing. Best for robust, multilingual ASR.","https:\u002F\u002Fgithub.com\u002Fjleechanorg\u002Fjleechan-skills\u002Fblob\u002Fmain\u002F.claude\u002Fskills_archive\u002F2026-11-09-no-usage-evidence\u002Fwhisper\u002FSKILL.md",[],[],"2026-11-11 15:11:14",{"skillNo":101,"name":102,"nameZh":13,"description":103,"descriptionZh":13,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":104,"licenseFileUrl":105,"sourceHtmlUrl":106,"categories":107,"keywords":108,"publishedAt":99},"01M7432T6BN1A9SHB8RBQR5EMP","webapp-testing","Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.","Apache-2.0","https:\u002F\u002Fgithub.com\u002Fjleechanorg\u002Fjleechan-skills\u002Fblob\u002Fmain\u002F.claude\u002Fskills_archive\u002F2026-11-09-no-usage-evidence\u002Fwebapp-testing\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002Fjleechanorg\u002Fjleechan-skills\u002Fblob\u002Fmain\u002F.claude\u002Fskills_archive\u002F2026-11-09-no-usage-evidence\u002Fwebapp-testing\u002FSKILL.md",[],[],{"skillNo":110,"name":111,"nameZh":13,"description":112,"descriptionZh":13,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":13,"sourceHtmlUrl":113,"categories":114,"keywords":115,"publishedAt":99},"01M7432NDC7S6C6MX7M6RW8CTT","pr-report","This skill should be used when the user asks for a PR report, PR audit, PR delta analysis, \u002Fpr-report, or wants per-PR summary with delta files\u002Flines. Generates a structured report for one or more open PRs covering purpose, files changed, +\u002F− line counts, \u002Fcode-standards + \u002Fthermo review findings, \u002Fponytail simplification opportunities, file-overlap combination candidates, and \u002Fgreen status per pr-green-definition. Output: machine-readable JSONL + human-readable markdown. Read-only by default; can apply simplifications if user opts in.","https:\u002F\u002Fgithub.com\u002Fjleechanorg\u002Fjleechan-skills\u002Fblob\u002Fmain\u002F.claude\u002Fskills_archive\u002F2026-11-09-no-usage-evidence\u002Fpr-report\u002FSKILL.md",[],[]]