Commit and Push Skill Changes to GitHub Repository
Commits and pushes a skill change to the canonical ~/.agents repo, which auto-mirrors a sanitized copy publicly.
Why it matters
Automate the process of committing and pushing AI skill updates to a configured GitHub repository, ensuring changes are staged, committed with descriptive messages, and published to the canonical skills repo with verification.
Outcomes
What it gets done
Open a fresh terminal pane in the current cmux workspace without stealing focus
Stage all changes, commit with a concise message, and push to the remote GitHub repository from ~/.agents
Verify the push succeeded by reading terminal output and confirming the branch update
Clean up by closing the temporary pane after successful push confirmation
Install
Add it to your toolbox
Run in your project directory:
curl -fsSL https://spark.entire.vc/get/ag-push-skill-to-github | bash Overview
Push Skills to GitHub
Commits and pushes a finished skill change from the canonical ~/.agents repo root, which auto-publishes a sanitized mirror to the public davidondrej/skills repo. Use it after creating or editing a skill, once distribution (if any) is done. Only push when the user asks, and never push directly to the public mirror repo.
What it does
Commits and pushes any skill change to the user's private skills repo at git root ~/.agents - also the canonical skill folder, since .claude and .pi/agent/skills symlink to ~/.agents/skills. Pushes here auto-publish a sanitized public mirror to davidondrej/skills; the public repo itself must never be pushed to directly.
When to use - and when NOT to
Use it when skill changes are ready to commit and push to the configured skills repo, or when the user asks to save or publish skill updates after validation. Use it after creating or editing a skill, and if the skill is also being distributed to all agents, run distribute-skill-to-all-agents first, then push the canonical copy with this skill. Only push to GitHub when the user asks - never push speculatively.
Inputs and outputs
If not running inside cmux (no $CMUX_WORKSPACE_ID set), skip the cmux pane steps entirely and just run the git commands directly in any available terminal, then verify the push output. Inside cmux: open a fresh pane in the current workspace without stealing focus:
cmux new-pane --type terminal --direction right --workspace "$CMUX_WORKSPACE_ID" --focus false
cmux list-panes --workspace "$CMUX_WORKSPACE_ID" # note the NEW pane + its surface ref
Stage, commit, and push from ~/.agents by sending the command to that new pane's surface:
cmux send --surface surface:NEW 'cd ~/.agents && git add -A && git commit -m "<concise message>" && git push'
cmux send-key --surface surface:NEW enter
Verify the push landed by reading the pane's screen after a short sleep and expecting "main -> main"; then close the pane once confirmed and re-list panes to confirm it's gone.
Integrations
Git commands always run from ~/.agents (the repo root), never from ~/.agents/skills. Commit messages must be concise and specific about the actual skill change. Because a push here auto-mirrors to the public davidondrej/skills repo, direct pushes to that public repo are never made.
Who it's for
Anyone finishing a skill edit who needs it committed, pushed, and mirrored to the public skills repo correctly, without accidentally pushing to the wrong repo root or the public mirror directly.
Source README
Push Skills to GitHub
When to Use
- Use when skill changes are ready to commit and push to the configured skills repo.
- Use when the user asks to save or publish skill updates after validation.
For committing any skill change to the user's private skills repo, git root ~/.agents (this is also the canonical skill folder; .claude and .pi/agent/skills symlink to ~/.agents/skills). Pushes here auto-publish a sanitized public mirror to davidondrej/skills - never push directly to that public repo.
Use this after creating or editing a skill. If the skill is distributed to all agents, do that first (distribute-skill-to-all-agents), then run this to push the canonical copy.
Steps
Not in cmux? (no $CMUX_WORKSPACE_ID): skip the cmux pane steps - just run the git commands from step 2 directly in any available terminal, then verify the push output.
- Open a fresh cmux pane in the current workspace, no focus steal:
cmux new-pane --type terminal --direction right --workspace "$CMUX_WORKSPACE_ID" --focus false cmux list-panes --workspace "$CMUX_WORKSPACE_ID" # note the NEW pane + its surface ref - Stage, commit, push in
~/.agents(send to the new pane's surface):cmux send --surface surface:NEW 'cd ~/.agents && git add -A && git commit -m "<concise message>" && git push' cmux send-key --surface surface:NEW enter - Verify the push landed:
sleep 2 cmux read-screen --surface surface:NEW | tail -15 # expect "main -> main" - Close the pane once confirmed:
cmux close-surface --surface surface:NEW cmux list-panes --workspace "$CMUX_WORKSPACE_ID" # confirm the pane is gone
Notes
- Always run git from
~/.agents(the repo root), not~/.agents/skills. - Write a concise, specific commit message describing the skill change.
- Only push to GitHub when the user asks. Don't push speculatively.
Limitations
- Adapted from
davidondrej/skills; verify local paths, tools, credentials, and agent features before acting. - For commands, remote access, scheduling, browser automation, or file-changing workflows, get explicit user approval and confirm the target environment first.
Discussion
Questions & comments ยท 0
Sign In Sign in to leave a comment.