git-commit-and-push

Generates confirmed commit messages from diffs and pushes branches to fork remotes.

2.5k|524|Updated May 29, 2019
One-click install
npx skills add https://github.com/TencentBlueKing/bk-ci --skill git-commit-and-push
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: git-commit-and-push
Source: https://github.com/TencentBlueKing/bk-ci/tree/main/ai/skills/git-commit-and-push
Command: npx skills add https://github.com/TencentBlueKing/bk-ci --skill git-commit-and-push

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Committing and pushing code in the BK-CI repository involves conventions that are easy to get wrong: commit messages must follow issue-based formats, pushes should target a personal fork rather than the upstream repository, and unrelated or sensitive changes must not slip into a commit. This Skill enforces those rules so every commit and push is deliberate and correctly targeted.

Core Features & Use Cases

  • Diff-based commit preview: Generates a short one-line commit summary from the actual current diff and shows it to the user for confirmation before running git commit.
  • Fork-first push strategy: Inspects remotes to distinguish the personal fork from the upstream repository, sets upstream tracking with git push -u when needed, and refuses to push shared branches like master by default.
  • Direct-push shortcut: When the user explicitly names an issue and says to push directly, it commits with the normalized message <issue title> #<issue number> and pushes without a second confirmation.
  • Use Case: After finishing changes on an issue branch, ask the assistant to commit and push; it reviews the diff, proposes feat: add worktree skill #13062 added worker-skill file., waits for your approval, then pushes to your fork remote.

Quick Start

Ask the assistant to review my current changes, generate a commit message, and push the branch to my fork after I confirm.

Frequently Asked Questions about git-commit-and-push

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I commit and push changes to a fork on GitHub?

Check the current branch and diff, generate a short commit message from the actual changes, confirm it with the user, then run git commit. For the push, identify which remote is the personal fork and use git push -u <fork-remote> HEAD if no upstream is set.

How do I write a commit message that references a GitHub issue?

Use the issue title followed by the issue number, formatted as '<issue title> #<number>'. If the title already contains the issue number, reuse it unchanged; otherwise append the number. Optionally add a one-sentence summary of the actual diff.

Can I push directly to the upstream repository instead of my fork?

By default pushes target the personal fork remote, not the upstream main repository. Pushing to the upstream remote only happens when the user explicitly requests it, and shared branches like master or release branches should not be pushed directly.

What happens when git push is rejected or the remote has diverged?

The push stops and the situation is reported to the user instead of retrying blindly. Force-pushing, rewriting history, or using --no-verify is never done unless the user explicitly asks, and the cause of the divergence is explained first.

When should I not use this commit and push workflow?

Avoid it when you only need a commit message drafted without committing, when you need to create PRs or manage issues, or when you intend to rewrite history with rebase, amend, or force-push. Starting new work from master should go through a worktree-based branch workflow first.