git-safety
Apply critical git safety protocols before any git operations, especially in collaborative environments. Use when performing git commands, managing files, or making destructive changes.
What this skill does
# Git Safety Skill Apply rigorous git safety protocols to prevent data loss and conflicts in collaborative development environments, particularly when multiple agents or developers work concurrently. ## Core Safety Principles ### File Management Rules **Deleting Files:** - โ ๏ธ **STOP before deleting any file to resolve type/lint failures** - Ask the user first - Only remove obsolete files when changes make them genuinely irrelevant - Only revert your own work or changes explicitly requested by the user - **Coordinate with teammates before removing in-progress edits** - Never assume a file is safe to delete without confirmation **File Modifications:** - Always verify file ownership and recent changes before modifying - Check `git log <file>` to see who last edited - Communicate before making sweeping changes to shared files ### Environment & Configuration Safety **Critical: Environment Files** - ๐ซ **NEVER edit `.env` or any environment variable files** - Only the user may change environment configurations - This includes `.env`, `.env.local`, `.env.production`, etc. - If environment changes are needed, inform the user - never make them yourself **Git Configuration:** - Never modify `.gitconfig` or repository git settings - Never amend commits without explicit written approval - Preserve existing git hooks and configurations ## Destructive Operations - Extreme Caution Required ### Absolutely Forbidden Without Explicit Permission ๐จ **ABSOLUTELY NEVER run these operations unless the user gives explicit, written instruction:** - `git reset --hard` - Destroys uncommitted work permanently - `git checkout <old-commit>` - Can lose current work - `git restore --source=<old-commit>` - Reverts to old state, losing changes - `rm -rf` - Irreversible file deletion - `git push --force` - Overwrites remote history - `git rebase` without safeguards - Can lose commits - `git clean -fd` - Deletes untracked files permanently ### What Requires User Approval Before running these commands, **STOP and ask the user explicitly:** 1. Any command that can lose uncommitted changes 2. Force pushing to remote repositories 3. Rebasing published branches 4. Amending pushed commits 5. Deleting branches (local or remote) 6. Hard resets of any kind 7. File deletions to fix build errors ## Safe Workflow Standards ### Before Any Commit **Pre-commit Checklist:** 1. Run `git status` to verify exactly what's being committed 2. Use explicit file paths - never `git add .` or `git add -A` blindly 3. Ensure only modified/intended files are staged 4. Review diffs with `git diff --staged` 5. Keep commits atomic (focused on one logical change) **Example - Safe Commit:** ```bash # Good: Explicit, verified, atomic git status git add src/components/Button.tsx src/components/Button.test.tsx git diff --staged git commit -m "feat: add disabled state to Button component" ``` **Example - Unsafe Commit:** ```bash # Bad: No verification, adds everything git add . git commit -m "fixes" ``` ### Path Handling **Quote Special Characters:** - Always quote paths with brackets, parentheses, or spaces - Use double quotes to prevent shell interpretation ```bash # Good git add "src/utils/parse(data).ts" git add "src/components/[id].tsx" # Bad - shell may misinterpret git add src/utils/parse(data).ts git add src/components/[id].tsx ``` ### Rebase Safety When rebasing is necessary: ```bash # Suppress editor prompts GIT_SEQUENCE_EDITOR=true git rebase <branch> # Or set environment variable export GIT_SEQUENCE_EDITOR=true git rebase main ``` ## Coordination in Collaborative Environments ### Before Major Changes **Communication First:** 1. Check who else is working on related files: `git log --since="1 day ago" --oneline` 2. Announce intention to make sweeping changes 3. Wait for confirmation before proceeding 4. Coordinate timing of force pushes or rebases ### Conflict Prevention **Proactive Coordination:** - Pull frequently: `git pull --rebase` - Communicate when working on shared files - Use feature branches to isolate work - Merge main frequently to stay current ## Decision Tree for Destructive Operations ``` Are you about to run a destructive git command? โโ YES โ Is there explicit written user approval? โ โโ YES โ Proceed carefully, verify twice โ โโ NO โ STOP. Ask user for permission first. โโ NO โ Proceed with normal safety checks ``` ## Common Scenarios ### Scenario 1: Type Error in File **Wrong Approach:** ```bash # โ Delete file to fix error rm src/components/BrokenComponent.tsx ``` **Right Approach:** ```bash # โ Stop and ask user # "I see a type error in BrokenComponent.tsx. # Should I fix the error or is this file obsolete?" ``` ### Scenario 2: Need to Reset Changes **Wrong Approach:** ```bash # โ Hard reset without asking git reset --hard HEAD ``` **Right Approach:** ```bash # โ Ask first, then use safer methods git stash # Preserves work # OR git checkout -b backup-branch # Creates backup ``` ### Scenario 3: Multiple Agents Working **Wrong Approach:** ```bash # โ Force push over teammate's work git push --force ``` **Right Approach:** ```bash # โ Coordinate first # "I need to force push to fix history. # Is anyone else working on this branch?" ``` ## Safety Verification Commands **Before Destructive Operations:** ```bash # Check what will be affected git status git log --oneline -n 10 git diff HEAD # See who's been working recently git log --since="1 day ago" --all --oneline # Check remote status git fetch git status ``` ## Environment File Protection **Files to NEVER modify:** - `.env` - `.env.local` - `.env.development` - `.env.production` - `.env.test` - Any file matching `.env.*` **If environment changes are needed:** 1. Stop immediately 2. Inform the user exactly what needs to change 3. Let the user make the modification 4. Never assume or guess environment values ## Summary - The Golden Rules 1. ๐ **STOP before deleting files** to fix build errors 2. ๐ซ **NEVER touch environment files** - user only 3. โ ๏ธ **Get explicit permission** for destructive git operations 4. โ **Verify with git status** before every commit 5. ๐ **Use explicit paths** - never blindly add all files 6. ๐ **Quote special characters** in file paths 7. ๐ค **Coordinate with teammates** before major changes 8. ๐พ **When in doubt, ask** - communication over assumption ## When This Skill Applies Invoke this skill when: - About to run any git command - Considering deleting a file - Planning to modify shared files - Encountering build/type errors that might be "fixed" by deletion - Working in an environment where others might be active - Unsure if an operation is safe **Default stance: Cautious and communicative. Preserve work, ask questions, coordinate changes.**
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.