This document details how agent-sync processes input files and generates output files.
The inputs
field supports glob patterns with doublestar support for recursive matching and exclusions. Input paths are always resolved relative to the configuration file directory (where your agent-sync.yml
is located):
Pattern | Description |
---|---|
*.md |
All Markdown files in the current directory |
**/*.md |
All Markdown files in any subdirectory (recursive) |
!*_test.md |
Exclude all test Markdown files |
For detailed information about glob pattern syntax and behavior, see the Glob Patterns documentation.
inputs:
# Include all Markdown files in commands directory and subdirectories
- "commands/**/*.md"
# Exclude test files
- "!commands/**/*_test.md"
# Exclude specific temporary file
- "!commands/temp.md"
!
prefix) are processed first!
prefix) are applied to filter the resultsNote: The final list of files will be sorted alphabetically by path. If you need files to be processed in a specific order, list them individually without glob patterns.
The outputDirs
setting (at the project level or root level in simplified format) defines the base directories where files will be generated. The outputs
setting within each task defines which agents to generate files for and optionally the specific paths relative to the base directories.
outputDirs
are specified, the same output files will be generated in each directory.outputs
entry defines a specific agent target and (optionally) a custom output path.outputPath
is specified, the agent’s default path is used (see “Default Output Path Behavior” section).Example:
outputDirs:
- ~/projects/my-app
- ~/projects/my-app-worktree
tasks:
- type: memory
outputs:
- agent: roo
# Will be generated in both:
# ~/projects/my-app/.roo/rules/
# ~/projects/my-app-worktree/.roo/rules/
When specifying output directories in the outputDirs
setting:
/
on Unix or drive letters on Windows) are used as-is/
or drive letters) are:
This approach allows you to specify output directories relative to your configuration file, making configurations more portable across different environments, while ensuring that all paths used internally are unambiguous.
Example:
# If agent-sync.yml is located at /path/to/project/agent-sync.yml
outputDirs:
- dist # Will be resolved to absolute path: /path/to/project/dist
The format of the outputPath
determines how files are processed:
/
are treated as directories where individual files will be placed/
are treated as files where all input content will be concatenatedThe outputPath
can be specified as either relative or absolute:
/
on Unix or drive letters on Windows) are used as-isTrailing slash rule and aggregation examples:
.claude/agents/
→ each input mode becomes its own markdown file.roomodes
→ all input Roo modes aggregated into one YAML file.roo/rules/
→ each input memory becomes its own file.roo/rules/combined.md
→ all input memories concatenated into one fileFor example:
.roo/rules/
- Treated as a directory, each source file becomes a separate output file.roo/rules/combined.md
- Treated as a file, all source files are concatenated into one file.roomodes
- Treated as a single file aggregating all Roo modes in project scope/absolute/path/rules/
- Absolute path to a directory for separate output filesIf outputPath
is not specified, the agent’s default path is used (see “Default Output Path Behavior” sections below).
When no outputPath
is specified, the following default paths are used. The path format (with or without trailing slash) determines whether files are concatenated or kept separate:
Agent | Task Type | Default Path | Concatenation Behavior |
---|---|---|---|
Claude | memory | CLAUDE.md or ~/.claude/CLAUDE.md |
Concatenated (file path) |
Claude | command | .claude/commands/ |
Non-concatenated (directory path) |
Claude | mode | .claude/agents/ or ~/.claude/agents/ |
Non-concatenated (directory path, per-mode files) |
Roo | memory | .roo/rules/ |
Non-concatenated (directory path) |
Roo | command | .roo/commands/ or ~/.roo/commands/ |
Non-concatenated (directory path; Roo slash commands per file) |
Roo | mode | .roomodes (project; aggregation) or (user) VS Code globalStorage custom_modes.yaml (aggregation). User-scope OS-specific locations: macOS ~/Library/Application Support/Code/User/globalStorage/rooveterinaryinc.roo-cline/settings/custom_modes.yaml , Linux ~/.config/Code/User/globalStorage/rooveterinaryinc.roo-cline/settings/custom_modes.yaml , Windows %APPDATA%\Code\User\globalStorage\rooveterinaryinc.roo-cline\settings\custom_modes.yaml |
Concatenated (single file aggregation) |
Cline | memory | .clinerules/ or ~/Documents/Cline/Rules/ |
Non-concatenated (directory path) |
Cline | command | .clinerules/workflows/ or ~/Documents/Cline/Workflows/ |
Non-concatenated (directory path) |
Copilot | memory | .github/copilot-instructions.md or ~/.vscode/copilot-instructions.md |
Concatenated (file path) |
Copilot | command | .github/prompts/ or ~/.vscode/prompts/ |
Non-concatenated (directory path) |
When the agent-sync apply
command is executed, the following workflow occurs:
--dry-run
flag, the process will show what would be generated without actually writing files. The enhanced output displays content organized by agent with file status ([CREATE], [MODIFY], [UNCHANGED]), file paths, sizes, and per-agent summaries.Previous | Next |
---|---|
Template System | Glob Patterns |