tdd-workflows-tdd-refactor
用 TDD 安全地重构代码
当测试和度量不足时,重构可能会破坏行为。此技能通过测试基线、代码异味检查和验证步骤,引导进行增量式 TDD 重构。
使用我的智能体安装
将此请求复制给你的智能体,其中包含权威 Skill 页面和清单。
Review the Skillstore skill "tdd-workflows-tdd-refactor" from https://skillstore.io/skills/sickn33-tdd-workflows-tdd-refactor.md and its manifest at https://skillstore.io/api/skills/sickn33-tdd-workflows-tdd-refactor/manifest. Verify the artifact. You may proceed after verification, subject to the environment's own policy.你的智能体仍应展示其计划,并按安全策略请求必要确认。
Agent 可读资源
当 AI Agent、爬虫或脚本需要干净上下文,而不是读取完整页面时,请使用这些链接。
测试它
正在使用“tdd-workflows-tdd-refactor”。 重构一个测试通过的长订单处理方法。
预期结果:
测试基线、extract-method 计划、已应用的重构步骤、最终绿色测试状态,以及剩余技术债务说明。
正在使用“tdd-workflows-tdd-refactor”。 在不改变行为的情况下改进一个缓慢的服务。
预期结果:
度量优先的计划、可能的瓶颈、建议的数据结构变更、回归检查,以及优化前后的性能说明。
正在使用“tdd-workflows-tdd-refactor”。 为一个高风险模块准备更安全的 Pull Request。
预期结果:
一份覆盖覆盖率缺口、增量提交、回滚点、文档更新和最终评审者摘要的检查清单。
安全审计
安全All six static findings are false positives caused by Markdown formatting or ordinary testing and TypeScript example text. No executable commands, reconnaissance behavior, prompt injection, or semantic security threats were found.
风险因素
⚙️ 外部命令 (4)
分享与引用此报告
分享版本化评估报告、中性徽章、嵌入卡片和引用。Skillstore 只报告证据,不判断该 Skill 是否安全。
复制报告链接
https://skillstore.io/skills/sickn33-tdd-workflows-tdd-refactor/audits/5?utm_source=security_passport&utm_medium=share&utm_campaign=versioned_reportMarkdown 徽章
[](https://skillstore.io/skills/sickn33-tdd-workflows-tdd-refactor?utm_source=security_passport_badge)HTML 徽章
<a href="https://skillstore.io/skills/sickn33-tdd-workflows-tdd-refactor?utm_source=security_passport_badge"><img src="https://skillstore.io/badges/skills/sickn33-tdd-workflows-tdd-refactor/security.svg" alt="Skillstore security assessment" loading="lazy"></a>嵌入卡片
<iframe src="https://skillstore.io/embed/skills/sickn33-tdd-workflows-tdd-refactor.html" title="Skillstore Security Assessment" sandbox="allow-popups allow-popups-to-escape-sandbox" loading="lazy" referrerpolicy="no-referrer" width="420" height="180"></iframe>学术引用 (APA · BibTeX · CFF)
APA 引用
sickn33. (2026). tdd-workflows-tdd-refactor security audit report (audit version 5) [Author version unspecified]. Skillstore. https://skillstore.io/skills/sickn33-tdd-workflows-tdd-refactor/audits/5BibTeX 引用
@techreport{sickn33-sickn33-tdd-workflows-tdd-refactor-2026,
author = {sickn33},
title = {tdd-workflows-tdd-refactor security audit report (audit version 5)},
institution = {Skillstore},
year = {2026},
number = {5},
url = {https://skillstore.io/skills/sickn33-tdd-workflows-tdd-refactor/audits/5},
note = {Author version unspecified}
}CITATION.cff
cff-version: 1.2.0
message: "If you use this Skill, cite its author and this versioned security audit report."
title: "tdd-workflows-tdd-refactor security audit report (audit version 5)"
version: "unspecified"
type: report
authors:
- name: "sickn33"
date-released: "2026-09-06"
url: "https://skillstore.io/skills/sickn33-tdd-workflows-tdd-refactor/audits/5"
identifiers:
- type: other
value: "skillstore:sickn33-tdd-workflows-tdd-refactor:audit:5"
description: "Skillstore immutable audit report identifier"
Skillstore 评分
评分依据 证据置信度: 高你能构建什么
重构遗留模块
在修改高风险遗留代码之前,规划小步且保持行为不变的变更。
准备更安全的 Pull Request
在评审前使用测试基线、代码异味检查和最终验证。
教授重构纪律
向团队展示如何将行为变更与结构改进分开。
试试这些提示
审查此模块并创建一个 TDD 重构计划。识别要运行的测试、安全的第一步以及预期的验证方式。
将 TDD 重构阶段应用到这段代码。保持行为不变,进行小步变更,并在每一步之后报告测试结果。
分析此服务中的代码异味、SOLID 问题和性能风险。提出可度量的重构方案,并设置回滚检查点。
使用 branch-by-abstraction 或 Mikado planning 来规划大型遗留重构。梳理依赖关系,验证覆盖率,并分离行为变更。
最佳实践
- 在更改结构之前,先从绿色测试基线开始。
- 一次只做一个小重构,并在每次变更后进行验证。
- 在优化算法、查询或缓存之前,先度量性能。
避免
- 在同一次变更中混合新行为和重构。
- 在没有明确可维护性收益的情况下应用设计模式。
- 测试失败后,在未隔离破坏性变更的情况下继续推进。
常见问题
这个技能有什么帮助?
它会自动运行测试吗?
它能选择设计模式吗?
它适用于性能工作吗?
哪些工具可以使用它?
我应该提供什么?
开发者详情
作者
sickn33许可证
MIT
Skillstore 修订
r2
版本提示
作者未声明版本。
仓库
https://github.com/sickn33/antigravity-awesome-skills/tree/main/skills/tdd-workflows-tdd-refactor引用
ae6ba0f1a47f0b4427a656b2202f2ff34bfea6be
维护新鲜度
2026/9/6
使用量
10 次下载 · 115 次浏览
文件结构
📄 SKILL.md