--- name: templates description: | Template gallery for sharing workflows, team presets, archetypes, domain configs, and complete setup bundles across ArcheFlow projects. Supports init-from-template, save-as-template, and clone-from-project operations. User: "archeflow init writing-short-story" User: "archeflow template save my-backend-setup" User: "archeflow template list" --- # Template Gallery -- Shareable ArcheFlow Configurations Makes ArcheFlow setups portable and reusable across projects. ## Template Storage | Location | Scope | Precedence | |----------|-------|------------| | `.archeflow/templates/` | Project-local | Higher (checked first) | | `~/.archeflow/templates/` | Global (user-wide) | Lower (fallback) | Subdirectories: `workflows/`, `teams/`, `archetypes/`, `domains/`, `bundles/`. ## Bundles A bundle is a complete setup (team + workflow + archetypes + domain) in one directory. **Manifest (`manifest.yaml`):** ```yaml name: writing-short-story description: "Complete setup for short fiction writing" domain: writing includes: team: story-development.yaml workflow: kurzgeschichte.yaml archetypes: [story-explorer.md, story-sage.md] domain: writing.yaml requires: [colette.yaml] variables: target_words: 6000 max_cycles: 2 ``` | Field | Required | Description | |-------|----------|-------------| | `name` | Yes | Bundle identifier for `archeflow init ` | | `description` | Yes | Human-readable description | | `includes` | Yes | File types to filenames within bundle | | `requires` | No | Files that must exist in target project | | `variables` | No | Key-value defaults, overridable at init | ## Operations **`archeflow init `** 1. Find bundle (project-local, then global) 2. Check `requires` files exist 3. Warn before overwriting existing `.archeflow/` config 4. Copy files to `.archeflow/` (teams/, workflows/, archetypes/, domains/) 5. Generate `.archeflow/config.yaml` with variables **`archeflow init --from `** - Copy teams/, workflows/, archetypes/, domains/, config.yaml, hooks.yaml - Skip run-specific data: events/, artifacts/, context/, templates/ **`archeflow template save `** - Package current `.archeflow/` into `~/.archeflow/templates/bundles//` - Auto-generate manifest.yaml **`archeflow template list`** - Show all bundles and individual templates (global + project-local) ## Variable Substitution Variables in manifests are stored in `.archeflow/config.yaml` after init. Substitution happens at run time, not template time. Override at init: `archeflow init writing-short-story --set target_words=8000` ## Individual Templates Single files can be copied directly without a bundle: - `~/.archeflow/templates/workflows/.yaml` - `~/.archeflow/templates/archetypes/.md` - `~/.archeflow/templates/teams/.yaml`