A skill to construct, refine, and maintain high-performance .geminiignore files across diverse tech stacks. By filtering out machine-generated code, heavy logs, package locks, and binary assets, this skill optimizes the AI agent's context window, accelerates processing speed, and reduces token consumption costs (FinOps).
Detect the languages, frameworks, and dependency managers present in the project (e.g., Node.js, Python, PHP, Dart/Flutter, Rust).
.geminiignore FileCreate a .geminiignore file at the root of the active workspace. If one already exists, review it to add missing categories.
Add rules divided into the following categories to filter out unnecessary machine noise while keeping human-written code visible:
.DS_Store, Thumbs.db) and user-specific IDE caches (.idea/, .vscode/*, Xcode user data).node_modules/, vendor/) and giant machine-generated lock files (package-lock.json, yarn.lock, Cargo.lock, composer.lock).dist/, build/, .next/, .nuxt/)..tsbuildinfo, .vite/, .pytest_cache/, .eslintcache).*.png, *.pdf, *.mp4, *.woff2) to prevent triggering expensive vision/multimodal tokens.*.log) and SQL dumps or local SQLite DBs (*.sqlite, *.db).*.apk, *.ipa) and compiled binaries (*.class, *.pyc, *.dll).Verify that the AI can still see critical configuration blueprints (like .env.example, package.json, composer.json, pyproject.toml) but ignores the actual .env files and compilation artifacts.
.geminiignore TemplateHere is a recommended baseline configuration for a multi-language project:
# ==============================================================================
# .geminiignore - BASELINE DE FINOPS E ARQUITETURA
# ==============================================================================
# 1. SISTEMA OPERACIONAL E IDEs
.DS_Store
Thumbs.db
Desktop.ini
$RECYCLE.BIN/
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
.idea/
*.iml
.gradle/
local.properties
.history/
# 2. DEPENDÊNCIAS (ECONOMIA DE TOKENS EM LOCK FILES)
node_modules/
package-lock.json
yarn.lock
pnpm-lock.yaml
vendor/
composer.lock
venv/
.venv/
env/
.env
.env.*
!.env.example
poetry.lock
Cargo.lock
pubspec.lock
# 3. BUILDS E EXPORTAÇÕES
dist/
build/
out/
target/
.next/
.nuxt/
.output/
bin/
obj/
# 4. CACHES DE FRAMEWORKS
.vite/
.parcel-cache/
.eslintcache
.babel-cache/
.tsbuildinfo
.turbo/
.pytest_cache/
.ruff_cache/
storage/framework/
storage/logs/
# 5. ASSETS BINÁRIOS E MULTIMÍDIA EXTREMOS
*.png
*.jpg
*.jpeg
*.gif
*.webp
*.svg
*.ico
*.psd
*.fig
*.pdf
*.zip
*.tar.gz
*.woff
*.woff2
*.ttf
# 6. BANCOS DE DADOS E LOGS
*.log
*.db
*.sqlite
*.sqlite3
*.sql
*.sql.gz
# 7. ARQUIVOS COMPILADOS
*.apk
*.aab
*.ipa
*.jar
*.class
*.pyc
__pycache__/
*.so
*.dylib
*.dll
*.exe
*.js.map
*.css.map
package-lock.json, yarn.lock) contain thousands of lines of redundant package resolution trees. Ignoring them is the single largest FinOps win.package.json, composer.json, Cargo.toml, and pyproject.toml are NEVER ignored, as the AI needs them to understand dependencies.!.env.example alongside .env ignores so the AI understands configuration structure without exposing credentials.lib/ or app/ if they contain primary source code. Be specific (e.g., block vendor/bundle/ but not your actual code)..geminiignore file only affects AI tools parsing the workspace; it does not replace .gitignore for Git repository hosting.@context-optimization - Broad tactics for context window management.@clean-code - Architectural practices for clean, human-readable codebases.