Sources & Layouts
Source types
Section titled “Source types”Forge supports two source types for fetching AI configs.
Git source
Section titled “Git source”Any remote git repository (SSH or HTTPS).
sources: - name: team-skills type: git branch: mainFeatures:
- Shallow clone with temp-dir caching
- Connectivity verification via
git ls-remote GIT_TERMINAL_PROMPT=0for security (no interactive prompts)- SSH
ConnectTimeout=5, 10-second timeout
Local source
Section titled “Local source”A path on disk.
sources: - name: local-rules type: local path: ~/my-rulesFeatures:
- Supports
~expansion - Validates existence at configure time
Layouts
Section titled “Layouts”Forge auto-detects three source layouts.
Canonical
Section titled “Canonical”Flat files organized by resource type:
source-repo/ skills/ drawio/SKILL.md detect-stack/SKILL.md rules/ code-style.md workflows/ document-project.mdFiles are distributed to each assistant’s expected path and transformed as needed (e.g., .md → .mdc for Cursor).
Pre-structured
Section titled “Pre-structured”Contains assistant-specific directories:
source-repo/ .claude/ skills/... rules/... .cursor/ rules/... .windsurf/ rules/...Files are copied as-is without transforms. Each assistant gets only its own directory.
Hybrid
Section titled “Hybrid”Mix of both layouts:
source-repo/ skills/ ← canonical (transformed + distributed) rules/ ← canonical (transformed + distributed) .cursor/ ← pre-structured (copied as-is) rules/ custom.mdcCanonical files are transformed and distributed. Pre-structured files are copied directly. Auto-detected by detectSourceLayout().
Advanced options
Section titled “Advanced options”Filtering
Section titled “Filtering”Include or exclude files with glob patterns:
sources: - name: team-skills type: git include: - 'skills/**' - 'rules/**' exclude: - '**/*.test.md'Mapping
Section titled “Mapping”Prepend a virtual directory prefix:
sources: - name: flat-files type: local path: ~/my-rules map: 'rules' # turns flat files into rules/ subtreeLayout override
Section titled “Layout override”Override auto-detection:
sources: - name: team-skills type: git layout: canonical # auto | canonical | pre-structuredAdding a new source type
Section titled “Adding a new source type”Adding a new source type requires three files:
infrastructure/source/<type>/messages.ts— prompt constantsinfrastructure/source/<type>/loader.ts—configure()andload()implementationinfrastructure/source/<type>/index.ts— barrel export
Plus one entry in source/index.ts. Zero changes to any command handler.