ai-dev-loop-sanitize-commits
Skill2 starsChanged 5 months agoMITView on GitHub
Sanitize unpushed local git commits from ai-dev-loop R/K loops. Use when a branch has local `R:` or `K:` commits and an agent needs to remove `.ai-dev-loop/*` artifacts, rewrite human-readable commit messages, preserve authors/dates, and prepare history before push or review.
In this repository17 other files it gives its agents.
- advisory-suggestionsSkill
- agent-readability-reviewSkill
- ai-dev-loopSkill
- benchmark-dataset-builderSkill
- best-version-builderSkill
- cogniact-governorSkill
- context-compressorSkill
- core-coding-agent-behaviorSkill
- github-issue-fix-plannerSkill
- high-signal-modeSkill
- insightforge-reviewerSkill
- mythos-visualizationSkill
- ponytailSkill
- project-scaffolding-and-docsSkill
- realitybench-caseforgeSkill
- variant-best-version-builderSkill
- visual-diff-skillSkill
The file
We split this skill into the rules it gives an agent
9 rules. About 0 are common, 4 are distinctive, and 5 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
5
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 10
Use this skill before sharing a branch that contains ai-dev-loop review/response commits.
- Distinctive: line 32
If any generated commit message is not good enough, create a JSON override file:
- Very specific: line 65
Do not run rewrite --apply on a dirty worktree unless the user explicitly asks for --allow-dirty.
- Very specific: line 66
Do not sanitize pushed commits.
- Very specific: line 67
Do not create backup branches, temporary branches, or switch branches.
- Very specific: line 68
Prefer --target-tail for ai-dev-loop review/response commits stacked at HEAD.
- Distinctive: line 69
Do not use this on merge-heavy local history unless the script reports support for it.
- Very specific: line 70
Keep the default --keep-empty-targets behavior when preserving commit count and timestamps matters.
- Distinctive: line 71
Prefer message overrides for important commits.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 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
AI Dev Loop Commit Sanitizer
Version: 1.0.2
Use this skill before sharing a branch that contains ai-dev-loop review/response commits.
The bundled script rewrites only local, unpushed commits selected from the current branch. It removes .ai-dev-loop/* files from targeted R:/K: commits, sanitizes commit subjects and bodies, and recreates commits with the original author, committer, author date, and committer date.
v1.0.2 requirement: do not create branches and do not switch branches while using this skill. The script rewrites by building commit trees, updating the current branch ref in place, and syncing a clean worktree/index to the rewritten HEAD; it prints the original HEAD for recovery through the reflog.
Workflow
- Inspect the branch state. If the branch has no upstream, or the only commits to sanitize are the contiguous
R:/K:commits atHEAD, prefer--target-tail:
python3 <skill>/scripts/sanitize_ai_dev_loop_commits.py plan
python3 <skill>/scripts/sanitize_ai_dev_loop_commits.py plan --target-tail- Preview the rewrite:
python3 <skill>/scripts/sanitize_ai_dev_loop_commits.py rewrite
python3 <skill>/scripts/sanitize_ai_dev_loop_commits.py rewrite --target-tail- If any generated commit message is not good enough, create a JSON override file:
{
"014e52f1": "fix pageLoadCaches visibility and cache tests\n\nMake pageLoadCaches private and add cache-path coverage for getScriptsForTab.\n\nTests: 969 pass."
}Then preview again:
python3 <skill>/scripts/sanitize_ai_dev_loop_commits.py rewrite --message-overrides /path/to/messages.json
python3 <skill>/scripts/sanitize_ai_dev_loop_commits.py rewrite --target-tail --message-overrides /path/to/messages.json- Apply only after the preview is correct:
python3 <skill>/scripts/sanitize_ai_dev_loop_commits.py rewrite --apply --message-overrides /path/to/messages.json
python3 <skill>/scripts/sanitize_ai_dev_loop_commits.py rewrite --apply --target-tail --message-overrides /path/to/messages.json- Verify the result:
git log --stat --format=fuller <base>..HEAD
git log --name-only <base>..HEAD -- .ai-dev-loopThe second command should produce no .ai-dev-loop paths.
Rules
- Do not run
rewrite --applyon a dirty worktree unless the user explicitly asks for--allow-dirty. - Do not sanitize pushed commits. The script determines the default base from
@{upstream}and refuses commits already reachable from remote refs. - Do not create backup branches, temporary branches, or switch branches. In v1.0.2 the script must keep the current branch checked out, use
git update-refonly after the new commit chain is built, and sync a clean worktree/index to the rewrittenHEAD. - Prefer
--target-tailfor ai-dev-loop review/response commits stacked atHEAD; it avoids scanning or replaying earlier pushed commits when the branch has no upstream or a PR ref has unusual topology. - Do not use this on merge-heavy local history unless the script reports support for it. The rewrite path is intentionally linear-history only.
- Keep the default
--keep-empty-targetsbehavior when preserving commit count and timestamps matters. Use--drop-empty-targetsonly if the user explicitly wants artifact-onlyR:commits removed. - Prefer message overrides for important commits. The built-in sanitizer is conservative text cleanup, not a semantic commit-message author.
- Record the printed
Original HEADafterrewrite --apply; use the reflog orgit update-ref refs/heads/<branch> <original-head>to recover if needed.
Script
Run:
python3 <skill>/scripts/sanitize_ai_dev_loop_commits.py --helpUseful features:
plan: list local unpushed commits and show which commits match the target prefixes.rewrite: dry-run by default; add--applyto rewrite the branch.--target-tail: infer the contiguousR:/K:commit tail atHEADand use its parent as the base. This is the fastest and safest mode for local ai-dev-loop cleanup.--base <rev>: choose the base explicitly instead of using@{upstream}.--range <rev-range>: inspect a custom range such asmain..HEAD.--message-overrides <json>: supply exact replacement messages by full or short SHA.--drop-empty-targets: drop targeted commits that become empty after artifact removal.--artifact-path <path>: remove another artifact directory in addition to the default.ai-dev-loop.
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.

