write-review-replylisted
Install: claude install-skill ku5ic/dotfiles
## Procedure
1. Get the scratch directory: `!`scratch-dir.sh``.
2. Resolve the repo slug: `gh repo view --json nameWithOwner -q .nameWithOwner`. If this fails (no remote, no auth), stop and say so.
3. Resolve the current GitHub user: `gh api user -q .login`. Used later to detect already-answered threads.
4. Parse `$ARGUMENTS`:
- First non-flag token: reviewer username.
- A bare number: PR number.
- `--all`: include every review round, not just the newest (see step 7).
5. If no PR number was given, resolve the current branch's PR: `gh pr view --json number,url`. If that fails (not on a PR branch, no open PR), ask for the PR number or URL via the AskUserQuestion tool instead of guessing.
6. If no reviewer username was given:
- List distinct reviewers from `gh api repos/<slug>/pulls/<n>/reviews` and `gh api repos/<slug>/pulls/<n>/comments`, excluding the PR author and the current user.
- Exactly one candidate: use it.
- Zero or more than one: ask via the AskUserQuestion tool, listing the candidates, instead of guessing.
7. Fetch the reviewer's comments:
- Inline: `gh api repos/<slug>/pulls/<n>/comments --paginate`, filtered to `user.login == <reviewer>`. Keep `id`, `path`, `line` (or `original_line`), `body`, `html_url`, `created_at`, `in_reply_to_id`.
- Reviews: `gh api repos/<slug>/pulls/<n>/reviews --paginate`, filtered to the same user. Keep `id`, `body`, `html_url`, `submitted_at`. Include a review's own `body` as a comment only if non-empty.
8. Sco