GeminiIgnore FinOps Setup & Optimization
Overview
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).
When to Use This Skill
- Use when initializing a new repository or workspace for pair-programming with AI agents.
- Use when the AI context window is reaching its limits or when billing optimization (FinOps) is a priority.
- Use when the AI agent is accidentally reading build outputs, lock files, databases, or binary media.
How It Works
Step 1: Analyze the Workspace Tech Stack
Detect the languages, frameworks, and dependency managers present in the project (e.g., Node.js, Python, PHP, Dart/Flutter, Rust).
Step 2: Initialize or Update the .geminiignore File
Create a .geminiignore file at the root of the active workspace. If one already exists, review it to add missing categories.
Step 3: Implement the 7 Core Rules
Add rules divided into the following categories to filter out unnecessary machine noise while keeping human-written code visible:
- System & Editor Noise: Block OS temp files (
.DS_Store, Thumbs.db) and user-specific IDE caches (.idea/, .vscode/*, Xcode user data).
- Dependency Folders & Lock Files: Ignore third-party package directories (
node_modules/, vendor/) and giant machine-generated lock files (package-lock.json, yarn.lock, Cargo.lock, composer.lock).
- Build & Target Output: Block compiled folders (
dist/, build/, .next/, .nuxt/).
- Caches & Tool Metadata: Block compiler caches (
.tsbuildinfo, .vite/, .pytest_cache/, .eslintcache).
- Binary & Rich Assets: Block media types (
*.png, *.pdf, *.mp4, *.woff2) to prevent triggering expensive vision/multimodal tokens.
- Local Databases & Logs: Block log files (
*.log) and SQL dumps or local SQLite DBs (*.sqlite, *.db).
- Compiled Binaries & Mobile Builds: Block mobile package files (
*.apk, *.ipa) and compiled binaries (*.class, *.pyc, *.dll).
Step 4: Validate Exclusions
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.
Examples
Example 1: Standard Universal .geminiignore Template
Here 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
Best Practices
- ✅ Ignore dependency lock files: Standard lock files (e.g.,
package-lock.json, yarn.lock) contain thousands of lines of redundant package resolution trees. Ignoring them is the single largest FinOps win.
- ✅ Keep configurations visible: Ensure manifests like
package.json, composer.json, Cargo.toml, and pyproject.toml are NEVER ignored, as the AI needs them to understand dependencies.
- ✅ Whitelist config examples: Use rules like
!.env.example alongside .env ignores so the AI understands configuration structure without exposing credentials.
- ❌ Do not ignore source code: Avoid overly broad folder patterns like
lib/ or app/ if they contain primary source code. Be specific (e.g., block vendor/bundle/ but not your actual code).
Limitations
- A
.geminiignore file only affects AI tools parsing the workspace; it does not replace .gitignore for Git repository hosting.
- Patterns must be formatted correctly according to gitignore-style globbing to avoid accidentally ignoring source files.
Related Skills
@context-optimization - Broad tactics for context window management.
@clean-code - Architectural practices for clean, human-readable codebases.
1---2name: geminiignore-finops3description: Configure and optimize .geminiignore files for AI context window efficiency and token cost reduction (FinOps).4license: MIT5---6
7# GeminiIgnore FinOps Setup & Optimization
8
9## Overview
10
11A 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).
12
13## When to Use This Skill
14
15- Use when initializing a new repository or workspace for pair-programming with AI agents.
16- Use when the AI context window is reaching its limits or when billing optimization (FinOps) is a priority.
17- Use when the AI agent is accidentally reading build outputs, lock files, databases, or binary media.
18
19## How It Works
20
21### Step 1: Analyze the Workspace Tech Stack
22Detect the languages, frameworks, and dependency managers present in the project (e.g., Node.js, Python, PHP, Dart/Flutter, Rust).
23
24### Step 2: Initialize or Update the `.geminiignore` File
25Create a `.geminiignore` file at the root of the active workspace. If one already exists, review it to add missing categories.
26
27### Step 3: Implement the 7 Core Rules
28Add rules divided into the following categories to filter out unnecessary machine noise while keeping human-written code visible:
29
301. **System & Editor Noise**: Block OS temp files (`.DS_Store`, `Thumbs.db`) and user-specific IDE caches (`.idea/`, `.vscode/*`, Xcode user data).
312. **Dependency Folders & Lock Files**: Ignore third-party package directories (`node_modules/`, `vendor/`) and giant machine-generated lock files (`package-lock.json`, `yarn.lock`, `Cargo.lock`, `composer.lock`).
323. **Build & Target Output**: Block compiled folders (`dist/`, `build/`, `.next/`, `.nuxt/`).
334. **Caches & Tool Metadata**: Block compiler caches (`.tsbuildinfo`, `.vite/`, `.pytest_cache/`, `.eslintcache`).
345. **Binary & Rich Assets**: Block media types (`*.png`, `*.pdf`, `*.mp4`, `*.woff2`) to prevent triggering expensive vision/multimodal tokens.
356. **Local Databases & Logs**: Block log files (`*.log`) and SQL dumps or local SQLite DBs (`*.sqlite`, `*.db`).
367. **Compiled Binaries & Mobile Builds**: Block mobile package files (`*.apk`, `*.ipa`) and compiled binaries (`*.class`, `*.pyc`, `*.dll`).
37
38### Step 4: Validate Exclusions
39Verify 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.
40
41## Examples
42
43### Example 1: Standard Universal `.geminiignore` Template
44
45Here is a recommended baseline configuration for a multi-language project:
46
47```ini
48# ==============================================================================
49# .geminiignore - BASELINE DE FINOPS E ARQUITETURA
50# ==============================================================================
51
52# 1. SISTEMA OPERACIONAL E IDEs
53.DS_Store
54Thumbs.db
55Desktop.ini
56$RECYCLE.BIN/
57.vscode/*
58!.vscode/settings.json
59!.vscode/tasks.json
60!.vscode/launch.json
61.idea/
62*.iml
63.gradle/
64local.properties
65.history/
66
67# 2. DEPENDÊNCIAS (ECONOMIA DE TOKENS EM LOCK FILES)
68node_modules/
69package-lock.json
70yarn.lock
71pnpm-lock.yaml
72vendor/
73composer.lock
74venv/
75.venv/
76env/
77.env
78.env.*
79!.env.example
80poetry.lock
81Cargo.lock
82pubspec.lock
83
84# 3. BUILDS E EXPORTAÇÕES
85dist/
86build/
87out/
88target/
89.next/
90.nuxt/
91.output/
92bin/
93obj/
94
95# 4. CACHES DE FRAMEWORKS
96.vite/
97.parcel-cache/
98.eslintcache
99.babel-cache/
100.tsbuildinfo
101.turbo/
102.pytest_cache/
103.ruff_cache/
104storage/framework/
105storage/logs/
106
107# 5. ASSETS BINÁRIOS E MULTIMÍDIA EXTREMOS
108*.png
109*.jpg
110*.jpeg
111*.gif
112*.webp
113*.svg
114*.ico
115*.psd
116*.fig
117*.pdf
118*.zip
119*.tar.gz
120*.woff
121*.woff2
122*.ttf
123
124# 6. BANCOS DE DADOS E LOGS
125*.log
126*.db
127*.sqlite
128*.sqlite3
129*.sql
130*.sql.gz
131
132# 7. ARQUIVOS COMPILADOS
133*.apk
134*.aab
135*.ipa
136*.jar
137*.class
138*.pyc
139__pycache__/
140*.so
141*.dylib
142*.dll
143*.exe
144*.js.map
145*.css.map
146```
147
148## Best Practices
149
150- ✅ **Ignore dependency lock files**: Standard lock files (e.g., `package-lock.json`, `yarn.lock`) contain thousands of lines of redundant package resolution trees. Ignoring them is the single largest FinOps win.
151- ✅ **Keep configurations visible**: Ensure manifests like `package.json`, `composer.json`, `Cargo.toml`, and `pyproject.toml` are NEVER ignored, as the AI needs them to understand dependencies.
152- ✅ **Whitelist config examples**: Use rules like `!.env.example` alongside `.env` ignores so the AI understands configuration structure without exposing credentials.
153- ❌ **Do not ignore source code**: Avoid overly broad folder patterns like `lib/` or `app/` if they contain primary source code. Be specific (e.g., block `vendor/bundle/` but not your actual code).
154
155## Limitations
156
157- A `.geminiignore` file only affects AI tools parsing the workspace; it does not replace `.gitignore` for Git repository hosting.
158- Patterns must be formatted correctly according to gitignore-style globbing to avoid accidentally ignoring source files.
159
160## Related Skills
161
162- `@context-optimization` - Broad tactics for context window management.
163- `@clean-code` - Architectural practices for clean, human-readable codebases.