返回顶部
r

refactoring

Deep refactoring workflow—characterization tests, incremental steps, behavior preservation, design direction, and verification. Use when improving structure without changing external behavior, or paying down tech debt safely.

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 1.0.0
安全检测
已通过
142
下载量
0
收藏
概述
安装方式
版本历史

refactoring

# Refactoring (Deep Workflow) Refactoring changes **structure**, not **behavior**. Safety comes from **small steps**, **fast feedback**, and verification (tests, golden outputs, or controlled manual checks). ## When to Offer This Workflow **Trigger conditions:** - Code is hard to change; duplication; unclear module boundaries - Need to prepare an area for a new feature without mixing behavior change - Paying down tech debt with management expecting “no user-visible change” **Initial offer:** Use **six stages**: (1) clarify goal & scope, (2) establish safety net, (3) plan increments, (4) execute with reviewable commits, (5) verify behavior, (6) document & follow-ups). Confirm test coverage and release pressure. --- ## Stage 1: Clarify Goal & Scope **Goal:** Why refactor now—reduce coupling, enable feature X, remove dead code, improve naming. **Exit condition:** Explicit **non-goals** (no feature changes in this effort unless separately scoped). --- ## Stage 2: Establish Safety Net **Goal:** Prefer characterization tests for legacy; golden outputs for data pipelines; use snapshot tests sparingly. ### If tests are weak - Approval tests, short exploratory scripts, or pair review with domain expert --- ## Stage 3: Plan Increments **Goal:** Small commits, each leaving the codebase **working** (not necessarily perfect). ### Practices - Move code, then change behavior in separate steps (Fowler-style when helpful) - Separate mechanical renames from logic edits for reviewability --- ## Stage 4: Execute With Reviewable Commits **Goal:** Each PR/commit tells a story; avoid thousand-line “cleanup” dumps. --- ## Stage 5: Verify Behavior **Goal:** CI green; compare outputs for batch jobs; manual smoke on critical paths when needed. --- ## Stage 6: Document & Follow-Ups **Goal:** ADR or short module README for new boundaries; tickets for remaining debt accepted consciously. --- ## Final Review Checklist - [ ] Scope and non-goals explicit - [ ] Safety net matches risk - [ ] Incremental, reviewable steps - [ ] Behavior verified - [ ] Follow-up debt tracked ## Tips for Effective Guidance - Keep refactor commits separate from feature commits when possible. - If behavior must change, it is not “pure refactoring”—plan as a migration with communication. - Under hotfix pressure, minimize refactor scope or defer. ## Handling Deviations - **Strangler** refactors: maintain adapters at boundaries until cutover is complete.

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 refactoring-1776030807 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 refactoring-1776030807 技能

通过命令行安装

skillhub install refactoring-1776030807

下载 Zip 包

⬇ 下载 refactoring v1.0.0

文件大小: 1.94 KB | 发布时间: 2026-4-13 11:46

v1.0.0 最新 2026-4-13 11:46
- Initial release introducing a structured deep refactoring workflow.
- Outlines six clear stages: goal clarification, safety net establishment, incremental planning, reviewable execution, verification, and documentation.
- Provides practical guidance for when and how to use the workflow, emphasizing behavior preservation and risk management.
- Includes a review checklist and troubleshooting tips for effective and safe refactoring.

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部