Add OS entries to .gitignore
Add the curated OS metadata and filesystem-artifact patterns for one or
more operating systems.
Step 1: Resolve which OS templates to apply
From arguments or the user's message:
| Target |
Template |
Recognize |
| macOS |
../../templates/macos.gitignore |
macos, mac, osx, darwin, apple |
| Windows |
../../templates/windows.gitignore |
windows, win |
| Linux |
../../templates/linux.gitignore |
linux, ubuntu, debian, fedora, wsl |
With no target given, detect the host with uname -s (Darwin → macOS,
Linux → Linux, MINGW*/MSYS*/CYGWIN* → Windows) and say which one
you picked.
Multiple targets are normal — a repository worked on from several
machines should carry all of them. Apply them in the order the user named
them (detected host first when detecting).
Step 2: Read the templates
Read each selected template verbatim. Do not paraphrase, reorder, or
trim its patterns and comments — the curation is the point.
Step 3: Merge
Follow ../../references/merge-procedure.md exactly: build the candidate
set, deduplicate within it and against the existing file, obey the
comment and structure rules, write, verify, report.
Canonical section headers: # --- macOS ---, # --- Windows ---,
# --- Linux ---.
OS-specific notes
- The Windows template deliberately omits
*.stackdump, *.msi,
*.cab, *.msix, *.msm, *.msp, and *.lnk. Offer them as
commented opt-ins only if the user mentions Cygwin, installer builds,
or committed shortcuts.
- The Linux template deliberately omits
*~ and *.swp. Those are
editor behavior, not Linux behavior — if the user wants them, point
them at a global ignore file (~/.config/git/ignore) rather than
adding them to the project.
- The macOS template covers modern metadata only; classic Mac OS 6–9
entries, quota files, and Time Machine backup directories are
intentionally absent.
$RECYCLE.BIN/ and .Trash-*/ contain a literal $ and *. Write
them exactly as the template has them.
Constraints
- Never modify an existing entry or its comment, except the exact-match
case defined in the merge procedure.
- Never add editor, IDE, or framework patterns here — this skill is OS
artifacts only.
- Never write a
.gitignore outside a Git repository.
1---2name: os3description: Add OS-specific entries (macOS, Windows, or Linux metadata and filesystem artifacts) to a .gitignore file.4argument-hint: Optional — macos, windows, linux (any combination). Defaults to the host OS.5disable-model-invocation: true6metadata:7 source: https://skillmd.com/skills/florianbuetow/os8---910# Add OS entries to .gitignore1112Add the curated OS metadata and filesystem-artifact patterns for one or13more operating systems.1415---1617## Step 1: Resolve which OS templates to apply1819From arguments or the user's message:2021| Target | Template | Recognize |22|--------|----------|-----------|23| macOS | `../../templates/macos.gitignore` | macos, mac, osx, darwin, apple |24| Windows | `../../templates/windows.gitignore` | windows, win |25| Linux | `../../templates/linux.gitignore` | linux, ubuntu, debian, fedora, wsl |2627With no target given, detect the host with `uname -s` (`Darwin` → macOS,28`Linux` → Linux, `MINGW*`/`MSYS*`/`CYGWIN*` → Windows) and say which one29you picked.3031Multiple targets are normal — a repository worked on from several32machines should carry all of them. Apply them in the order the user named33them (detected host first when detecting).3435---3637## Step 2: Read the templates3839Read each selected template verbatim. Do not paraphrase, reorder, or40trim its patterns and comments — the curation is the point.4142---4344## Step 3: Merge4546Follow `../../references/merge-procedure.md` exactly: build the candidate47set, deduplicate within it and against the existing file, obey the48comment and structure rules, write, verify, report.4950Canonical section headers: `# --- macOS ---`, `# --- Windows ---`,51`# --- Linux ---`.5253---5455## OS-specific notes5657- The Windows template deliberately omits `*.stackdump`, `*.msi`,58 `*.cab`, `*.msix`, `*.msm`, `*.msp`, and `*.lnk`. Offer them as59 commented opt-ins only if the user mentions Cygwin, installer builds,60 or committed shortcuts.61- The Linux template deliberately omits `*~` and `*.swp`. Those are62 editor behavior, not Linux behavior — if the user wants them, point63 them at a global ignore file (`~/.config/git/ignore`) rather than64 adding them to the project.65- The macOS template covers modern metadata only; classic Mac OS 6–966 entries, quota files, and Time Machine backup directories are67 intentionally absent.68- `$RECYCLE.BIN/` and `.Trash-*/` contain a literal `$` and `*`. Write69 them exactly as the template has them.7071---7273## Constraints7475- Never modify an existing entry or its comment, except the exact-match76 case defined in the merge procedure.77- Never add editor, IDE, or framework patterns here — this skill is OS78 artifacts only.79- Never write a `.gitignore` outside a Git repository.