git-refactor-hygiene
Skill1 starsChanged 6 months agoApache-2.0View on GitHub
Use when reorganizing, moving, renaming, staging, committing, or
In this repository25 other files it gives its agents.
- AGENTS.mdAGENTS.md
- developer-tool-installation-policySkill
- project-repository-setupSkill
- scientific-accelerator-portabilitySkill
- scientific-build-systemsSkill
- scientific-ciSkill
- scientific-cli-benchmarkSkill
- scientific-cli-designSkill
- scientific-code-styleSkill
- scientific-container-workflowsSkill
- scientific-data-analysis-and-visualizationSkill
- scientific-data-managementSkill
- scientific-documentationSkill
- scientific-io-and-data-formatsSkill
- scientific-notebook-workflowsSkill
- scientific-numerics-reviewSkill
- scientific-package-managementSkill
- scientific-parallel-debuggingSkill
- scientific-performance-portabilitySkill
- scientific-profilingSkill
- scientific-release-and-publicationSkill
- scientific-reproducibilitySkill
- scientific-reviewSkill
- scientific-testingSkill
- scientific-workflow-automationSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
18 rules. About 0 are common, 14 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈14
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- could be automatic: a setting could enforce it
- Distinctive: line 12
Check status first with git status --short.
- Distinctive: line 16
Before implementation starts, confirm the work is on a focused branch for the requested concern.
- Distinctive: line 21
Check the current branch and compare it with its base when practical before committing or preparing a pull request.
- Very specific: line 25
If a plain mv already happened, stage with git add -A <paths> and verify Git reports R renames, not just D plus A.
- Distinctive: line 27
Leave unrelated dirty or untracked files untouched unless the user explicitly asks otherwise.
- Distinctive: line 30
Verify with git status --short and, when needed, git diff --cached --summary.
- Distinctive: line 35
Keep branches single-purpose: one bug fix, feature, refactor, documentation update, release chore, or validation change.
- Very specific: line 37
Use the repository's documented pull-request target as the base branch.
- Very specific: line 45
Treat remote tracking branches as the source of truth for pull-request scope.
- Very specific: line 46
Before opening or updating a PR, check the commit list and diff against the actual target branch, for example git log --oneline …
- Distinctive: line 49
Keep commits atomic: each commit should explain one coherent reason for the changed files and should be revertible without taking unrelated …
- Distinctive: line 56
If a change touches unrelated skill boundaries, build files, documentation, and release metadata at once, pause and explain whether those …
- Distinctive: line 59
Do not stage unrelated dirty files just because they are present in the worktree.
- Distinctive: line 64
Before committing, pushing, opening a pull request, or summarizing a branch, warn the user when:
- Distinctive: line 80
When warning, name the files or themes causing the concern and suggest a split such as separate commits, a follow-up branch, or leaving …
- Distinctive: line 86
Prefer one move-focused commit separate from content edits when practical.
- Distinctive: line 87
If files are edited during the move, Git may still detect renames after staging, but check explicitly.
- Distinctive: line 89
Keep persistent scratch notes either ignored intentionally or outside the repository.
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Git Refactor Hygiene
Workflow
- Check status first with
git status --short. - Fetch remote refs before branch or pull-request decisions when network
access is available, so comparisons use current
origin/*state rather than stale local tracking refs. - Before implementation starts, confirm the work is on a focused branch for
the requested concern. If it is still on the project's target branch, such
as
main,trunk, ordevelopment, update that intended base withgit pull --ff-onlyand create a short-lived topic branch from it unless the user explicitly wants to work in place. - Check the current branch and compare it with its base when practical before committing or preparing a pull request.
- For tracked files or directories, use
git mv <old> <new>rather than plainmv. - If a plain
mvalready happened, stage withgit add -A <paths>and verify Git reportsRrenames, not justDplusA. - Leave unrelated dirty or untracked files untouched unless the user explicitly asks otherwise.
- Stage by path or hunk so each commit represents one purpose.
- Verify with
git status --shortand, when needed,git diff --cached --summary.
Branch and Commit Scope
- Keep branches single-purpose: one bug fix, feature, refactor, documentation update, release chore, or validation change.
- Use the repository's documented pull-request target as the base branch. Some
projects use trunk-based development with PRs into
main; others usetrunk,development, or temporary release branches. Do not assumedevelopmentis universal. - A short-lived topic branch is the default for new implementation work, but a tiny mechanical release chore can be committed directly on an integration branch when the maintainer explicitly chooses that path and the diff is limited to the release metadata.
- Treat remote tracking branches as the source of truth for pull-request scope.
Before opening or updating a PR, check the commit list and diff against the
actual target branch, for example
git log --oneline origin/main..HEADorgit diff --stat origin/development...HEAD. - Keep commits atomic: each commit should explain one coherent reason for the changed files and should be revertible without taking unrelated work with it.
- Watch for scope drift while working. If the branch's diff starts to include a second concern, warn the user and propose either staying focused on the current concern or moving the new concern to a separate branch.
- Separate mechanical moves or generated refreshes from semantic edits when practical.
- If a change touches unrelated skill boundaries, build files, documentation, and release metadata at once, pause and explain whether those changes form one contract or should be split.
- Do not stage unrelated dirty files just because they are present in the worktree.
Warning Triggers
Before committing, pushing, opening a pull request, or summarizing a branch, warn the user when:
git status --shortshows unrelated modified or untracked files;- the branch diff mixes independent concerns that could be reviewed or reverted separately;
- the branch includes commits already intended for the target branch because it
was created from a local integration branch that was ahead of
origin/*; - a commit would combine file moves with substantial content changes;
- generated artifacts, caches, logs, or local environment files appear in the diff;
- the diff spans many directories or skill boundaries without a clear single purpose;
- the pull request would include cleanup, feature work, release metadata, and validation changes that are not part of the same repository contract.
When warning, name the files or themes causing the concern and suggest a split such as separate commits, a follow-up branch, or leaving unrelated files unstaged.
Notes
- Prefer one move-focused commit separate from content edits when practical.
- If files are edited during the move, Git may still detect renames after staging, but check explicitly.
- Keep persistent scratch notes either ignored intentionally or outside the repository; do not stage them by accident.
- Ignored caches such as
__pycache__/do not need to be removed for normal Git hygiene. Usegit status --short --ignoredorgit check-ignore -v <path>if you need to verify that generated files are safely ignored.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

