Agent Skills
› penpot/penpot
› rewrite-commit-message
rewrite-commit-message
GitHub重写 HEAD 提交信息,遵循规范生成标题和描述,保留所有 AI 辅助署名。通过 git commit --amend 原地修改,执行检查脚本确保合规,不推送变更。
Trigger Scenarios
用户要求重写、重命名或修复最后一次提交信息
Squash 操作后 HEAD 包含堆叠的旧消息和重复的尾部标记
Install
npx skills add penpot/penpot --skill rewrite-commit-message -g -y
SKILL.md
Frontmatter
{
"name": "rewrite-commit-message",
"slash": true,
"description": "Rewrite HEAD's commit message (typically a squash that concatenated old messages) into one proper title plus description following Penpot commit conventions, preserving every distinct AI-assisted-by attribution. Amends in place, never pushes."
}
Skill: rewrite-commit-message
HEAD's message is a concatenation of older messages (typical after a squash): several subjects, bodies and repeated trailers stacked in a single message. Replace it with one proper message and amend HEAD.
When to Use
- The user asks to rewrite, retitle or fix the last commit message
- After a squash left HEAD with stacked messages and trailer repeats
Steps
- Read the full current message (
git log -1 --format=%B HEAD) and the branch diff (git diff develop..HEAD --stat, plus the code when the summary needs grounding). - Collect every DISTINCT
AI-assisted-by:value in the current message. All of them survive into the new message, one line each: attributions are never dropped in a rewrite, even when most of the old text is. - Draft one message per
mem:workflow/creating-commits(read it end-to-end first): single subject (imperative, capitalized, no trailing period, ≤80 chars), blank line, body wrapped at ≤80 chars covering the whole diff (not the old per-commit slices), then the preserved trailers. - Write it to a file (a heredoc keeps real newlines; inline
-mwith\ndoes not) andgit commit --amend -F <file>. - Run
./scripts/check-commitand require exit code 0. A non-zero exit is a hard blocker: fix the message, amend again. - Report the new hash. Never push: the user pushes from their own shell. Warn when local history was rewritten over pushed commits (the push will need force — their call, not yours).
Version History
- be2e117 Current 2026-10-20 06:51


