Agent Skills
› tldraw/tldraw
› commit-changes
commit-changes
GitHub辅助生成符合规范的 Git 提交,自动收集上下文、暂存文件并撰写 Conventional Commits 格式信息,同时处理 Hook 失败重试,确保提交安全规范。
触发场景
用户要求提交更改
生成提交消息
提交当前工作区
安装
npx skills add tldraw/tldraw --skill commit-changes -g -y
SKILL.md
Frontmatter
{
"name": "commit-changes",
"description": "Create a git commit for the current changes. Use when asked to commit changes, make a commit, generate a commit message, or commit the current worktree with optional user-provided context."
}
Commit changes
Create a focused git commit for the current changes.
Workflow
- Gather context:
- User notes, if provided.
- Current branch:
git branch --show-current. - Working tree:
git status --short. - Staged changes:
git diff --cached --stat. - Unstaged changes:
git diff --stat. - Recent commits for style reference:
git log -5 --oneline.
- Review the changed files.
- If there are no changes to commit, tell the user and stop.
- If there are unstaged changes, stage the relevant files with
git add. - Do not stage files that look like secrets, credentials, API keys, or private environment files.
- Write a conventional commit message:
type(scope): brief description
Optional longer explanation if the changes are complex.
Allowed types: feat, fix, refactor, test, docs, chore, perf, style, build, ci.
Message guidelines
- Keep the first line under 72 characters.
- Use imperative mood, for example
add feature, notadded feature. - Be specific about what changed and why.
- Incorporate user-provided context when it clarifies intent.
Commit rules
- Use
git commit -m "message". - Do not push.
- Do not amend unless explicitly requested.
- Do not use
--no-verify. - Do not include AI attribution.
If the commit fails because of hooks, fix mechanical formatting, lint, or import issues and retry. If the hook failure reveals a meaningful product or implementation issue, stop and ask the user how to proceed.
版本历史
- 5181649 当前 2026-08-20 19:18


