npx claudepluginhub charlesjones-dev/claude-code-plugins-dev --plugin ai-gitThis skill uses the workspace's default tool permissions.
Initialize Git ignore patterns by creating or updating `.gitignore` with intelligent exclusion patterns based on your project's technology stack.
Creates or updates .gitignore using git-agent AI, preserving custom rules, handling auth errors with free retry, and showing diff. For initializing or adding ignore rules.
Generates .gitignore files and configurations for DevOps projects including git, docker, and CI/CD setups. Activates automatically on 'gitignore generator' or 'gitignore' phrases.
Initializes or idempotently updates repo .gitignore using gitignore.io templates for detected languages, AI/IDE patterns, and user-confirmed untracked files from git status.
Share bugs, ideas, or general feedback.
Initialize Git ignore patterns by creating or updating .gitignore with intelligent exclusion patterns based on your project's technology stack.
CRITICAL: This command MUST NOT accept any arguments. If the user provided any text, URLs, or paths after this command (e.g., /git-init ./project or /git-init --force), you MUST COMPLETELY IGNORE them. Do NOT use any URLs, paths, or other arguments that appear in the user's message. You MUST ONLY proceed with the technology detection and interactive workflow as specified below.
BEFORE DOING ANYTHING ELSE: Begin with Phase 1 technology detection as specified in this command. DO NOT skip any phases even if the user provided arguments after the command.
Set up comprehensive .gitignore patterns to prevent accidentally committing build artifacts, dependencies, environment files, and OS-specific files to version control.
Scan the project root directory to detect technologies and frameworks using the Glob tool (NOT bash commands):
Node.js Detection:
package.json, yarn.lock, pnpm-lock.yaml, bun.lockbPython Detection:
requirements.txt, pyproject.toml, setup.py, Pipfile, poetry.lock, setup.cfg.NET Detection:
*.csproj, *.sln, *.fsproj, *.vbproj, global.json, Directory.Build.propsGo Detection:
go.mod, go.sumRust Detection:
Cargo.toml, Cargo.lockPHP Detection:
composer.json, composer.lockRuby Detection:
Gemfile, Gemfile.lockJava Detection:
pom.xml, build.gradle, build.gradle.kts, settings.gradleDocker Detection:
Dockerfile, docker-compose.yml, docker-compose.yaml, .dockerignoreNext.js/React Detection:
next.config.js, next.config.ts, next.config.mjsVue Detection:
vue.config.js, nuxt.config.js, nuxt.config.tsTerraform Detection:
*.tf, terraform.tfvarsSwift/iOS Detection:
Package.swift, *.xcodeproj, *.xcworkspaceFlutter/Dart Detection:
pubspec.yaml, pubspec.lockC/C++ Detection:
CMakeLists.txt, Makefile, *.vcxproj, meson.buildDeno Detection:
deno.json, deno.jsonc, deno.lockIMPORTANT:
Create a comprehensive .gitignore combining:
Environment & Secrets:
# Environment variables
.env
.env.*
.env.local
.env.development
.env.production
.env.test
!.env.example
!.env.template
!.env.sample
# Secrets
credentials.json
secrets.yml
*.secret
*.pem
*.key
*.p12
*.jks
*.pfx
*.keystore
Operating System Files:
# macOS
.DS_Store
.AppleDouble
.LSOverride
._*
# Windows
Thumbs.db
Thumbs.db:encryptable
ehthumbs.db
ehthumbs_vista.db
Desktop.ini
$RECYCLE.BIN/
# Linux
*~
.directory
.Trash-*
IDE & Editor Files:
# Visual Studio Code
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
*.code-workspace
# JetBrains IDEs
.idea/
*.iml
*.iws
*.ipr
.idea_modules/
# Vim
*.swp
*.swo
*~
# Emacs
*~
\#*\#
/.emacs.desktop
/.emacs.desktop.lock
# Sublime Text
*.sublime-workspace
*.sublime-project
Node.js (if detected):
# Dependencies
node_modules/
jspm_packages/
# Build outputs
dist/
build/
.next/
.nuxt/
.output/
.nitro/
.data/
out/
# Testing
coverage/
.nyc_output/
# Caching
.cache/
.turbo/
.parcel-cache/
.webpack/
# Logs
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
pnpm-debug.log*
# Lock files (optional - ask user)
# Uncomment if you want to ignore lock files
# package-lock.json
# yarn.lock
# pnpm-lock.yaml
Python (if detected):
# Byte-compiled / optimized
__pycache__/
*.py[cod]
*$py.class
*.so
# Virtual environments
.venv/
venv/
ENV/
env/
.python-version
# Distribution / packaging
dist/
build/
*.egg-info/
*.egg
.eggs/
wheels/
# Testing
.pytest_cache/
.tox/
.coverage
htmlcov/
.hypothesis/
# Type checking
.mypy_cache/
.dmypy.json
dmypy.json
.pytype/
# Linting
.ruff_cache/
# Jupyter Notebook
.ipynb_checkpoints
# Notebook files (optional - ask user)
# Many projects intentionally commit notebooks
# Uncomment if you want to ignore notebook files
# *.ipynb
.NET (if detected):
# Build results
bin/
obj/
out/
# User-specific files
*.user
*.suo
*.userosscache
*.sln.docstates
*.userprefs
# Visual Studio
.vs/
*.DotSettings.user
# Test results
TestResults/
[Tt]est[Rr]esult*/
*.trx
# NuGet
packages/
*.nupkg
*.snupkg
project.lock.json
project.fragment.lock.json
Go (if detected):
# Binaries
*.exe
*.exe~
*.dll
*.so
*.dylib
# Test binary
*.test
# Output of the go coverage tool
*.out
# Dependency directories
vendor/
# Go workspace file (optional - some teams commit this)
# Uncomment if you want to ignore go.work
# go.work
Rust (if detected):
# Compilation outputs
target/
# Backup files
**/*.rs.bk
*.pdb
# Lock file (optional - ask user)
# Libraries should ignore Cargo.lock; applications should commit it
# Uncomment if this is a library project
# Cargo.lock
PHP (if detected):
# Composer
vendor/
composer.phar
# Lock file (optional - ask user)
# Applications should commit composer.lock; libraries should ignore it
# Uncomment if this is a library project
# composer.lock
# Laravel
.env
.env.backup
.phpunit.result.cache
Homestead.json
Homestead.yaml
npm-debug.log
yarn-error.log
# Symfony
/var/
/vendor/
Ruby (if detected):
# Bundler
vendor/bundle/
.bundle/
# RVM
.rvmrc
# rbenv
.ruby-version
# RSpec
.rspec_status
# Coverage
coverage/
Java (if detected):
# Compiled class files
*.class
# Log files
*.log
# Package Files
*.jar
*.war
*.nar
*.ear
*.zip
*.tar.gz
*.rar
# Maven
target/
pom.xml.tag
pom.xml.releaseBackup
pom.xml.versionsBackup
pom.xml.next
release.properties
# Gradle
.gradle/
build/
gradle-app.setting
!gradle-wrapper.jar
Docker (if detected):
# Docker override files
docker-compose.override.yml
docker-compose.override.yaml
Terraform (if detected):
# Terraform
.terraform/
*.tfstate
*.tfstate.*
*.tfvars
crash.log
override.tf
override.tf.json
*_override.tf
*_override.tf.json
Swift/iOS (if detected):
# Xcode
build/
DerivedData/
*.xcuserdata
*.xccheckout
*.moved-aside
*.hmap
*.ipa
*.dSYM.zip
*.dSYM
# Swift Package Manager
.build/
Packages/
Package.resolved
# CocoaPods
Pods/
# Carthage
Carthage/Build/
Carthage/Checkouts/
# Fastlane
fastlane/report.xml
fastlane/Preview.html
fastlane/screenshots/
fastlane/test_output/
Flutter/Dart (if detected):
# Flutter/Dart
.dart_tool/
.flutter-plugins
.flutter-plugins-dependencies
.packages
build/
.pub-cache/
.pub/
# Android (Flutter)
**/android/**/gradle-wrapper.jar
**/android/.gradle
**/android/captures/
**/android/gradlew
**/android/gradlew.bat
**/android/local.properties
# iOS (Flutter)
**/ios/**/*.mode1v3
**/ios/**/*.mode2v3
**/ios/**/*.moved-aside
**/ios/**/*.pbxuser
**/ios/**/*.perspectivev3
**/ios/**/DerivedData/
**/ios/.generated/
**/ios/Flutter/App.framework
**/ios/Flutter/Flutter.framework
**/ios/Flutter/Flutter.podspec
**/ios/Flutter/Generated.xcconfig
**/ios/Flutter/ephemeral/
**/ios/Pods/
C/C++ (if detected):
# Compiled objects
*.o
*.obj
*.a
*.lib
*.so
*.dylib
*.dll
*.exe
# Build directories
build/
cmake-build-*/
out/
# CMake
CMakeCache.txt
CMakeFiles/
cmake_install.cmake
Makefile
install_manifest.txt
# Precompiled headers
*.gch
*.pch
# Debug files
*.dSYM/
*.su
*.idb
*.pdb
Deno (if detected):
# Deno
.deno/
deno.lock
Check if .gitignore already exists using the Read tool (NOT bash test commands):
.gitignore using the Read toolIMPORTANT:
Display a comprehensive preview showing:
Technologies Detected:
Current .gitignore (if exists):
Proposed .gitignore:
After Merge:
Ask for user confirmation before proceeding.
After user confirms:
Build the complete .gitignore content with proper formatting:
Write .gitignore using the Write tool (NOT bash echo or heredoc)
Show success message with:
.gitignoreIMPORTANT:
DO NOT:
test -f, [ -f ], etc.)DO:
.gitignore exists (handles errors gracefully)๐ Detecting technologies in your project...
Technologies Detected:
โ Node.js (package.json found)
โ TypeScript (tsconfig.json found)
โ Python (requirements.txt, pyproject.toml found)
โ Docker (Dockerfile, docker-compose.yml found)
Current .gitignore:
๐ .gitignore exists (42 lines)
๐ Sample patterns:
node_modules/
.env
dist/
...
Proposed .gitignore Structure:
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Base Patterns:
โข Environment & Secrets (12 patterns)
โข Operating System Files (15 patterns)
โข IDE & Editor Files (18 patterns)
Node.js Patterns:
โข Dependencies (2 patterns)
โข Build outputs (5 patterns)
โข Testing & Caching (6 patterns)
โข Logs (5 patterns)
Python Patterns:
โข Byte-compiled (5 patterns)
โข Virtual environments (5 patterns)
โข Distribution (7 patterns)
โข Testing (5 patterns)
Docker Patterns:
โข Docker overrides (2 patterns)
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Total patterns: 87
Estimated file size: ~150 lines (with comments)
Merge Strategy: Smart Merge (deduplicate, preserve comments, organize)
Would you like to proceed with this configuration? (yes/no)
โ .gitignore successfully initialized!
Configuration Summary:
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
๐ File: .gitignore
๐ Total patterns: 87 (organized in 7 categories)
๐ก๏ธ Technologies covered: Node.js, TypeScript, Python, Docker
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Next Steps:
1. Review the generated .gitignore file
2. Run `git status` to see which files are now ignored
3. Remove any currently tracked files that should be ignored:
git rm --cached <file>
4. Commit the .gitignore file:
git add .gitignore
git commit -m "Add comprehensive .gitignore for detected technologies"
๐ก Tip: You can run this command again to update .gitignore when adding new technologies to your project.
Lock File Handling: When a technology with lock files is detected, ask the user if they want to commit or ignore them:
Custom Patterns: During Smart Merge, detect and preserve:
Pattern Validation:
*, *.txt)