重构
- 作者仓库星标 5,319
- 许可证 NOASSERTION
- 作者仓库 unkey
Refactor pass
Review the diff against main and perform a structural refactoring pass on all changed code in this branch.
Focus on:
Extract and consolidate: Pull repeated logic into shared functions. Merge near-duplicate code paths. Collapse unnecessary wrapper layers.
Improve structure: Flatten deep nesting. Break oversized functions into focused units. Move code closer to where it's used. Colocate related logic.
Clean up APIs and interfaces: Remove unused parameters, exports, and return values. Simplify function signatures. Make types tighter and more precise.
Reduce indirection: Inline trivial helpers that obscure intent. Remove pass-through functions that add no value. Shorten unnecessary call chains.
Fix naming: Rename variables, functions, and types so they say what they mean. Align naming with surrounding code conventions.
Rules:
- Do not change behavior. Every input/output must remain identical.
- Stay within the branch diff. Only refactor code that was added or modified in this branch. Do not refactor unrelated code unless it is directly entangled.
- Respect project conventions. Follow patterns and standards from CLAUDE.md and the surrounding codebase.
- Don't over-abstract. Three similar lines are fine. Only extract when duplication is real and likely to grow.
- Commit-ready output. The code should compile and pass tests after your changes.
Process:
- Read the full branch diff (
git diff main...HEAD) - Identify structural issues in the changed code
- Apply refactors file by file
- Run the project's type check / lint if available
- Report a 1-5 sentence summary of what you changed
- 流狐分类
- 工程开发
- 作者声明 Agent
- 未找到明确声明;不据此推断已兼容或已测试
- 静态检查
- 94 / 100 · 启发式扫描,不代表运行安全
- 作者 / 版本 / 许可
- @unkeyed · NOASSERTION
- 流狐 Token 估算
- 低消耗
- 流狐接入估算
- 即装即用
- 是否需要外部 API Key
- 未发现要求
- 检测到的系统要求
- 未声明
- 底层运行要求
- 未声明
- 检测到的文件与系统行为
-
- 只读
- 允许写入 / 修改
- 检测到的网络行为
- 仅限本地
- 安装命令数
- 无(仅作为资料)
档案由构建时根据 SKILL.md 与安装命令自动衍生,可能与作者实际意图存在差异。
需要注意: 未限定 allowed-tools,默认拥有全部工具权限。
作者没有在当前 SKILL.md 中定义固定输出样例。 # Refactor pass Review the diff against main and perform a structural refactoring pass on all changed code in this branch. Focus on: 1. **Extract and consolidate**: Pull repeated logic into shared functions. Merge near-duplicate code paths. Collapse unnecessary wrapper layers. …
# Refactor pass
Review the diff against main and perform a structural refactoring pass on all changed code in this branch.
Focus on:
1. **Extract and consolidate**: Pull repeated logic into shared functions. Merge near-duplicate code paths. Collapse unnecessary wrapper layers.
2. **Improve structure**: Flatten deep nesting. Break oversized functions into focused units. Move code closer to where it's used. Colocate related logic.
3. **Clean up APIs and interfaces**: Remove unused parameters, exports, and return values. Simplify function signatures. Make types tighter and more precise.
4. **Reduce indirection**: Inline trivial helpers that obscure intent. Remove pass-through functions that add no value. Shorten unnecessary call chains.
5. **Fix naming**: Rename variables, functions, and types so they say what they mean. Align naming with surrounding code conventions.
Rules:
- **Do not change behavior.** Every input/output must remain identical.
- **Stay within the branch diff.** Only refactor code that was added or modified in this branch. Do not refactor unrelated code unless it is directly entangled.
- **Respect project conventions.** Follow patterns and standards from CLAUDE.md and the surrounding codebase.
- **Don't over-abstract.** Three similar lines are fine. Only extract when duplication is real and likely to grow.
- **Commit-ready output.** The code should compile and pass tests after your changes.
Process:
1. Read the full branch diff (`git diff main...HEAD`)
2. Identify structural issues in the changed code
3. Apply refactors file by file
4. Run the project's type check / lint if available
5. Report a 1-5 sentence summary of what you changed 作者原文负责流程事实;流狐只索引当前章节、要点、文件与命令。
章节 -> 原文未使用二、三级标题
要点 -> Extract and consolidate · Improve structure · Clean up APIs and interfaces · Reduce indirection · Fix naming · Do not change behavior. · Stay within the branch diff. · Respect project conventions.
文件/命令 -> git diff main...HEAD · input/output · CLAUDE.md
内容 SHA-256 -> e4d0cb3d659c
原文结构
适用与边界
原文中的明确线索
git diff main...HEAD、input/output、CLAUDE.md