| doc-type | user | ||||
|---|---|---|---|---|---|
| title | Configuration Guide | ||||
| purpose | Documentation for ace-bundle/docs/configuration.md | ||||
| ace-docs |
|
This guide explains all configuration options available in ace-bundle YAML presets, including both simplified and section-based formats.
ace-bundle supports two configuration approaches:
- Simplified Format - Direct configuration without sections (ideal for simple use cases)
- Section-Based Format - Organized configuration with logical sections (ideal for complex contexts)
Both formats are fully supported and can be used interchangeably.
- You have simple, flat configurations
- You don't need complex organization or XML-style structured output
- You prefer a straightforward approach
- Your context requirements are basic
- You need structured output for processing by other tools
- You want clear separation between different types of content
- You're creating specialized review contexts (code review, security review, etc.)
- You need precise control over content ordering
- You want to use preset-in-section functionality
---
description: "Brief description of this preset"
bundle:
# Configuration goes here
---description: Human-readable description of the preset
presets: Array of preset names to inherit from (for preset composition)
bundle:
params: # Output and processing parameters
base: # Path or protocol to a file for base content
embed_document_source: bool # Include the preset file itself in output
sources: # Unified source list for files, commands, and presets
files: # List of files to include (simplified format)
commands: # List of commands to execute (simplified format)
diffs: # Git diff ranges (simplified format)
include: # Files to include via protocols
sections: # Section-based organization (alternative to simplified)bundle:
params:
output: cache|stdio|file # Where to send output (default: stdio)
format: markdown|markdown-xml|yaml|json # Output format (default: markdown)
max_size: 10485760 # Maximum output size in bytes (default: 10485760)
timeout: 30 # Command timeout in seconds (default: 30)cache: Save to cache directorystdio: Print to standard outputfile: Save to specified file (use with--outputCLI option)
markdown: Standard markdown with code blocksmarkdown-xml: Markdown with XML-style tags (recommended for sections)yaml: YAML formatjson: JSON format
The base key allows you to specify a file or protocol reference that will be loaded as the primary content, appearing before any section-based output.
bundle:
base: docs/system-prompt.md # Load from a file
# or
base: prompt://base/system # Load via protocol
# Base content appears first, followed by sections
sections:
guidelines:
files:
- docs/coding-standards.md- File Paths: Load content from any file path relative to the project root
- Protocol Support: Use protocol references like
prompt://,wfi://,guide://for dynamic content - Error Handling: Gracefully handles missing files or invalid protocols with clear error messages
- Output Position: Base content always appears before sections in formatted output
---
description: "Code review context with base instructions"
bundle:
params:
format: markdown-xml
base: prompt://base/system # Load base review instructions
sections:
focus:
title: "Review Focus"
files:
- prompt://focus/architecture/atom
- prompt://focus/languages/ruby---
description: "Simple project context"
bundle:
params:
output: stdio
format: markdown
max_size: 5242880
timeout: 15
embed_document_source: true
files:
- README.md
- lib/**/*.rb
- src/**/*.js
- "docs/**/*.md"
commands:
- pwd
- git status --short
- npm test
diffs:
- origin/main...HEAD
- HEAD~5...HEAD
------
description: "Source files without tests"
bundle:
files:
- src/**/*.rb
- lib/**/*.rb
exclude:
- "**/*_test.rb"
- "**/*_spec.rb"
- "test/**/*"
- "spec/**/*"
- "vendor/**/*"
- "node_modules/**/*"
------
description: "Include workflow files"
bundle:
include:
- wfi://code-review-workflow
- wfi://planning-session
- guide://development-guide
files:
- README.md
- CHANGELOG.md
---Use bundle.sources when you want one ordered list that mixes files, commands, and presets. This is equivalent to using
the dedicated files, commands, and presets keys, but it is easier to generate from prompt-preparation workflows.
---
description: "Mixed context sources"
bundle:
sources:
- file: README.md
- file: docs/**/*.md
- command: git status --short
- preset: project-base
---sources entries are normalized internally before the bundle runs:
fileentries are loaded likebundle.filescommandentries are executed likebundle.commandspresetentries are composed like top-levelpresets
You can mix sources with the dedicated keys when needed. Prefer dedicated keys for hand-written presets that benefit
from separate sections, and prefer sources for compact generated presets.
---
description: "Project context with sections"
bundle:
params:
output: cache
format: markdown-xml
max_size: 10485760
timeout: 30
embed_document_source: true
sections:
focus:
title: "Source Files"
description: "Main source code and documentation"
files:
- src/**/*.rb
- lib/**/*.rb
- README.md
exclude:
- "**/*_test.rb"
- "test/**/*"
commands:
title: "System Information"
description: "Current project status"
commands:
- pwd
- git status --short
- bundle exec rspec --format documentation
changes:
title: "Recent Changes"
description: "Code changes to review"
diff:
ranges:
- origin/main...HEAD
- HEAD~5...HEAD
intro:
title: "Introduction"
description: "Context for this review"
content: |
This code review focuses on the recent changes to the authentication system.
Please pay special attention to security implications and performance.
------
description: "Complete project context using presets"
bundle:
params:
output: stdio
format: markdown-xml
sections:
project_context:
title: "Complete Project Context"
description: "Project context built from multiple presets"
presets:
- "base"
- "development"
- "testing"
files:
- "src/**/*.rb"
- "docs/**/*.md"
content: |
This section combines base configuration with development and testing
setups, plus project-specific files and documentation.
security_review:
title: "Security Analysis"
description: "Security-focused review"
presets:
- "security-scanning"
- "dependency-audit"
commands:
- "custom-security-script.sh"
content: |
Security analysis combining standard scanning tools with custom validation.
------
description: "Comprehensive review with mixed content"
bundle:
sections:
comprehensive:
title: "Complete Review"
description: "Files, commands, diffs, and analysis"
files:
- "src/**/*.js"
- "package.json"
- "README.md"
commands:
- "npm test"
- "npm run lint"
- "npm audit"
diffs:
- "origin/main...HEAD"
content: |
This comprehensive review includes:
1. **Code Quality**: Style, patterns, maintainability
2. **Security**: Vulnerabilities and dependencies
3. **Testing**: Coverage and test results
4. **Performance**: Potential bottlenecks
Focus on security and performance aspects.
---files:
- "src/**/*.rb" # Glob patterns
- "lib/main.rb" # Specific files
- "docs/**/*.md" # Multiple patterns
- "config/*.yml" # YAML files
exclude: # Optional exclusion patterns
- "**/*_test.rb"
- "test/**/*"
- "vendor/**/*"commands:
- "pwd" # System commands
- "git status --short" # Git commands
- "npm test" # Package managers
- "bundle exec rspec" # Ruby commands
- "python -m pytest" # Python commandsace-bundle supports two formats for git diffs:
diffs: # or ranges (both work)
- "origin/main...HEAD" # Branch comparison
- "HEAD~5...HEAD" # Recent commits
- "main..feature" # Feature branch
- "abc123..def456" # Commit rangesThis format provides a simple array of git range strings. Both diffs and ranges keys are supported for backward compatibility.
diff:
ranges: # Required: array of git ranges
- "origin/main...HEAD"
- "HEAD~5...HEAD"
paths: # Optional: filter to specific paths
- "src/**/*.rb"
- "lib/**/*.js"
since: # Optional: alternative to ranges
"origin/main" # Expands to "origin/main...HEAD"The diff format supports additional options:
ranges: Array of git range strings (same as simple format)since: Single reference point (automatically expands tosince...HEAD)paths: Path filtering passed togit diff -- <paths>
Use simple format when: You only need basic git ranges Use complex format when: You need path filtering or other diff options
# Simple format - direct array
bundle:
diffs:
- "origin/main...HEAD"
# Complex format - with options
bundle:
diff:
ranges:
- "origin/main...HEAD"
# Complex format - using 'since'
bundle:
diff:
since: "origin/main" # Expands to "origin/main...HEAD"Both formats are normalized internally to the same ranges structure, ensuring consistent processing.
content: |
This is markdown content that will be included directly.
You can use **bold**, *italic*, and `code` formatting.
## Lists
- Item 1
- Item 2
- Item 3
### Code Blocks
```ruby
def example
puts "Hello, World!"
end
## Preset Composition
### Basic Preset Composition
```yaml
---
description: "Development environment"
presets:
- "base-config"
- "ruby-tools"
- "testing-setup"
bundle:
files:
- "src/**/*.rb"
commands:
- "bundle exec rspec"
---
The system automatically detects and prevents circular dependencies:
# preset-a.yaml
presets:
- "preset-b"
# preset-b.yaml
presets:
- "preset-a" # ❌ This will cause circular dependency errorRecommended Maximum Depth: 3-4 levels
While ace-bundle supports deep preset nesting, excessive depth can impact performance and maintainability. Follow these guidelines:
# base.md (level 0)
bundle:
files:
- "README.md"
# development.md (level 1)
presets:
- "base"
bundle:
files:
- "src/**/*.rb"
# project-context.md (level 2)
presets:
- "development"
- "testing"
bundle:
files:
- "docs/**/*.md"Performance: Fast loading, clear inheritance chain
# project-context.md (level 3)
presets:
- "team-shared" # references "base" (level 2)
- "ruby-tools" # references "development" (level 2)Performance: Slight overhead, still manageable
# feature-context.md (level 5+)
presets:
- "specialized" # references 4+ levels deepProblems:
- Slow context loading
- Difficult to debug inheritance issues
- Complex dependency chains
- Circular dependency risk increases
If you need deep nesting, consider flattening with explicit content:
# ❌ Deep nesting
presets:
- "level-1" # which includes level-2, level-3, level-4...
# ✅ Explicit composition
presets:
- "base"
- "ruby-tools"
- "testing"
- "deployment"
files:
- "specific/files/**/*"This makes dependencies explicit and improves performance.
| Depth Level | Load Time* | Maintainability |
|---|---|---|
| 1-2 levels | Fast | Excellent |
| 3-4 levels | Normal | Good |
| 5+ levels | Slow | Poor |
*Approximate relative performance on typical configurations
For section-based configurations:
- All section fields are optional (no required fields)
- Section names can be any valid YAML key
presetsmust be an array of strings if present- File patterns must be valid glob patterns or file paths
- Command strings are executed as-is
Error: Failed to load preset 'missing-preset': Preset 'missing-preset' not found
Warning: Section validation failed: Preset reference must be a string
Error: Circular dependency detected: preset-a -> preset-b -> preset-a
When using simplified format, ace-bundle automatically organizes content into sections:
| Traditional Field | Auto-Section | Title |
|---|---|---|
files |
files |
"Files" |
commands |
commands |
"Commands" |
diffs/ranges |
diffs |
"Diffs" |
This means simplified configurations still benefit from structured output when using markdown-xml format.
- Start Simple: Begin with simplified format, add sections only when needed
- Use Descriptive Names: Make preset and section names clear and meaningful
- Group Related Content: Keep similar files, commands, and content together
- Consider Audience: Structure configurations based on who will use the output
- Use Specific Patterns: Be precise with file patterns to avoid including unnecessary files
- Exclude Appropriately: Use exclude patterns to filter out test files, dependencies, etc.
- Order Logically: Arrange files and commands in the order you want them processed
- Create Focused Presets: Design presets for specific purposes (base, development, testing)
- Avoid Over-Composition: Keep preset hierarchies reasonably simple. While powerful, aim for a balance between reusability and clarity. For simple contexts, defining content directly can be more straightforward than composing multiple very small presets.
- Document Dependencies: Clearly document what each preset provides
- Limit File Scope: Use specific patterns rather than overly broad ones
- Set Appropriate Timeouts: Configure timeouts based on command complexity
- Monitor Output Size: Use
max_sizeto prevent unexpectedly large outputs
---
description: "Basic Ruby project context"
bundle:
params:
output: stdio
format: markdown
files:
- "lib/**/*.rb"
- "test/**/*.rb"
- "Gemfile"
- "README.md"
commands:
- "ruby -v"
- "bundle exec ruby -c lib/**/*.rb"
- "bundle exec rspec --format documentation"
------
description: "Security-focused Node.js review"
bundle:
params:
output: stdio
format: markdown-xml
timeout: 60
sections:
code:
title: "Source Code"
description: "Application source files"
files:
- "src/**/*.js"
- "lib/**/*.js"
- "package.json"
- "package-lock.json"
security:
title: "Security Analysis"
description: "Security scanning results"
commands:
- "npm audit --production"
- "npx eslint --ext .js src/"
- "npx semgrep --config=security"
dependencies:
title: "Dependencies"
description: "Package dependencies and versions"
commands:
- "npm list --depth=0"
- "npm outdated"
changes:
title: "Recent Changes"
description: "Code changes to review"
diff:
since: "origin/main" # Expands to origin/main...HEAD
---This configuration guide covers all available options in ace-bundle presets. Choose the format and features that best match your use case, from simple file listings to complex multi-section contexts with preset composition.