AgentSkillsCN

review-commit

在提交更改之前,先审查已修改的文件是否存在漏洞,随后以详尽的描述性信息完成提交。

SKILL.md
--- frontmatter
name: review-commit
description: Review changed files for bugs, then commit with a descriptive message.

Review & Commit

Follow these steps in order:

1. Inspect the diff

Run git diff and git diff --staged to see all changed files and their modifications.

2. Bug check

Use the ios-swift-bug-finder agent on every Swift file that appears in the diff. Pass the list of changed file paths explicitly so the agent focuses only on what changed.

If the agent surfaces any real bugs (not style notes), stop and report them to the user before proceeding. Ask whether to fix them first or commit anyway.

3. Commit

If no blocking bugs are found, commit using the project's commit style:

  • Stage only the modified Swift files (never .env or credential files)
  • Write a concise commit message focused on why, not what
  • Follow the same tone as recent commits (git log --oneline -5)
  • End the message with Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
  • Use a HEREDOC to pass the message to avoid formatting issues

Report the commit hash and summary when done.