用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/tomevault-io/skills-registry --skill git-commit命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
正在显示 SKILL.md
| name | git-commit |
| description | > Use when this capability is needed. |
This skill gates every commit behind a test run and user confirmation. The goal is to avoid broken commits and ensure the message accurately reflects the change.
Run git status and git diff HEAD --name-only to see which files are modified,
staged, or untracked. Group them by area:
If nothing has changed, tell the user and stop.
Run only the tests relevant to what changed. This keeps the feedback loop fast.
| Changed area | Command |
|---|---|
src/ | mvn test |
webapp/ | cd webapp && npm run build && npm run lint && npm test --run |
Run each applicable command. If any test run fails, stop immediately and show the failure output. Do not proceed to staging or committing. Explain which area failed and what the user should fix.
If all tests pass, summarise the result briefly (e.g. "✓ 111 tests passed in api module") and continue.
List the files you intend to stage. Use git diff HEAD --name-only and
git ls-files --others --exclude-standard for untracked files.
Exclude files that should not be committed:
.claude/settings.local.json (personal local settings).env* filestarget/ or node_modules/ contents (should be gitignored, but flag if not)Present the proposed file list to the user clearly. If there are files you are unsure about, flag them and ask.
Analyse the diff with git diff HEAD and draft a commit message following the
project's convention:
<type>: <short description>
<optional body — bullet points describing key changes>
Types: feat, fix, refactor, docs, test, chore, perf, ci
Keep the subject line under 72 characters. Use the body to capture the why and
what when the change is non-trivial. Do not include Co-Authored-By lines.
Present a summary to the user before doing anything irreversible:
Files to stage:
<list of files>
Commit message:
<type>: <subject>
<body if any>
Proceed? (yes / edit message / cancel)
Wait for the user's response:
Stage only the files from Step 3 (add them individually, not with git add -A
or git add ., to avoid accidentally staging sensitive files).
Commit with the confirmed message using a heredoc to avoid shell escaping issues:
git commit -m "$(cat <<'EOF'
<type>: <subject>
<body>
EOF
)"
Do not append Co-Authored-By or any attribution footer.
After the commit, run git log --oneline -3 and show the user the result so they
can confirm everything looks correct.
git push.git push -u origin <branch>.Source: gessnerfl/fake-smtp-server — distributed by TomeVault.
基于 SOC 职业分类