[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7DBE61BCZFBM5CTVB69YS1K":3,"skill-same:01M7DBE61BCZFBM5CTVB69YS1K":80},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":26,"commitSha":27,"skillDirectory":5,"forksCount":28,"repositoryHtmlUrl":29,"repositoryHomepageUrl":30,"ownerHtmlUrl":31,"ownerBlogUrl":32,"ownerDescription":33,"updatedAt":34,"install":35,"resources":47},"01M7DBE61BCZFBM5CTVB69YS1K","repo-scrub",null,"Scan a GitHub repo's full history for secrets and large files, scrub what the user picks, rewrite history safely, then flip it private → public.","KrishP147\u002Fskills","KrishP147","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F188794047?v=4","01M7DBBNP6K4GDW9NMJR1X3MXH","Krish Punjabi","01M7DBBNPXCPD04VA30YQBHBT8",37,"MIT","https:\u002F\u002Fgithub.com\u002FKrishP147\u002Fskills\u002Fblob\u002Fmaster\u002Frepo-scrub\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: repo-scrub\ndescription: Scan a GitHub repo's full history for secrets and large files, scrub what the user picks, rewrite history safely, then flip it private → public.\nargument-hint: \"[owner\u002Frepo] (default: current repo)\"\ndisable-model-invocation: true\n---\n\nGoing public is one-way: forks, caches and scrapers copy history within minutes, and GitHub offers no hook on its visibility toggle. So all cleanup happens *before* the flip, and you flip it yourself with `gh`.\n\nTwo rules hold throughout:\n- **Gate**: each numbered gate below needs the user's explicit go-ahead.\n- **Complete report**: every secret and large blob found is shown, including ones the user keeps.\n\n`\u003Ctmp>` = `$(mktemp -d)`, created once and echoed to the user; reuse that same path in every step (Git Bash's `\u002Ftmp` and Windows `%TEMP%` differ for Python). `\u003Ctmp>\u002Fscrub-work` holds secret-bearing files. Delete it (step 12) on every exit, early ones included.\n\n## 1. Prereqs and target\n\n- `gh auth status`; else user runs `gh auth login`.\n- `gitleaks version`; missing → Windows `winget install --id Gitleaks.Gitleaks -e`, mac\u002Flinux `brew install gitleaks`. v8.19+ uses `gitleaks git`; older uses `gitleaks detect --source . --log-opts=\"--all -m\"`.\n- `git filter-repo --version`; missing → `pip install git-filter-repo` (mac: or brew). Trust the version command, not pip's exit code: a `--user` install can land off PATH.\n\nMissing tool → give the install command and stop.\n\n`\u003Crepo>` = the argument, else `origin`'s repo per the `next` skill's `BOARD.md`, Target repo section (never a bare `gh` call: on a fork it hits the parent). `gh repo view \u003Crepo> --json name,owner,isPrivate,defaultBranchRef` → confirm the repo, and that a rewrite + force-push is OK if anything gets scrubbed.\n\nIn the user's clone:\n- **Other remotes**: `git remote -v`; per remote other than `origin`, `git ls-remote --heads --tags \u003Cremote>`. Each is its own copy of the history: its branches are scanned (step 3) and rewritten (step 7), and it gets the rewritten history (step 9, each push on a yes). A branch only there is not local-only. List each remote with its branches.\n- **Submodules**: `git log --all -m -p -- .gitmodules | grep -E '^\\+\\s*url'`. Each is a separate repo whose history this scan never enters: tell the user to `\u002Frepo-scrub` each one before this repo goes public (a private one breaks `--recurse-submodules` clones). Flag a relative URL (`.\u002F`, `..\u002F`): it resolves against wherever the superproject was cloned from, so public clones need that sibling repo public at the same path; else use an absolute URL.\n\n## 2. LFS bail-out\n\n`gh api repos\u002F\u003Co>\u002F\u003Cr>\u002Fcontents\u002F.gitattributes --jq .content | base64 -d | grep -i lfs` (404 = no LFS). LFS-tracked paths → stop: `filter-repo` has no LFS awareness; this needs manual handling. This only sees the root file on the default branch, so repeat the check on clone #1 (step 3): `git log --all -m -p -- '*.gitattributes' | grep -i filter=lfs` catches nested files and other branches. A hit there → stop too.\n\n## 3. Scan (clone #1)\n\n```\nmkdir -p \u003Ctmp>\u002Fscrub-work\ngit clone \u003Curl> \u003Ctmp>\u002Fscan-clone && cd \u003Ctmp>\u002Fscan-clone\ngit fetch \u003Cremote-url> '+refs\u002Fheads\u002F*:refs\u002Fremotes\u002F\u003Cremote>\u002F*'   # per other remote (step 1)\ngit count-objects -vH > \u003Ctmp>\u002Fscrub-work\u002Fbefore-size.txt\ngitleaks git . --log-opts=\"--all -m\" --report-format json --report-path \u003Ctmp>\u002Fscrub-work\u002Fgitleaks-report.json --no-banner\ngit filter-repo --analyze\npython \u003Cskill-dir>\u002Fscripts\u002Fsummarize_findings.py --gitleaks \u003Ctmp>\u002Fscrub-work\u002Fgitleaks-report.json \\\n  --analysis-dir .git\u002Ffilter-repo\u002Fanalysis --out \u003Ctmp>\u002Fscrub-work\u002Ffindings.json\n```\n\n- Run the LFS history check from step 2 here, in `scan-clone`, before trusting the scan.\n- gitleaks exit 1 = findings, not failure.\n- `-m` on `--log-opts` and on every `git log -S`\u002F`--grep` here and in step 8: without it a change made only in a merge commit (a conflict resolution) is never diffed, so a secret added there scans clean.\n- `summarize_findings.py` merges gitleaks + `.git\u002Ffilter-repo\u002Fanalysis\u002F` into `findings.json`: secrets `S1…` (deduped by rule + value, or by location when the value is empty; fingerprint `secret_sha256` only), large blobs `L1…` (bytes accumulated across every version). Use it; the analysis tables are easy to misread.\n- **Personal strings** (names, emails) from `\u002Frepo-showcase` or the user: gitleaks has no rule for them. Per string, `git log --all -m -S'\u003Cstring>' --oneline` (blob hits) and `git log --all -m -F -i --grep='\u003Cstring>' --oneline` (commit-message hits). Each hit is a finding `P1…` (Detail: `personal string`, plus the commit count); refer to it by ID from here on.\n- **Identities and messages**: `git log --all --format='%an %ae %cn %ce%n%B' | grep -Eo '[[:alnum:]._%+-]+@[[:alnum:].-]+\\.[[:alpha:]]+' | sort -u` and `git log --all --format='%an \u003C%ae>%n%cn \u003C%ce>' | sort -u`. Drop the owner's own (ask). Each other email is checked as a personal string; each other author\u002Fcommitter identity is a `P` finding (Detail: `author identity`), unless `\u002Frepo-showcase` handed over \"author identities stay\".\n- **Signatures**: `git log --all --format='%h %G?' | grep -v ' N$'` (signed commits) and `git for-each-ref refs\u002Ftags --format='%(if)%(contents:signature)%(then)%(refname:short)%(end)'` (signed tags). filter-repo drops every signature it rewrites.\n- `--analyze` spends this clone (filter-repo refuses a second run). Delete `scan-clone` once `findings.json` exists; keep `gitleaks-report.json` until step 12 (step 7 recovers values from it).\n\n## 4. Report\n\n```\n3 secrets across 2 files, 2 large blobs totaling 410 MB (accumulated across history)\n\nID | Type   | Path(s)                  | Detail                 | Commits\nS1 | secret | config\u002Fdev.env (+1 more) | AWS Access Key         | 3\nL1 | large  | assets\u002Fdemo.mov          | 340 MB (all versions)  | -\nP1 | personal | src\u002Fcli.js             | personal string        | 2\nP2 | personal | (commit identity)        | author identity        | 4\n\nRemotes: origin, mirror (branch only there: release\u002Fx). Submodules: vendor\u002Flib (..\u002Flib.git, relative).\nSigned: 2 commits, 1 tag (v1.0.0). A rewrite drops them: tags can be re-signed (step 8), commits stay unsigned.\n```\n\nRaw secret values stay out of the table. Reveal one only on request, looked up by fingerprint in `gitleaks-report.json`.\n\n## 5. Select\n\nPer ID or bulk (\"all secrets\", \"over 50MB\", a path glob). Echo back the final **scrub** and **keep** lists. Silence is not \"scrub everything\".\n\n## 6. Gates before any rewrite\n\n- **Rotation** (any secret selected): walk the user through [ROTATE.md](ROTATE.md). **Gate**: rotation confirmed done.\n- **Collaborators**:\n  ```\n  gh api repos\u002F\u003Co>\u002F\u003Cr>\u002Fcollaborators --jq '.[].login'\n  gh api repos\u002F\u003Co>\u002F\u003Cr>\u002Finvitations\n  gh pr list -R \u003Co>\u002F\u003Cr> --state open --json number,title,headRefName,author\n  gh api repos\u002F\u003Co>\u002F\u003Cr>\u002Fforks --jq length\n  ```\n  Anyone affected → draft a notice (what, why, re-clone from scratch, which PRs need recreating); user posts it or skips. Forks can't be messaged; report the count. **Gate**: go-ahead to rewrite.\n\n## 7. Rewrite (clone #2)\n\n```\ngit clone \u003Curl> \u003Ctmp>\u002Frewrite-clone && cd \u003Ctmp>\u002Frewrite-clone\ngit fetch \u003Cremote-url> '+refs\u002Fheads\u002F\u003Cb>:refs\u002Fremotes\u002Forigin\u002F\u003Cb>'   # per branch only on another remote\ngit repack -ad                                                    # after any such fetch: filter-repo wants one fresh pack\npython \u003Cskill-dir>\u002Fscripts\u002Fbuild_replace_text.py --gitleaks \u003Ctmp>\u002Fscrub-work\u002Fgitleaks-report.json \\\n  --findings \u003Ctmp>\u002Fscrub-work\u002Ffindings.json --ids S1 S3 --out \u003Ctmp>\u002Fscrub-work\u002Fexpressions.txt\n```\n\nFetching into `origin\u002F\u003Cb>` lets filter-repo turn it into a local branch like the rest; a name on two remotes with different tips → ask which one. The script writes `--replace-text` expressions without printing a value; no `S` selected → drop `--ids` and it writes an empty file for the `P` lines. Each selected `P` finding adds one line, `literal:\u003Cstring>==>REDACTED`, appended to `expressions.txt` by a file edit (no `echo` of the string); a commit-message hit also needs `--replace-message \u003Ctmp>\u002Fscrub-work\u002Fexpressions.txt` in the call below. `literal:` never touches author\u002Fcommitter fields: each selected `author identity` gets a line `New Name \u003Cnew@email> Old Name \u003Cold@email>` (names bare, emails in `\u003C>`; the user picks the replacement) in `\u003Ctmp>\u002Fscrub-work\u002Fmailmap`, and the call adds `--mailmap \u003Ctmp>\u002Fscrub-work\u002Fmailmap`. An identity the user keeps → record `author identities stay: \u003Cidentity>` in the step-8 summary. Location-only findings (`secret_sha256: null`) have no value to replace; it skips them, so scrub those by `--path` or by hand. Large blobs, per finding: strip entirely, or strip history but keep the current file (re-add it in a commit after the rewrite: path\u002Fsize stripping removes HEAD's copy too).\n\nOne combined call, only the flags for what was selected:\n\n```\ngit filter-repo --replace-text \u003Ctmp>\u002Fscrub-work\u002Fexpressions.txt --path \u003Cpaths> --invert-paths\n```\n\n(`--strip-blobs-bigger-than \u003Csize>` when a threshold describes the selection better.)\n\n## 8. Verify (still reversible)\n\n`git log --oneline -10`, `gitleaks git . --log-opts=\"--all -m\" --no-banner`, `git count-objects -vH`. Spot-check stripped paths are gone. Per scrubbed `P` finding, `git log --all -m -S'\u003Cstring>' --oneline` (and the `--grep` form for message hits) prints nothing, and so does `git log --all --format='%an %ae %cn %ce %B' | grep -F -i '\u003Cstring>'` per scrubbed string or identity email (`-S` never sees identities). Show before\u002Fafter commit count and size. **Gate**.\n\nPer tag signed before (step 3), ask to re-sign it with the user's own key (`user.signingkey`): `git tag -l --format='%(contents:subject)%0a%0a%(contents:body)' \u003Ctag> > \u003Ctmp>\u002Fscrub-work\u002Ftag.msg && git tag -f -s \u003Ctag> '\u003Ctag>^{commit}' -F \u003Ctmp>\u002Fscrub-work\u002Ftag.msg`, then `git tag -v \u003Ctag>`. No → it ships unsigned; say so.\n\n## 9. Force-push\n\nOnly after the step-6 notice went out (or was confirmed unnecessary). filter-repo removed `origin`:\n\n```\ngit remote add origin \u003Curl>\ngit push origin --force --all && git push origin --force --tags\n```\n\nPer other remote from step 1, each on its own yes: `git remote add \u003Cremote> \u003Curl> && git push \u003Cremote> --force \u003Ceach branch it holds>` (plus `--tags` if it held tags). One the user declines keeps the old history and the secret: say so.\n\nA hook or permission rule that blocks the push → show the user these exact commands to run themselves (in Claude Code, prefixed with `!`), then continue at step 10 once they confirm.\n\n`--all` covers non-default branches only because `filter-repo` turned the fresh clone's `origin\u002F*` into local branches. Run `git branch` before pushing and confirm every branch you mean to keep is listed; a missing one is not pushed, and keeps its old history on the remote. Branches fetched from another remote at step 7 are local too: then push `origin` its own branches by name instead of `--all`.\n\n## 10. Post-push\n\n**Every local copy of this repo, the user's own included**, still holds the old commits (and the secret). A plain `git pull` would merge the old history back in and the next push would re-leak it. Per copy, either:\n\n- **Re-clone** (simplest): copy uncommitted work, stashes (`git stash show -p --include-untracked stash@{n}`) and unpushed branches and tags (`git bundle create`) out of the old clone first, and keep it until they are carried over.\n- **Reset in place**: follow [POST-PUSH.md](POST-PUSH.md). It parks the WIP first, saves every stash entry (untracked parts included) and every local-only branch and tag outside the repo, resets the pushed branches, re-creates the stashes on the new history and checks them against the saved copies, re-points a tag whose commit was rebased, and deletes a branch or tag only on a yes. Its `reflog expire` and `gc` run before its final steps: a warning per branch or tag kept as is (old history, secret included, never push it) and a gated offer to delete the save folder. Never a bare `git reflog expire --all`: it wipes the stash list.\n\nTell collaborators the same (the step-6 notice).\n\n`gh pr list -R \u003Co>\u002F\u003Cr> --state open` → name PRs that must be closed and recreated. Tell the user: old commits stay reachable on GitHub (via `refs\u002Fpull\u002F*`, direct SHA, cached views) until GitHub Support garbage-collects them. Rotation protects the secret; the push is hygiene.\n\n## 11. Flip visibility\n\nState `gh`'s consequences first: stars\u002Fwatchers lost, forks detached, push rulesets disabled, Actions history becomes public. **Gate**, separate from the push.\n\n```\ngh repo edit \u003Co>\u002F\u003Cr> --visibility public --accept-visibility-change-consequences\ngh repo view \u003Co>\u002F\u003Cr> --json isPrivate\n```\n\n## 12. Cleanup\n\n```\nrm -rf \u003Ctmp>\u002Fscrub-work \u003Ctmp>\u002Fscan-clone \u003Ctmp>\u002Frewrite-clone\n```\n","Going public is one-way: forks, caches and scrapers copy history within minutes, and GitHub offers no hook on its visibility toggle. So all cleanup happens *before* the flip, and you flip it yourself with `gh`.\n\nTwo rules hold throughout:\n- **Gate**: each numbered gate below needs the user's explicit go-ahead.\n- **Complete report**: every secret and large blob found is shown, including ones the user keeps.\n\n`\u003Ctmp>` = `$(mktemp -d)`, created once and echoed to the user; reuse that same path in every step (Git Bash's `\u002Ftmp` and Windows `%TEMP%` differ for Python). `\u003Ctmp>\u002Fscrub-work` holds secret-bearing files. Delete it (step 12) on every exit, early ones included.\n\n## 1. Prereqs and target\n\n- `gh auth status`; else user runs `gh auth login`.\n- `gitleaks version`; missing → Windows `winget install --id Gitleaks.Gitleaks -e`, mac\u002Flinux `brew install gitleaks`. v8.19+ uses `gitleaks git`; older uses `gitleaks detect --source . --log-opts=\"--all -m\"`.\n- `git filter-repo --version`; missing → `pip install git-filter-repo` (mac: or brew). Trust the version command, not pip's exit code: a `--user` install can land off PATH.\n\nMissing tool → give the install command and stop.\n\n`\u003Crepo>` = the argument, else `origin`'s repo per the `next` skill's `BOARD.md`, Target repo section (never a bare `gh` call: on a fork it hits the parent). `gh repo view \u003Crepo> --json name,owner,isPrivate,defaultBranchRef` → confirm the repo, and that a rewrite + force-push is OK if anything gets scrubbed.\n\nIn the user's clone:\n- **Other remotes**: `git remote -v`; per remote other than `origin`, `git ls-remote --heads --tags \u003Cremote>`. Each is its own copy of the history: its branches are scanned (step 3) and rewritten (step 7), and it gets the rewritten history (step 9, each push on a yes). A branch only there is not local-only. List each remote with its branches.\n- **Submodules**: `git log --all -m -p -- .gitmodules | grep -E '^\\+\\s*url'`. Each is a separate repo whose history this scan never enters: tell the user to `\u002Frepo-scrub` each one before this repo goes public (a private one breaks `--recurse-submodules` clones). Flag a relative URL (`.\u002F`, `..\u002F`): it resolves against wherever the superproject was cloned from, so public clones need that sibling repo public at the same path; else use an absolute URL.\n\n## 2. LFS bail-out\n\n`gh api repos\u002F\u003Co>\u002F\u003Cr>\u002Fcontents\u002F.gitattributes --jq .content | base64 -d | grep -i lfs` (404 = no LFS). LFS-tracked paths → stop: `filter-repo` has no LFS awareness; this needs manual handling. This only sees the root file on the default branch, so repeat the check on clone #1 (step 3): `git log --all -m -p -- '*.gitattributes' | grep -i filter=lfs` catches nested files and other branches. A hit there → stop too.\n\n## 3. Scan (clone #1)\n\n```\nmkdir -p \u003Ctmp>\u002Fscrub-work\ngit clone \u003Curl> \u003Ctmp>\u002Fscan-clone && cd \u003Ctmp>\u002Fscan-clone\ngit fetch \u003Cremote-url> '+refs\u002Fheads\u002F*:refs\u002Fremotes\u002F\u003Cremote>\u002F*'   # per other remote (step 1)\ngit count-objects -vH > \u003Ctmp>\u002Fscrub-work\u002Fbefore-size.txt\ngitleaks git . --log-opts=\"--all -m\" --report-format json --report-path \u003Ctmp>\u002Fscrub-work\u002Fgitleaks-report.json --no-banner\ngit filter-repo --analyze\npython \u003Cskill-dir>\u002Fscripts\u002Fsummarize_findings.py --gitleaks \u003Ctmp>\u002Fscrub-work\u002Fgitleaks-report.json \\\n  --analysis-dir .git\u002Ffilter-repo\u002Fanalysis --out \u003Ctmp>\u002Fscrub-work\u002Ffindings.json\n```\n\n- Run the LFS history check from step 2 here, in `scan-clone`, before trusting the scan.\n- gitleaks exit 1 = findings, not failure.\n- `-m` on `--log-opts` and on every `git log -S`\u002F`--grep` here and in step 8: without it a change made only in a merge commit (a conflict resolution) is never diffed, so a secret added there scans clean.\n- `summarize_findings.py` merges gitleaks + `.git\u002Ffilter-repo\u002Fanalysis\u002F` into `findings.json`: secrets `S1…` (deduped by rule + value, or by location when the value is empty; fingerprint `secret_sha256` only), large blobs `L1…` (bytes accumulated across every version). Use it; the analysis tables are easy to misread.\n- **Personal strings** (names, emails) from `\u002Frepo-showcase` or the user: gitleaks has no rule for them. Per string, `git log --all -m -S'\u003Cstring>' --oneline` (blob hits) and `git log --all -m -F -i --grep='\u003Cstring>' --oneline` (commit-message hits). Each hit is a finding `P1…` (Detail: `personal string`, plus the commit count); refer to it by ID from here on.\n- **Identities and messages**: `git log --all --format='%an %ae %cn %ce%n%B' | grep -Eo '[[:alnum:]._%+-]+@[[:alnum:].-]+\\.[[:alpha:]]+' | sort -u` and `git log --all --format='%an \u003C%ae>%n%cn \u003C%ce>' | sort -u`. Drop the owner's own (ask). Each other email is checked as a personal string; each other author\u002Fcommitter identity is a `P` finding (Detail: `author identity`), unless `\u002Frepo-showcase` handed over \"author identities stay\".\n- **Signatures**: `git log --all --format='%h %G?' | grep -v ' N$'` (signed commits) and `git for-each-ref refs\u002Ftags --format='%(if)%(contents:signature)%(then)%(refname:short)%(end)'` (signed tags). filter-repo drops every signature it rewrites.\n- `--analyze` spends this clone (filter-repo refuses a second run). Delete `scan-clone` once `findings.json` exists; keep `gitleaks-report.json` until step 12 (step 7 recovers values from it).\n\n## 4. Report\n\n```\n3 secrets across 2 files, 2 large blobs totaling 410 MB (accumulated across history)\n\nID | Type   | Path(s)                  | Detail                 | Commits\nS1 | secret | config\u002Fdev.env (+1 more) | AWS Access Key         | 3\nL1 | large  | assets\u002Fdemo.mov          | 340 MB (all versions)  | -\nP1 | personal | src\u002Fcli.js             | personal string        | 2\nP2 | personal | (commit identity)        | author identity        | 4\n\nRemotes: origin, mirror (branch only there: release\u002Fx). Submodules: vendor\u002Flib (..\u002Flib.git, relative).\nSigned: 2 commits, 1 tag (v1.0.0). A rewrite drops them: tags can be re-signed (step 8), commits stay unsigned.\n```\n\nRaw secret values stay out of the table. Reveal one only on request, looked up by fingerprint in `gitleaks-report.json`.\n\n## 5. Select\n\nPer ID or bulk (\"all secrets\", \"over 50MB\", a path glob). Echo back the final **scrub** and **keep** lists. Silence is not \"scrub everything\".\n\n## 6. Gates before any rewrite\n\n- **Rotation** (any secret selected): walk the user through [ROTATE.md](ROTATE.md). **Gate**: rotation confirmed done.\n- **Collaborators**:\n  ```\n  gh api repos\u002F\u003Co>\u002F\u003Cr>\u002Fcollaborators --jq '.[].login'\n  gh api repos\u002F\u003Co>\u002F\u003Cr>\u002Finvitations\n  gh pr list -R \u003Co>\u002F\u003Cr> --state open --json number,title,headRefName,author\n  gh api repos\u002F\u003Co>\u002F\u003Cr>\u002Fforks --jq length\n  ```\n  Anyone affected → draft a notice (what, why, re-clone from scratch, which PRs need recreating); user posts it or skips. Forks can't be messaged; report the count. **Gate**: go-ahead to rewrite.\n\n## 7. Rewrite (clone #2)\n\n```\ngit clone \u003Curl> \u003Ctmp>\u002Frewrite-clone && cd \u003Ctmp>\u002Frewrite-clone\ngit fetch \u003Cremote-url> '+refs\u002Fheads\u002F\u003Cb>:refs\u002Fremotes\u002Forigin\u002F\u003Cb>'   # per branch only on another remote\ngit repack -ad                                                    # after any such fetch: filter-repo wants one fresh pack\npython \u003Cskill-dir>\u002Fscripts\u002Fbuild_replace_text.py --gitleaks \u003Ctmp>\u002Fscrub-work\u002Fgitleaks-report.json \\\n  --findings \u003Ctmp>\u002Fscrub-work\u002Ffindings.json --ids S1 S3 --out \u003Ctmp>\u002Fscrub-work\u002Fexpressions.txt\n```\n\nFetching into `origin\u002F\u003Cb>` lets filter-repo turn it into a local branch like the rest; a name on two remotes with different tips → ask which one. The script writes `--replace-text` expressions without printing a value; no `S` selected → drop `--ids` and it writes an empty file for the `P` lines. Each selected `P` finding adds one line, `literal:\u003Cstring>==>REDACTED`, appended to `expressions.txt` by a file edit (no `echo` of the string); a commit-message hit also needs `--replace-message \u003Ctmp>\u002Fscrub-work\u002Fexpressions.txt` in the call below. `literal:` never touches author\u002Fcommitter fields: each selected `author identity` gets a line `New Name \u003Cnew@email> Old Name \u003Cold@email>` (names bare, emails in `\u003C>`; the user picks the replacement) in `\u003Ctmp>\u002Fscrub-work\u002Fmailmap`, and the call adds `--mailmap \u003Ctmp>\u002Fscrub-work\u002Fmailmap`. An identity the user keeps → record `author identities stay: \u003Cidentity>` in the step-8 summary. Location-only findings (`secret_sha256: null`) have no value to replace; it skips them, so scrub those by `--path` or by hand. Large blobs, per finding: strip entirely, or strip history but keep the current file (re-add it in a commit after the rewrite: path\u002Fsize stripping removes HEAD's copy too).\n\nOne combined call, only the flags for what was selected:\n\n```\ngit filter-repo --replace-text \u003Ctmp>\u002Fscrub-work\u002Fexpressions.txt --path \u003Cpaths> --invert-paths\n```\n\n(`--strip-blobs-bigger-than \u003Csize>` when a threshold describes the selection better.)\n\n## 8. Verify (still reversible)\n\n`git log --oneline -10`, `gitleaks git . --log-opts=\"--all -m\" --no-banner`, `git count-objects -vH`. Spot-check stripped paths are gone. Per scrubbed `P` finding, `git log --all -m -S'\u003Cstring>' --oneline` (and the `--grep` form for message hits) prints nothing, and so does `git log --all --format='%an %ae %cn %ce %B' | grep -F -i '\u003Cstring>'` per scrubbed string or identity email (`-S` never sees identities). Show before\u002Fafter commit count and size. **Gate**.\n\nPer tag signed before (step 3), ask to re-sign it with the user's own key (`user.signingkey`): `git tag -l --format='%(contents:subject)%0a%0a%(contents:body)' \u003Ctag> > \u003Ctmp>\u002Fscrub-work\u002Ftag.msg && git tag -f -s \u003Ctag> '\u003Ctag>^{commit}' -F \u003Ctmp>\u002Fscrub-work\u002Ftag.msg`, then `git tag -v \u003Ctag>`. No → it ships unsigned; say so.\n\n## 9. Force-push\n\nOnly after the step-6 notice went out (or was confirmed unnecessary). filter-repo removed `origin`:\n\n```\ngit remote add origin \u003Curl>\ngit push origin --force --all && git push origin --force --tags\n```\n\nPer other remote from step 1, each on its own yes: `git remote add \u003Cremote> \u003Curl> && git push \u003Cremote> --force \u003Ceach branch it holds>` (plus `--tags` if it held tags). One the user declines keeps the old history and the secret: say so.\n\nA hook or permission rule that blocks the push → show the user these exact commands to run themselves (in Claude Code, prefixed with `!`), then continue at step 10 once they confirm.\n\n`--all` covers non-default branches only because `filter-repo` turned the fresh clone's `origin\u002F*` into local branches. Run `git branch` before pushing and confirm every branch you mean to keep is listed; a missing one is not pushed, and keeps its old history on the remote. Branches fetched from another remote at step 7 are local too: then push `origin` its own branches by name instead of `--all`.\n\n## 10. Post-push\n\n**Every local copy of this repo, the user's own included**, still holds the old commits (and the secret). A plain `git pull` would merge the old history back in and the next push would re-leak it. Per copy, either:\n\n- **Re-clone** (simplest): copy uncommitted work, stashes (`git stash show -p --include-untracked stash@{n}`) and unpushed branches and tags (`git bundle create`) out of the old clone first, and keep it until they are carried over.\n- **Reset in place**: follow [POST-PUSH.md](POST-PUSH.md). It parks the WIP first, saves every stash entry (untracked parts included) and every local-only branch and tag outside the repo, resets the pushed branches, re-creates the stashes on the new history and checks them against the saved copies, re-points a tag whose commit was rebased, and deletes a branch or tag only on a yes. Its `reflog expire` and `gc` run before its final steps: a warning per branch or tag kept as is (old history, secret included, never push it) and a gated offer to delete the save folder. Never a bare `git reflog expire --all`: it wipes the stash list.\n\nTell collaborators the same (the step-6 notice).\n\n`gh pr list -R \u003Co>\u002F\u003Cr> --state open` → name PRs that must be closed and recreated. Tell the user: old commits stay reachable on GitHub (via `refs\u002Fpull\u002F*`, direct SHA, cached views) until GitHub Support garbage-collects them. Rotation protects the secret; the push is hygiene.\n\n## 11. Flip visibility\n\nState `gh`'s consequences first: stars\u002Fwatchers lost, forks detached, push rulesets disabled, Actions history becomes public. **Gate**, separate from the push.\n\n```\ngh repo edit \u003Co>\u002F\u003Cr> --visibility public --accept-visibility-change-consequences\ngh repo view \u003Co>\u002F\u003Cr> --json isPrivate\n```\n\n## 12. Cleanup\n\n```\nrm -rf \u003Ctmp>\u002Fscrub-work \u003Ctmp>\u002Fscan-clone \u003Ctmp>\u002Frewrite-clone\n```\n",{"name":5,"description":7,"argument-hint":24,"disable-model-invocation":25},"[owner\u002Frepo] (default: current repo)",true,"master","832ed2285970099cff9b593c3f65785fb2ecaac3",1,"https:\u002F\u002Fgithub.com\u002FKrishP147\u002Fskills","https:\u002F\u002Fwww.krishpunjabi.com\u002Fskills","https:\u002F\u002Fgithub.com\u002FKrishP147","https:\u002F\u002Fkrishpunjabi.com","constantly evolving. ","2026-11-10 00:19:00",{"source":8,"skillName":5,"commands":36,"prompt":46,"zipAvailable":25},[37,40,43],{"tool":38,"command":39},"npx","npx skills add KrishP147\u002Fskills --skill repo-scrub",{"tool":41,"command":42},"bunx","bunx skills add KrishP147\u002Fskills --skill repo-scrub",{"tool":44,"command":45},"pnpm","pnpm dlx skills add KrishP147\u002Fskills --skill repo-scrub","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FKrishP147\u002Fskills\u002Fblob\u002Fmaster\u002Frepo-scrub\u002FSKILL.md",[48,54,58,62,68,72,76],{"path":49,"resourceType":50,"resourceTypeDesc":51,"sizeBytes":52,"sourceHtmlUrl":53},"POST-PUSH.md","REFERENCE","参考文档",8498,"https:\u002F\u002Fgithub.com\u002FKrishP147\u002Fskills\u002Fblob\u002Fmaster\u002Frepo-scrub\u002FPOST-PUSH.md",{"path":55,"resourceType":50,"resourceTypeDesc":51,"sizeBytes":56,"sourceHtmlUrl":57},"README.md",9560,"https:\u002F\u002Fgithub.com\u002FKrishP147\u002Fskills\u002Fblob\u002Fmaster\u002Frepo-scrub\u002FREADME.md",{"path":59,"resourceType":50,"resourceTypeDesc":51,"sizeBytes":60,"sourceHtmlUrl":61},"ROTATE.md",923,"https:\u002F\u002Fgithub.com\u002FKrishP147\u002Fskills\u002Fblob\u002Fmaster\u002Frepo-scrub\u002FROTATE.md",{"path":63,"resourceType":64,"resourceTypeDesc":65,"sizeBytes":66,"sourceHtmlUrl":67},"scripts\u002Fbuild_replace_text.py","SCRIPT","脚本",3791,"https:\u002F\u002Fgithub.com\u002FKrishP147\u002Fskills\u002Fblob\u002Fmaster\u002Frepo-scrub\u002Fscripts\u002Fbuild_replace_text.py",{"path":69,"resourceType":64,"resourceTypeDesc":65,"sizeBytes":70,"sourceHtmlUrl":71},"scripts\u002Fsummarize_findings.py",6827,"https:\u002F\u002Fgithub.com\u002FKrishP147\u002Fskills\u002Fblob\u002Fmaster\u002Frepo-scrub\u002Fscripts\u002Fsummarize_findings.py",{"path":73,"resourceType":64,"resourceTypeDesc":65,"sizeBytes":74,"sourceHtmlUrl":75},"scripts\u002Ftest_build_replace_text.py",6394,"https:\u002F\u002Fgithub.com\u002FKrishP147\u002Fskills\u002Fblob\u002Fmaster\u002Frepo-scrub\u002Fscripts\u002Ftest_build_replace_text.py",{"path":77,"resourceType":64,"resourceTypeDesc":65,"sizeBytes":78,"sourceHtmlUrl":79},"scripts\u002Ftest_summarize_findings.py",9606,"https:\u002F\u002Fgithub.com\u002FKrishP147\u002Fskills\u002Fblob\u002Fmaster\u002Frepo-scrub\u002Fscripts\u002Ftest_summarize_findings.py",[81,88,94,101,108,115],{"skillNo":82,"name":83,"nameZh":6,"description":84,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":85,"categories":86,"keywords":87,"publishedAt":19},"01M7DBFQZ1SFM3ZCRV85H0X67S","wayfinder","Plan an effort too big for one session as a map of decision tickets (GitHub issue + sub-issues) and resolve them one per session until the way is clear, then hand off to divide.","https:\u002F\u002Fgithub.com\u002FKrishP147\u002Fskills\u002Fblob\u002Fmaster\u002Fwayfinder\u002FSKILL.md",[],[],{"skillNo":89,"name":90,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":91,"categories":92,"keywords":93,"publishedAt":19},"01M7DBFN4HYH1SR26YWT0DRYFY","skill","https:\u002F\u002Fgithub.com\u002FKrishP147\u002Fskills\u002Fblob\u002Fmaster\u002Ftemplates\u002Fskill\u002FSKILL.md",[],[],{"skillNo":95,"name":96,"nameZh":6,"description":97,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":98,"categories":99,"keywords":100,"publishedAt":19},"01M7DBFEVWPNGVJ2BPB6A9ZR6D","teammate-brief","Write an onboarding document for a person joining or picking up a project — what it is, setup steps verified by running them, env var names and where to get them, tasks with \"done when\", owners, don't-touch list. Use for \"brief my teammate\", \"onboarding doc for X\", \"hand this project to someone\".","https:\u002F\u002Fgithub.com\u002FKrishP147\u002Fskills\u002Fblob\u002Fmaster\u002Fteammate-brief\u002FSKILL.md",[],[],{"skillNo":102,"name":103,"nameZh":6,"description":104,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":105,"categories":106,"keywords":107,"publishedAt":19},"01M7DBF7C7DHQVW3YV2THX6YHX","switch","Move this conversation to another Claude account (the previous one, or one by name), or set up, add, remove, rename and list accounts.","https:\u002F\u002Fgithub.com\u002FKrishP147\u002Fskills\u002Fblob\u002Fmaster\u002Fswitch\u002FSKILL.md",[],[],{"skillNo":109,"name":110,"nameZh":6,"description":111,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":112,"categories":113,"keywords":114,"publishedAt":19},"01M7DBF1JRCF2YY5V5NK4PQNNR","spend-gate","Gate any billable action (GPU pods\u002Finstances, paid APIs or tiers, cloud credits) behind a cost estimate, a live balance check, and an explicit yes for that action. Use before any create\u002Fdeploy on a paid provider (runpodctl, vultr-cli, aws\u002Fgcloud\u002Faz, modal, provider MCP create\u002Fdeploy\u002Frun\u002Fstart\u002Fupdate), any paid API call, or when spend-guard blocks one.","https:\u002F\u002Fgithub.com\u002FKrishP147\u002Fskills\u002Fblob\u002Fmaster\u002Fspend-gate\u002FSKILL.md",[],[],{"skillNo":116,"name":117,"nameZh":6,"description":118,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":119,"categories":120,"keywords":121,"publishedAt":19},"01M7DBEXN6XR289TBYNRZ1F4TH","sitrep","Live status of this session in ≤10 lines — what's running, git state, PRs + CI, asked vs done, what needs the user, and a SAFE\u002FNOT SAFE close verdict. Use for \"how's it going\", \"status update\", \"what's running\", \"can I close this\".","https:\u002F\u002Fgithub.com\u002FKrishP147\u002Fskills\u002Fblob\u002Fmaster\u002Fsitrep\u002FSKILL.md",[],[]]