The best way to control Claude Code, Codex and more from any computer or phone
Mirrored from https://github.com/Camo67/t3code.git
Synced Nov 21, 07:15 UTC
| 1 | --- |
| 2 | name: audit |
| 3 | description: Audit one or more specific pull requests the user names — PR numbers, `#N`, or GitHub URLs (e.g. "/audit 2101", "/audit #2101 #2093", "/audit https://github.com/alchemy-run/alchemy/pull/2101"). Works through them one at a time: check out, merge main, resolve conflicts, audit tests and JSDoc, run the suites, rewrite the PR description as DX snippets, and stop with a merge-or-close recommendation. Use when the user hands you the PRs rather than a search criteria (for that, use pr-queue); also for "also audit #N", "skip #N" or "next" while an audit is running. |
| 4 | metadata: |
| 5 | internal: true |
| 6 | --- |
| 7 | |
| 8 | # Pull request audit |
| 9 | |
| 10 | The user names the PRs — one or many. Audit them one at a time: fix each, push |
| 11 | it, and ask the user to merge or close it. The user merges; you never do. |
| 12 | |
| 13 | ## 1. Take the list |
| 14 | |
| 15 | Accept any mix of `2101`, `#2101` and PR URLs, separated by spaces, commas or |
| 16 | newlines. Dedupe. A URL for another repository (e.g. `alchemy-run/distilled`) |
| 17 | is audited with `-R <owner>/<repo>` on every `gh` call, in that repository's |
| 18 | checkout (`submodules/distilled`). |
| 19 | |
| 20 | ```sh |
| 21 | gh pr view <n> --json number,title,author,state,isDraft,mergeable,additions,deletions,changedFiles,updatedAt,isCrossRepository,maintainerCanModify,headRefName,baseRefName,url |
| 22 | ``` |
| 23 | |
| 24 | Say up front which PRs are already merged, closed or don't exist, and drop |
| 25 | them. Drafts, PRs waiting on the author's answer to an earlier question, and |
| 26 | forks we can't push to (`maintainerCanModify: false`) stay — the user asked |
| 27 | for them — but say so; on an unpushable fork, fixes go to the author as a |
| 28 | standalone comment or a follow-up PR. |
| 29 | |
| 30 | **One PR:** no table. Go straight to §2 and end with the |
| 31 | [§7 report](procedure.md#7-report-and-ask). |
| 32 | |
| 33 | **Several PRs:** print a table — |
| 34 | `# | PR (link) | Author | Size | Behind main | What it does | Audit notes`, |
| 35 | with ✅/❌ against the standards in |
| 36 | [procedure.md §3](procedure.md#3-review-the-code) — and annotate: |
| 37 | |
| 38 | - **stacks** — a PR whose `baseRefName` is another listed PR's branch |
| 39 | (`base #N ← child #M`); the base goes first |
| 40 | - **overlaps** — PRs fixing the same issue or touching the same files; plan a |
| 41 | merge order and which ones to close |
| 42 | |
| 43 | Keep the user's order otherwise; if they gave none, easiest first (clean |
| 44 | merge, small diff, tests already in the right shape, single concern). Track |
| 45 | status (`todo` / `in progress` / `ready → merge?` / `close?` / `merged` / |
| 46 | `closed` / `parked`) and re-print the table whenever it changes. |
| 47 | |
| 48 | ## 2–7. Audit each PR |
| 49 | |
| 50 | Work through the list with the shared per-PR procedure in |
| 51 | [procedure.md](procedure.md): check out and merge main, review the code, |
| 52 | update JSDoc, run the tests, push and rewrite the description, then report |
| 53 | and ask. Read it in full before the first PR. |
| 54 | |
| 55 | ## 8. Keep the list moving |
| 56 | |
| 57 | Follow [procedure.md §8](procedure.md#8-keep-the-list-moving), plus: |
| 58 | |
| 59 | - On "also audit #N": fetch it as in §1, add it to the table (respecting |
| 60 | stacks and overlaps), and finish the current PR first. |
| 61 | - When every listed PR is `merged`, `closed` or `parked`, print the final |
| 62 | table and stop. Don't search for more PRs — that's pr-queue. |