跳到正文
Skillpedia
智能体48k · #4711

geminiignore-finops

它能做什么

这个技能可以创建和优化一个名为 `.geminiignore` 的特殊文件。它会让 AI 忽略机器码、日志和依赖包等不必要的文件,帮助 AI 专注于重要内容,从而节省时间和成本。

适用场景

  • ✓在用 AI 开始一个新项目时。
  • ✓当 AI 运行太慢或花费太多时。
  • ✓当 AI 读取了不该读取的内容,比如配置文件或系统文件时。

技能链接

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/geminiignore-finops/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/geminiignore-finops/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“为我的 Node.js 项目创建一个 `.geminiignore` 文件,忽略依赖和构建文件。”

每周 5 个新技能,1 分钟读完。

工作原理

它会先识别你的项目使用了哪些编程语言。然后在 `.geminiignore` 文件中添加规则,忽略 AI 不需要看的文件,比如自动生成的代码或日志文件。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

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:

  1. System & Editor Noise: Block OS temp files (.DS_Store, Thumbs.db) and user-specific IDE caches (.idea/, .vscode/*, Xcode user data).
  2. 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).
  3. Build & Target Output: Block compiled folders (dist/, build/, .next/, .nuxt/).
  4. Caches & Tool Metadata: Block compiler caches (.tsbuildinfo, .vite/, .pytest_cache/, .eslintcache).
  5. Binary & Rich Assets: Block media types (*.png, *.pdf, *.mp4, *.woff2) to prevent triggering expensive vision/multimodal tokens.
  6. Local Databases & Logs: Block log files (*.log) and SQL dumps or local SQLite DBs (*.sqlite, *.db).
  7. 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.

…

常见问题

什么是 `.geminiignore` 文件?

它是一个配置文件,用来告诉 AI 在项目中忽略哪些文件和文件夹,让 AI 专注于重要的代码。

为什么这样能省钱?

AI 使用“token”来处理信息。忽略体积大且没有必要的文件,可以减少 token 的使用量,从而降低成本。

这和 `.gitignore` 一样吗?

不一样。`.gitignore` 是给 Git(版本控制工具)用的,让 Git 不追踪某些文件。`.geminiignore` 则是让 AI 在分析你的代码时忽略某些文件。

详情

作者的原始描述

Configure and optimize .geminiignore files for AI context window efficiency and token cost reduction (FinOps).

repo: sickn33/agentic-awesome-skills

热度

GitHub 星标
48k
排名
#4711
许可证
MIT
更新时间
2026/10/15

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能