Coding

Gitignore Sync

Generate repo-aware `.gitignore` rules while preserving custom sections outside a managed block.

What it does

Generate or update `.gitignore` rules from the user’s requested templates, repository files and folders, and gitignore.io. A Python script writes the combined rules into a managed block, preserves manual sections outside that block, and supports repeat runs or offline testing with a local rules file.

When to use it

  • Creating `.gitignore` for a new repository
  • Adding rules for named tools and frameworks
  • Refreshing generated rules without replacing custom entries
  • Testing ignore rules in an offline environment

The skill document

Gitignore Sync

Generate high-confidence .gitignore rules from real repo signals and gitignore.io, then update safely via a managed block so manual rules stay untouched.

Execution Rule

Use scripts/update_gitignore.py as the only execution path. Do not fetch from the API directly in ad-hoc commands. Do not manually compose or rewrite .gitignore when this skill is selected.

Workflow

  1. Infer requested templates from the user prompt.
  2. Detect likely templates from repository files and folders.
  3. Run scripts/update_gitignore.py with --prompt-text and/or --services.
  4. Let the script fetch combined template rules from https://www.toptal.com/developers/gitignore/api/.
  5. Let the script write or update a managed block in .gitignore.
  6. Preserve non-managed user sections in .gitignore.

Run

From the target repository root, run:

python3 /scripts/update_gitignore.py \
  --prompt-text "create .gitignore for flutter firebase vscode" \
  --repo .

Use explicit templates when the user names exact services:

python3 /scripts/update_gitignore.py \
  --services flutter,firebase,visualstudiocode \
  --repo .

Notes

  • Prefer passing both --prompt-text and --services when available.
  • Keep manual custom rules outside the managed block markers.
  • Re-run safely; the script replaces only the managed block.
  • Use --rules-file for offline/local testing when network access is blocked.

Questions people ask

How does it choose which gitignore templates to use?
It infers templates from the user prompt and detects likely templates from repository files and folders. Exact services can also be passed explicitly, with both prompt text and service names preferred when available.
Will it overwrite my custom `.gitignore` rules?
The script replaces only its managed block and preserves non-managed sections. Manual custom rules should remain outside the managed block markers.
Can it run without network access?
Yes. Use `--rules-file` for offline or local testing; otherwise, the script fetches combined template rules from the gitignore.io API hosted by Toptal.

Related skills

Mirror Google Calendar events as private Busy holds to reduce double-booking across calendars.

52 installs2 stars

Write, repair, and convert Markdown for a specific renderer while preserving clean, reviewable diffs.

296 installs7 stars

Build, debug, and review Vue 3 code across reactivity, components, state, routing, forms, and performance.

121 installs8 stars

Upload images and embed their hosted URLs in GitHub PRs, issues, comments, and README files.

61 installs1 stars

Automate and troubleshoot Google Workspace operations from the terminal with gws.

by Iván68 installs

Plan and run a staged open-source launch and GitHub star growth loop.

70 installs