AGENT SKILL

refactor-with-tests

Use when splitting files, improving architecture, reducing duplication, changing internals, or preserving behavior through focused tests during refactors.

使用场景代码审查
License 许可
MIT
最近更新
2026-05-04
Stars
★ 1
Forks
0

01 前言 Front Matter

name
refactor-with-tests
metadata
{ "internal": true }
description
Use when splitting files, improving architecture, reducing duplication, changing internals, or preserving behavior through focused tests during refactors.

03 SKILL.md 正文

Refactor With Tests

Workflow

  1. Identify the exact behavior to preserve.
  2. Add or locate tests that cover the behavior.
  3. Make the smallest useful refactor.
  4. Run relevant tests and typecheck.
  5. Update docs only when behavior, architecture, or setup changes.
  6. Summarize changed files and validation.

Guardrails

  • Do not combine unrelated refactors.
  • Do not rename public APIs without an explicit migration reason.
  • Do not weaken validation, auth, error handling, or observability to simplify code.
  • Preserve user changes in a dirty worktree.

04 同仓库更多 Skills