gitignore
Skill1 starsChanged 5 months agoMITView on GitHub
Analyze the codebase to understand its languages, frameworks, and tooling, then create or update the project's .gitignore with the right entries. Use when the user asks to "fix/update/generate the .gitignore", "what should I gitignore", "add ignore rules", "stop tracking node_modules/.env/build artifacts", or wants secrets and generated files kept out of version control. Understands the repo first, avoids duplicates, and flags already-tracked files that ignoring alone won't remove.
- Reads credentials
We split this skill into the rules it gives an agent
8 rules. 0 are common, 2 are distinctive, and 6 are very specific to this project.
0
Common
Most of the 3 edited versions we read keep these.
2
Distinctive
This author's own choices. Worth a look.
6
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- could be automatic: a setting could enforce it
- Very specific: line 33
Run git status --porcelain and git ls-files to see what's actually tracked vs untracked — this reveals junk that's currently committed (e.g.
- Very specific: line 44
Prefer canonical patterns (node_modules/, not node_modules/*).
- Very specific: line 47
When ignoring env files, keep the example: .env + .env.* but !.env.example.
- Distinctive: line 51
If none exists, create one.
- Distinctive: line 54
Keep it organized and commented so it stays maintainable.
- Very specific: line 69
If a secret (like a committed .env or key) is already in history, warn that removing it from tracking does NOT scrub git history — …
- Very specific: line 77
Don't clobber an existing .gitignore — merge, don't replace.
- Very specific: line 78
Don't ignore lockfiles or .example templates.
“Common” is measured: kept by at least 6 in 10 of the 3 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
.gitignore Builder
Understand the codebase first, then write a correct, well-organized
.gitignore. Do not paste a generic template blindly — base every entry on
something actually present in this repo.
Step 1 — Understand the codebase
Inspect the repo to learn what it's made of. Look for:
- Languages & package managers:
package.json(Node),requirements.txt/pyproject.toml/Pipfile(Python),go.mod(Go),Cargo.toml(Rust),pom.xml/build.gradle(Java/Kotlin),Gemfile(Ruby),composer.json(PHP),*.csproj/*.sln(.NET), etc. - Frameworks & build tools: React/Next/Vue/Vite, Django/Flask, Rails, Spring, webpack/rollup, etc. — each has signature output dirs.
- Generated / dependency dirs already on disk:
node_modules/,dist/,build/,.next/,target/,__pycache__/,venv/,.venv/,vendor/, coverage output, compiled binaries. - Secrets & local config:
.env,.env.*,*.pem,*.key, credential files, local DB files (*.sqlite,*.db). - Editor / OS noise:
.vscode/,.idea/,.DS_Store,Thumbs.db,*.swp. - Logs / caches / temp:
*.log,.cache/,tmp/,coverage/.
Also:
- Read the existing
.gitignore(if any) so you don't add duplicates and you respect its structure/comments. - Run
git status --porcelainandgit ls-filesto see what's actually tracked vs untracked — this reveals junk that's currently committed (e.g. a checked-innode_modules/or.env).
Step 2 — Decide what to ignore
Build the list from evidence, not assumptions:
- Include rules only for stacks/tools you actually detected.
- Group entries under clear
# commentheaders (e.g.# Node,# Python,# Secrets,# Editor,# OS). - Prefer canonical patterns (
node_modules/, notnode_modules/*). - Never ignore things that should be tracked: lockfiles (
package-lock.json,poetry.lock,Cargo.lock,go.sum),.env.exampletemplates, source config. When ignoring env files, keep the example:.env+.env.*but!.env.example.
Step 3 — Write the .gitignore
- If none exists, create one. If one exists, append/merge — keep the user's existing entries and comments, only add what's missing. Never silently delete their rules.
- Keep it organized and commented so it stays maintainable.
- Show the user the proposed additions (a short diff/summary) before or alongside writing, so they know what changed.
Step 4 — Flag already-tracked files (important)
Adding a pattern to .gitignore does not untrack files Git already tracks. If
Step 1 found tracked files that now match an ignore rule (e.g. a committed .env or
node_modules/), tell the user and offer the fix:
git rm -r --cached <path> # stop tracking, keep the local file
# then commit the removalIf a secret (like a committed .env or key) is already in history, warn that
removing it from tracking does NOT scrub git history — recommend rotating the secret
and, if needed, history-rewriting tools (git filter-repo, BFG).
Rules
- Evidence-based: every entry should correspond to something in this repo (or a near-certain artifact of a detected tool). Skip stacks that aren't present.
- Don't clobber an existing
.gitignore— merge, don't replace. - Don't ignore lockfiles or
.exampletemplates. - Surface (don't auto-run)
git rm --cachedfor already-tracked matches; let the user confirm before changing what's tracked.
Other versions4 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 4
- KhaledSaeed18/dotclaude★ 5same name
- Pradnyeshp/Claude-Skills★ 2same name
- jcsaaddupuy/badrobots★ 1same name
- sangre72/claude-skills★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository6 other files it gives its agents.
- optimizeSkill
- pdf-summarySkill
- pre-pushSkill
- qnaSkill
- security-auditSkill
- tidySkill
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

