issue
Take a bug report (a Discord screenshot, a user's message, a GitHub issue) from a reproduction to a GitHub issue, a fix on its own branch, and a ship to main once the user says to ship. Use whenever t
SKILL.md.claude/skills/issue/SKILL.md
GitHubA bug goes from a report to main in four steps, in the session's own
worktree. Arguments: $ARGUMENTS (an issue number, or nothing for a report
in the conversation). Pass gh the origin repository (--repo <owner>/<repo>, from git remote get-url origin): the checkout has more
than one remote.
1. Reproduce, then file the issue
Skip the filing when the issue exists: read it (gh issue view <n>) and
check that its reproduction still fails.
Get the case down to data. For a game, fetch its PGN (
/game/export/<id>, with a browser's user agent: see "Crawlers get a 404" inAGENTS.md) and play it to the position, including the moves played after the game if the report shows a variation. Read the board in the screenshot to tell which moves they were.Compute what you need (FENs, the move's UCI) with the project's own code, in a throwaway test beside the module (
zz-*.test.ts, deleted right after), and run the function at fault on it. The bug is confirmed when its output is wrong: say so to the user before filing.Find the cause in the code, not only the case: which helper gets it wrong, and who else calls it.
File it (T3's
create_issue, elsegh issue create), in English, with the🐞 Buglabel:- what goes wrong, in a sentence or two, and a link to the game or page;
- steps to reproduce on lichess.org, then the data (FEN before, the move, FEN after);
- expected and actual;
- the cause, with the files and functions;
- a vitest case that fails on
maintoday, ready to paste; - how to fix it, and what it may change (legacy fixtures, other callers).
Leave out the reporter's personal details; a public game's link is fine.
Link it to the thread (T3's
link_issue) and give the user its URL.
2. A branch for the fix
Rename the worktree's branch after the issue:
git branch -m t3/issue-<n>-<what> (t3/issue-39-pinned-sacrifice). The
fix lives there until it ships; nothing is committed before the user says to
ship.
3. Fix, as a draft
Fix the cause where it lives, for the whole family of cases, to the quality bar of
AGENTS.md. Prefer a fix in the shared helper over a patch in one caller, then go over the other callers.Run the area's tests. A legacy fixture (
fixtures/legacy*.json) that changes is never regenerated: look at each changed entry, and edit by hand only the ones the old code got wrong, naming each in the commit.pnpm check:fast, rebase ontoorigin/main, thenpnpm previewwith a--urlto the page that shows the case (see "How a change goes").Tell the user exactly how to reproduce it in Chrome: the page, the moves to play from where it opens, what they saw before and should see now.
If they want to compare with
main, build it from a throwaway worktree and leave yours alone:git worktree add --detach /tmp/ln-issue<n>-main origin/main cd /tmp/ln-issue<n>-main && pnpm install --frozen-lockfile pnpm preview --take --name "<n>, sans le fix" --url <page> --thread <id> git worktree remove --force /tmp/ln-issue<n>-mainThen preview the fix again from your worktree when they come back to it.
4. Ship, when the user says so ("livre", "ship")
Write the tests: the issue's case first, then the rest of the family (each way the fix changes the answer, and a case it must leave alone).
See them fail without the fix, without touching the stash the worktrees share:
git diff <fixed files> > /tmp/ln-issue<n>.patch && git checkout <fixed files> pnpm vitest run <test files> # they fail git apply /tmp/ln-issue<n>.patch && rm /tmp/ln-issue<n>.patchpnpm check, then ship asAGENTS.md's "Before shipping" and "Shipping" say: the other sessions,pnpm turn take ship, the commit, a rebase ontoorigin/main,git push origin HEAD:main(a fast-forward: no PR, no merge commit), the main checkout pulled and previewed,pnpm turn release ship.The commit's body explains the cause, names any legacy entry it changes, and ends with
Fixes #<n>: the push tomaincloses the issue. Check that it did (gh issue view <n> --json state).Remove the throwaway files and worktrees, then tell the user what shipped, the tests, and any step skipped and why.