git-repo-normalize
SKILL.md
Git Repo Normalize
Workflow
-
Detect the repository scope first.
- Run
git rev-parse --is-inside-work-treeandgit rev-parse --show-toplevel. - Manage
.gitattributesonly at the repository root.
- Run
-
Normalize before doing other repository work.
- Do not postpone line-ending normalization until the end of the task.
- Treat the first Git-facing handling of a repo as the normalization point.
- If the root
.gitattributesdoes not contain* text=auto eol=lf, add or merge that rule instead of replacing the file. - Preserve existing user rules and binary file patterns.
-
Inspect the repo signals that explain LF/CRLF drift.
- Read
.editorconfigwhen present and check whether it already declaresend_of_line = lf. - Read
git config --get core.autocrlfto explain local warnings, but do not treat global Git config as the fix. - Use
git ls-files --eolon representative files when the repository state is unclear.
- Read
-
Renormalize once the repository rule is in place.
- Run
git add --renormalize .. - Review
git status --shortandgit diff --cached --stat. - Spot-check any large or suspicious change set with
git diff --cached -- <path>. - Keep the normalization change explicit before continuing with the original task.
- Run
-
Escalate only when the repository intentionally differs.
- If the repo already documents a different committed EOL policy and the user wants to preserve it, follow that policy instead of forcing LF.
- If renormalization reveals real content edits beyond line endings, stop and ask how to proceed.
- Never delete or overwrite unrelated user changes while normalizing.
Default repository baseline
When the repository does not already define a different policy, use this root .gitattributes baseline:
* text=auto eol=lf
*.png binary
*.jpg binary
*.jpeg binary
*.gif binary
*.webp binary
*.ico binary
*.pdf binary
*.zip binary
Typical triggers
- Bump application or plugin versions.
- Prepare a release, tag, or changelog commit.
- Edit GitHub Actions, CI files, or release workflows.
- Diagnose
LF will be replaced by CRLFor related warnings. - Review staged diffs, branch changes, or repository-wide file churn.
- Start work in a Git repository that has no committed
.gitattributesbaseline.
Expected outcome
- Keep line-ending policy in version control instead of relying on local Git configuration.
- Perform repository normalization on the first Git-facing handling, not as final cleanup.
- Leave the repo in a stable LF-based state so later Git work does not repeat the onboarding step.
Weekly Installs
1
Repository
why8023/agent-skillsFirst Seen
5 days ago
Security Audits
Installed on
windsurf1
amp1
cline1
trae1
qoder1
opencode1