Dev commit

From pdl-openair/OpenAIR · View interactive version

Dev commit is an AI agent skill from the GitHub repository pdl-openair/OpenAIR. 开发者准备提交代码时触发。当用户说"commit"、"提交"、"写 commit message"、 "commit these changes"、"生成提交信息"、"帮我写 commit"时使用本 skill。 基于 git diff 生成符合项目 commit 规范的提交信息。 即使用户没有明确说"commit message",只要涉及提交代码的操作都应该触发。

How to use this skill

Skill file

Dev: Commit Message Generation

When to use

开发者已暂存代码,需要生成符合项目规范的 commit message。

Step 1: Read staged diff

  1. Run git diff --cached --stat to see staged changes
  2. Read the actual diff
  3. From the diff, extract the key identifiers and values that changed (types, enums, field names, status values, directory names, etc.)

Step 2: Consistency Check

STOP — Do not proceed to Step 3 until this check is complete.

Check whether the staged changes introduce inconsistencies elsewhere in the project. This prevents committing partial or contradictory changes.

What to check

Use the key identifiers extracted in Step 1. Search the rest of the project for the same concepts to see if they are still aligned.

How to handle inconsistencies

Steps

  1. Search the project for those identifiers/values in all relevant files (docs, code, mocks, fixtures, skills, configs). Note: .trae/skills/ and .claude/skills/ are sync mirrors managed by scripts/sync_claude_skills.py — do NOT manually check or fix them.
  2. For each inconsistency found:
  1. Report a brief summary of what was checked and what (if anything) was fixed or needs user decision

Gate: Consistency check confirmation

Before proceeding, confirm ALL of the following:

Only after all items are confirmed, proceed to Step 3.

Step 3: Generate commit message

Rules source

Read before generating:

Determine commit

From the actual diff, determine type, scope, and summary.

Co-author(必须)

如果本次 commit 有 AI coding 工具参与,必须在 commit message body 末尾追加 Co-authored-by 行。

格式:

<type>(<scope>): <summary>

Co-authored-by: qoder <qoder@users.noreply.github.com>

可用 Agent 标识:

规则:

Output

Single line: <type>(<scope>): <summary>

Optional body with Co-authored-by trailer.

If changes span multiple concerns, recommend splitting into separate commits.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.