# Refactor Commit

> Refactor code and commit changes safely. Use when asked to refactor files, reorganize code, rename/move classes, or clean up code with a commit at the end. Use when this capability is needed.

- Skill: `tomevault-io/refactor-commit` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add tomevault-io/refactor-commit`
- Raw SKILL.md: https://api.skillmd.com/api/skills/tomevault-io/refactor-commit/raw
- Safety review: pending (external: skill-scanner PASS, skillspector PASS)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: tomevault-io (https://skillmd.com/u/tomevault-io)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/tomevault-io/refactor-commit

---


# Refactor and Commit

Refactor target files and commit the result after all tests pass.

## Workflow

1. Read the target file(s) and understand the current structure
2. Identify refactoring opportunities based on user request
3. Make changes following existing patterns in the codebase (prefer AST-based over token-based)
4. Update all namespaces and using statements in both main and test projects
5. Build: `dotnet build src/TsqlRefine.sln -c Release`
6. Fix any build errors before proceeding
7. Run full test suite: `dotnet test src/TsqlRefine.sln -c Release`
8. Fix any test failures
9. Commit with a descriptive message summarizing what was refactored and why

## Rules

- Never commit with failing tests
- Always update namespaces when moving/renaming files
- Build before testing to catch compile errors early
- If a refactoring causes widespread breakage, revert and take a smaller approach

---
> Converted and distributed by [TomeVault](https://tomevault.io/claim/masmgr) — claim your Tome and manage your conversions.
<!-- tomevault:4.0:skill_md:2026-04-15 -->

