Agent Skills › penpot/penpot › rewrite-commit-message

rewrite-commit-message

GitHub

重写 HEAD 提交信息,遵循规范生成标题和描述,保留所有 AI 辅助署名。通过 git commit --amend 原地修改,执行检查脚本确保合规,不推送变更。

.agents/skills/rewrite-commit-message/SKILL.md penpot/penpot

Trigger Scenarios

用户要求重写、重命名或修复最后一次提交信息 Squash 操作后 HEAD 包含堆叠的旧消息和重复的尾部标记

Install

npx skills add penpot/penpot --skill rewrite-commit-message -g -y
More Options

Non-standard path

npx skills add https://github.com/penpot/penpot/tree/develop/.agents/skills/rewrite-commit-message -g -y

Use without installing

npx skills use penpot/penpot@rewrite-commit-message

指定 Agent (Claude Code)

npx skills add penpot/penpot --skill rewrite-commit-message -a claude-code -g -y

安装 repo 全部 skill

npx skills add penpot/penpot --all -g -y

预览 repo 内 skill

npx skills add penpot/penpot --list

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

  1. 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).
  2. 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.
  3. 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.
  4. Write it to a file (a heredoc keeps real newlines; inline -m with \n does not) and git commit --amend -F <file>.
  5. Run ./scripts/check-commit and require exit code 0. A non-zero exit is a hard blocker: fix the message, amend again.
  6. 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

Same Skill Collection

.agents/skills/bat-cat/SKILL.md
.agents/skills/code-review-criteria/SKILL.md
.agents/skills/create-commit/SKILL.md
.agents/skills/create-issue/SKILL.md
.agents/skills/create-pr/SKILL.md
.agents/skills/fd-find/SKILL.md
.agents/skills/find-project-anomalies/SKILL.md
.agents/skills/implement-plan/SKILL.md
.agents/skills/jq-json-processor/SKILL.md
.agents/skills/local-ci/SKILL.md
.agents/skills/make-a-plan/SKILL.md
.agents/skills/nrepl-eval/SKILL.md
.agents/skills/plan-review-criteria/SKILL.md
.agents/skills/planner/SKILL.md
.agents/skills/refine-prompt/SKILL.md
.agents/skills/resolve-git-conflicts/SKILL.md
.agents/skills/review-code/SKILL.md
.agents/skills/review-plan/SKILL.md
.agents/skills/ripgrep/SKILL.md
.agents/skills/security-and-hardening/SKILL.md
.agents/skills/taiga/SKILL.md
.agents/skills/testing/SKILL.md
.agents/skills/update-changelog/SKILL.md
.opencode/skills/bat-cat/SKILL.md
.opencode/skills/code-review-and-quality/SKILL.md
.opencode/skills/code-review/SKILL.md
.opencode/skills/create-commit/SKILL.md
.opencode/skills/create-issue/SKILL.md
.opencode/skills/create-pr/SKILL.md
.opencode/skills/fd-find/SKILL.md
.opencode/skills/jq-json-processor/SKILL.md
.opencode/skills/nrepl-eval/SKILL.md
.opencode/skills/plan-review/SKILL.md
.opencode/skills/planner/SKILL.md
.opencode/skills/refine-prompt/SKILL.md
.opencode/skills/ripgrep/SKILL.md
.opencode/skills/security-and-hardening/SKILL.md
.opencode/skills/taiga/SKILL.md
.opencode/skills/testing/SKILL.md
.opencode/skills/update-changelog/SKILL.md
.agents/skills/ste/SKILL.md
.opencode/skills/ste/SKILL.md

Metadata

Files
0
Version
be2e117
Hash
b6fe8106
Indexed
2026-10-20 06:51

Home - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-11-02 16:24
浙ICP备14020137号-1