Refactoring

From docxology/template · View interactive version

Refactoring is an AI agent skill from the GitHub repository docxology/template. Clean-break refactors with migration for the Research Project Template — move logic to src/, split modules, rename APIs with test updates. USE WHEN restructuring code, extracting modules, removing duplication, or migration without behavior change.

How to use this skill

Skill file

Refactoring

Natural invoke

Inputs to confirm

Workflow

  1. Baseline — run tests on scope; record coverage.
  1. Move logic — from scripts to src/ or infrastructure/; keep orchestrators thin.
  1. Update imports — repo-wide grep; fix tests and docs.
  1. Migration — if breaking, document in project/infrastructure AGENTS.md; no silent API removal.
  1. Verify — pytest + ruff/mypy on public scope paths; pipeline smoke if project scripts moved.

Deliverables

Verification commands

uv run pytest <affected-test-path> -v
uv run python -m infrastructure.project.public_scope lint-paths | xargs uv run ruff check
uv run python scripts/pipeline/stage_01_test.py --project <project>  # when project scope

When NOT to use

References

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.