Skip to content

Latest commit

 

History

History
67 lines (50 loc) · 2.21 KB

File metadata and controls

67 lines (50 loc) · 2.21 KB

auto-gitignore

A global Claude Code skill that automatically generates .gitignore files based on detected project type.

Project Structure

auto-gitignore/
├── src/cli/           # TypeScript CLI source
│   └── install.ts     # Installer script (install/uninstall/status commands)
├── dist/              # Compiled JavaScript (generated by npm run build)
├── skill/             # Claude skill (copied to ~/.claude/plugins/repos/ on install)
│   ├── .claude-plugin/plugin.json    # Plugin manifest
│   ├── commands/gitignore.md         # /gitignore slash command
│   ├── hooks/
│   │   ├── hooks.json                # SessionStart hook config
│   │   └── check-gitignore.sh        # Proactive detection script
│   └── skills/gitignore-generator/
│       ├── SKILL.md                  # Skill definition
│       └── templates/                # Gitignore templates by project type

Commands

# Install dependencies
npm install

# Build TypeScript CLI
npm run build

# Test CLI locally
node dist/cli/install.js install
node dist/cli/install.js status
node dist/cli/install.js uninstall

# Publish to npm
npm publish --access public

How It Works

  1. CLI Installer: npx @blurtopian/auto-gitignore install copies the skill/ directory to ~/.claude/plugins/repos/auto-gitignore/

  2. SessionStart Hook: When Claude starts in a project directory, the hook script detects project types and suggests creating a .gitignore if missing

  3. Slash Command: Users can run /gitignore to generate or update their .gitignore

  4. Skill Definition: SKILL.md teaches Claude how to detect project types and merge gitignore patterns

Supported Project Types

  • Node.js (package.json)
  • Python (requirements.txt, pyproject.toml)
  • Rust (Cargo.toml)
  • Go (go.mod)
  • Java (pom.xml, build.gradle)
  • Ruby (Gemfile)
  • Swift (Package.swift)
  • .NET (*.csproj, *.sln)
  • Aleo/Leo (program.json, *.leo)

Adding New Templates

  1. Create skill/skills/gitignore-generator/templates/<type>.gitignore
  2. Update detection logic in skill/hooks/check-gitignore.sh
  3. Update the project type table in skill/skills/gitignore-generator/SKILL.md