cs-refactor-ff
Installation
SKILL.md
cs-refactor-ff
启动必读
开始任何判断或动作前,先执行 CodeStable preflight:读 .codestable/attention.md;缺失先 cs-onboard;不读外部 AI 入口替代(详见 .codestable/reference/execution-conventions.md)。
用户说"优化一下这个函数"而改动明显很小(单函数变长、组件里抽个 composable、一段重复代码合并)时走完整三阶段太重。fastforward 让 AI 像平时一样直接改但守住底线——行为等价、引用经典方法、跑测试自证。
很轻:没有 scan 清单、没有 design doc、没有 checklist,改完一句话汇报就行。
执行 gate(worktree + commit)
改前运行 start gate,{slug} 为 refactor 目录名:
python3 .codestable/tools/codestable-worktree-gate.py --root . --json start --unit .codestable/refactors/YYYY-MM-DD-{slug}
gate 不通过不动代码;override 先在 unit 目录写 worktree-override.md(reason / scope / approval)。自证通过、提交前运行 commit gate(同命令 commit);不通过先处理 findings。gate 安装与 branch-guard hook 见 .codestable/reference/branch-guard-hooks.md。