Agent skill
gitignore-generator
Generate a .gitignore file for any project using the gitignore.io command-line tool (gi) or API.
Stars
163
Forks
31
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/development/gitignore-generator
SKILL.md
Claude Gitignore Generator Skill
🧠 Purpose
Automatically create or update a .gitignore file tailored to your project using gitignore.io.
This skill detects the type of project (Java, Node, Python, Docker, etc.) and uses either the gi CLI or a curl fallback to generate the correct .gitignore file.
⚙️ How It Works
-
Detect project type
- Look for indicators like
pom.xml,build.gradle.kts,package.json,Dockerfile, etc. - Infer appropriate gitignore keywords (e.g.
java,maven,gradle,linux,intellij,docker).
- Look for indicators like
-
Generate keyword list
- Combine detected technologies with user input.
- Example:
java,maven,gradle,linux,intellij,docker
-
Generate the .gitignore file
- If
giis installed:bashgi java,maven,gradle,linux,intellij,docker > .gitignore - Otherwise, use curl fallback:
bash
curl -L -s https://www.toptal.com/developers/gitignore/api/java,maven,gradle,linux,intellij,docker > .gitignore
- If
-
Add metadata header
- Append a creation timestamp and skill attribution:
bash
echo "# Generated by Claude Gitignore Skill on $(date)" | cat - .gitignore > temp && mv temp .gitignore
- Append a creation timestamp and skill attribution:
-
Confirm success
- Output a summary and ensure
.gitignoreexists and is not empty.
- Output a summary and ensure
🧪 Example Usage
Ask Claude
“Use the
gitignore-generatorskill to create a.gitignorefor a Java + Maven + Docker project.”
Claude will:
- Detect your stack
- Run
gi java,maven,docker - Generate
.gitignorein your project root
Manual CLI
bash
./scripts/generate_gitignore.sh "java,maven,docker,intellij"
Didn't find tool you were looking for?