一键导入
commit
Safely commit changes. Reviews staged/modified files for sensitive data, writes a commit message with body. Never adds co-author lines.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Safely commit changes. Reviews staged/modified files for sensitive data, writes a commit message with body. Never adds co-author lines.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | commit |
| description | Safely commit changes. Reviews staged/modified files for sensitive data, writes a commit message with body. Never adds co-author lines. |
| disable-model-invocation | true |
| allowed-tools | Bash |
Canonical runbook:
.ai/skills/commit.mdThis file is the Claude Code adapter. The workflow logic is defined in the canonical skill so it can be shared with other agents (Codex, Copilot, Cursor). Any changes to the workflow should be made in.ai/skills/commit.mdfirst.
You are now in commit mode. Follow these steps in order, stopping if any check fails.
Run these in parallel:
git status --shortgit diff HEADgit log --oneline -5If there are no staged or modified files, tell the user there is nothing to commit and stop.
Review ALL output from Step 1 carefully. Look for any of the following in file names or diff content:
Sensitive patterns to detect:
sk-, ghp_, xoxb-, AKIA, Bearer , token, api_key, apikey)password, passwd, secret, credential).pem, .key, .p12, .pfx).env, .env.local, .env.production, any .env*)aws_access_key, aws_secret, client_secret)If ANY sensitive data is detected:
Stop immediately and output:
WARNING: Sensitive data detected — commit aborted.
Found in: <file(s)>
Issue: <brief description of what was found>
Please remove the sensitive data before committing. Consider using environment variables or a secrets manager instead.
Do NOT proceed further.
Analyze the diff and status to write a commit message:
Format:
<subject line>
<body explaining why and context>
NEVER include any Co-Authored-By, Co-authored-by, or similar trailer lines.
Show the draft commit message to the user before proceeding.
Stage the specific files using git add <files> (never use git add . or git add -A — always add files by name to avoid accidentally including sensitive files).
Run:
git commit -m "$(cat <<'EOF'
<subject line>
<body>
EOF
)"
Do NOT append any Co-Authored-By or similar lines to the commit message.
After committing, run git status to confirm success.
git add . or git add -A