agentleFS
bsamsonovbsamsonov/claude-code-config/skills/github-push/SKILL.md

github-push

Skill0 starsChanged 2 months agoMITView on GitHub

Push the current project repository to GitHub. Handles the full flow: git init, first commit, gh auth, repo creation, and push. Use when the user says "push to github", "create github repo", "push repo", "publish to github", "put this on GitHub".

  • Reads credentials
  • Installs packages
  • Commits and pushes

2 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

14 rules. About 0 are common, 6 are distinctive, and 8 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈6

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 8

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Ensure git is initialised and has at least one commit

    line 15
  2. Very specific:

    Ensure gh CLI is authenticated

    line 16
  3. Distinctive:

    Create a GitHub repository if no remote exists

    line 17
  4. Very specific:

    If output contains not a git repository → go to Step 2a (init)

    line 32
  5. Very specific:

    If output shows nothing to commit or a clean state with commits → skip to Step 3

    line 33
  6. Distinctive:

    If output shows uncommitted changes → go to Step 2b (stage + commit)

    line 34
  7. Distinctive:

    Use a descriptive commit message based on what files changed.

    line 73
  8. Very specific:

    If output contains Logged in as → skip to Step 4

    line 83
  9. Very specific:

    If output contains not logged in → run:

    line 84
  10. Very specific:

    If a remote named origin exists → skip to Step 5 (just push)

    line 103
  11. Distinctive:

    If no remote → go to Step 4a (create repo)

    line 104
  12. Very specific:

    Default repo name: basename "$PWD"

    line 111
  13. Very specific:

    Default visibility: private — use --public only if the user explicitly specified it in their request

    line 112
  14. Distinctive:

    If the branch has no upstream yet:

    line 134

≈ “Common” is an estimate: at least 1 in 5 of the 383,637 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

Skill: Push Project to GitHub

Purpose

Handles the complete flow of publishing the current project to GitHub:

  1. Ensure git is initialised and has at least one commit
  2. Ensure gh CLI is authenticated
  3. Create a GitHub repository if no remote exists
  4. Push all commits

Workflow

Work through the steps below sequentially, checking state at each step before acting.


Step 1 — Check git status

git -C "$PWD" status 2>&1
  • If output contains not a git repository → go to Step 2a (init)
  • If output shows nothing to commit or a clean state with commits → skip to Step 3
  • If output shows uncommitted changes → go to Step 2b (stage + commit)

Step 2a — Initialise git (if not a repo)

cd /path/to/project
git init

Then check if .gitignore is needed. If the project has node_modules/, __pycache__/, .venv/, .env, or similar — offer to create a .gitignore. Common template:

node_modules/
__pycache__/
.venv/
venv/
.env
*.pyc
.DS_Store

Then stage and commit:

git add -A
git commit -m "Initial commit"

Step 2b — Stage and commit pending changes

git add -A
git status   # confirm what will be committed
git commit -m "<describe the changes>"

Use a descriptive commit message based on what files changed.


Step 3 — Check gh authentication

gh auth status 2>&1
  • If output contains Logged in as → skip to Step 4
  • If output contains not logged in → run:
gh auth login --web -h github.com

Walk the user through the interactive prompts:

  1. Protocol: HTTPS
  2. Authenticate Git with credentials: Yes
  3. Copy the one-time code shown, press Enter to open the browser, paste the code on GitHub

Step 4 — Check for existing remote

git remote -v
  • If a remote named origin exists → skip to Step 5 (just push)
  • If no remote → go to Step 4a (create repo)

Step 4a — Create GitHub repository and push

First, determine the repo name and visibility:

  • Default repo name: basename "$PWD"
  • Default visibility: private — use --public only if the user explicitly specified it in their request
gh repo create <repo-name> --private --description "<short description>" \
  --source=. --remote=origin --push

For a public repo:

gh repo create <repo-name> --public --source=. --remote=origin --push

This creates the repo, adds origin remote, and pushes in one step.


Step 5 — Push (remote already exists)

git push

If the branch has no upstream yet:

git push --set-upstream origin $(git branch --show-current)

What to report after completion

Tell the user:

  1. The GitHub URL of the repository (from gh repo view --json url -q .url or from the output of gh repo create)
  2. How many commits were pushed (git log --oneline | wc -l)
  3. Current branch name

Edge cases

SituationAction
gh not installedRun sudo apt install gh or sudo snap install gh
Branch is master not mainPush as-is; mention user can rename with git branch -m main
Push rejected (non-fast-forward)Show git log origin/<branch>..HEAD and ask whether to force-push or merge
Repo already exists on GitHubSkip creation, add remote manually: git remote add origin https://github.com/<user>/<repo>.git, then push
Binary files or large filesWarn if any file > 50 MB (GitHub limit is 100 MB; LFS recommended above 50 MB)

Dependencies

  • git — version control
  • gh — GitHub CLI: sudo apt install gh or sudo snap install gh
  • Active internet connection
  • A GitHub account (free tier is sufficient)

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.