lilmgenius/paperthin

re0-git

Rewrite a finished commit's message into a clean, handoff-ready form in your own log style, place a late commit in time order on a linear history, and take a rejected or duplicate commit out of a range, so git log alone tells the story.

Voir la source

Mode d’emploi

  1. Copiez la commande et examinez le paquet avant de l’installer dans votre environnement agent.
  2. Consultez le document original pour les outils, identifiants et environnements requis.
  3. Décrivez les entrées et le livrable souhaité ; comparez la sortie aux sources.
npx skills add https://github.com/lilmgenius/paperthin --skill re0-git

Avant de commencer

  • L’installation n’inclut ni abonnement au modèle, ni quota API, ni accès aux fichiers.
  • Étoiles et installations reflètent l’activité, pas un test indépendant de qualité ou de sécurité.
Document Skill original

Rendu depuis le dépôt source en conservant titres, exemples, code, tableaux, liens et images.

Rewrite a finished commit message so the log supports handoff in the author's voice, place a late commit where its time falls, and drop a commit that should not stay.

Goal

Repeated amends and momentum commits leave messages bloated, stale, or padded with trivia, a change committed late lands out of time order, and a commit the human rejected or a bot duplicated stays in the log as noise. re0-git refines the author's message so a fresh session can continue from git log alone, without the diff. It changes only messages, where a late commit sits, and whether a rejected or duplicate commit stays; every other commit's own change and every date already written stay put.

It is user-invoked: run it once you've decided to commit. Giving an agent autonomous access to commit cleanup would bias it toward committing when it shouldn't.

Workflow

  1. Scope the target: usually HEAD, sometimes a short unpushed range, or a late change the human decided to commit.
  2. Read the change (git show --stat, git diff), then the commit convention the repository documents (AGENTS.md, CONTRIBUTING.md, or its equivalent) and the log it describes: git log -20 and git log -5 -- <changed-paths>, bodies as well as subjects. Read them on every run, before drafting; a convention remembered from another repository or an earlier session is not a reading.
  3. Resolve mixed logs in this order: documented project rules, nearby commits touching the same area, then same-author commits within that convention. Do not average incompatible styles or let one author's habits override the repo. If no convention is documented, report the one the sample shows (subject form, scope, language, body shape) and propose it for the contributor guide as a separate change the human commits.
  4. Rewrite to the commit-economy below: keep durable handoff facts, fold supporting edits into the change they serve, and cut what the diff or tag already proves. Give trivia no bullet of its own. Then set the draft beside the nearest non-target commits of the same type, fix every difference in form, and run the repository's message checker if it has one.
  5. Rebuild with the bundled script, run from this skill's folder (scripts/rebuild.mjs), never with git rebase: rebase makes you the committer of every commit and restamps each committer date to now, and --committer-date-is-author-date erases the gap between the two dates instead. Write each new message to <dir>/<full-sha>.txt, then run node scripts/rebuild.mjs messages --repo <path> --base <commit> --messages <dir> with --base the parent of the oldest target, HEAD~1 for your own tip. Input: the linear range <base>..HEAD of the checked-out branch and the message files. Output: JSON with the old tip (old), the new tip (new), the old-to-new id map (map) and the signing outcome (signing). It rebuilds every commit in the range oldest first with git commit-tree on its own tree, the new message where a file names it and its own message elsewhere, under that commit's own author and committer names, emails and raw dates, adding -S only where the committer is the repository's user.email, and leaves a commit that changed nothing under its old id. It moves no ref. Exit 0 means built, 1 means a git call failed, 2 means a usage error or refused input: a merge in range, a --base that is not an ancestor of HEAD, or a message file naming a commit outside the range. signing reading unavailable means user.signingkey is unset and your commits came out unsigned; stop and fix signing before moving the branch.
  6. Place a late commit by time. Date it at the newest modification time among the files it changes, read before a stash, checkout, or rebase rewrites them; if those times were already reset, ask the human for the time. Once the late change is committed on the branch, run node scripts/rebuild.mjs place --repo <path> --base <commit> --late <commit> --date "<unix-seconds> <+zone>" with --base older than every commit it may pass. Input: the range, the late commit and its time. Output: the same JSON plus the new id of the placed commit (placed). It builds the late commit on the last commit dated at or before --date, its own diff replayed there with git merge-tree --write-tree --merge-base=<old-parent> <new-parent> <commit>, sets both its dates to --date, and rebuilds every later commit as in step 5 on the tree its own diff makes over its new parent. It moves no ref. Exit codes are as in step 5, and a diff that does not apply at the new point is exit 1. To take a commit out (one the human rejected, or a duplicate a bot left), run node scripts/rebuild.mjs drop --repo <path> --base <commit> --drop <sha>... with --base older than every dropped commit: it rebuilds every later commit on the tree its own diff makes without the dropped ones, prints the same JSON plus dropped, and moves no ref; a --drop outside the range is exit 2.
  7. Verify (below), then move the branch as its own step: only after verify exits 0, and for a pushed or shared range only after the human confirms the rewrite, run git update-ref refs/heads/<branch> <new-tip> <old-tip>, which refuses if the branch moved since the old tip was read. For each rewritten remote ref, push with --force-with-lease=<ref>:<id the mirror was cut at>, never bare --force or --mirror. If the lease fails, carry only commits that landed after the cut onto the rewritten tip with git rebase --onto <rewritten tip> <cut id> <remote ref>, re-sign and lease again; do not recut the mirror. Name the cut id in the report.

