agentleFS
lingengyuanlingengyuan/my-skills/.claude/skills/sync-to-github/SKILL.md

sync-to-github

Skill9 starsChanged 2 days agoMITView on GitHub

Inspect, stage, commit, and push Git repository changes safely within authorized scope. Use when committing code, pushing to GitHub, inspecting staged diffs, creating commits, or drafting commit messages.

  • Commits and pushes

1 other project uses 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. About 0 are common, 8 are distinctive, and 5 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈8

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 5

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  • could be automatic: a setting could enforce it
  1. Distinctive:

    Inspect / Preview: Read-only operations. Do not stage files or create commits.

    line 12
  2. Distinctive:

    Stage task-related changes: Verify that changes do not contain API keys, credentials, or unintended build artifacts.

    line 19
  3. Very specific:

    Draft commit message: Create a concise commit message following Conventional Commits (feat:, fix:, docs:, refactor:, test:, chore:).

    line 20
  4. Very specific:

    Create commit: Run the bundled tools/git_sync.py or standard git commit.

    line 21
  5. Distinctive:

    If changes were just committed, push to the configured upstream remote.

    line 23
  6. Very specific:

    Push-only branch: If local commits already exist and working tree is clean, do not invoke tools/git_sync.py (which requires staged changes).

    line 24
  7. Distinctive:

    Verify synchronization: Verify tracking status with git status or git rev-parse.

    line 26
  8. Distinctive:

    Preserve unrelated work: Never discard, restage, or overwrite changes outside the current task.

    line 61
  9. Very specific:

    No force push: Never use --force or --force-with-lease unless explicitly instructed by the user.

    line 63
  10. Very specific:

    No unsolicited trailers: Do not add assistant co-author trailers (Co-Authored-By) unless requested.

    line 65
  11. Distinctive:

    Before completing the task, verify:

    line 69
  12. Distinctive:

    Commit exists locally with a valid hash and clear message.

    line 72
  13. Distinctive:

    If push was requested, remote ref matches local branch tip.

    line 73

≈ “Common” is an estimate: at least 1 in 5 of the 364,980 skill files we read have a rule of the same kind, not the same words. “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

Sync to GitHub Skill

Inspect, stage, commit, and push Git changes according to explicit user authorization. Standard Git commands and concepts are assumed knowledge.

Authorization Scopes

  • Inspect / Preview: Read-only operations. Do not stage files or create commits.
  • Commit: Authorized to stage task-related files and create local commits.
  • Push / Sync: Authorized to create local commits and push to the configured upstream remote.

Workflow

  1. Inspect repository state: Inspect git status, current branch, and tracking remotes. Inspect both staged and unstaged diffs.
  2. Stage task-related changes: Verify that changes do not contain API keys, credentials, or unintended build artifacts. Stage only files related to the task. Never use blanket staging (git add . or git add -A) when unrelated modifications exist.
  3. Draft commit message: Create a concise commit message following Conventional Commits (feat:, fix:, docs:, refactor:, test:, chore:). Describe the specific change and motivation. Do not add assistant co-author trailers unless explicitly requested.
  4. Create commit: Run the bundled tools/git_sync.py or standard git commit. Preview the staged diff before finalizing.
  5. Push to remote (if authorized):
    • If changes were just committed, push to the configured upstream remote.
    • Push-only branch: If local commits already exist and working tree is clean, do not invoke tools/git_sync.py (which requires staged changes). Directly push using standard Git: git push or git push <remote> <branch>.
    • Push only to the current branch upstream remote. Never force-push or rewrite public history unless explicitly instructed.
  6. Verify synchronization: Verify tracking status with git status or git rev-parse. Report local commit hash, branch name, and remote status.

CLI Usage

Bundled Tool (For staging and committing changes)

# Preview status and generated commit message without committing
python3 "<skill-dir>/tools/git_sync.py" --dry-run

# Commit staged changes
python3 "<skill-dir>/tools/git_sync.py"

# Commit staged changes and push to upstream
python3 "<skill-dir>/tools/git_sync.py" --push

Standard Git Workflow & Fallback

# Stage specific files
git add <file1> <file2>

# Commit with message
git commit -m "<type>(<scope>): <summary>"

# Push to configured upstream tracking branch
git push

# Or push explicitly to target remote
git push <remote> <branch>

Guidelines & Safety Rules

  • Preserve unrelated work: Never discard, restage, or overwrite changes outside the current task.
  • No secret exposure: Inspect diffs before staging to prevent committing tokens, keys, or passwords.
  • No force push: Never use --force or --force-with-lease unless explicitly instructed by the user.
  • Handle push rejection: On rejection, inspect remote divergence with git fetch and git status. Do not force-push over remote changes.
  • No unsolicited trailers: Do not add assistant co-author trailers (Co-Authored-By) unless requested.

Verification Checklist

Before completing the task, verify:

  1. Staged diff contains only task-related files and no sensitive credentials.
  2. Commit exists locally with a valid hash and clear message.
  3. If push was requested, remote ref matches local branch tip.
  4. Output reports the exact commit hash, branch, and push status.

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.