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.zipInstalls 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 の一部としても呼び出される。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
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.json の project.language から主要テンプレートを決定する。
言語マッピング
project.language | gitignore.io テンプレート |
|---|---|
javascript | node |
typescript | node |
python | python |
go | go |
rust | rust |
java | java,maven,gradle |
csharp | csharp,visualstudio |
ruby | ruby |
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 が既に存在する場合:
- 既存の内容を読み取る
- ユーザーに上書き・マージ・スキップを確認
- 上書き: API 出力で置き換え
- マージ: 既存のカスタムルールを保持し、API 出力を先頭に配置
- スキップ: 何もしない
完了メッセージ
✅ .gitignore を生成しました。
テンプレート: <templates>
When not to use it
- →Non-git projects
Prerequisites
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.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| generate-gitignore (this skill) | 0 | 5mo | Caution | Beginner |
| resolve-conflicts | 81 | 8mo | Review | Intermediate |
| openspec-onboard | 10 | 6mo | Review | Beginner |
| codex-cli-bridge | 9 | 9mo | Review | Intermediate |
Try saying
Example prompts that trigger this skill in your AI assistant.
More by nanikasheila
View all by nanikasheila →You might also like
resolve-conflicts
antinomyhq
Use this skill immediately when the user mentions merge conflicts that need to be resolved. Do not attempt to resolve conflicts directly - invoke this skill first. This skill specializes in providing a structured framework for merging imports, tests, lock files (regeneration), configuration files, and handling deleted-but-modified files with backup and analysis.
openspec-onboard
studyzy
Guided onboarding for OpenSpec - walk through a complete workflow cycle with narration and real codebase work.
codex-cli-bridge
alirezarezvani
Bridge between Claude Code and OpenAI Codex CLI - generates AGENTS.md from CLAUDE.md, provides Codex CLI execution helpers, and enables seamless interoperability between both tools
skill-sync
KyleKing
Syncs Claude Skills with other AI coding tools like Cursor, Copilot, and Codeium by creating cross-references and shared knowledge bases. Invoke when user wants to leverage skills across multiple tools or create unified AI context.
github-workflow-automation
ruvnet
Advanced GitHub Actions workflow automation with AI swarm coordination, intelligent CI/CD pipelines, and comprehensive repository management
git-advanced-workflows
wshobson
Master advanced Git workflows including rebasing, cherry-picking, bisect, worktrees, and reflog to maintain clean history and recover from any situation. Use when managing complex Git histories, collaborating on feature branches, or troubleshooting repository issues.