grepai-ignore-patterns by yoanbernabeu/grepai-skills
npx skills add https://github.com/yoanbernabeu/grepai-skills --skill grepai-ignore-patterns本技能介绍如何配置忽略模式,以将文件和目录从 GrepAI 索引中排除。
GrepAI 使用两个来源的忽略模式:
.grepai/config.yaml - 您定义的自定义模式.gitignore - 自动遵循# .grepai/config.yaml
ignore:
- pattern1
- pattern2
ignore:
# 精确目录名(在任何位置匹配)
- node_modules
- vendor
- __pycache__
# 带尾部斜杠(明确指定目录)
- dist/
- build/
- coverage/
ignore:
# 精确文件名
- package-lock.json
- yarn.lock
# 通配符模式
- "*.min.js"
- "*.min.css"
- "*.map"
- "*.lock"
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
ignore:
# 包含子字符串的路径
- /tests/
- /spec/
- /__tests__/
# 特定路径
- src/generated/
- api/swagger/
ignore:
# 双星号(递归)
- "**/test/**"
- "**/mock/**"
# 单星号(单层级)
- "*.test.js"
- "*.spec.ts"
- "*_test.go"
GrepAI 的默认配置包括:
ignore:
# 版本控制
- .git
- .svn
- .hg
# GrepAI 自身
- .grepai
# 包管理器
- node_modules
- vendor
- .npm
- .yarn
# 构建输出
- target
- dist
- build
- out
# 缓存目录
- __pycache__
- .pytest_cache
- .mypy_cache
- .cache
# 框架输出
- .next
- .nuxt
- .output
ignore:
- node_modules
- dist
- build
- coverage
- .nyc_output
- "*.min.js"
- "*.bundle.js"
- "*.map"
- package-lock.json
- yarn.lock
- pnpm-lock.yaml
ignore:
- vendor
- bin
- "*.pb.go" # Protobuf 生成
- "*_mock.go" # 模拟文件
- "mocks/"
- go.sum
ignore:
- __pycache__
- .pytest_cache
- .mypy_cache
- .venv
- venv
- env
- "*.pyc"
- "*.pyo"
- .eggs
- "*.egg-info"
- dist
- build
ignore:
- target
- Cargo.lock
- "*.rlib"
ignore:
- target
- build
- .gradle
- "*.class"
- "*.jar"
- "*.war"
ignore:
# 通用
- node_modules
- dist
- build
- coverage
# 要排除的特定包
- packages/legacy/
- packages/deprecated/
# 生成的
- "**/generated/**"
- "**/__generated__/**"
要将搜索集中在生产代码上:
ignore:
# 测试目录
- tests/
- test/
- __tests__/
- spec/
# 按模式匹配的测试文件
- "*.test.js"
- "*.test.ts"
- "*.spec.js"
- "*.spec.ts"
- "*_test.go"
- "test_*.py"
- "*_test.py"
替代方案: 使用搜索提升来惩罚(而非排除)测试文件:
search:
boost:
penalties:
- pattern: /tests/
factor: 0.5
- pattern: _test.
factor: 0.5
ignore:
# 生成标记
- "**/generated/**"
- "*.generated.*"
- "*.gen.*"
# 特定生成器
- "*.pb.go" # Protobuf
- "*.graphql.ts" # GraphQL 代码生成
- "*.d.ts" # TypeScript 声明文件
- "swagger_*.go" # Swagger
- "openapi_*.ts" # OpenAPI
ignore:
- docs/
- documentation/
- "*.md"
- "*.mdx"
- "*.rst"
检查正在索引的内容:
# 检查索引状态
grepai status
# 输出显示文件计数
# 如果过高,请添加更多忽略模式
❌ 问题: 索引太大 ✅ 解决方案: 为依赖项和生成的文件添加更多忽略模式
❌ 问题: 搜索返回第三方/测试代码 ✅ 解决方案: 要么忽略,要么使用提升惩罚
❌ 问题: 模式不生效 ✅ 解决方案: 检查语法 - 对于包含特殊字符的模式使用引号:
ignore:
- "*.min.js" # 正确
- *.min.js # 可能导致 YAML 解析问题
❌ 问题: 需要包含先前忽略的文件
✅ 解决方案: 从忽略列表中移除并重新运行 grepai watch
node_modules、vendor 等dist、build、target"*.min.js" 而不是 *.min.js修改忽略模式后:
# 停止现有守护进程
grepai watch --stop
# 清除索引并重新启动
rm .grepai/index.gob
grepai watch
配置忽略模式后:
✅ 忽略模式已配置
模式:已配置 15 个
类别:
- 目录:node_modules, vendor, dist, build
- 文件类型:*.min.js, *.map, *.lock
- 路径:/tests/, /docs/
同时遵循:.gitignore
运行 'grepai watch' 以使用新模式重新索引。
每周安装次数
251
仓库
GitHub 星标数
15
首次出现
2026年1月28日
安全审计
安装于
opencode200
codex192
gemini-cli177
github-copilot175
kimi-cli163
amp161
This skill covers how to configure ignore patterns to exclude files and directories from GrepAI indexing.
GrepAI uses two sources for ignore patterns:
.grepai/config.yaml - Custom patterns you define.gitignore - Automatically respected# .grepai/config.yaml
ignore:
- pattern1
- pattern2
ignore:
# Exact directory name (matches anywhere)
- node_modules
- vendor
- __pycache__
# With trailing slash (explicit directory)
- dist/
- build/
- coverage/
ignore:
# Exact filename
- package-lock.json
- yarn.lock
# Wildcard patterns
- "*.min.js"
- "*.min.css"
- "*.map"
- "*.lock"
ignore:
# Paths containing substring
- /tests/
- /spec/
- /__tests__/
# Specific paths
- src/generated/
- api/swagger/
ignore:
# Double star (recursive)
- "**/test/**"
- "**/mock/**"
# Single star (single level)
- "*.test.js"
- "*.spec.ts"
- "*_test.go"
GrepAI's default configuration includes:
ignore:
# Version control
- .git
- .svn
- .hg
# GrepAI itself
- .grepai
# Package managers
- node_modules
- vendor
- .npm
- .yarn
# Build outputs
- target
- dist
- build
- out
# Cache directories
- __pycache__
- .pytest_cache
- .mypy_cache
- .cache
# Framework outputs
- .next
- .nuxt
- .output
ignore:
- node_modules
- dist
- build
- coverage
- .nyc_output
- "*.min.js"
- "*.bundle.js"
- "*.map"
- package-lock.json
- yarn.lock
- pnpm-lock.yaml
ignore:
- vendor
- bin
- "*.pb.go" # Protobuf generated
- "*_mock.go" # Mocks
- "mocks/"
- go.sum
ignore:
- __pycache__
- .pytest_cache
- .mypy_cache
- .venv
- venv
- env
- "*.pyc"
- "*.pyo"
- .eggs
- "*.egg-info"
- dist
- build
ignore:
- target
- Cargo.lock
- "*.rlib"
ignore:
- target
- build
- .gradle
- "*.class"
- "*.jar"
- "*.war"
ignore:
# Common
- node_modules
- dist
- build
- coverage
# Specific packages to exclude
- packages/legacy/
- packages/deprecated/
# Generated
- "**/generated/**"
- "**/__generated__/**"
To focus search on production code:
ignore:
# Test directories
- tests/
- test/
- __tests__/
- spec/
# Test files by pattern
- "*.test.js"
- "*.test.ts"
- "*.spec.js"
- "*.spec.ts"
- "*_test.go"
- "test_*.py"
- "*_test.py"
Alternative: Use search boosting instead to penalize (not exclude) tests:
search:
boost:
penalties:
- pattern: /tests/
factor: 0.5
- pattern: _test.
factor: 0.5
ignore:
# Generated markers
- "**/generated/**"
- "*.generated.*"
- "*.gen.*"
# Specific generators
- "*.pb.go" # Protobuf
- "*.graphql.ts" # GraphQL codegen
- "*.d.ts" # TypeScript declarations
- "swagger_*.go" # Swagger
- "openapi_*.ts" # OpenAPI
ignore:
- docs/
- documentation/
- "*.md"
- "*.mdx"
- "*.rst"
Check what's being indexed:
# Check index status
grepai status
# Output shows file count
# If too high, add more ignore patterns
❌ Problem: Index is too large ✅ Solution: Add more ignore patterns for dependencies and generated files
❌ Problem: Search returns vendor/test code ✅ Solution: Either ignore or use boosting penalties
❌ Problem: Pattern not working ✅ Solution: Check syntax - use quotes for patterns with special characters:
ignore:
- "*.min.js" # Correct
- *.min.js # May cause YAML parsing issues
❌ Problem: Need to include previously ignored files ✅ Solution: Remove from ignore list and re-run grepai watch
node_modules, vendor, etc.dist, build, target"*.min.js" not *.min.jsAfter modifying ignore patterns:
# Stop existing daemon
grepai watch --stop
# Clear index and restart
rm .grepai/index.gob
grepai watch
After configuring ignore patterns:
✅ Ignore Patterns Configured
Patterns: 15 configured
Categories:
- Directories: node_modules, vendor, dist, build
- File types: *.min.js, *.map, *.lock
- Paths: /tests/, /docs/
Also respecting: .gitignore
Run 'grepai watch' to re-index with new patterns.
Weekly Installs
251
Repository
GitHub Stars
15
First Seen
Jan 28, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
opencode200
codex192
gemini-cli177
github-copilot175
kimi-cli163
amp161
agent-browser 浏览器自动化工具 - Vercel Labs 命令行网页操作与测试
140,500 周安装
竞争对手研究指南:SEO、内容、反向链接与定价分析工具
231 周安装
Azure 工作负载自动升级评估工具 - 支持 Functions、App Service 计划与 SKU 迁移
231 周安装
Kaizen持续改进方法论:软件开发中的渐进式优化与防错设计实践指南
231 周安装
软件UI/UX设计指南:以用户为中心的设计原则、WCAG可访问性与平台规范
231 周安装
Apify 网络爬虫和自动化平台 - 无需编码抓取亚马逊、谷歌、领英等网站数据
231 周安装
llama.cpp 中文指南:纯 C/C++ LLM 推理,CPU/非 NVIDIA 硬件优化部署
231 周安装