GE

generate-gitignore

A tool to generate project-specific .gitignore files based on language and OS.

Install

mkdir -p .claude/skills/generate-gitignore && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/10787" && unzip -o skill.zip -d .claude/skills/generate-gitignore && rm skill.zip

Installs to .claude/skills/generate-gitignore

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

プロジェクト用の .gitignore ファイルを gitignore.io API で自動生成・更新する。 「.gitignore を作って」「gitignore を生成して」「無視するファイルを設定して」 「.gitignore を更新して」「Python 用の gitignore が欲しい」と言った場合にトリガーする。 プロジェクトの言語・OS・エディタに対応したテンプレートを取得し、プロジェクトルートに配置する。 initialize-project の一部としても呼び出される。
246 charsno explicit “when” trigger
Beginner

Key capabilities

  • Fetch gitignore templates via API
  • Generate .gitignore files
  • Merge custom rules with API output
  • Validate template names

How it works

It fetches templates from the gitignore.io API based on project language and OS, then appends custom project-specific rules.

Inputs & outputs

You give it
project language and OS
You get back
.gitignore file

When to use generate-gitignore

  • Generate a gitignore file
  • Update ignored files for a new project
  • Add custom templates to gitignore

About this skill

.gitignore 生成

gitignore.io(toptal)API を利用して .gitignore を生成する。

API リファレンス

  • ベース URL: https://www.toptal.com/developers/gitignore/api
  • テンプレート一覧: GET /list?format=lines(改行区切り)または ?format=json(JSON)
  • gitignore 生成: GET /<templates>(カンマ区切りで複数指定)

例: GET /node,visualstudiocode,windows → Node.js + VS Code + Windows 用の .gitignore を返す

手順

1. テンプレートの決定

settings.jsonproject.language から主要テンプレートを決定する。

言語マッピング

project.languagegitignore.io テンプレート
javascriptnode
typescriptnode
pythonpython
gogo
rustrust
javajava,maven,gradle
csharpcsharp,visualstudio
rubyruby
otherユーザーに確認

2. 追加テンプレートの収集

以下を自動追加する:

  • エディタ: visualstudiocode(常時追加)
  • OS: ユーザーの OS に応じて windows, macos, linux を追加

ユーザーに追加テンプレートが必要か確認する:

「追加の gitignore テンプレートはありますか?(例: terraform, dotenv, redis)」

3. テンプレートの検証

不明なテンプレート名が指定された場合、一覧を取得して近い候補を提示する:

curl -sL "https://www.toptal.com/developers/gitignore/api/list?format=lines"

PowerShell の場合:

Invoke-RestMethod "https://www.toptal.com/developers/gitignore/api/list?format=lines"

4. gitignore の生成

テンプレートをカンマ区切りで結合し、API から .gitignore の内容を取得する:

curl -sL "https://www.toptal.com/developers/gitignore/api/<templates>" -o .gitignore

PowerShell の場合:

$templates = "node,visualstudiocode,windows"
$content = Invoke-RestMethod "https://www.toptal.com/developers/gitignore/api/$templates"
Set-Content -Path ".gitignore" -Value $content -NoNewline

5. カスタムルールの追加

API 生成コンテンツの末尾に、プロジェクト共通のルールとプロジェクト固有のルールを追加する:


# === Worktree (always excluded) ===
.worktrees/

# === Project-specific rules ===
.env
.env.*
!.env.example

.worktrees/ は Git Worktree の作業ディレクトリであり、常に .gitignore に含める。 rules/worktree-layout.md で定義された配置規約に対応する。

ユーザーに追加ルールが必要か確認する。

6. 既存 .gitignore がある場合

.gitignore が既に存在する場合:

  1. 既存の内容を読み取る
  2. ユーザーに上書き・マージ・スキップを確認
  3. 上書き: API 出力で置き換え
  4. マージ: 既存のカスタムルールを保持し、API 出力を先頭に配置
  5. スキップ: 何もしない

完了メッセージ

✅ .gitignore を生成しました。
テンプレート: <templates>

When not to use it

  • Non-git projects

Prerequisites

curl or PowerShell

Limitations

  • Requires internet access for API calls

How it compares

It automates the retrieval and merging of standard templates instead of manually copying and pasting from online sources.

Compared to similar skills

generate-gitignore side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
generate-gitignore (this skill)05moCautionBeginner
resolve-conflicts818moReviewIntermediate
openspec-onboard106moReviewBeginner
codex-cli-bridge99moReviewIntermediate

Try saying

Example prompts that trigger this skill in your AI assistant.

Search skills

Search the agent skills registry