Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions .agents/skills/merged-pr-audit/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
name: merged-pr-audit
description: "Audit merged PRs against the issues that spawned them: census every PR merged in a window, read each PR body and full diff, compare against its spawning issue (especially Closes/fixes closures), check later PRs for completions before filing gaps, file real gaps/bugs, apply the audit outcome labels, and land a dated record with all raw material as supplements. Use when asked to review merged PRs for completeness, verify that closed issues were fully implemented, or run a lane of a multi-lane audit programme over merged work."
---

# Merged-PR audit

You own the PR-vs-issue comparison: for every PR merged in the window, did it fully implement the issue that spawned it, and did anything get left on the floor?

## Rules of the road

- GitHub reads via `fleet gh api` only; issue/comment writes via `~/tools/gh-post`. Never plain `gh`, never the GitHub connector.
- File your tracking issue first, link it on the programme umbrella, and post progress at EVERY slice boundary.
- Check the umbrella and each item's comments before acting; another lane's claim is a hard stop. Reopen/correction decisions on closed issues belong to the closed-issues lane — send suspect closures there as pointer comments on the umbrella, never reopen them yourself.
- Never use closing keywords in comments on issues that must stay open.

## Outcome labels (create in each repo before applying)

| Label | Meaning |
|---|---|
| `audit:complete` | PR fully implemented its spawning issue / stated intent |
| `audit:partial` | PR partially implemented; remainder filed or already tracked (link it) |
| `audit:gap-filed` | A gap / unfiled next step from this PR was filed as a new issue |
| `audit:bug-filed` | A bug in the merged diff was filed as a new issue |
| `audit:completed-later` | A later merged PR completed/fixed what this PR left undone |
| `audit:no-issue` | No spawning issue; judged on stated intent only |

## Steps

