rewrite-aggressively
/rewrite-aggressively
Usuwa z mieszanych commitów zmiany w CHANGES przez rebase i na nowo generuje świeży changelog gałęzi.
Ocena i bezpieczeństwo
- Pliki w paczce
- 2
- Skrypty
- 0
- Komentarze HTML
- 0
- Adresy URL w SKILL.md
- 0
Brak sygnałów. Repozytorium zmienione 08.11.2026, bez odwołań do wycofanych modeli i API.
MIT, otwarta: można używać i zmieniać, z zachowaniem informacji o autorze.
Co robi i kiedy
Usuwa z mieszanych commitów zmiany w CHANGES przez rebase i na nowo generuje świeży changelog gałęzi.
Argumenty
/rewrite-aggressively [--commit] [optional additional context about the changes]
Oryginalny opis (EN)
Use when a user explicitly wants to strip CHANGES edits from mixed commits by rebase and regenerate a branch changelog fresh.
Jak działa
- Phase 1: Safety checks, scope, approval
- Phase 2: Back up and rebase out the old changelog commits
- Phase 3: Regenerate entries and present
- Phase 4: Insert, commit, report
Podgląd SKILL.md
---
name: rewrite-aggressively
description: "Use when a user explicitly wants to strip CHANGES edits from mixed commits by rebase and regenerate a branch changelog fresh."
allowed-tools: ["Bash", "Read", "Grep", "Glob", "Edit", "AskUserQuestion"]
argument-hint: "[--commit] [optional additional context about the changes]"
---
# Rewrite Changelog Entries Aggressively
Remove the changelog commits this branch accumulated, then regenerate its
entries from the branch's current net change. With `--commit`, the entries
land as one fresh commit at the tip; otherwise they stay an uncommitted edit.
`/changelog:refresh` stacks a correcting commit instead.
Scope: only the branch's own changelog content is rewritten. Base-branch
changelog content and code changes stay intact. Only pure changelog commits
are dropped; surviving commits may receive new IDs during the rebase. A
request for a final's section is the exception in `branch-scope.md`: Phase 3
writes it per `../../references/graduation.md`, replacing the prerelease
sections.
Additional context from user: $ARGUMENTS
Read these first:
- `../../references/branch-scope.md`: a branch is not a release, base branch,
changelog file lookup, whole-branch perspective.
- `../../references/entry-rules.md`: categorizing, format, voice, exclusions.
- `../../references/commit-message.md`: used in Phase 4.
Write entries, commit messages, and user-facing replies per
`../../references/prose-rules.md`.
`<rewrite>` is `../../scripts/rewrite.py` resolved from this skill's directory
to an absolute path, written literally in every command, and run with
`python3`. File paths are relative to the repository root, from any working
directory. It prints one JSON object; `"ok": false` carries the `reason`.
## Phase 1: Safety checks, scope, approval
1. **Detect the base**, fetch it, and find the changelog file per
`branch-scope.md`.
2. **Preconditions.** Report why and stop if any fail. Name the failed
precondition in plain words; mention no local paths or temp directories:
- Working tree dirty (`git status --porcelain` non-empty). Tell the user to
commit or stash the tracked changes. Advise `git stash -u` for untracked
files only after `git rev-parse --show-toplevel` shows a root that is
neither the output of `(cd ~ && pwd -P)` nor a parent of it (compare
physical paths, not the string `$HOME`).
- Detached HEAD, or an in-progress rebase, merge, or cherry-pick.
- Currently on the base branch.
- A merge commit between the base and HEAD (`git rev-list --merges
origin/<base>..HEAD` non-empty): the rebase would flatten it.
Reply in this shape for a stopped run, as plain text outside any code
fence: one result sentence, then what the user must do. Skip the checks that
passed.
```text
Stopped before changing anything: the working tree has uncommitted changes in src/ping.py.
Commit or stash them, then run /changelog:rewrite-aggressively --commit again.
```
3. **Partition the branch's commits** that touch the changelog file. The
output lists each commit's `subject` and whether it is `pure` (touches only
the changelog file) or mixed:
```console
$ python3 <rewrite> partition \
--base origin/<base> \
--file <changelog-file>
```
- **Pure changelog commits** touch only the changelog file. Phase 2 drops
them.
- **Mixed commits** entangle changelog hunks with code and cannot be
dropped. Ask via `AskUserQuestion` per commit: leave it intact and let the
new tip commit supersede its entries (recommended), or abort so the user
can split it. Without a question tool, leave it intact and say so.
- No changelog commits: nothing to rewrite. Suggest `/changelog:changelog`
or `/changelog:refresh` and stop.
- Only mixed commits: there is nothing safe to drop. Suggest
`/changelog:refresh` and stop without changing history.
4. **Approve the rewrite.** Nothing in git changes before this approval.
`--commit` does not approve the rewrite, and neither does an invoking
request to "rewrite" or "clean up" the changelog; only explicit approval of
the history rewrite itself does (for example "yes, drop those commits").
Via `AskUserQuestion`, or in the invoking message when the host has no such
tool, show:
- the commits Phase 2 will drop, by subject, never by bare SHA;
- the backup branch it will create first, named
`changelog-rewrite-backup-` plus the current UTC date and time;
- that clean failures restore the backup, while conflicts or new edits
stop with their state preserved;
- whether the dropped commits appear on a remote branch, checked with
`git branch --remotes --contains <sha>`; when they do, publishing needs a later
`git push --force-with-lease --force-if-includes` by the user. This skill
never pushes.
Proceed only on an explicit yes. Without one (including with no
`AskUserQuestion` and no approval in the message), stop with the list above
and the tree unchanged; never wait.
Reply in this shape for the approval stop, as plain text outside any code
fence, with plain bullets, no bold, and no recap of the checks that passed:
```text
Nothing changed yet: the rewrite needs your explicit approval, and --commit does not count.
If you approve:
- The commit "docs(CHANGES) First draft of the cache entry" is dropped.
- A backup branch, changelog-rewrite-backup-20261006-142530Z, is created first.
- A failed check restores clean state; conflicts or new edits stop for recovery.
- The new entries are committed once at the tip.
Reply "yes, drop that commit" to proceed.
```
## Phase 2: Back up and rebase out the old changelog commits
1. Run the helper with the pure commits' SHAs from the partition. It stops
unless the tree is clean, then creates the backup branch, rebases the named
commits out onto the merge-base (not `origin/<base>`: the fetch may have
moved the base, and the rebase must not also move code onto it), and checks
that no code changed and exactly the requested commits disappeared. It
protects other branch refs from Git's `rebase.updateRefs` setting and
refuses ignored files that overlap replayed paths. With no mixed commits,
it also checks that no branch changelog edits remain:
```console
$ python3 <rewrite> drop \
--base origin/<base> \
--file <changelog-file> \
<sha1> <sha2>
```
2. On `"ok": true`, note the `backup` branch name for the report. On
`"ok": false`, report the actual `reason` and any `backup` or `recovery`
refs, then stop. A precondition failure creates no backup. A clean failed
validation restores the original branch and pins the attempted result;
conflicts and new edits keep their files and staging intact. Do not
automatically abort, reset, or discard them. The user must preserve or
resolve that state before choosing a recovery operation.
## Phase 3: Regenerate entries and present
Approval gate. The Phase 1 approval covers the rebase only. Approval to
edit comes from, in order:
- `--commit` in `$ARGUMENTS`: approves the edit and the commit.
- An invoking message that asks to insert or regenerate the entries: approves
the edit only.
- `AskUserQuestion`, when the host has it and neither of the above applies.
- Otherwise, present the entries and stop; never wait. The tree then holds
the rebased history with no entries; say so and name the backup.
Generate entries from the branch's current net change
(`git diff origin/<base>...HEAD`, three-dot, so base commits the fetch pulled
in stay out), per `entry-rules.md`. For the PR number, run
`gh pr view --json number --jq .number`. On failure, if the branch already
merged, read the number from its merge commit on the base branch ("Merge pull
request #N"); otherwise write `(#???)`. Never copy a number from a dropped
commit or an earlier entry. Entries superseding a mixed commit's
surviving changelog hunks may update those hunks, which are branch-owned, but
nothing from the base branch. Check for prerelease sections of a final not
cut yet, per `branch-scope.md`.
When the edit was approved up front (`--commit` or an invoking request), skip
the Phase 3 reply and send only the Phase 4 reply, which carries the summary
line, entries, voice check, and `Target` line itself.
Present:
1. The summary line
`Branch: <name> | Base: <base> | Dropped: <count> | Backup: <branch>`.
2. The proposed entries as exact markdown, then the voice check and `Target`
line from `entry-rules.md`.
3. When asking, an `AskUserQuestion` with **Insert** and **Edit first** (return
to generation). Offer no commit choice: `--commit` alone decides what lands.
Reply in this shape, as plain text outside any code fence, with plain bullets, no bold (never `- **Label:** ...`), and no local paths:
````text
Branch: feat/cache-evict | Base: main | Dropped: 3 | Backup: changelog-rewrite-backup-20261006-142530Z
```markdown
- Add `Cache.evict()` to drop a cached key (#212)
```
Voice check:
- Add `Cache.evict()` to drop a cached key: can I take a new affordance?
Target: CHANGES.md, Unreleased, Features, after the "### Features" heading. No version assigned, no release cut.
````
## Phase 4: Insert, commit, report
Run only after the Phase 3 approval.
1. Apply with Edit. With `--commit` in `$ARGUMENTS`, run the project checks
and commit once at the tip per `commit-message.md`. Without `--commit`,
leave the edit uncommitted and show a ready-to-use commit message in the
project's format.
2. Report the backup branch (to delete once satisfied with
`git branch -D <backup>`), an uncommitted edit awaiting the user's commit
when `--commit` was not passed, and for a pushed branch the
`git push --force-with-lease --force-if-includes` the user needs.
Reply in this shape, with plain bullets, no bold labels, and no local
paths. Read the project's commit format at reply time. Bullets follow
`entry-rules.md` Notes, plus no subject-format explanations. The dropped
count and backup identify the operation. A retained mixed commit gets one
bullet: its subject and that it also changes code.
The example shows a committed result. For an uncommitted edit, drop "added" from
the first sentence, state that the edit is uncommitted, and replace the commit bullet with one
pasteable `console` command in the exact `$ git commit \` form of
`commit-message.md`.
````text
Rewrote the changelog history of feat/cache-evict: 3 changelog-only commits dropped, 1 added.
```markdown
- Add `Cache.evict()` to drop a cached key (#212)
```
Voice check:
- Add `Cache.evict()` to drop a cached key: can I take a new affordance?
Target: CHANGES.md, Unreleased, Features, after the "### Features" heading. No version assigned, no release cut.
- Backup: changelog-rewrite-backup-20261006-142530Z; delete it once satisfied.
- Committed at the tip as CHANGES(docs) Cache key eviction.
- Retained: "cache(feat) Add evict" also changes code.
- The branch is pushed; publish with git push --force-with-lease --force-if-includes.
````
Pliki w paczce (2)
- SKILL.md 11 KB
- agents/openai.yaml 1 KB
Wersje
W bazie nie ma innych skilli o nazwie rewrite-aggressively.
Migawka bazy z 13.11.2026 · wersja paczki 2a0801acdddf (skrót SHA-256 całej paczki)
Pobrania w ostatnich 30 dniach: 0 · ranking
Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.
Podobne skille
- 100changelog-rewrite-aggressively
Usuwa zmiany w CHANGELOG z mieszanych commitów przez rebase i odtwarza changelog gałęzi od nowa. - 100rebase
Przeprowadza interaktywny rebase bieżącej gałęzi z wizualnym planem i przepisanymi komunikatami commitów bez edytora, a także kontynuuje, pomija lub przerywa wstrzymany rebase. - 90changelog
Tworzy lub aktualizuje CHANGELOG.md na podstawie commitów od ostatniego tagu, by udokumentować wydanie. - 100stack-rebase
Kaskadowo przebudowuje (rebase) cały stos PR po scaleniu bazowego PR lub zmianach w gałęzi bazowej. - 90rebase-pr
Przenosi gałąź pull requesta na main, rozwiązuje konflikty, uruchamia lintery i wykonuje force push. - 100rebase
Podpina bieżącą gałąź funkcji pod gałąź bazową projektu, gdy użytkownik prosi o rebase albo synchronizację gałęzi.