一键导入
refactor
Constrains the Agent to follow a safe refactoring process — guarantee functional equivalence while improving code quality.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Constrains the Agent to follow a safe refactoring process — guarantee functional equivalence while improving code quality.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
约束 Agent 必须遵循结构化的 Bug 修复流程:定位 → 根因分析 → 实施修复 → 回归测试验证。
约束 Agent 从正确性、安全性、性能和可维护性四个维度进行系统化的结构性代码审查。
约束 Agent 必须遵循结构化的功能特性开发流程:理解需求 → 技术设想 → 编写代码 → 自验自测。
约束 Agent 遵循标准流程生成结构化、高质量且要素齐全的产品需求文档。
约束 Agent 必须遵循安全的重构流程:在保证原有业务逻辑和功能完全等价的前提下,提升代码质量。
Constrains the Agent to generate structured Product Requirements Documents (PRDs) with quality and completeness guarantees.
| name | refactor |
| description | Constrains the Agent to follow a safe refactoring process — guarantee functional equivalence while improving code quality. |
| assets | {"checklist":"assets/checklist.yaml","template":"assets/template.yaml"} |
| references | {"guidelines":"references/guidelines.yaml","security":"references/security.yaml"} |
Constrains the Agent to perform safe code refactoring: guarantee functional equivalence while improving code quality.
Before refactoring, you must check every item in assets/checklist.yaml.
Your output must strictly follow the format in assets/template.yaml.
Must include: refactoring goal, impact analysis, refactoring steps (with diff), behavioral equivalence checklist.
If you need to execute code during refactoring for verification, check references/security.yaml first.
Do not delete tests or remove error handling logic during refactoring.
Audit your refactoring output against references/guidelines.yaml.
Key checks: is the behavior equivalent? Are public APIs unchanged? Is code complexity reduced?
Roll back and regenerate if non-compliant, up to 3 retries.