agentleFS
LucasCooperBeyLucasCooperBey/claude-skills/skills/ship/SKILL.md

ship

Skill1 starsChanged 5 months agoMITView on GitHub

Fix-until-clean loop then commit and push. Use when ready to ship code — runs tests, lint, typecheck, fixes any issues, commits, and pushes.

  • Reads credentials
  • Commits and pushes

We split this skill into the rules it gives an agent

9 rules. 0 are common, 7 are distinctive, and 2 are very specific to this project.

  • 0

    Common

    Most of the 180 edited versions we read keep these.

  • 7

    Distinctive

    This author's own choices. Worth a look.

  • 2

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Before running anything, detect what's available:

    line 36
  2. Very specific:

    Only run checks that exist.

    line 46
  3. Distinctive:

    Run all available checks. Max 5 fix iterations (hard stop: same error 3 times).

    line 60
  4. Distinctive:

    Read the error output

    line 63
  5. Distinctive:

    If fixed → continue to next check

    line 67
  6. Distinctive:

    If still failing after 3 attempts on same issue → STOP and report

    line 68
  7. Distinctive:

    If push is rejected (remote has new commits):

    line 94
  8. Very specific:

    Run /sv to save session state

    line 107
  9. Distinctive:

    Update changelog if applicable

    line 108

“Common” is measured: kept by at least 6 in 10 of the 180 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

Ship — Fix Until Clean, Then Push

Automated loop that ensures code is clean before shipping.

When to Use

  • Done coding and ready to commit + push
  • Want to make sure everything passes before pushing
  • Replace manual "run tests, fix, run again" cycle

Arguments

/ship [optional commit message]

Examples:
/ship add user validation endpoint
/ship fix dashboard performance regression
/ship                              # auto-generates commit message from diff

Parse $ARGUMENTS as the commit message. If empty, auto-generate from git diff --staged.

Time Budget

  • Quality checks: 2 min max per suite run
  • Fix loop: 3 min max per fix attempt, 10 min total
  • Hard stop: 15 min total. If not shipped by then → STOP, report status

Step 0: Detect Project Type

Before running anything, detect what's available:

# Check for package.json scripts
# Node/Bun project: use bun test, bun run lint, bun run typecheck
# Python project (pyproject.toml or setup.py): use uv run pytest, uv run ruff check
# Ruby project (Gemfile): use bundle exec rake test, bundle exec rubocop
# If no recognizable project → warn and skip quality checks, just commit

Only run checks that exist. If package.json has no lint script, skip lint. Don't fail on missing scripts.

Step 1: Detect Branch Context

# Check current branch
BRANCH=$(git branch --show-current)

# Branch detection: check your project's CLAUDE.md for branch conventions
# If your project uses a staging/dev branch instead of main, warn before pushing to main

Step 2: Quality Check Loop

Run all available checks. Max 5 fix iterations (hard stop: same error 3 times).

For each failure:

  1. Read the error output
  2. Identify root cause
  3. Fix it (max 2 attempts same approach, then try alternative)
  4. Re-run the failing check
  5. If fixed → continue to next check
  6. If still failing after 3 attempts on same issue → STOP and report

Step 3: Commit + Push

Once all checks pass:

# Stage changes — use specific files, NOT git add -A
# Review what changed with git status first
# NEVER stage .env, credentials, or secrets files
git add [specific files]

# Commit with message (from $ARGUMENTS or auto-generated from diff)
git commit -m "$(cat <<'EOF'
[commit message]

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
EOF
)"

# Push
git push

Step 4: Handle Push Failures

If push is rejected (remote has new commits):

git pull --rebase
# Re-run quality suite (rebase might introduce conflicts)
# If clean → push again
git push
# If merge conflicts → STOP, ask user

Step 5: Post-Ship

After successful push:

  • Run /sv to save session state
  • Update changelog if applicable
  • Report: SUCCESS: Shipped. [N] files changed, all checks passing.

Safety Rails

ConditionAction
5+ fix iterationsSTOP, report remaining issues
Same error 3 timesSTOP, needs different approach
Merge conflictsSTOP, ask for help
No changes to commitSkip, notify user
.env or secrets in diffWARN, exclude from staging
On wrong branch (per project convention)WARN before pushing

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.

Reviews can't be read right now.

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.