agentleFS
phanghonghaophanghonghao/THU-Awesome-Skills/skills/git-push/SKILL.md

git-push

Skill8 starsChanged 3 months agoMITView on GitHub

Push git changes to GitHub. Use whenever user wants to upload/commit/push code changes to GitHub repository.

  • Commits and pushes

18 other projects use a version of this.

Adopted by

Most recently taken up by

The file

Show its rules and text

We split this skill into the rules it gives an agent

13 rules. 0 are common, 9 are distinctive, and 4 are very specific to this project.

  • 0

    Common

    Most of the 11 edited versions we read keep these.

  • 9

    Distinctive

    This author's own choices. Worth a look.

  • 4

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    FIRST: Ask the user to provide their own description for this commit:

    line 14
  2. Distinctive:

    If the user provides a path:

    line 30
  3. Distinctive:

    Read the current README.md at the repo root

    line 31
  4. Distinctive:

    Run git status and git diff --stat to see what files have changed.

    line 41
  5. Distinctive:

    DO add: source code (.py, .js, .md, etc.), data files (.csv), images/docs

    line 74
  6. Distinctive:

    DON'T add: __pycache__, venv, node_modules, .claude, .git, etc.

    line 75
  7. Distinctive:

    Create commit with combined message format:

    line 77
  8. Very specific:

    If user chooses merge: run gh pr merge <number> --merge

    line 112
  9. Very specific:

    If user chooses skip: abort the push, tell user to handle PR first

    line 114
  10. Distinctive:

    After all PRs resolved → continue to Step 7

    line 115
  11. Very specific:

    If myfork remote exists → push to myfork (NOT origin)

    line 122
  12. Distinctive:

    After confirmation, execute without further prompts: add → commit → push

    line 139
  13. Very specific:

    Commit message format: (User's description), (AI's summary)

    line 140

“Common” is measured: kept by at least 6 in 10 of the 11 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Git Push Skill

Quickly commit and push git changes to GitHub.

Workflow

Step 1: Ask User for Description

FIRST: Ask the user to provide their own description for this commit:

请输入本次提交的描述(简短说明你做了什么改动):

Step 2: Ask about README.md update

Ask the user:

是否需要更新 GitHub 首页 README.md?
如果需要,请提供素材目录路径(包含 gif、reward 趋势图等):
(留空跳过,默认路径示例:RTX6000\Magicbot_Z1\docs\github_readme)

If the user provides a path:

  1. Read the current README.md at the repo root
  2. List all files in the provided素材目录 (gifs, pngs, etc.)
  3. Compare with what's already referenced in README.md
  4. Propose updates to README.md (new images, updated sections, etc.)
  5. Apply the changes after user confirms

This step runs in parallel with Step 3 (git status check).

Step 3: Check git status

Run git status and git diff --stat to see what files have changed.

Step 4: List Changes for Confirmation

Clearly display what will be uploaded:

=== 将要上传的更改 ===

新增文件:
- file1.ext
- file2.ext

修改文件:
- file3.ext
- file4.ext

删除文件:
- file5.ext

=== AI 生成的总结 ===
[AI's summary of changes]

请确认是否上传?(yes/no)

Wait for user confirmation before proceeding.

Step 5: Add and Commit

After user confirms:

  1. Add relevant files:
    • DO add: source code (.py, .js, .md, etc.), data files (.csv), images/docs
    • DON'T add: pycache, venv, node_modules, .claude, .git, etc.
  2. Create commit with combined message format:
(User's description), (AI's summary)

- [key change 1]
- [key change 2]

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

Example:

修复笔记图片显示问题, 更新材料加工笔记结构和图片路径

- 图片重命名为 English_Pinyin 格式
- 更新 MD 和 HTML 中的图片引用路径
- 修复 3_17.html 图片不显示问题

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

Step 6: Check for Open PRs (gate before push)

Before pushing, check for open Pull Requests using gh pr list:

gh pr list --state open

If there are open PRs:

  1. Display each PR with title, author, and clickable URL
  2. Ask user: 检测到以下 PR 尚未处理,请选择操作:
    • For each PR, offer: merge / close / skip (稍后处理)
  3. If user chooses merge: run gh pr merge <number> --merge
  4. If user chooses close: run gh pr close <number>
  5. If user chooses skip: abort the push, tell user to handle PR first
  6. After all PRs resolved → continue to Step 7

If no open PRs: → proceed directly to Step 7

Step 7: Push to GitHub

First check remotes with git remote -v. Many projects have multiple remotes:

  • If myfork remote exists → push to myfork (NOT origin)
  • Otherwise → push to origin

Before push, pull latest changes to avoid conflicts:

git pull <remote> main --rebase

Then push:

git push <remote> main

Important Notes

  • Always ask user for their description first
  • Always list changes and wait for confirmation
  • After confirmation, execute without further prompts: add → commit → push
  • Commit message format: (User's description), (AI's summary)
  • Push to myfork if it exists, never push to origin when myfork is available
  • Always check for open PRs before pushing — unresolved PRs may cause conflicts
  • Pull with rebase before push to stay in sync with remote

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.