Agent Skills
› winstonkoh87/Athena-Public
› diagnostic-first-refactoring
diagnostic-first-refactoring
GitHub指导在重构代码前进行深度诊断的规范,强调先扫描结构、识别耦合与测试缺口,再按依赖安全顺序执行变更并逐步验证,避免盲目修改。
触发场景
需要重构现有模块时
计划对代码库进行大规模结构调整时
安装
npx skills add winstonkoh87/Athena-Public --skill diagnostic-first-refactoring -g -y
SKILL.md
Frontmatter
{
"how": "1. Map file structure → 2. Identify dependencies → 3. Check test coverage → 4. Plan changes → 5. Execute with verification",
"who": "Any AI coding agent",
"why": "Prevents blind edits that break unknown dependencies",
"name": "diagnostic-first-refactoring",
"what": "Read-only workspace scan before executing refactoring changes",
"when": "Before any \/refactor or structural code change",
"where": "Target codebase or module",
"description": "Analyze codebase structure before making changes — the \"Surgeon's Scan\" pattern"
}
Diagnostic-First Refactoring (Surgeon's Scan)
Core Principle: Understand before you cut.
Protocol
- Scan: Map the target module's file structure and dependencies
- Diagnose: Identify coupling, dead code, and test coverage gaps
- Plan: Design the refactoring sequence (dependency-safe order)
- Execute: Apply changes with verification at each step
- Verify: Run tests, check for regressions
Anti-Patterns
- ❌ Editing files without reading them first
- ❌ Refactoring multiple modules simultaneously
- ❌ Skipping the dependency scan
- ❌ Not running tests after each change
Related Protocols
- DIAG-001: Knowledge-Action Gap
- DIAG-002: Baseline Check
- DIAG-003: Frame Collision
版本历史
- e624e2d 当前 2026-07-19 08:46


