Git Pushing Fast
Overview
Commit and push the current repository's local changes on the current branch with a fast, safe single-branch workflow.
The default output is one focused Conventional Commit plus a push to the tracked remote branch. Analyze the actual diff, stage the requested change set, generate the commit message from the change content, and write a segmented body for non-trivial changes so reviewers can quickly see what changed by topic.
This workflow handles ordinary single-branch handoff requests such as saving current work to the remote, without branch merging, history rewriting, or PR creation.
Conventional Commit Rules
Base format:
<type>[optional scope]: <description>
[body: optional only for trivial changes; required and segmented for non-trivial changes]
[footer(s): required for breaking changes; optional for relevant issue references]
For this skill, the body is optional only for trivial commits. For non-trivial changes, write a segmented body and include a Tests: or localized equivalent section when tests, validators, hooks, or manual verification ran.
Types:
| Type |
Use for |
feat |
New user-facing or product capability |
fix |
Bug fix |
docs |
Documentation-only change |
style |
Formatting/style change with no logic impact |
refactor |
Code restructure with no feature or bug fix |
perf |
Performance improvement |
test |
Test-only or test coverage change |
build |
Build system, dependency, or packaging change |
ci |
CI or automation config change |
chore |
Maintenance or miscellaneous change |
revert |
Revert a previous commit |
Breaking changes:
- Use
! after the type or scope, such as feat(api)!: remove legacy field.
- Add a
BREAKING CHANGE: footer when the behavioral contract changes.
Message style:
- Use the repository's existing commit language.
- Write the subject in present tense and imperative mood, such as
fix login redirect.
- Keep the subject under 72 characters when practical.
- Reference issues in the body or footer when relevant, such as
Closes #123 or Refs #456.
When to Use
Use this skill when the user asks to:
- Commit and push the current work
- Push this, save to remote, or finish a normal single-branch handoff
- Create one Conventional Commit from staged and unstaged changes
- Include a readable commit body that groups changes by feature area, UI area, tests, docs, or validation
Do Not Use
Do not use this skill for:
- Multi-branch flows that merge a work branch into a primary branch
- Force-push, rebase, squash, amend, or history-rewrite requests
- Pull request creation unless the user explicitly asks for it after the push
- Code review, release notes, weekly reports, or changelog generation
- Destructive commands such as
git reset --hard or git checkout -- <file>
Instructions
Follow this workflow in order. Stop and report the blocker instead of guessing when the target repository, branch, or push destination is unclear.
Inspect the repository.
- Run
git status --short, git branch --show-current, and git remote -v.
- Check the upstream with
git rev-parse --abbrev-ref --symbolic-full-name @{u} when possible.
- Review the staged diff with
git diff --cached --stat and git diff --cached; if nothing is staged, review git diff --stat and git diff.
- Use
git status --porcelain when script-friendly status parsing is useful.
- Never discard or revert user changes.
Stage changes.
- If the user asked to commit everything, run
git add -A.
- If the user requested a narrower scope, stage only that scope.
- Use file-specific adds, path patterns, or
git add -p only when the requested scope requires logical grouping.
- Re-run
git status --short and verify the intended files are staged.
- Never leave known secrets staged for commit, including
.env, credential files, private keys, or tokens.
Build the commit message.
- Use Conventional Commits:
type(scope): concise summary in the repository's existing commit language.
- Choose the type and scope from the actual diff, not from filenames alone.
- For non-trivial changes, include a segmented body with 2-5 short sections.
- Each section title should name the affected area, followed by bullet points.
- Include a
Tests: or localized equivalent section when tests, validators, hooks, or manual verification ran.
Example segmented body:
fix(module): update component behavior
Behavior:
- Adjust the default state for the affected component.
- Keep existing behavior unchanged for unsupported input.
Implementation:
- Move repeated logic into a small helper.
- Update related configuration to use the new helper.
Tests:
- Add coverage for the updated behavior.
- Run the relevant validator before pushing.
Commit.
- Use
git commit with multiple -m arguments or an editor-free equivalent so the body is preserved.
- Do not use
--no-verify.
- If hooks or validation fail, fix the failure and retry the commit.
Push.
- If the current branch has an upstream, run
git push.
- If there is no upstream, run
git push -u origin <current_branch> unless the repository or user specifies another remote.
- If the push is rejected because the remote moved, run
git fetch and inspect before retrying.
- Do not force-push unless the user explicitly requested force-push and the risk has been confirmed.
- Never force-push to
main or master.
Report.
- Keep the final response concise.
- Include the commit hash, branch, remote push result, and validation that ran.
- If the host app supports Git directives, emit them only after the matching action succeeds.
Safety Protocol
- Never update global or system Git config.
- Never run destructive commands such as
git reset --hard or git checkout -- <file> unless explicitly requested.
- Never skip hooks.
- Never commit secrets.
1---
2name: git-pushing-fast
3description: Use when committing and pushing current changes on one branch with a Conventional Commit message. Supports diff-based type/scope/message generation, staged or requested change handling, segmented commit bodies for non-trivial changes, and safe single-branch push handling.
4---
5
6# Git Pushing Fast
7
8## Overview
9
10Commit and push the current repository's local changes on the current branch with a fast, safe single-branch workflow.
11
12The default output is one focused Conventional Commit plus a push to the tracked remote branch. Analyze the actual diff, stage the requested change set, generate the commit message from the change content, and write a segmented body for non-trivial changes so reviewers can quickly see what changed by topic.
13
14This workflow handles ordinary single-branch handoff requests such as saving current work to the remote, without branch merging, history rewriting, or PR creation.
15
16## Conventional Commit Rules
17
18Base format:
19
20```text
21<type>[optional scope]: <description>
22
23[body: optional only for trivial changes; required and segmented for non-trivial changes]
24
25[footer(s): required for breaking changes; optional for relevant issue references]
26```
27
28For this skill, the body is optional only for trivial commits. For non-trivial changes, write a segmented body and include a `Tests:` or localized equivalent section when tests, validators, hooks, or manual verification ran.
29
30Types:
31
32| Type | Use for |
33| --- | --- |
34| `feat` | New user-facing or product capability |
35| `fix` | Bug fix |
36| `docs` | Documentation-only change |
37| `style` | Formatting/style change with no logic impact |
38| `refactor` | Code restructure with no feature or bug fix |
39| `perf` | Performance improvement |
40| `test` | Test-only or test coverage change |
41| `build` | Build system, dependency, or packaging change |
42| `ci` | CI or automation config change |
43| `chore` | Maintenance or miscellaneous change |
44| `revert` | Revert a previous commit |
45
46Breaking changes:
47- Use `!` after the type or scope, such as `feat(api)!: remove legacy field`.
48- Add a `BREAKING CHANGE:` footer when the behavioral contract changes.
49
50Message style:
51- Use the repository's existing commit language.
52- Write the subject in present tense and imperative mood, such as `fix login redirect`.
53- Keep the subject under 72 characters when practical.
54- Reference issues in the body or footer when relevant, such as `Closes #123` or `Refs #456`.
55
56## When to Use
57
58Use this skill when the user asks to:
59- Commit and push the current work
60- Push this, save to remote, or finish a normal single-branch handoff
61- Create one Conventional Commit from staged and unstaged changes
62- Include a readable commit body that groups changes by feature area, UI area, tests, docs, or validation
63
64## Do Not Use
65
66Do not use this skill for:
67- Multi-branch flows that merge a work branch into a primary branch
68- Force-push, rebase, squash, amend, or history-rewrite requests
69- Pull request creation unless the user explicitly asks for it after the push
70- Code review, release notes, weekly reports, or changelog generation
71- Destructive commands such as `git reset --hard` or `git checkout -- <file>`
72
73## Instructions
74
75Follow this workflow in order. Stop and report the blocker instead of guessing when the target repository, branch, or push destination is unclear.
76
771. Inspect the repository.
78 - Run `git status --short`, `git branch --show-current`, and `git remote -v`.
79 - Check the upstream with `git rev-parse --abbrev-ref --symbolic-full-name @{u}` when possible.
80 - Review the staged diff with `git diff --cached --stat` and `git diff --cached`; if nothing is staged, review `git diff --stat` and `git diff`.
81 - Use `git status --porcelain` when script-friendly status parsing is useful.
82 - Never discard or revert user changes.
83
842. Stage changes.
85 - If the user asked to commit everything, run `git add -A`.
86 - If the user requested a narrower scope, stage only that scope.
87 - Use file-specific adds, path patterns, or `git add -p` only when the requested scope requires logical grouping.
88 - Re-run `git status --short` and verify the intended files are staged.
89 - Never leave known secrets staged for commit, including `.env`, credential files, private keys, or tokens.
90
913. Build the commit message.
92 - Use Conventional Commits: `type(scope): concise summary` in the repository's existing commit language.
93 - Choose the type and scope from the actual diff, not from filenames alone.
94 - For non-trivial changes, include a segmented body with 2-5 short sections.
95 - Each section title should name the affected area, followed by bullet points.
96 - Include a `Tests:` or localized equivalent section when tests, validators, hooks, or manual verification ran.
97
98Example segmented body:
99
100```text
101fix(module): update component behavior
102
103Behavior:
104- Adjust the default state for the affected component.
105- Keep existing behavior unchanged for unsupported input.
106
107Implementation:
108- Move repeated logic into a small helper.
109- Update related configuration to use the new helper.
110
111Tests:
112- Add coverage for the updated behavior.
113- Run the relevant validator before pushing.
114```
115
1164. Commit.
117 - Use `git commit` with multiple `-m` arguments or an editor-free equivalent so the body is preserved.
118 - Do not use `--no-verify`.
119 - If hooks or validation fail, fix the failure and retry the commit.
120
1215. Push.
122 - If the current branch has an upstream, run `git push`.
123 - If there is no upstream, run `git push -u origin <current_branch>` unless the repository or user specifies another remote.
124 - If the push is rejected because the remote moved, run `git fetch` and inspect before retrying.
125 - Do not force-push unless the user explicitly requested force-push and the risk has been confirmed.
126 - Never force-push to `main` or `master`.
127
1286. Report.
129 - Keep the final response concise.
130 - Include the commit hash, branch, remote push result, and validation that ran.
131 - If the host app supports Git directives, emit them only after the matching action succeeds.
132
133## Safety Protocol
134
135- Never update global or system Git config.
136- Never run destructive commands such as `git reset --hard` or `git checkout -- <file>` unless explicitly requested.
137- Never skip hooks.
138- Never commit secrets.