Rules

  • Never create or suggest a commit. re0-git works only on commits the human already decided: rewriting a message, placing a late commit or dropping one the human rejected. Using it is never a reason to commit.
  • Content stays put: a message rewrite keeps the tree byte-identical (git diff <old> <new> empty); a placed late commit carries exactly its own diff, a drop removes exactly the dropped commits' diffs, and every later commit keeps its own. Never edit content in a re0-git pass.
  • commit-economy: use one bullet per real, durable change, folding in supporting edits. Omit what the diff or version already proves and every co-author tag except a closing Co-authored-by trailer that credits a human contributor on a squashed or carried contribution. A subject that ends with (#n) keeps it, since that number ties a landed commit to the pull request it came through. Match the local log's sampled shape. If none is settled, use a subject line, a blank line, then one - bullet per change on a single unwrapped line, never prose paragraphs. A required checklist step, such as registering a new skill or syncing translations after a source edit, proves the process ran. Fold it into the bullet it serves as a trailing clause, or omit it if that bullet already implies it. Give it a separate bullet only when how it was done is itself non-obvious. This standard also governs first drafts; re0-git enforces it on existing messages that have drifted.
  • Original dates and people; signed. A rewritten commit keeps its author, its committer and both of their dates, HEAD included: a message edit changes neither when the work was done nor when it landed, so never restamp the past. A gap between the two dates records a rebase, a cherry-pick or a later push and is not a defect; no check reads it, and no commit is rewritten or moved to close one. A late commit takes the time its work was done as both dates. Sign every commit you are the committer of; one someone else committed stays theirs and unsigned, since your signature would claim it.
  • Linear. Never create a merge commit. A late commit goes where its time falls, and every other commit keeps its place.
  • Never rewrite pushed or shared history without explicit confirmation; it forces a force-push. Placing a late commit behind a pushed commit is such a rewrite.

Verification

  1. Run node scripts/rebuild.mjs verify --repo <path> --old <old-tip> --new <new-tip> [--placed <new-sha>...] [--dropped <old-sha>...], passing each id place printed under placed and each id drop printed under dropped. Input: the two tips and the placed or dropped commits. Output: JSON with ok, a checks entry per check below and each named failure under failures. Exit 0 means every check passed, 1 means a named failure, 2 a usage error or an id outside the new range. Its first check: the two tips' trees are equal, or differ by exactly the diffs of placed commits that were not in the old range and of the dropped commits.
  2. The %an %ae %ad %cn %ce %cd line of every commit in the old range appears unchanged and in order over the new range, the placed and dropped commits aside; each placed commit carries one time as both dates; and each commit the repository user committed shows %G? = G. Without user.signingkey the script reports signing unavailable and lists those commits under unsigned: that is a failure to fix before the branch moves, never a pass.
  3. The new range holds no merge commit, and each placed commit is dated no earlier than its parent's committer date.
  4. The documented convention and the sampled log were read on this run, each message matches the nearest same-type commits in form, and any repository message checker passes.
  5. Re-read git log with the diff hidden. Restore any cut line needed to follow the change.
du même dépôt

Autres Skills

Tous les Skills
lilmgenius
Communauté

re0-order

Move items only, reword nothing; realign a listing whose order has gone arbitrary (a list, table, catalog, sections, an enum) into a logical sequence under one stated principle. Nothing is added or removed. Use when the user names a listing, or a scope holding one, whose order no longer helps a reader follow the set, or when a pipeline the user invoked passes that scope on. Acts only inside that scope.

Installations / 1h
5
GitHub Stars
1,5 k
Mis à jour
15 nov.
lilmgenius
Communauté

readback

Verify the model's understanding of a user's instruction before spending non-trivial work. Use when a request is long, bundled, high-stakes, hard to undo, or has ambiguous scope or referents such as this, that, it, the other one, whatever is cleaner, or whichever order makes sense. Restate internally, cross-check against available context, proceed silently when resolved, and surface only a genuine surviving fork.

Installations / 1h
5
GitHub Stars
1,5 k
Mis à jour
15 nov.
lilmgenius
Communauté

whychk

Right after you pick an option, have a fresh outsider find the sharpest gap in the choice, then explain that gap in your own words, one gap at a time.

Installations / 1h
5
GitHub Stars
1,5 k
Mis à jour
15 nov.
lilmgenius
Communauté

aim

When data lands with a thin ask (files, a repo, a paste, a chat scrollback), read it and propose what the user is trying to do with it for them to confirm. Use the moment material arrives without a fully-formed ask, or when the ask reads thinner than the data suggests.

Installations / 1h
4
GitHub Stars
1,5 k
Mis à jour
15 nov.