Easyuseaide high risk git operation
Skill john-ops-lab/EasyUseAIDE/assets/skills/easyuseaide-high-risk-git-operation
面向个人开发者的跨 IDE Agent AI 编码工程化规则、Skills 与项目交付模板。
npx -y skills add john-ops-lab/EasyUseAIDE --skill easyuseaide-high-risk-git-operationAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
2 things to look at
- 15 days oldThe repository was created 15 days ago. New is not bad, but a brand new repository carrying a familiar-sounding name is the shape a typosquat arrives in, and there has been no time for anyone else to find a problem with it.
- 2 stars2 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
What its author says it does
Copied from the file, not written here
Use this skill only for Git operations that can rewrite, delete, expose, or disrupt shared history or working data, including force push, filter-repo, reset --hard, clean, shared-branch rebase, secret removal, and recovery. Do not use it for ordinary commits, branches, merges, or worktree creation; if another branch workflow is active, apply this skill only as the safety gate around the risky step.
SKILL.md
2.7 KB, 829 tokens by cl100k_base, as published. Nobody here has run it
高风险 Git 操作
未经用户明确授权,不执行历史重写、强制推送、硬重置、大范围清理或共享分支变基。普通强制推送禁止使用。
普通分支、评审、合并和 worktree 流程继续由当前项目或已有框架管理。本 Skill 不接管完整开发流程,只在即将发生高风险 Git 操作时增加影响确认、恢复能力和远端核验门禁。
1. 确认目标与影响
明确:
- 要解决的问题;
- 目标仓库、远端和分支;
- 是否为共享分支;
- 是否存在 Fork、PR、Release、Tag 或自动部署;
- 哪些提交和对象会受影响;
- 是否有其他协作者;
- 是否涉及敏感信息泄漏。
2. 只读检查
至少检查:
git status --short
git remote -v
git branch -vv
git log --oneline --decorate --graph -n 30
git reflog -n 30
按场景补充检查远端最新提交、Tag、PR 和 Release。
不得在工作区存在未确认修改时直接执行破坏性操作。
3. 建立恢复能力
执行前:
- 创建本地备份分支或 Tag;
- 必要时创建私有
git bundle恢复包; - 记录当前 HEAD 和远端引用;
- 对恢复包设置安全存放位置;
- 在隔离克隆或临时仓库中先验证命令。
4. 优先低风险方案
按风险由低到高选择:
- 新提交修复;
git revert;- 仅本地交互式 rebase;
- 经授权的历史重写;
- 经授权的
--force-with-lease。
能用 revert 解决时,不重写共享历史。
5. 执行约束
- 每一步后检查结果;
- 不串联大量不可逆命令;
- 不使用普通
--force; git reset --hard和git clean前明确列出将丢失内容;- 历史过滤操作先在隔离仓库验证;
- 远端在检查后发生变化时,停止强推并重新评估。
6. 完成验证
历史重写或敏感清理后:
- 使用全新克隆验证公开可达历史;
- 重新运行敏感信息扫描;
- 验证分支、Tag、CI、PR 和 Release;
- 说明托管平台可能暂时保留不可达旧对象;
- 告知协作者重新同步的方法。
7. 交付报告
说明执行原因、实际命令、影响范围、恢复点、验证结果、协作者需要执行的操作和剩余风险。