ai.config.js Configuration Guide
ai.config.js is the unified entry for ai-jue (and jue.config.js is also supported; ai.config.js has priority). The design goal is minimal cognitive load: users declare intent once, and the system auto-discovers assets and performs adapter conversions.
1. Minimal Working Config
js
export default {
presets: ['base']
}bash
npx jue apply --allThis means:
- You only declare which preset to use
- You do not need heavy object configuration first
- The system auto-mounts default asset directories
2. Canonical Fields (Single)
js
export default {
presets: ['base'],
language: 'en',
commands: {
review: {
description: 'Code review',
prompt: 'Review current changes for correctness, performance, and security',
triggers: ['/review']
}
},
hooks: {
'pre-commit': 'npm run lint'
},
agents: {
reviewer: {
description: 'Focused reviewer agent',
prompt: 'You are a strict code review agent',
skills: ['review']
}
},
mcp: {
servers: {
filesystem: {
command: 'npx',
args: ['@modelcontextprotocol/server-filesystem', '.']
}
}
},
tools: {
gemini: {
temperature: 0.2
}
}
}3. How Config Relates to File Structure
3.1 Default Mounting Logic (Low Cognitive Load)
When you run jue apply, core processing order is (you can explicitly pass --adapter or --all; if omitted, adapters are auto-detected from tool footprints like .cursor/.gemini/.claude):
- Load assets from configured presets
- Auto-scan local
.ai/(if absent, scan.jue/) - If root
AGENTS.mdexists, auto-inject it as global context - Merge files referenced by
extends - Apply object overrides from
ai.config.js
Implication:
- Object config is not mandatory for core usage
- Directory assets work by default
- Object config is mainly for explicit override/runtime tuning
3.2 Directory-to-Capability Mapping
text
project root/
└── AGENTS.md -> global context (auto-injected, zero extra config)
.ai/
├── AGENTS.md -> global context
├── rules/ -> rules
├── commands/ -> commands
├── skills/ -> skills
├── agents/ -> agents
├── hooks/ -> hooks
└── tools/ -> tool-private config3.3 When to Use Directory vs Object
- Prefer directories for reusable, versioned assets
- Use object config for explicit overrides (for example
tools.gemini,mcp.servers) - Use
extendsfor temporary or externalized assets
3.4 Merging Multiple AGENTS.md Sources (Nested Presets)
When multiple sources exist (for example nested presets, .ai/AGENTS.md, root AGENTS.md):
- Use layered append semantics, not replacement
- Order (low -> high):
AGENTS.mdfrom preset dependency chainAGENTS.mdfrom current preset.ai/AGENTS.md- root
AGENTS.md context.globalinai.config.js(if explicitly provided)
Notes:
- Later layers have higher priority and represent closer project/user intent
- Structured capabilities (
rules/commands/...) still follow object merge with later overrides
4. Field Summary
preset/presets: choose presets (presetswins when both exist)extends: explicitly load external files and mergelanguage: i18n preferencecommands: command definitionshooks: hook definitionsagents: agent definitionsmcp: MCP server definitionstools: tool-private passthrough config
5. Non-Canonical Input Policy
- Fail fast on non-canonical capability fields
- Return actionable repair guidance
- Do not implement non-canonical concept handling in adapters
6. Design Constraints
- Minimal Knowledge Principle: expose mainstream concepts only
- Single canonical model: no dual-track semantics
- Adapter single responsibility: format conversion only