Agent Skills
› winstonkoh87/Athena-Public
› diagnostic-first-refactoring
diagnostic-first-refactoring
GitHub一种重构方法论,强调在修改代码前先进行全面的结构扫描、依赖分析和诊断,制定安全的执行计划并逐步验证,以避免引入回归错误。
Trigger Scenarios
需要对现有模块进行大规模重构
担心重构导致回归错误
需要梳理复杂的模块依赖关系
Install
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
Version History
- e624e2d Current 2026-07-19 08:46


