Squashed 'docs/standards/playbook/' changes from e504a68..b529012
b529012 ✅ test(tests): avoid hardcoded missing path 07583c8 🐛 fix(tests): make doc link check awk-portable 6244aa3 🔧 chore(ci): relax gitattributes check 31dd0c5 🐛 fix(scripts): require existing project root 15d4d63 🔧 chore(ci): install python3-pip 90c6313 🔧 chore(ci): run tests in a single job d84eff0 🔧 chore(ci): make actions base url configurable 395598d 🔧 chore(ci): fix yaml step names 4ae2733 ✨ feat(sync_standards): auto-detect existing languages e97fb00 ✨ feat(sync_standards): default gitattributes to append da0ef2b ✅ test: add automated tests and ci workflow 99bef30 🎨 style(markdown): format all markdown files with prettier 7e96bc8 ♻️ refactor(tsl): split function.md into 44 modular files 0d6b2a0 📝 docs(readme): add quick decision table and TL;DR for distribution methods 3b2188f 🎨 style(markdown): format markdown files with prettier 41fc43b 📝 docs(tsl): document {Unit.}Type source annotation 3dceaf7 📝 docs(tsl): clarify tsf-only top-level rules and type annotations 3a63829 📝 docs(skills): add create-plan skill f02a707 🐛 fix(scripts): escape markdown backticks in vendor_playbook 064aa92 🐛 fix(scripts): correct bat scripts 4881feb 🔧 chore(gitattributes): enforce crlf for bat files 1fa3e2a 🐛 fix(scripts): escape parentheses in sync_standards output 3958cad 📝 docs(vendor_playbook): mention ci templates 9d059cf ✨ feat(templates): add gitea ci example a52bb24 📝 docs(codex_skills): normalize markdown formatting cc8ad4c 📝 docs(skills): slim commit-message 2a98e15 🐛 fix(skills): quote YAML descriptions 8f78d22 🐛 fix(sync_standards): generate minimal AGENTS.md 5547665 ✨ feat(skills): add commit-message suggestion skill 3fe8bd7 🔧 chore(sync_standards): create AGENTS.md on sync 283d311 ✨ feat(playbook): add syntax book and codex skills tooling 5b97ed5 📝 docs(tsl): clarify syntax references 27e0700 ✨ feat(skills): add pdf/docx/pptx/xlsx wrapper workflows 5551363 ✨ feat(skills): add debugging and bulk refactor workflows 1d4f548 ✨ feat(skills): add built-in workflow skills c0895dd 📝 docs(skills): add anthropics document-skills integration cf9f80d 🔧 chore(playbook): add Claude Code skills guide and align python templates git-subtree-dir: docs/standards/playbook git-subtree-split: b529012c59c5d67c3073884d7b617763647417fd
This commit is contained in:
@@ -0,0 +1,61 @@
|
||||
---
|
||||
name: bulk-refactor-workflow
|
||||
description:
|
||||
"Safe bulk refactors and mass edits across a repo (rename APIs, global
|
||||
replacements, mechanical changes). Triggers: bulk refactor, mass edit, rename
|
||||
symbol, global replace, 批量重构, 全局替换, 统一改名, 大范围修改."
|
||||
---
|
||||
|
||||
# Bulk Refactor Workflow(批量重构 / 大范围修改)
|
||||
|
||||
## When to Use
|
||||
|
||||
- Rename API / symbol / file convention across many files
|
||||
- Mechanical refactors (imports, formatting, lint fixes, signature migrations)
|
||||
- Cross-cutting changes touching 10+ files
|
||||
|
||||
## Inputs(required)
|
||||
|
||||
- Scope:目录/文件类型/排除项(include/exclude)
|
||||
- Transformation:要做的规则(rename A→B、替换模式、接口迁移策略)
|
||||
- Constraints:是否允许行为变化?是否需要兼容期?是否允许自动格式化?
|
||||
- Verification:必须通过哪些命令/检查(最少一个)
|
||||
|
||||
## Procedure(default)
|
||||
|
||||
1. **Baseline**
|
||||
- 确保工作区干净:`git status --porcelain`
|
||||
- 跑一个基线验证(至少 build 或核心测试子集),避免“本来就坏”
|
||||
|
||||
2. **Enumerate**
|
||||
- 先搜索再改:用 `rg`/`git grep` 列出全部命中
|
||||
- 分类命中:真实调用 vs 注释/文档/样例;避免误改
|
||||
|
||||
3. **Apply Mechanical Change**
|
||||
- 优先使用确定性的机械变换(脚本/结构化编辑)而非手工逐个改
|
||||
- 每轮改动后立即做小验证(编译/单测子集)
|
||||
- 复杂迁移优先“两阶段”:先兼容旧接口(deprecated),再清理旧接口
|
||||
|
||||
4. **Format & Lint(按项目约定)**
|
||||
- 仅在确认“会破坏 diff 可读性”前提下分批格式化(避免把重构和格式揉在一起)
|
||||
|
||||
5. **Verify & Report**
|
||||
- 跑约定的验证命令并记录输出
|
||||
- 汇总影响范围:改动文件数、主要改动点、潜在风险
|
||||
|
||||
## Execution Hint(optional)
|
||||
|
||||
如果环境支持“执行型批量处理”(例如脚本执行),优先用脚本完成批量修改,然后只把**最小 diff + 摘要**交付,避免上下文膨胀与漏改。
|
||||
|
||||
## Output Contract(stable)
|
||||
|
||||
- Scope:改动覆盖范围(文件/目录/语言)
|
||||
- Transformation:执行的规则(可复用)
|
||||
- Changes:关键改动摘要(按类别)
|
||||
- Verification:命令 + 证据(输出/退出码/产物)
|
||||
- Risks:高风险点与回滚建议
|
||||
|
||||
## Guardrails
|
||||
|
||||
- 任何“全局替换”都必须先给出命中清单与排除策略
|
||||
- 避免把行为重构与格式化/无关清理混在同一轮
|
||||
Reference in New Issue
Block a user