Ship — Safe Push to Remote
Trigger
User says "/ship", "ship it", "ship this", or "safe push".
For normal "push" or "commit this" — commit and push normally but still never commit secrets.
Purpose
Audited push for a PUBLIC repo. Prevents accidental secret leaks, catches files that shouldn't be public, and ensures clear commit messages. Think of it as checking your pockets before walking through the door.
Process
Step 1 — Pre-flight check
- Run
git status and git diff --staged (or git diff if nothing staged yet)
- Show the user a plain-English summary: what files changed, what the changes do, how many additions/deletions
- If nothing to commit, say so and stop
Step 2 — Secret scan
Scan every staged/changed file for these patterns:
API keys & tokens:
sk-ant-, sk- (Anthropic, OpenAI)
ghp_, gho_, github_pat_ (GitHub)
AKIA (AWS access key)
xoxb-, xoxp- (Slack)
whsec_ (Stripe webhook)
pk_live_, sk_live_, rk_live_ (Stripe)
Generic secret patterns:
API_KEY=, api_key=, apikey= followed by a value
SECRET=, secret= followed by a value
TOKEN=, token= followed by a value
PASSWORD=, password= followed by a value
PRIVATE_KEY followed by content
Bearer followed by a token (not in docs/examples)
Basic followed by encoded credentials
Dangerous files:
.env, .env.local, .env.production (even if gitignored — verify)
credentials.json, service-account.json, *.pem, *.key
- Files > 10MB (large binaries don't belong in git)
Production hazards:
- Hardcoded
http://localhost or http://127.0.0.1 in non-config, non-test files
If ANY match is found:
- STOP immediately. Do not push.
- Show the exact file, line, and matched pattern
- If the pattern is in
.env.example with placeholder values (like sk-ant-...), that's fine — skip it
- If a secret appears to have been committed in a prior commit, warn: "This secret is burned. Deleting it from code doesn't help — bots already scraped it. Rotate the key immediately."
Step 3 — Stage and commit
- If changes aren't staged yet, show which files will be staged and ask user to confirm
- Stage specific files (never
git add . or git add -A without reviewing)
- Write a clear commit message: imperative mood, what changed and why
- Show the commit message to user before committing
- Commit
Step 4 — Push
git push origin <current-branch>
- Never force push unless user explicitly requests it AND you warn what will be lost
- If push is rejected (remote has new commits), explain and offer
git pull --rebase first
Step 5 — Confirm
One line: Shipped: {commit message} → origin/{branch} ({N} files, +{additions} -{deletions})
Rules
- Never skip the secret scan — even for "just a quick fix"
- Never commit
.env, .env.local, credentials, or private key files
- Never force push without explicit user request + warning about consequences
.env.example with placeholder values is fine to commit
- If in doubt about a file, ask the user before staging
- This skill is portable — works for any git repo, not just this project
1---2name: ship3description: Ship — Safe Push to Remote4---5# Ship — Safe Push to Remote67## Trigger8User says "/ship", "ship it", "ship this", or "safe push".910For normal "push" or "commit this" — commit and push normally but still never commit secrets.1112## Purpose13Audited push for a PUBLIC repo. Prevents accidental secret leaks, catches files that shouldn't be public, and ensures clear commit messages. Think of it as checking your pockets before walking through the door.1415## Process1617### Step 1 — Pre-flight check181. Run `git status` and `git diff --staged` (or `git diff` if nothing staged yet)192. Show the user a **plain-English summary**: what files changed, what the changes do, how many additions/deletions203. If nothing to commit, say so and stop2122### Step 2 — Secret scan23Scan **every staged/changed file** for these patterns:2425**API keys & tokens:**26- `sk-ant-`, `sk-` (Anthropic, OpenAI)27- `ghp_`, `gho_`, `github_pat_` (GitHub)28- `AKIA` (AWS access key)29- `xoxb-`, `xoxp-` (Slack)30- `whsec_` (Stripe webhook)31- `pk_live_`, `sk_live_`, `rk_live_` (Stripe)3233**Generic secret patterns:**34- `API_KEY=`, `api_key=`, `apikey=` followed by a value35- `SECRET=`, `secret=` followed by a value36- `TOKEN=`, `token=` followed by a value37- `PASSWORD=`, `password=` followed by a value38- `PRIVATE_KEY` followed by content39- `Bearer ` followed by a token (not in docs/examples)40- `Basic ` followed by encoded credentials4142**Dangerous files:**43- `.env`, `.env.local`, `.env.production` (even if gitignored — verify)44- `credentials.json`, `service-account.json`, `*.pem`, `*.key`45- Files > 10MB (large binaries don't belong in git)4647**Production hazards:**48- Hardcoded `http://localhost` or `http://127.0.0.1` in non-config, non-test files4950**If ANY match is found:**51- **STOP immediately.** Do not push.52- Show the exact file, line, and matched pattern53- If the pattern is in `.env.example` with placeholder values (like `sk-ant-...`), that's fine — skip it54- If a secret appears to have been committed in a prior commit, warn: **"This secret is burned. Deleting it from code doesn't help — bots already scraped it. Rotate the key immediately."**5556### Step 3 — Stage and commit571. If changes aren't staged yet, show which files will be staged and ask user to confirm582. Stage specific files (never `git add .` or `git add -A` without reviewing)593. Write a clear commit message: imperative mood, what changed and why604. Show the commit message to user before committing615. Commit6263### Step 4 — Push641. `git push origin <current-branch>`652. **Never force push** unless user explicitly requests it AND you warn what will be lost663. If push is rejected (remote has new commits), explain and offer `git pull --rebase` first6768### Step 5 — Confirm69One line: `Shipped: {commit message} → origin/{branch} ({N} files, +{additions} -{deletions})`7071## Rules72- Never skip the secret scan — even for "just a quick fix"73- Never commit `.env`, `.env.local`, credentials, or private key files74- Never force push without explicit user request + warning about consequences75- `.env.example` with placeholder values is fine to commit76- If in doubt about a file, ask the user before staging77- This skill is portable — works for any git repo, not just this project