Enhance agentignore init to perform lightweight project/environment discovery and generate useful default entries in .agentignore and .agentallow.
Today, agentignore init creates template files with comments. The proposed behavior would keep those templates but additionally detect common development ecosystems and pre-populate rules that reflect the current workspace.
This would help users get immediate value from AgentIgnore without having to manually configure common exclusions and tool allowances.
Motivation
Most projects contain large dependency directories, build outputs, caches, and tooling that agents rarely need to inspect directly.
Likewise, many agent workflows require access to common package managers and build tools.
Instead of starting from empty configuration files, AgentIgnore could provide sensible defaults based on the detected project type.
Benefits:
- Better out-of-the-box experience.
- Reduced configuration friction.
- Faster onboarding for new users.
- Encourages least-privilege visibility by default.
- Keeps configuration explicit and editable.
Proposed Behavior
When agentignore init is executed:
- Perform lightweight discovery of the current workspace.
- Detect common project ecosystems.
- Generate commented sections in
.agentignore.
- Generate matching tool allowances in
.agentallow.
- Allow users to review and modify the generated entries.
Example:
If the workspace contains:
package.json
node_modules/
Generated .agentignore:
Generated .agentallow:
# Node.js tooling
npm
npx
node
Suggested Ecosystem Detection
Node.js / JavaScript / TypeScript
Detection:
package.json
node_modules/
pnpm-lock.yaml
yarn.lock
bun.lockb
Suggested .agentignore:
node_modules/
dist/
build/
.next/
.nuxt/
coverage/
Suggested .agentallow:
node
npm
npx
pnpm
yarn
bun
Rust
Detection:
Suggested .agentignore:
Suggested .agentallow:
.NET
Detection:
*.csproj
*.sln
global.json
Suggested .agentignore:
Suggested .agentallow:
Python
Detection:
pyproject.toml
requirements.txt
Pipfile
poetry.lock
.venv/
venv/
Suggested .agentignore:
.venv/
venv/
__pycache__/
.pytest_cache/
.mypy_cache/
dist/
build/
Suggested .agentallow:
python
python3
pip
pip3
poetry
uv
pytest
Go
Detection:
Suggested .agentignore:
Suggested .agentallow:
Java
Detection:
pom.xml
build.gradle
build.gradle.kts
Suggested .agentignore:
Suggested .agentallow:
PHP
Detection:
Suggested .agentignore:
Suggested .agentallow:
Ruby
Detection:
Suggested .agentignore:
Suggested .agentallow:
Docker
Detection:
Dockerfile
docker-compose.yml
compose.yaml
Suggested .agentallow:
Kubernetes
Detection:
kustomization.yaml
helm/
Chart.yaml
Suggested .agentallow:
Additional Ideas
Commented Generation
Generate entries with comments indicating why they were added:
# Detected Cargo.toml
target/
Preview Mode
agentignore init --dry-run
Show detected technologies and the generated configuration before writing files.
Interactive Mode
agentignore init --interactive
Example:
Detected:
✓ Node.js
✓ Docker
✓ Kubernetes
Generate Node.js defaults? [Y/n]
Generate Docker defaults? [Y/n]
Generate Kubernetes defaults? [Y/n]
Future Plugin Architecture
Consider implementing the discovery mechanism as a registry of detectors:
type Detector interface {
Detect(path string) bool
IgnoreEntries() []string
AllowEntries() []string
}
This would make it easy to add support for new ecosystems over time.
Open Question
Should generated entries be:
- Added automatically (best onboarding experience), or
- Added as commented suggestions that users explicitly enable?
My preference is automatic generation with clear comments explaining how each entry was discovered.
Enhance
agentignore initto perform lightweight project/environment discovery and generate useful default entries in.agentignoreand.agentallow.Today,
agentignore initcreates template files with comments. The proposed behavior would keep those templates but additionally detect common development ecosystems and pre-populate rules that reflect the current workspace.This would help users get immediate value from AgentIgnore without having to manually configure common exclusions and tool allowances.
Motivation
Most projects contain large dependency directories, build outputs, caches, and tooling that agents rarely need to inspect directly.
Likewise, many agent workflows require access to common package managers and build tools.
Instead of starting from empty configuration files, AgentIgnore could provide sensible defaults based on the detected project type.
Benefits:
Proposed Behavior
When
agentignore initis executed:.agentignore..agentallow.Example:
If the workspace contains:
Generated
.agentignore:Generated
.agentallow:Suggested Ecosystem Detection
Node.js / JavaScript / TypeScript
Detection:
package.jsonnode_modules/pnpm-lock.yamlyarn.lockbun.lockbSuggested
.agentignore:Suggested
.agentallow:Rust
Detection:
Cargo.tomlCargo.lockSuggested
.agentignore:Suggested
.agentallow:.NET
Detection:
*.csproj*.slnglobal.jsonSuggested
.agentignore:Suggested
.agentallow:Python
Detection:
pyproject.tomlrequirements.txtPipfilepoetry.lock.venv/venv/Suggested
.agentignore:Suggested
.agentallow:Go
Detection:
go.modSuggested
.agentignore:Suggested
.agentallow:Java
Detection:
pom.xmlbuild.gradlebuild.gradle.ktsSuggested
.agentignore:Suggested
.agentallow:PHP
Detection:
composer.jsonSuggested
.agentignore:Suggested
.agentallow:Ruby
Detection:
GemfileSuggested
.agentignore:Suggested
.agentallow:Docker
Detection:
Dockerfiledocker-compose.ymlcompose.yamlSuggested
.agentallow:Kubernetes
Detection:
kustomization.yamlhelm/Chart.yamlSuggested
.agentallow:Additional Ideas
Commented Generation
Generate entries with comments indicating why they were added:
Preview Mode
Show detected technologies and the generated configuration before writing files.
Interactive Mode
Example:
Future Plugin Architecture
Consider implementing the discovery mechanism as a registry of detectors:
This would make it easy to add support for new ecosystems over time.
Open Question
Should generated entries be:
My preference is automatic generation with clear comments explaining how each entry was discovered.