1. **Census.** For each repo: `fleet gh api "repos/<repo>/pulls?state=closed&per_page=100&page=<k>&sort=updated&direction=desc"` until a full page predates the window; keep `merged_at` inside the window. Snapshot the lists to files before judging — the lists grow while you work, and every number in the snapshot must end with a verdict. (If the `fleet gh` cache daemon on 127.0.0.1:4802 is down, start `fleet gh cache-serve`; otherwise calls resolve in-process and take ~2 min each.)
2. **Read each PR in full.** `fleet gh api repos/<repo>/pulls/<n>` (body) and `.../pulls/<n>/files?per_page=100` (diff). No judging from titles.
3. **Read the spawning issue in full.** Extract references, especially `Closes/closes/fixes #n`; fetch the issue and all comments (`per_page=100`, count-confirmed against the issue's comment count).
4. **Judge.** Complete / completed-later / partial / gap / bug / no-issue. BEFORE filing a gap, search the repo's later merged PRs for the completion — things change over time, and a completed gap is a `completed-later` mark on both items, never a new issue.
5. **File what's real.** Gaps, bugs, and unfiled planned next steps go in as issues via `gh-post` in the owning repo, prioritised via the pilot queue, linked from your ledger. Check first whether the remainder is already tracked (standing issues, parent epics) — an already-tracked remainder is a `partial` with the link, not a duplicate.
6. **Mark.** Apply the outcome label to the PR (`fleet gh api repos/<repo>/issues/<pr>/labels -f labels[]=<label>`). Where a completed-later relationship isn't visible from the items themselves, comment the link on the PR/issue.
7. **Slice and enqueue the overflow.** A repo too big for one session gets packetised: batches of ~250 PRs, one `feature_slice` packet per batch to `repo-health-code-pilot`, full PR-number list in `payload.slice`, dedupe key `repo-health:v1:slice:<repo>:issue:<tracking>:slice-<k>`, acceptance = ledger comment on the tracking issue. Packet schema is enforced by the validator — run `fleet queue validate <packet>` on the laptop and fix what it names. If the sandbox→broker route refuses CONNECT, enqueue from the laptop.
8. **Land everything.** Dated record in the code repo's doc/ (`doc/<UTC>_<kind>_<name>/`, same-named .md, line in doc/README.md) containing: the brief verbatim, the label set, this method, the census, findings, the per-PR ledger, the enqueue record — plus ALL raw material as supplements (censuses, per-PR JSON, ledgers, scripts, logs). A summary is never the only record.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
You are LANE 4 — MERGED-PR-AUDIT of programme AUDIT-7 (Drew's directive, 2026-11-23 ~17:56 CST): seven parallel audit lanes over the four repos (developing-today/code, developing-today-forks/opencode, developing-today-forks/openchamber, dezren39/fleet), exhaustive — every item in scope, one by one, read in full, no sampling.

UMBRELLA TRACKING ISSUE: developing-today/code#13871 — https://github.com/developing-today/code/issues/13871 — the cross-lane coordination point. File your own tracking issue in developing-today/code first, post its link as a comment on #13871, and post progress on your tracking issue at EVERY slice boundary.

SHARED RULES (binding on all seven lanes):
- GitHub access: the fleet GitHub subcommand ONLY. All reads via `fleet gh api` (the `fleet` binary lives at ~/.local/share/hatch-recovery/bin/fleet — put that dir on PATH); all issue/comment writes via `~/tools/gh-post` (the GitHub App identity). NEVER plain `gh` with the user token, NEVER the GitHub connector. Reason (Drew): direct access burns the personal user API tokens; the GitHub App identity must do this work. If a fleet-gh verb you need does not exist, report that to the coordinator in your return — do not fall back to plain gh.
- Tracking first: file your own tracking issue in developing-today/code, link it on the umbrella (#13871), and post progress on it at EVERY slice boundary. Check the umbrella + an issue's comments before acting on it — if another lane has claimed it, the lane whose primary scope it is owns the action; the other records a pointer comment on the umbrella, never a duplicate issue or PR.
- Exhaustive, one by one, read everything. No sampling, no skimming by title. Volume is large — work in slices (per repo, per batch); if a slice exceeds one session, enqueue per-batch sub-work to the pilot queue (`--queue repo-health-code-pilot`, kind `feature_slice` + `payload.slice`, NEVER kind `design`; premise + singular-ownership check first, fresh fleet-gh REST reads, comments per_page=100 count-confirmed) following the lane conventions. A claim comment from another lane is a HARD STOP.
- Standing authority: merge PRs when verified done (merge authority applies; drafts/conflicted included, fix forward); never force-push main; never close issues for age; file-the-issue in the same pass for anything found. Flag doctrine: if a platform flag trips on a checkout, stop on that checkout, record it, vary the mechanic (worktree off the EXISTING clone, worktree at main then switch ref, vary transport fleet gh/git) before stopping; never re-ask Drew for a permanently-flagging item.
- Repo work happens in laptop worktrees via ~/tools/laptop-ssh.sh (laptop `amd`, user `user`); NEVER the sandbox for repo work. One clone per repo on the laptop; each piece of work in a worktree off that clone.
- Deliverables: (a) a dated report + comprehensive log committed to the code repo's doc/ area under the dated-record convention (`doc/<UTC datetime>_<kind>_<name>/` folder with a same-named .md inside, plus a line in doc/README.md), INCLUDING your own prompt verbatim (this whole brief); (b) findings filed as issues/PRs/labels AS YOU GO, not only at the end; (c) where the process is repeatable, a skill for it, committed in the repo if it has a skills home (check first) or documented as a procedure in the report; (d) a final summary comment on your tracking issue.
- Latitude (rigid requirement to do the work, free choice in outputs): open investigation issues, designs, and bug tickets; open PRs for quick doc fixes and to document findings; create labels; suggest things that aren't top-level projects but could be; suggest where things are converging and could be merged, where there's duplication, which duplicate is best and how they should best be combined.

YOUR BRIEF — LANE 4 — MERGED-PR-AUDIT. Scope: every PR merged in the past month (since 2026-10-23) across the four repos. One by one: read the PR and its diff; look for gaps, bugs, and planned next steps that never got issues (file them, properly prioritised via the queue). Compare each PR to the issue that spawned it — ESPECIALLY every PR that marks an issue as closed (Closes/closes/fixes): did the PR fully implement the issue, or did anything get left on the floor? Remember things change over time: if an earlier PR left something undone but a LATER PR completed it, do NOT file a gap — leave a comment/mark on each issue and PR recording that. Where a gap is real, file the issue and prioritise it. Create and document a small set of outcome labels for later statistics (your choice, e.g. audit:complete / audit:partial / audit:gap-filed — document the set in your report and apply them). Return a per-PR ledger with the comparison verdict.

Coordination notes: LANE 2 (CLOSED-ISSUES-REVIEW) examines the same closures from the issue side — it owns reopen/correction decisions; you own the PR-vs-issue comparison and gap-filing. If lane 2 posts a pointer on the umbrella about a suspect closure, that is your cue to prioritise its comparison. Avoid closing keywords in comments on issues that must stay open.

Your return: your tracking-issue link; the outcome-label set you created (names + meanings); the per-PR ledger (PR link, repo, spawning issue, verdict: complete / completed-by-later-PR+link / partial-gap-filed+link / bug-filed+link / next-step-filed+link); report doc path + merge SHA; counts (examined, complete, completed-later, gaps filed, bugs filed).

---

Steer added 2026-11-23 ~18:46 CST (Drew), delivered mid-lane:

"STEER from Drew (2026-11-23 ~18:46 CST), a narrow addition to your existing deliverables — act on it before you commit your report:

Your brief already requires a dated report + comprehensive log committed to doc/. Extend that to the RAW gathered material too. A lane's work is never thrown away into a summary: ALL data gathered and files produced land inside your dated-record folder (doc/<UTC datetime>_<kind>_<name>/) as supplements alongside the main report, with the outside index (doc/README.md line / the folder's own index) linking in. Anything that isn't a live credential value belongs in the repo — censuses, ledgers, per-item JSON, working notes, scripts you wrote to do the gathering: commit them as supplements, don't leave them only in your workspace.

A codification lane is writing this up as a skill + protocol text; until it lands, work to the rule as stated here. If your report PR is already open, amend it; if already merged, open a small follow-up PR adding the supplements and note it on your tracking issue."
Loading