agentleFS
charlie947charlie947/skills-for-everyone/skills/push-check/SKILL.md

push-check

Skill2 starsChanged 41 days agoMITView on GitHub

Check everything before work goes to GitHub, then push it. Runs the repo's own checks, a sweep for leaked keys, personal paths, oversized files and dead links, a second Claude reading the changes cold, and a fresh-copy rehearsal of what a new user does first. Pushes only after two clean passes in a row, then drafts the short note to send people, if there is anything for them to do. Use when the user says "push", "push this", "ship it", "put it on GitHub", "release", "send it to them", "is it ready to push", or is about to share a repo other people will download.

  • Reads credentials
  • Deletes or force-pushes
  • Commits and pushes

The file

We split this skill into the rules it gives an agent

5 rules. About 0 are common, 4 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈4

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    A push is a sequence, not a command: Every step below runs, in order, before git push.

    line 19
  2. Distinctive:

    Run whatever the repo already has and read the last line of the output, not the first few.

    line 46
  3. Very specific:

    If gitleaks is installed, run it on the commits about to leave as a second net: gitleaks git .

    line 68
  4. Distinctive:

    Every fix changes the repo, and the next pass sees what the fix exposed.

    line 105
  5. Distinctive:

    If you fixed anything, the pass that found it does not count.

    line 110

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

push-check

A push feels finished before it is. The checks pass, the files look fine, and the faults turn up when someone else downloads the work: a leaked key, a link to a file that is not there, a setup step that only works on your machine. None of it is hard to find. Nothing looked for it.

A push is a sequence, not a command. Every step below runs, in order, before git push. The step that "obviously will pass" is the one that catches something.

Talk to the user in plain English the whole way through. They may not know git. Say what you found and what you did about it, never which command printed it.


Step 1. Say what is about to leave

git status --short
git log --oneline @{u}..HEAD 2>/dev/null || git log --oneline -10
git diff --stat @{u}..HEAD 2>/dev/null

Tell the user in one or two lines what this push contains: which files, and what changed for someone who downloads it. If there is no remote yet, say so and ask where it should go before going further. Never create a public repo without a yes. Public is the default risk.

Step 2. Run the repo's own checks

ls tools/ scripts/ 2>/dev/null | grep -iE 'check|test|verify|validate|lint'
cat package.json 2>/dev/null | grep -A5 '"scripts"'

Run whatever the repo already has and read the last line of the output, not the first few. A summary at the bottom that says FAIL is easy to miss when you skim from the top. If the repo has no checks of its own, say so. That is a finding, not a pass.

Step 3. Sweep for what a passing check cannot see

bash "${CLAUDE_SKILL_DIR}/scripts/push-sweep.sh" .

${CLAUDE_SKILL_DIR} is the folder this skill is installed in. If it comes up empty, use the folder this SKILL.md sits in. Exit 0 is clean, 1 means problems, 3 means it could not scan anything, which is never a pass.

CheckWhy it matters
SecretsAn API key in a public repo is found by bots within minutes. The script prints the file and line, never the key itself
A tracked .envThe usual home of every password in the project
Your home folderA path like /Users/yourname/... works for you and for nobody else
Files over 50MBGitHub warns at 50MB and refuses anything over 100MB
Dead linksA README pointing at a file that is not in the repo is the first thing a new user hits

If gitleaks is installed, run it on the commits about to leave as a second net: gitleaks git . --redact --no-banner --log-opts="@{u}..HEAD". If it is not, say NOT RUN. Never skip it silently.

A key that has already been pushed is leaked, even after you delete it. Tell the user to rotate it at the provider first. Cleaning the history comes second.

Step 4. A second reader, cold

The person who wrote the change is the worst person to review it. Start a fresh subagent with no memory of this session and give it only the diff and one line on what the change is meant to do:

Read this diff as someone about to download the repo. List anything that is broken, untrue, confusing or missing for a new user. Quote the file and line for each one. Do not fix anything.

Then check each finding against the file before acting on it. Reviewers are sometimes wrong. Report the count both ways: found, fixed, and rejected with the reason. If nothing is ever rejected, you are copying the review, not checking it.

Step 5. Rehearse on a fresh copy

This is the step that catches what every other step misses, because it runs somewhere your setup is not.

rm -rf "${TMPDIR:-/tmp}/push-rehearsal"
git clone -q . "${TMPDIR:-/tmp}/push-rehearsal" && cd "${TMPDIR:-/tmp}/push-rehearsal"

Then follow the README exactly as a stranger would: the install step, then the first thing it tells a new user to run. It has to work. Then run the thing this change was about and check the output is what you meant. Say plainly what this cannot prove: other computers, other operating systems, other versions.

Step 6. Loop until two passes in a row come back clean

Every fix changes the repo, and the next pass sees what the fix exposed. So the exit condition is not "the checks passed once". It is:

Two full passes of steps 2 to 5 with nothing found, and nothing changed between them.

If you fixed anything, the pass that found it does not count. Stop after five loops. If it is still finding things, the repo has a problem you have not understood yet. Say so instead of pushing.

Step 7. Push

git push

Then confirm it arrived: git status should say the branch is up to date with the remote. For a public repo, open the repo page and check the README renders.

Step 8. Tell people only if they have something to do

Draft a message only when someone needs to download the update, something they use now behaves differently, or something they reported is fixed. A note with nothing to do in it teaches people to stop reading your notes.

Three lines at most: the instruction, what it fixes in their words, and the one thing that now behaves differently, if there is one.

Quick one when you get a sec: download the latest version.
It fixes the broken setup link Sam spotted.
Nothing else changes for you.

Show the user the draft. Never send it. They send it.

What this skill does not do

  • Push to a public repo, or make a private one public, without the user saying yes.
  • Force-push, rewrite history or delete a branch.
  • Print a secret it found.
  • Send the announcement.

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.