From qingyi
This skill should be used when the user wants to commit code changes to git and optionally push to a remote. ACTION TRIGGERS: - "commit", "git commit", "commit this", "commit my work" - "save changes", "create a commit", "conventional commit" NATURAL LANGUAGE PATTERNS: - "commit" + code/changes context - "save my changes" / "commit what I have" - "done, commit" / "looks good, commit" NOTE: For "commit and push" or "push changes", use the commit-push skill instead.
How this skill is triggered — by the user, by Claude, or both
Slash command
/qingyi:commitThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
Create a conventional commit and optionally push to GitHub.
Create a conventional commit and optionally push to GitHub.
Run git status --porcelain to detect changes.
If no changes: Report "No changes to commit. Working tree is clean." and stop.
If changes exist: Categorize into:
If nothing staged but changes exist, use AskUserQuestion with options:
git add -A)git add -u)Run the appropriate git add command.
After staging, run git diff --cached --stat and analyze changed files for logical groupings.
Group changes by scope:
src/ vs docs/ vs tests/)Single-scope (all changes relate to one concern): proceed to Step 4 with one commit.
Multi-scope (2+ unrelated scopes detected): present the grouped changes using AskUserQuestion:
If splitting:
git reset HEAD to unstage everythinggit add <files>)Run these in parallel:
git log --oneline -5 -- recent commit style for consistencygit diff --cached --stat -- what will be committedgit diff --cached -- full diff for analysisAnalyze the diff and construct a commit message following conventional commits format:
<type>(<scope>): <description>
<body>
Commit types:
| Type | When to Use |
|---|---|
feat | New feature |
fix | Bug fix |
docs | Documentation only |
style | Formatting, no code change |
refactor | Code change that neither fixes nor adds |
perf | Performance improvement |
test | Adding or updating tests |
chore | Build process, dependencies |
Rules:
Auto-commit immediately -- do NOT ask the user to confirm the message. Execute using heredoc:
git commit -m "$(cat <<'EOF'
<constructed message>
EOF
)"
Verify with git log -1 --oneline.
Check remote: git remote -v
If remote exists, ask: "Push to remote?"
If yes:
git status -sbgit pushgit push -u origin <branch>Report final status with commit hash.
| Condition | Response |
|---|---|
| Not a git repo | "Error: Not a git repository. Run git init first." |
| No changes | "Nothing to commit. Working tree is clean." |
| Commit hook fails | Report hook output, suggest fixes |
| Push rejected | "Push rejected. Pull latest changes: git pull --rebase" |
| No upstream | Suggest git push -u origin <branch> |
| No remote | "No remote configured. Commit created locally." |
Creates, edits, and optimizes skills for Claude Code, including drafting, evaluating with test prompts, iterating on performance, and improving skill descriptions for better triggering accuracy.
npx claudepluginhub fly-onlyone/qingyi --plugin qingyi