界面已本地化;技能介绍与说明文档按所选语言由 AI 自动翻译,代码、命令、路径和专业术语保留原文,以原作者文档为准。
探索技能
开发与工程 · SKILL.md

refactor-clean

refactor-clean

【开发与工程】Imported from everything-codex command refactor-clean

独立 GitHub 快照 · 自动分类 · 以原作者文档为准

技能说明

GitHub

name: refactor-clean description: Imported from everything-codex command refactor-clean version: 0.1.0 source: fork checksum: a8500c117b78940fb9d9b3c4505a829ddfa2d3232a46f92d157aae5c69c09aa8 updated_at: 2026-02-11T09:29:16+08:00 layer: quality

Refactor Clean

Native Subagent Protocol (Codex)

Codex supports native subagents. Delegate with spawn_agent, coordinate with send_input, collect via wait_agent, and clean up with close_agent.

Execution preference:

  1. Use native subagents first for independent workstreams (parallel when possible).
  2. Merge results in main thread and run final verification.
  3. Fallback only when delegation is blocked: use the [ANALYST]/[ARCHITECT]/[EXECUTOR]/[REVIEWER] structure in a single response.

Minimal orchestration pattern:

spawn_agent -> send_input (optional) -> wait_agent -> close_agent

Safely identify and remove dead code with test verification:

  1. Run dead code analysis tools:

    • knip: Find unused exports and files
    • depcheck: Find unused dependencies
    • ts-prune: Find unused TypeScript exports
  2. Generate comprehensive report in .reports/dead-code-analysis.md

  3. Categorize findings by severity:

    • SAFE: Test files, unused utilities
    • CAUTION: API routes, components
    • DANGER: Config files, main entry points
  4. Propose safe deletions only

  5. Before each deletion:

    • Run full test suite
    • Verify tests pass
    • Apply change
    • Re-run tests
    • Rollback if tests fail
  6. Show summary of cleaned items

Never delete code without running tests first!

我的收藏