Install
openclaw skills install @sunflower070203/git-commit-helperAnalyze the current git changes, generate a Conventional Commits message, confirm with the user, then commit. 当用户说「帮我提交代码」「提交一下」「commit this」「commit my changes」时使用。Use when asked to commit code after changes are made.
openclaw skills install @sunflower070203/git-commit-helperUse when the user asks to commit code: "帮我提交代码", "提交一下", "commit this", "commit my changes", "commit".
git and powershell available on PATH.scripts/git-commit-helper.ps1 lives in this skill directory. Resolve paths relative to this directory.git commit before the user explicitly confirms BOTH the scope and the message.Run:
powershell -NoProfile -ExecutionPolicy Bypass -File "scripts/git-commit-helper.ps1" analyze
The output is a fixed-format block, for example:
[git-commit-helper] branch: main
[git-commit-helper] initial-commit: no
[git-commit-helper] merge-in-progress: no
[git-commit-helper] staged:
[git-commit-helper] A src/new.py (+12/-0)
[git-commit-helper] unstaged:
[git-commit-helper] M src/foo.py (+5/-2)
[git-commit-helper] untracked:
[git-commit-helper] ?? docs/note.md
[git-commit-helper] total: 3 files, +17/-2
total: 0 files appears: tell the user there is nothing to commit and STOP.merge-in-progress: yes appears: ask the user how to proceed before continuing.Show the user the full output block verbatim. Do not summarize.
Ask: commit everything, exclude files, or cancel.
Follow this decision tree.
| Type | Use when |
|---|---|
| feat | New user-facing feature |
| fix | Bug fix |
| refactor | Behavior-preserving code change |
| docs | Documentation only |
| style | Formatting/whitespace, no behavior change |
| test | Adding or fixing tests |
| perf | Performance improvement |
| build | Build system or dependency changes |
| ci | CI configuration changes |
| chore | Maintenance, tooling, or misc |
If changes span multiple types, pick the dominant one. If still tied, prefer in this order: feat, fix, refactor, docs, chore.
feat(api): ....If the change is breaking, add ! after the type/scope in the subject (e.g. feat(api)!: ...) and include a BREAKING CHANGE: <description> line in the body footer.
Compose the full message in a variable, normalize line endings to LF, then write UTF-8 WITHOUT BOM:
$msg = $msg -replace "`r`n", "`n"
[IO.File]::WriteAllText("$env:TEMP\gch-msg.txt", $msg, (New-Object System.Text.UTF8Encoding($false)))
Show the user the confirmed scope summary AND the full message. Wait for explicit approval. If the user edits the message, update the file and show it again.
powershell -NoProfile -ExecutionPolicy Bypass -File "scripts/git-commit-helper.ps1" commit -MessageFile "$env:TEMP\gch-msg.txt"
If the user excluded files, pass them explicitly:
powershell -NoProfile -ExecutionPolicy Bypass -File "scripts/git-commit-helper.ps1" commit -MessageFile "$env:TEMP\gch-msg.txt" -Paths "path/to/a.txt" "path/to/b.txt"
Omit -Paths when committing everything.
Run git log -1 --stat and report the result to the user.