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.
From vp-gitignore-buildernpx claudepluginhub vdustr/vp-claude-code-marketplace --plugin vp-gitignore-builderThis skill uses the workspace's default tool permissions.
references/examples.mdGuides Next.js Cache Components and Partial Prerendering (PPR) with cacheComponents enabled. Implements 'use cache', cacheLife(), cacheTag(), revalidateTag(), static/dynamic optimization, and cache debugging.
Migrates code, prompts, and API calls from Claude Sonnet 4.0/4.5 or Opus 4.1 to Opus 4.5, updating model strings on Anthropic, AWS, GCP, Azure platforms.
Analyzes BMad project state from catalog CSV, configs, artifacts, and query to recommend next skills or answer questions. Useful for help requests, 'what next', or starting BMad.
Build and merge .gitignore files using templates from github/gitignore with smart project detection.
Invoke this skill when:
/gitignore or asks to create/update a .gitignoregit init or a newly cloned repo without .gitignoregit status output with files that should typically be ignored (e.g., node_modules/, .env, __pycache__/, *.log).git directory to determine repo root.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 |
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 |
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:
Use the merge-gitignore.sh script located at ${CLAUDE_PLUGIN_ROOT}/scripts/merge-gitignore.sh:
"${CLAUDE_PLUGIN_ROOT}/scripts/merge-gitignore.sh" Node Python macOS
Merge Order (later entries have higher priority in gitignore):
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.
If target .gitignore already exists, show a 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]
After user confirms, write the file and report success:
ā
Created /path/to/repo/.gitignore (150 lines, 3 templates merged)
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.
When discussing or modifying gitignore:
!important.log re-includes important.log.# are comments./ matches only directories (e.g., build/).* matches anything except /, ** matches everything including /.Templates section must be wrapped with START/END markers:
# āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
# ā 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:
If merging with an existing .gitignore, preserve user-added content in the appropriate section:
# āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
# ā 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
The merge-gitignore.sh script handles:
Usage:
# Fetch and merge templates
"${CLAUDE_PLUGIN_ROOT}/scripts/merge-gitignore.sh" <template1> [template2] ...
# Templates can be:
# - Top-level: Node, Python, Rust, Go, etc.
# - Global: Global/macOS, Global/VisualStudioCode, etc.
Exit Codes:
| Code | Meaning |
|---|---|
| 0 | Success |
| 1 | Network error (failed to fetch) |
| 2 | EOL conflict detected (info in stderr) |