better-github-skilllisted
Install: claude install-skill AVGVSTVS96/better-github-skill
# better-github-skill
Raw `gh` first when you know the command; the scripts replace only the flows
agents repeatedly get wrong. Scripts run TS directly (node ≥ 23.6), no deps.
## Scripts
| script | use for |
|---|---|
| `scripts/pr-snapshot.ts <pr> [-R o/r]` | full PR state in one call: meta, mergeability, checks, files, reviews, comments, thread counts. Use instead of hand-assembling `pr view --json` field sets or chaining view/checks/comments calls. |
| `scripts/pr-threads.ts <pr> [-R o/r] [--unresolved] [--author X] [--since ISO]` | review threads with isResolved/isOutdated, which porcelain gh cannot get. Read-only: never reply to or resolve threads unless explicitly told to. |
| `scripts/ci-failures.ts [run-id] [--pr N] [-R o/r]` | failing checks → failing jobs/steps → log snippet each; full logs saved to files (paths printed); rg those instead of re-fetching. |
All scripts: `--json` for structured output, `--full` to disable truncation
(snapshot/threads), `--help` for usage. They exit 0 when the report succeeds
even if CI is red or threads are unresolved.
## Gotchas (each one burned real sessions repeatedly)
- Never pipe gh into `head`: SIGPIPE can kill gh mid-write (spurious nonzero
exit, shell-dependent) or silently truncate large output.
Redirect to a file and read that, or trim with `--jq '.[0:20]'`.
- `gh pr diff` has no `--stat` and no positive pathspec (`--name-only` and
`-e/--exclude` globs exist in gh ≥ 2.95). Per-file stats:
`gh api 'repos/{owner}