Add language entries to .gitignore
Add the curated build-artifact, cache, and environment patterns for one
or more languages.
Step 1: Resolve which language templates to apply
| Target |
Template |
Recognize |
| Node.js |
../../templates/node.gitignore |
node, nodejs, npm, yarn, pnpm, javascript, js, typescript, ts |
| Python |
../../templates/python.gitignore |
python, py, django, flask, fastapi, jupyter |
| Java |
../../templates/java.gitignore |
java, maven, gradle |
| Kotlin |
../../templates/kotlin.gitignore |
kotlin, kt, kts |
| C |
../../templates/c.gitignore |
c, gcc, clang, make, cmake |
| Go |
../../templates/go.gitignore |
go, golang |
| Elixir |
../../templates/elixir.gitignore |
elixir, ex, mix, phoenix |
With no target given, detect from the repository root:
root=$(git rev-parse --show-toplevel) && ls "$root"/{package.json,pyproject.toml,setup.py,requirements.txt,pom.xml,build.gradle,build.gradle.kts,go.mod,mix.exs,Makefile,CMakeLists.txt} 2>/dev/null
For Java vs Kotlin, check which sources dominate:
git ls-files '*.kt' '*.kts' | head -5; git ls-files '*.java' | head -5
Say which languages you detected and why, in one line. Do not add a
template for a language with no evidence in the repository — an unused
template is noise that hides nothing.
Step 2: Read the templates
Read each selected template verbatim. Preserve its patterns, comments,
and the order of its negation blocks.
Step 3: Merge
Follow ../../references/merge-procedure.md exactly.
Canonical section headers: # --- Node.js ---, # --- Python ---,
# --- Java ---, # --- Kotlin ---, # --- C ---, # --- Go ---,
# --- Elixir ---.
Language templates overlap more than OS ones. The overlap table in
../../references/curation-notes.md lists what to expect — .env
blocks across Node/Python/Go, *.class and the Maven/Gradle blocks
across Java/Kotlin, *.so/*.dll/*.exe across C/Go. Each overlapping
entry is emitted once, under the first section that claims it.
Language-specific notes
- Node.js: lockfiles stay versioned.
dist/, build/, and out/
are not in the template because whether they are generated or
committed is project-specific — add them only on request, under their
own header. Framework outputs (.next/, .nuxt/, .svelte-kit/,
.docusaurus/) are likewise out of scope for the language template.
- Python:
/build/ and /dist/ are root-anchored on purpose, so a
src/mypkg/build/ source directory is not hidden. .python-version
is not ignored — it is repo policy in some projects.
- Java / Kotlin:
**/build/ pairs with !**/src/**/build/, and the
Gradle wrapper negations must stay. Generic *.jar is omitted —
repositories legitimately contain vendored libraries and wrapper
binaries.
- C: broad names (
*.map, *.out, bare build/) are omitted
because they often describe real project data. The kernel-module
patterns are narrow on purpose — .*.cmd matches the dot-prefixed
files the kernel build generates, not a project's gradlew.cmd or
build.cmd. *.mod collides with Go's go.mod: when both templates
are selected, emit !go.mod right after it (see the conflict table in
../../references/curation-notes.md). Build-system directories
(cmake-build-*, Autotools output) go in their own section, on
request.
- Go:
go.mod, go.sum, vendor/, go.work, and go.work.sum
stay versioned. A project that treats go.work as developer-local
can add those two lines explicitly. *.out is the one broad pattern
kept on purpose — it is go test coverage output — so check for
golden files first (git ls-files '*.out') and say so if the pattern
would hide testdata/*.out.
- Elixir:
mix.lock stays versioned for applications. A library
with a different release policy can ignore it on request. /doc/ is
ExDoc output, but some repositories keep hand-written docs there —
check git ls-files doc/ first and flag the conflict instead of
hiding tracked documentation.
Constraints
- Never modify an existing entry or its comment, except the exact-match
case defined in the merge procedure.
- Never add a framework or build-system pattern to a language section —
give it its own header so the distinction stays visible.
- Never ignore lockfiles, manifests, or the Gradle wrapper without the
user explicitly confirming (see the merge procedure's hazard list).
- Never write a
.gitignore outside a Git repository.
1---2name: language3description: Add programming-language-specific entries (Node.js, Python, Java, Kotlin, C, Go, or Elixir build artifacts and tool caches) to a .gitignore file.4argument-hint: Optional — node, python, java, kotlin, c, go, elixir (any combination). Defaults to languages detected from project manifests.5disable-model-invocation: true6metadata:7 source: https://skillmd.com/skills/florianbuetow/language8---910# Add language entries to .gitignore1112Add the curated build-artifact, cache, and environment patterns for one13or more languages.1415---1617## Step 1: Resolve which language templates to apply1819| Target | Template | Recognize |20|--------|----------|-----------|21| Node.js | `../../templates/node.gitignore` | node, nodejs, npm, yarn, pnpm, javascript, js, typescript, ts |22| Python | `../../templates/python.gitignore` | python, py, django, flask, fastapi, jupyter |23| Java | `../../templates/java.gitignore` | java, maven, gradle |24| Kotlin | `../../templates/kotlin.gitignore` | kotlin, kt, kts |25| C | `../../templates/c.gitignore` | c, gcc, clang, make, cmake |26| Go | `../../templates/go.gitignore` | go, golang |27| Elixir | `../../templates/elixir.gitignore` | elixir, ex, mix, phoenix |2829With no target given, detect from the repository root:3031```bash32root=$(git rev-parse --show-toplevel) && ls "$root"/{package.json,pyproject.toml,setup.py,requirements.txt,pom.xml,build.gradle,build.gradle.kts,go.mod,mix.exs,Makefile,CMakeLists.txt} 2>/dev/null33```3435For Java vs Kotlin, check which sources dominate:3637```bash38git ls-files '*.kt' '*.kts' | head -5; git ls-files '*.java' | head -539```4041Say which languages you detected and why, in one line. Do not add a42template for a language with no evidence in the repository — an unused43template is noise that hides nothing.4445---4647## Step 2: Read the templates4849Read each selected template verbatim. Preserve its patterns, comments,50and the order of its negation blocks.5152---5354## Step 3: Merge5556Follow `../../references/merge-procedure.md` exactly.5758Canonical section headers: `# --- Node.js ---`, `# --- Python ---`,59`# --- Java ---`, `# --- Kotlin ---`, `# --- C ---`, `# --- Go ---`,60`# --- Elixir ---`.6162Language templates overlap more than OS ones. The overlap table in63`../../references/curation-notes.md` lists what to expect — `.env`64blocks across Node/Python/Go, `*.class` and the Maven/Gradle blocks65across Java/Kotlin, `*.so`/`*.dll`/`*.exe` across C/Go. Each overlapping66entry is emitted once, under the first section that claims it.6768---6970## Language-specific notes7172- **Node.js**: lockfiles stay versioned. `dist/`, `build/`, and `out/`73 are not in the template because whether they are generated or74 committed is project-specific — add them only on request, under their75 own header. Framework outputs (`.next/`, `.nuxt/`, `.svelte-kit/`,76 `.docusaurus/`) are likewise out of scope for the language template.77- **Python**: `/build/` and `/dist/` are root-anchored on purpose, so a78 `src/mypkg/build/` source directory is not hidden. `.python-version`79 is not ignored — it is repo policy in some projects.80- **Java / Kotlin**: `**/build/` pairs with `!**/src/**/build/`, and the81 Gradle wrapper negations must stay. Generic `*.jar` is omitted —82 repositories legitimately contain vendored libraries and wrapper83 binaries.84- **C**: broad names (`*.map`, `*.out`, bare `build/`) are omitted85 because they often describe real project data. The kernel-module86 patterns are narrow on purpose — `.*.cmd` matches the dot-prefixed87 files the kernel build generates, not a project's `gradlew.cmd` or88 `build.cmd`. `*.mod` collides with Go's `go.mod`: when both templates89 are selected, emit `!go.mod` right after it (see the conflict table in90 `../../references/curation-notes.md`). Build-system directories91 (`cmake-build-*`, Autotools output) go in their own section, on92 request.93- **Go**: `go.mod`, `go.sum`, `vendor/`, `go.work`, and `go.work.sum`94 stay versioned. A project that treats `go.work` as developer-local95 can add those two lines explicitly. `*.out` is the one broad pattern96 kept on purpose — it is `go test` coverage output — so check for97 golden files first (`git ls-files '*.out'`) and say so if the pattern98 would hide `testdata/*.out`.99- **Elixir**: `mix.lock` stays versioned for applications. A library100 with a different release policy can ignore it on request. `/doc/` is101 ExDoc output, but some repositories keep hand-written docs there —102 check `git ls-files doc/` first and flag the conflict instead of103 hiding tracked documentation.104105---106107## Constraints108109- Never modify an existing entry or its comment, except the exact-match110 case defined in the merge procedure.111- Never add a framework or build-system pattern to a language section —112 give it its own header so the distinction stays visible.113- Never ignore lockfiles, manifests, or the Gradle wrapper without the114 user explicitly confirming (see the merge procedure's hazard list).115- Never write a `.gitignore` outside a Git repository.