用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/SocketDev/action --skill refreshing-history命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
Propagate a wheelhouse template change across fleet repos: worktrees, push/PR fallback, cleanup.
Run this repo's GitHub Actions locally with Agent-CI before pushing CI-sensitive changes.
Audit package exports for dead, internal-only, or weakly-consumed subpaths before pruning.
基于 SOC 职业分类
正在显示 SKILL.md
| name | refreshing-history |
| description | Refresh a default branch to one signed initial commit: update deps, verify, force-push with backup. |
Resets the default branch to a single signed commit, with deps freshly resolved and code freshly formatted. Works entirely in a sibling worktree; pushes a remote backup ref before any destructive action.
Not for: dropping unwanted commits surgically (use git rebase -i), or covering up bad PR hygiene.
squashing-historysquashing-history is the lower-level "squash to 1 commit" primitive. This skill layers on dep refresh + signed commit + integrity check + force-push contract. The org's required_signatures branch protection mandates git commit-tree -S — the bare config flag is unreliable for plumbing commands.
node .claude/skills/fleet/refreshing-history/run.mts /path/to/<repo>
The runner walks 10 phases end-to-end. See run.mts for the implementation.
| # | Phase | What it does |
|---|---|---|
| 1 | Pre-flight | Resolve default branch (main → master fallback); fetch; capture ORIG_HEAD and ORIG_COUNT. |
| 2 | Worktree | git worktree add -b chore/squash-and-refresh ../<repo>-squash origin/$BASE. |
| 3 | Backup | Push $ORIG_HEAD:refs/heads/backup-YYYYMMDD-HHMMSS before any destructive op. |
| 4 | Squash | git commit-tree -S on HEAD^{tree} → reset to that single signed commit. Verify count == 1 and signature == G. |
| 5 | Integrity check | git diff --ignore-submodules $ORIG_HEAD must be empty. Abort otherwise. |
| 6 | Refresh | pnpm run update, pnpm install, pnpm run fix --all, pnpm run check --all. Soft-warn on failures. |
| 7 | Amend | git add -A && git commit --amend --no-edit --no-verify if anything moved. |
| 8 | Force-push | git push --force --no-verify origin HEAD:$BASE. |
| 9 | Cleanup | Remove worktree + delete the temp branch. |
| 10 | Report | Print new SHA + backup ref name + recovery one-liner. |
main or master; the runner resolves $BASE via git symbolic-ref refs/remotes/origin/HEAD.-S explicitly to commit-tree; the bare config flag is unreliable for plumbing.If something goes wrong AFTER the force-push, restore from the remote backup:
cd "$SRC"
git fetch origin "<backup-name>"
git push --force origin "FETCH_HEAD:$BASE"
The backup ref persists indefinitely on the remote until manually deleted.
Run via socket-wheelhouse/scripts/run-skill-fleet.mts to dispatch one job per repo in parallel. Useful for refreshing multiple repos in one wave.