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 从公开仓库中收录这些内容。

举报或申请下架