|
| 1 | +--- |
| 2 | +name: commit |
| 3 | +description: Make a commit in Git with an appropriate commit message for the currently staged changes. |
| 4 | +allowed-tools: Bash(git *) |
| 5 | +--- |
| 6 | + |
| 7 | +Please make a commit with an appropriate commit message for the currently |
| 8 | +staged changes. |
| 9 | + |
| 10 | +Don't touch the staged changes, just create the commit. |
| 11 | + |
| 12 | +The first line of the commit message should be a concise summary of the |
| 13 | +changes (50 characters or less). You shouldn't follow the conventional |
| 14 | +commits, in other words, just write a normal commit message without any |
| 15 | +special prefixes. |
| 16 | + |
| 17 | +The second line of the commit message should be blank. |
| 18 | + |
| 19 | +The rest of the commit message should provide more detailed explanations |
| 20 | +about the changes, wrapped at 72 characters. |
| 21 | + |
| 22 | +If you have some references like issues or pull requests, you can add |
| 23 | +them in the body of the commit message, usually after a blank line. |
| 24 | +Issues and pull requests should be referenced as full URLs instead of |
| 25 | +#numbers, and you can put some verbs like “Fixes” or “Closes” before |
| 26 | +the URLs. For just references without any verbs, you can just put the |
| 27 | +URLs in the body. |
| 28 | + |
| 29 | +When running `git commit`, pass the commit message via a HEREDOC to |
| 30 | +preserve newlines correctly. Never use literal `\n` escape sequences |
| 31 | +inside a quoted string, as they will appear as literal characters in |
| 32 | +the commit message. For example: |
| 33 | + |
| 34 | +~~~~ bash |
| 35 | +git commit -m "$(cat <<'EOF' |
| 36 | +Summary line here |
| 37 | +
|
| 38 | +Detailed explanation here. |
| 39 | +EOF |
| 40 | +)" |
| 41 | +~~~~ |
| 42 | + |
| 43 | +Don't put `Generated with [Claude Code](https://claude.ai/code)`, or |
| 44 | +`Co-authored-by` trailers at the end of the commit message. Instead, |
| 45 | +use the `Assiged-by` trailer to indicate that the commit was generated by |
| 46 | +an AI assistant, if necessary. The format of the `Assiged-by` trailer should |
| 47 | +be: |
| 48 | + |
| 49 | +~~~~ |
| 50 | +Assisted-by: AGENT_NAME:MODEL_VERSION |
| 51 | +~~~~ |
| 52 | + |
| 53 | +For example: |
| 54 | + |
| 55 | +~~~~ |
| 56 | +Assisted-by: OpenCode:qwen3.6-plus |
| 57 | +Assisted-by: Claude Code:claude-sonnet-4-6 |
| 58 | +Assisted-by: Gemini CLI:gemini-3.1-pro-preview |
| 59 | +Assisted-by: Codex:gpt-5.4 |
| 60 | +~~~~ |
0 commit comments