Commit

作者 parcadeid07ff4b06b62無授權條款3.9K 個星標收錄於 2026年10月8日更新於 2026年10月8日儲存庫8 個月前更新

Create git commits with user approval and no Claude attribution

AI 產生的概覽

在使用者確認後為本次工作階段的變更建立 git 提交,且不加入 Claude 署名。

功能
回顧工作階段脈絡、git status 與 git diff,了解變更內容,接著規劃一個或多個邏輯提交並撰寫清楚的祈使句提交訊息。它會先向使用者列出預計加入的檔案與提交訊息並請求確認,再以 git add 指定具體檔案並建立提交。每次提交後顯示紀錄,並可選擇執行外部推理指令碼,將開發過程記錄到 .git/claude/commits 下。
適用情境
適用於工作階段結束、變更已準備好提交,且使用者希望對提交方案進行確認的情況。適合要求提交僅由使用者署名、不含共同作者列或工具署名的流程。不適用於分支、合併等其他儲存庫操作。
執行需求
需要有待提交變更的 git 儲存庫以及 git 命令列工具。僅為指令,技能本身不附帶指令碼,但流程引用了外部指令碼 .claude/scripts/generate-reasoning.sh,該指令碼需存在才能執行推理記錄步驟。

Commit Changes

You are tasked with creating git commits for the changes made during this session.

Process:

  1. Think about what changed:

    • Review the conversation history and understand what was accomplished
    • Run git status to see current changes
    • Run git diff to understand the modifications
    • Consider whether changes should be one commit or multiple logical commits
  2. Plan your commit(s):

    • Identify which files belong together
    • Draft clear, descriptive commit messages
    • Use imperative mood in commit messages
    • Focus on why the changes were made, not just what
  3. Present your plan to the user:

    • List the files you plan to add for each commit
    • Show the commit message(s) you'll use
    • Ask: "I plan to create [N] commit(s) with these changes. Shall I proceed?"
  4. Execute upon confirmation:

    • Use git add with specific files (never use -A or .)
    • Create commits with your planned messages
    • Show the result with git log --oneline -n [number]
  5. Generate reasoning (after each commit):

    • Run: bash "$CLAUDE_PROJECT_DIR/.claude/scripts/generate-reasoning.sh" <commit-hash> "<commit-message>"
    • This captures what was tried during development (build failures, fixes)
    • The reasoning file helps future sessions understand past decisions
    • Stored in .git/claude/commits/<hash>/reasoning.md

Important:

  • NEVER add co-author information or Claude attribution
  • Commits should be authored solely by the user
  • Do not include any "Generated with Claude" messages
  • Do not add "Co-Authored-By" lines
  • Write commit messages as if the user wrote them

Remember:

  • You have the full context of what was done in this session
  • Group related changes together
  • Keep commits focused and atomic when possible
  • The user trusts your judgment - they asked you to commit

來源與署名

來源:parcadei/continuous-claude-v3位於.claude/skills/commit提交d07ff4b

授權條款: 無授權條款

內容歸原作者所有。SourceWeft 從公開儲存庫中收錄這些內容。

檢舉或申請下架