gitignore-builder
Build and merge .gitignore files using github/gitignore templates with smart project detection. Use when the user asks to "create gitignore", "build .gitignore", "add gitignore templates", "set up gitignore", "update gitignore", or requests "/gitignore". Also trigger when observing projects without .gitignore, seeing untracked files like node_modules/, .env, __pycache__/, or *.log in git status, or after git init in a new repo. Boundary: not for .dockerignore or other non-git ignore files.
What this skill does
# Gitignore Builder Build and merge `.gitignore` files using templates from [github/gitignore](https://github.com/github/gitignore) with smart project detection. ## When to Use Invoke this skill when: - User explicitly requests `/gitignore` or asks to create/update a `.gitignore` - Detecting `git init` or a newly cloned repo without `.gitignore` - User mentions ignoring files, not wanting to track certain files - Observing `git status` output with files that should typically be ignored (e.g., `node_modules/`, `.env`, `__pycache__/`, `*.log`) ## Workflow ### Step 1: Determine Target Location 1. Find the nearest `.git` directory to determine repo root 2. If no `.git` found, ask user if they want to create a global gitignore at `~` **Location Rules:** | Situation | Action | |-----------|--------| | Inside a repo, project-level requested | Use repo root (where `.git` is) | | Inside a repo, global requested | Warn: "Global gitignore is recommended at `~/.gitignore`. You're currently inside a repo. Proceed here anyway?" | | Not in a repo | Suggest creating global gitignore at `~/.gitignore` | ### Step 2: Detect Project Type **For project-level gitignore (basic detection):** | Indicator File | Template | |----------------|----------| | `package.json` | Node.gitignore | | `requirements.txt`, `pyproject.toml`, `setup.py`, `Pipfile` | Python.gitignore | | `Cargo.toml` | Rust.gitignore | | `go.mod` | Go.gitignore | | `composer.json` | Composer.gitignore | | `Gemfile` | Ruby.gitignore | | `pom.xml` | Maven.gitignore | | `build.gradle`, `build.gradle.kts` | Gradle.gitignore | | `*.swift`, `Package.swift` | Swift.gitignore | | `*.csproj`, `*.sln` | VisualStudio.gitignore | | `CMakeLists.txt` | CMake.gitignore | | `Makefile` with C/C++ files | C.gitignore or C++.gitignore | **For global gitignore (environment-aware detection):** | Detection Method | Template (from Global/) | |------------------|-------------------------| | `uname` = Darwin | macOS.gitignore | | `uname` = Linux | Linux.gitignore | | Windows environment | Windows.gitignore | | `.vscode/` exists or `code` command available | VisualStudioCode.gitignore | | `.idea/` exists | JetBrains.gitignore | | `vim` or `nvim` available | Vim.gitignore | | `emacs` available | Emacs.gitignore | ### Step 3: Present Recommendations Show detected templates and ask for confirmation: ``` Detected project root: /path/to/repo Found indicators: package.json, .vscode/ Recommended templates: - Node.gitignore - VisualStudioCode.gitignore (for global) Proceed with these templates? [Y/n/edit] ``` Allow user to: - Confirm (Y) - Cancel (n) - Edit the list (add/remove templates) ### Step 4: Fetch and Merge Use the bundled `scripts/merge-gitignore.sh` script from this skill directory: ```bash scripts/merge-gitignore.sh Node Python macOS ``` **Merge Order (later entries have higher priority in gitignore):** 1. **Templates section** - github/gitignore templates with START/END markers (easiest to replace/update) 2. **Local files section** - Project-specific ignores 3. **Overrides section** - Custom overrides with highest priority (last wins in gitignore) ### Step 5: Handle EOL Conflicts If the script detects mixed line endings: ``` โ ๏ธ EOL inconsistency detected: - Node.gitignore: LF - VisualStudio.gitignore: CRLF - Existing .gitignore: LF Choose unified format: 1. LF (Unix/macOS) - recommended 2. CRLF (Windows) 3. Keep as-is (no conversion) ``` Wait for user confirmation before proceeding. ### Step 6: Show Diff Preview If target `.gitignore` already exists, show a diff: ```diff ๐ Will write to: /path/to/repo/.gitignore --- Existing content +++ Merged content @@ -1,5 +1,60 @@ +# โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ +# โ START - github/gitignore templates โ +# โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ + +# -------------------------------------------- +# Source: Node.gitignore +# -------------------------------------------- +node_modules/ +... + +# โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ +# โ END - github/gitignore templates โ +# โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ + +# ============================================ +# Local files (project-specific ignores) +# ============================================ + +# ============================================ +# Overrides (highest priority - last wins) +# ============================================ + # User custom rules my-custom-file.txt Confirm write? [Y/n] ``` ### Step 7: Write File After user confirms, write the file and report success: ``` โ Created /path/to/repo/.gitignore (150 lines, 3 templates merged) ``` ## Important Notes ### Always Recommend *.local Pattern At the end of every gitignore generation, suggest: ``` ๐ก Tip: Consider adding these patterns for local configuration files: *.local *.local.* These patterns prevent accidentally committing local overrides. ``` ### Gitignore Syntax Reminders When discussing or modifying gitignore: - **Negation**: The exclamation mark prefix negates a pattern, re-including previously excluded files. Order is important: the negation must come after the exclusion. Example: `!important.log` re-includes `important.log`. - **Order matters**: Later patterns override earlier ones. - **Comments**: Lines starting with `#` are comments. - **Directory**: Trailing `/` matches only directories (e.g., `build/`). - **Wildcards**: `*` matches anything except `/`, `**` matches everything including `/`. ### Source Attribution & Structure Templates section must be wrapped with START/END markers: ```gitignore # โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ # โ github/gitignore templates โ # โ https://github.com/github/gitignore โ # โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฃ # โ START - Do not edit this section manually โ # โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ # -------------------------------------------- # Source: Node.gitignore # -------------------------------------------- node_modules/ ... # โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ # โ END - github/gitignore templates โ # โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ ``` This makes it easy to: - Identify template content for updates (replace between START/END) - Understand where each rule comes from - Avoid accidental edits to generated content ### Preserve User Content If merging with an existing `.gitignore`, preserve user-added content in the appropriate section: ```gitignore # โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ # โ START - github/gitignore templates โ # โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ # -------------------------------------------- # Source: Node.gitignore # -------------------------------------------- node_modules/ ... # โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ # โ END - github/gitignore templates โ # โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ # ============================================ # Local files (project-specific ignores) # ============================================ secret-folder/ local-config.json # ============================================ # Overrides (highest priority - last wins) # ============================================ # User custom rules (preserved from original) my-custom-rule.txt !important.log ``` ## Reference Files - **[examples.md](references/examples.md)** - Detailed workflow examples
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.