name: git-push description: 自动完成当前仓库的拉取、提交和推送流程。仅当用户明确要求“提交并推送”“git push 当前改动”时触发。
Git Push
用于在用户明确要求时,一次性完成 pull -> commit -> push。
Workflow
- Pull first
- Run
git pull. - If merge conflict occurs, stop immediately and report conflicted files.
- If pull fails for other reasons, stop and report the error.
- Analyze changes
- Check
git statusandgit diff HEAD. - If there is no change to commit, stop and report no-op.
- Create commit message
- Follow commit type rules from
commitlint.config.cjs:feat,fix,update,refactor,style,doc,test,framework,revert
- Format:
- First line:
Type: summary - Blank line
- Bullet list of key changes
- First line:
- Do not add auto-generated byline text.
- Commit and push
- Stage changes with
git add .. - Create commit.
- Push to remote branch.
- Report result
- Return commit hash, commit message summary, branch name, and push status.
Safety constraints
- Only run this skill when user explicitly asks to commit/push.
- If commitlint fails, adjust message and retry once.
- Do not run destructive git commands.