All authors

Claude Skills by wan-huiyan
github.com/wan-huiyan124 skills0 installs202 views
- Worktree Historical Test Replay Missing DirsFix `pytest exit 4` ("file or directory not found") when running a test command in a git worktree checked out at an OLD commit. Use when: (1) you're doing historical replay (incident replay, mutation testing, git bisect with tests) and the suite errors out in 1-2 seconds with no test execution, (2) the test command works fine at HEAD but fails at pre-fix SHAs, (3) `pytest scripts/overnight/tests/ <analytics_pkg>/tests/ --tb=no -q` returns "ERROR: file or directory not found: scripts/overnight...Votes: 0GitHub stars: 3
- Worktree Index Corrupt Async Post Commit HookFix `fatal: unable to read <sha>` or `invalid sha1 pointer in cache-tree of .git/worktrees/<name>/index` errors that surface when running git operations (`git status`, `git rebase`, `git pull`) in worktree B shortly after committing in sibling worktree A — when the project has an async post-commit hook (a hook that runs `&`, `nohup`, or "running ... in background"). Use when: (1) error message points at worktree B's index but you weren't editing B, (2) you just merged/squashed/committed in wo...Votes: 0GitHub stars: 3
- Worktree Outer Ls Mistaken For Main StatePrevent citing files as "on main" when they actually live only in a sibling worktree's working tree. Use when (1) you're working inside a worktree at `<repo>/.claude/worktrees/<X>/` and need to verify whether a file or feature is on `origin/main`, (2) you're tempted to run `ls /path/to/outer-repo/...` or `find /path/to/outer-repo` to check, (3) you're about to cite that filesystem-walk result in a PR description, handoff doc, or commit message as if it represented main's state. Trap: in a mul...Votes: 0GitHub stars: 3
- Worktree Stale Local Main Ref Inflates Pr DiffStop a false "my PR is reverting/touching dozens of upstream files" alarm when `git diff main...<branch>` reports far more files than your commit changed, in a multi-worktree repo. Use when: (1) you're in a worktree at `<repo>/.claude/worktrees/<X>/` (or any `git worktree`), (2) `git diff main...HEAD` (3-dot) or `--stat` shows tens/hundreds of files + thousands of lines but your actual commit (`git show --stat HEAD`) touched only a handful, (3) you're about to panic about the `stale-base-pr-s...Votes: 0GitHub stars: 3
- Worktree Write Abs Path Lands In Parent CheckoutIn a git worktree session, a Write/Edit whose absolute path points at the MAIN-REPO ROOT (the parent checkout) silently creates the file in that parent checkout's working tree — on whatever branch it has checked out — NOT in your worktree on your feature branch. The file then doesn't appear in `git status` on your branch and `ls`/Read inside the worktree can't find it. Use when: (1) the environment's "Primary working directory" is a worktree at `<repo>/.claude/worktrees/<name>/`, (2) you're a...Votes: 0GitHub stars: 3
- Batch Merge Subject Is Not Evidence A Member LandedYou are about to close, delete the branch of, or mark as landed a pull request because a batch, roll-up or merge-train commit on the target branch names it in the subject line, and because the member's own commits all predate that merge by wall clock. Neither of those is evidence. A batch branch is assembled at some moment BEFORE it merges, so anything the member pushed after assembly is outside it, and the subject records INTENT at assembly time rather than CONTENT at merge time. Use before ...Votes: 0GitHub stars: 3
- Ci Leg Skipping Moves Minutes It Does Not Remove ThemYou are about to propose, price or approve a CI cost saving that works by making a job or matrix leg SKIP on pull requests — a path filter, a safe list, a changed-files gate, an exemption list. Check first whether the pipeline runs a complement or backstop on merge, on push, or nightly: many do, and then the legs a pull request skipped are exactly the legs some later run executes, so a branch that goes green once and merges bills the same total either way and the wall clock does not move at a...Votes: 0GitHub stars: 3
- Clean Merge Lands Line Guard On A Value Neither Branch PredictedTwo branches each contain a guard, test or document that pins a line NUMBER in a third file, each side correctly re-aims that number for its own tree, and git merges both edits with NO conflict — leaving a merged tree whose real line can be neither number. Use when: (1) two parallel PRs both insert or delete lines in a file that other files cite by line, (2) a merge you just completed touched a test or page that resolves `path:NNN` and the merge was clean, (3) a guard file in your merge resul...Votes: 0GitHub stars: 3
- Conflicted Pr Starts No Ci Run Push Resolution FirstA conflicted pull request stops producing NEW CI runs for as long as the conflict stands, because the provider rebuilds the synthetic merge ref whenever either side moves and cannot build it for a conflicting PR. The run list is usually NOT empty: it still holds the head's PRE-conflict run, and that run's red is then read as the blocker. Use when: (1) a landing script refuses to step a PR and prints something like `DRAFT UNKNOWN (git: CONFLICTED vs origin/main <sha>) gates=failure auto-mer...Votes: 0GitHub stars: 3
- Durable Script Copy Still Imports The Session ScratchpadYou copied a script out of the session scratchpad into a durable directory so the next session (or the next you) can re-run it — but it still imports a helper from the scratchpad, so the copy dies with `/tmp` and looks complete until someone runs it. Use when: (1) you are saving a wrap-up, re-run or analysis script anywhere outside the scratchpad; (2) a handoff note, issue or pull request body points a reader at a script "saved to" a durable path; (3) you are about to say a script, log or art...Votes: 0GitHub stars: 3
- Gh Pr Checks Exit Code Folds A By Design Red Wait On The Row`gh pr checks` returns ONE exit status for the whole pull request, so a check your repo keeps red ON PURPOSE — a required aggregation context that is red while a PR is a draft, a placeholder context, a job the workflow allows to fail — makes the command exit non-zero on a pull request where everything that actually ran passed. Use when: (1) you are writing a background wait loop or watchdog that polls a PR and decides from `$?`; (2) a background poll came back "failed with exit code 1" and yo...Votes: 0GitHub stars: 3
- Injected Claude Md Is The Worktrees Copy Not MainsThe CLAUDE.md (or AGENTS.md / GEMINI.md) your session quotes is the copy in the checkout the session STARTED in, not the one on the default branch — and a long-lived worktree's copy can be weeks behind, so every house rule in context may be retired. Use when: (1) you are about to write or say "CLAUDE.md says X", "the house rule is X", or "the project file is stale about X"; (2) your session runs in a worktree that was created days or weeks ago; (3) a SessionStart hook or banner mentions the i...Votes: 0GitHub stars: 3
- Job Reports Success While Its Worker Was Oom KilledA batch or cloud job lists as SUCCEEDED while the work inside it produced nothing, because the kernel's out-of-memory killer took a forked WORKER and the parent caught the failure, wrote its record and exited 0. Use when: (1) a run's own output says a worker "died"/"was terminated abruptly" but the execution listing says succeeded, (2) you are about to report "the job failed" or "the run died" to a coordinator who will quote you upstream, (3) a peer checks the listing, sees success and tells ...Votes: 0GitHub stars: 3
- Learning LoopTurn failures and user corrections into tested workflow improvements. Use for lessons and retrospectives.Votes: 0GitHub stars: 3
- Parallel Gate Legs Killed For Memory Count Cannot See RamTwo sessions run local test legs on the same machine and one session's leg is killed for memory mid-run, while the concurrency guard everybody uses — a count of running test processes — reads well inside its limit the whole time. Use when: (1) a background test run ends with a harness notice like "stopped because the system is running low on memory" and its log simply stops, with no traceback, no summary line and no exit code, (2) you are about to re-report that leg as RED, (3) your "at most ...Votes: 0GitHub stars: 3
- Peer Cited Platform Limit May Be A ConflationA coordinator or peer session hands you a constraint stated as a platform fact ("the provider's ceiling forbids N workers, so that run is not a machine you could buy"), and it is their own conflation of two quantities that happen to share a number in today's configuration. Use when: (1) a peer message tells you an option is impossible, unsupported or not purchasable, and names no source; (2) you are about to drop a measurement arm, narrow a brief or tell the user an option does not exist, on ...Votes: 0GitHub stars: 3
- Poll Loop Treats An Unreadable Status As FinishedYou are watching a long-running job you dispatched — a hosted batch execution, a remote build, a queued run — by asking its API for status on a loop, and the loop decides "finished" by pulling one field out of the reply and testing that the field is not empty. An error line, a fallback token or a truncated reply is also not empty, and `cut` without `-s` hands a delimiter-free line back whole whatever field you asked for — so the test passes on a reply that carries no status at all. Use when a...Votes: 0GitHub stars: 3
- Relayed Claim Widens And Two Relays Are One WitnessA claim that was TRUE in the document it came from arrives WIDER in the artifact you are about to put in front of the user, because one verb changed on the way — "nothing refuses X" becoming "nothing counted X". Use when: (1) you are writing a page, brief, card or summary downstream of an audit, analysis or report rather than from the system itself; (2) the sentence you are about to write is a negative universal ("nothing does X", "there is no Y anywhere", "no gate checks Z"); (3) two session...Votes: 0GitHub stars: 3
- Research Lane CoordinatorCoordinate research lanes, evidence and PR handoffs. Use for multi-session research; skip routine edits.Votes: 0GitHub stars: 3
- Rule Cited By Title Proposes Work The Ledger Says Is BuiltA standing rule ("no change to X until the owner has reviewed Y") cited from its TITLE, its id, or a peer's paraphrase instead of its recorded body — so a session proposes building Y when the shared ledger already carries Y as built and waiting on a human. The second half is a vocabulary trap: a status word that means "built, unreviewed" is usually spelled `open` or `pending`, which in issue vocabulary means "not started", so the row that proves the work exists reads as proof it does not. Use...Votes: 0GitHub stars: 3
- Scheduled Fallback Check Cites Stale Task IdDon't act on a background-task ID embedded in an incoming check-in message (a self-scheduled fallback wakeup, a peer's "did it finish?" ping, a cron reminder) without first verifying it's still the CURRENT run. Use when: (1) you dispatched a long-running background task (a local CI-equivalent gate run, a build, a deploy watcher) under task ID A; (2) while it was in flight, new work landed that required restarting the SAME class of task under a fresh ID B (a review fix, a merge, a retry after ...Votes: 0GitHub stars: 3
- Session Context Runs Out Mid Brief Measure First Hand Back EarlyA dispatched session can run out of its context budget before it finishes, and what survives is only what it MEASURED and sent — never the orientation it did. Hours of reading a call path leave nothing transferable; the two cheap readings the brief called unmeasured are the whole inheritance. Use when: (1) a brief names facts as unknown, unchecked or "not measured" and you are deciding what to do first; (2) you are partway through a task and can see the budget will not cover reading plus buil...Votes: 0GitHub stars: 3
- Waiter Pgrep Matches Its Own Command LineYou are about to trust a process search on a machine several sessions share: a wait loop that spins until some pattern stops matching, a liveness check before deleting a worktree or killing a run, or a "is the other session still going?" question answered from `ps`. The harness runs every shell command inside a wrapper shell whose argv carries the whole command text, so your pattern is present in the argv of the shell doing the searching, and in every other session's wrapper that merely menti...Votes: 0GitHub stars: 3
- Batch Member Cites A Path Only A Non Member AddsYou wrote something correct that the default reader cannot reach: a batch member citing a path only a NON-member adds, or a rule, ruling or ledger sitting on an unlanded branch.Votes: 0GitHub stars: 3