Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

claude: Move non-interactive rebase instructions into a skill.

Evy Kassirerbec1003bb5f4
diff --git a/.claude/CLAUDE.md b/.claude/CLAUDE.md
index a1ade433af1..646561d1127 100644
--- a/.claude/CLAUDE.md
+++ b/.claude/CLAUDE.md
@@ -268,39 +268,6 @@ Fixes #123.
and `Fixes #123.` in the final commit.
- Never: `Partially fixes #123.` (GitHub ignores "partially")
-### Rebasing Commits (Non-Interactive)
-
-Since `git rebase -i` requires an interactive editor, use
-`GIT_SEQUENCE_EDITOR` to supply the todo list via a script:
-
-1. **Updating the HEAD commit:** If the commit you need to modify is
- already at HEAD, just use `git commit --amend` directly. The
- fixup+rebase workflow below is only needed for non-HEAD commits.
-
-2. **Squashing fixups into existing commits:** Create fixup commits with
- `git commit --fixup=<target-hash>`, then write a shell script that
- outputs the desired todo (with `pick` and `fixup` lines in order)
- and run:
-
- ```bash
- GIT_SEQUENCE_EDITOR=/path/to/todo-script.sh git rebase -i <base>
- ```
-
- Note: `--autosquash` alone without `-i` does **not** reorder or
- squash anything.
-
-3. **Rewording commit messages:** Use `git format-patch` to export
- commits as patch files, edit the message headers in the patch
- files, then reapply:
-
- ```bash
- git format-patch <base> -o /tmp/patches/
- # Edit the commit message in each /tmp/patches/000N-*.patch file
- # (the message is between the Subject: line and the --- line)
- git reset --hard <base>
- git am /tmp/patches/*.patch
- ```
-
## Testing Requirements
Zulip server takes pride in its ~98% test coverage. All server changes
diff --git a/.claude/skills/git-rebase/SKILL.md b/.claude/skills/git-rebase/SKILL.md
new file mode 100644
index 00000000000..b8ebc243625
--- /dev/null
+++ b/.claude/skills/git-rebase/SKILL.md
@@ -0,0 +1,37 @@
+---
+name: git-rebase
+description: "Squash fixups into earlier commits, reorder commits, or reword commit messages, without needing an interactive editor."
+---
+
+# Git Rebase (Non-Interactive)
+
+Since `git rebase -i` requires an interactive editor, use
+`GIT_SEQUENCE_EDITOR` to supply the todo list via a script:
+
+1. **Updating the HEAD commit:** If the commit you need to modify is
+ already at HEAD, just use `git commit --amend` directly. The
+ fixup+rebase workflow below is only needed for non-HEAD commits.
+
+2. **Squashing fixups into existing commits:** Create fixup commits with
+ `git commit --fixup=<target-hash>`, then write a shell script that
+ outputs the desired todo (with `pick` and `fixup` lines in order)
+ and run:
+
+ ```bash
+ GIT_SEQUENCE_EDITOR=/path/to/todo-script.sh git rebase -i <base>
+ ```
+
+ Note: `--autosquash` alone without `-i` does **not** reorder or
+ squash anything.
+
+3. **Rewording commit messages:** Use `git format-patch` to export
+ commits as patch files, edit the message headers in the patch
+ files, then reapply:
+
+ ```bash
+ git format-patch <base> -o /tmp/patches/
+ # Edit the commit message in each /tmp/patches/000N-*.patch file
+ # (the message is between the Subject: line and the --- line)
+ git reset --hard <base>
+ git am /tmp/patches/*.patch
+ ```