cleaning-repos
Leaves a repo in a pristine state — commits all changes cleanly, prompts about leftover files, clears stale stashes, opens a PR if on a feature branch, cleans up merged branches and stale worktrees, and returns to main. Use when the user says "clean up the repo", "wrap up this branch", "tidy up", or wants to get back to a clean main branch after finishing work.
What this skill does
# Clean Repo
Get the repo into a clean, shippable state in one pass.
## Current context
- Branch: !`git branch --show-current`
- Status: !`git status --short`
- Worktrees: !`git worktree list`
- Stashes: !`git stash list`
## Decision tree
- What's the state?
- **Dirty working tree** -> start at "Step 1: Commit everything"
- **Clean tree, on a feature branch** -> start at "Step 3: Clear stashes"
- **Clean tree, on main** -> start at "Step 4: Open a PR" (skip to Step 5 if no other branches)
- **Everything is already clean** -> tell the user, done
## Step 1: Commit everything
Use the `creating-commits` skill to commit all working changes. Route through its decision tree — if changes are mixed concerns, use its multi-commit split or repo cleanup flow to produce line-level clean commits.
After committing, run `git status` to check for leftover files.
## Step 2: Handle leftover files
Run `git status` and look for untracked or ignored files that seem out of place. Categorize them:
- **Generated files** that should be gitignored (build output, `.DS_Store`, `node_modules`, `*.log`) -> add to `.gitignore` and commit
- **Clearly intentional files** that belong in the repo -> stage and commit
- **Ambiguous files** you're not sure about -> ask the user
For ambiguous files, use `AskUserQuestion` with options per file (or group of similar files):
- **Commit it** — stage and commit with an appropriate message
- **Add to .gitignore** — add the pattern and commit the .gitignore change
- **Delete it** — remove the file
- **Leave it** — skip, the user will deal with it later
Keep going until `git status` shows a clean working tree (or only intentionally skipped files).
## Step 3: Clear stashes
Run `git stash list`. If there are stashes, check each one:
```bash
git stash show -p stash@{N}
```
For each stash, check whether its changes already exist in the current codebase. Compare the stash diff against the current state of the files it touches — if the changes are already present (committed or in the working tree), the stash is stale.
- **Stash changes already in the codebase** -> drop it silently, it's obsolete
- **Stash changes NOT in the codebase** -> ask the user with `AskUserQuestion`:
- **Apply and commit** — apply the stash, commit the changes, drop the stash
- **Drop it** — discard the stash
- **Keep it** — leave it for now
## Step 4: Open a PR
Only do this if on a branch other than `main` or `master`.
Use the `creating-prs` skill. It handles rebasing onto main, checking for PR templates and contributing guides, and creating the PR.
## Step 5: Clean up branches and worktrees
### 5a. Prune stale worktrees
```bash
git worktree prune
```
Then list remaining worktrees with `git worktree list`. For any linked worktrees (not the main one) where the branch has been merged or deleted on the remote, remove them:
```bash
git worktree remove <path>
```
If a worktree has uncommitted changes, warn the user and skip it — don't force-remove.
### 5b. Delete merged branches
Fetch and prune remote tracking branches:
```bash
git fetch --prune
```
Find local branches that have been merged into main:
```bash
git branch --merged main
```
Delete each merged branch (except `main`/`master` and the current branch):
```bash
git branch -d <branch>
```
If a branch isn't merged but its remote counterpart is gone (deleted after PR merge), it's likely safe to delete — but ask the user first with `AskUserQuestion` listing the branch names and offering to delete or keep each one.
## Step 6: Return to main
If not already on `main` (or `master`):
```bash
git checkout main
git pull
```
## Step 7: Garbage collect
Run git garbage collection to clean up dangling objects left behind by branch deletions, rebases, and dropped stashes:
```bash
git gc
```
This repacks objects and removes unreachable ones. Safe to run — it only cleans up what's already orphaned.
## Done
Run a final `git status`, `git branch`, and `git stash list` to confirm everything is clean. Report what was done:
- Commits created
- Stashes cleared
- PR opened (with URL)
- Branches deleted
- Worktrees cleaned
Related in General
modeling-omnistudio-epc-catalog
IncludedSalesforce Industries CME EPC product-modeling skill for Product2-based catalog creation. Use when creating EPC products, configuring product attributes, building offer bundles with Product Child Items, or reviewing EPC DataPack JSON metadata for product catalog changes. TRIGGER when: user creates or updates Product2 EPC records, AttributeAssignment payloads, AttributeMetadata/AttributeDefaultValues, Offer bundles, or ProductChildItem relationships. DO NOT TRIGGER when: designing OmniScripts/FlexCards/Integration Procedures (use building-omnistudio-omniscript, building-omnistudio-flexcard, or building-omnistudio-integration-procedure), implementing Apex business logic (use generating-apex), or troubleshooting deployment pipelines (use deploying-metadata).
relationship-science-coach
IncludedUse this skill for direct, practical adult relationship coaching: couples conflict, repair, trust, marriage, dating, flirting, attachment patterns, emotional connection, sex, desire differences, eroticism, kink negotiation, affection, love languages, breakups, and long-term passion. Draw on Gottman, EFT and Hold Me Tight, attachment science, modern sex research, Perel, Nagoski, Kerner, Schnarch, Love and Stosny, and flexible love-language tools. Be concrete and low-hedge. Redirect only for imminent danger, abuse, coercive control, minors, non-consent, self-harm, stalking, or medical/legal/psychiatric decisions.
building-sf-integrations
IncludedSalesforce integration architecture and runtime plumbing with 120-point scoring. Use this skill to set up Named Credentials, External Credentials, External Services, REST/SOAP callout patterns, Platform Events, and Change Data Capture. TRIGGER when: user sets up Named Credentials, External Services, REST/SOAP callouts, Platform Events, CDC, or touches .namedCredential-meta.xml files. DO NOT TRIGGER when: Connected App/OAuth config (use configuring-connected-apps), Apex-only logic (use generating-apex), or data import/export (use handling-sf-data).
venue-templates
IncludedAccess comprehensive LaTeX templates, formatting requirements, and submission guidelines for major scientific publication venues (Nature, Science, PLOS, IEEE, ACM), academic conferences (NeurIPS, ICML, CVPR, CHI), research posters, and grant proposals (NSF, NIH, DOE, DARPA). This skill should be used when preparing manuscripts for journal submission, conference papers, research posters, or grant proposals and need venue-specific formatting requirements and templates.
let-fate-decide
IncludedDraws the 12 Houses of the Zodiac Tarot spread to inject entropy into planning when prompts are vague, ambiguous, or casually delegated. Interprets the spread to guide next steps. Use when the user says 'let fate decide', 'YOLO', 'whatever', 'idk', or other nonchalant phrases, makes Yu-Gi-Oh references, or when you are about to arbitrarily pick between multiple reasonable approaches. Prefer over ask-questions-if-underspecified when the user's tone is casual or playful rather than precision-seeking.
net-ops
IncludedCross-platform network troubleshooting (Windows, macOS, Linux) via local or remote shell. Use for: DNS broken, can't resolve hostnames, nslookup/dig works but apps fail, NRPT, WFP, scutil, /etc/resolver, systemd-resolved, /etc/resolv.conf, NetworkManager, VPN DNS leak residue (ProtonVPN/Mullvad/WireGuard/AnyConnect), AV/firewall blocking DNS or DoH, Tailscale DNS interaction, intermittent connectivity, remote diagnostics over SSH.