|
| 1 | +# Configuration |
| 2 | + |
| 3 | +The workspace is configured via `ai-workspace.toml` at the repository root. All settings have sensible defaults -- you only need to change what's relevant to your project. |
| 4 | + |
| 5 | +## Full example |
| 6 | + |
| 7 | +Here's a complete config file with all defaults shown: |
| 8 | + |
| 9 | +```toml |
| 10 | +[workspace] |
| 11 | +name = "AI Workspace" |
| 12 | + |
| 13 | +[repositories] |
| 14 | +default_branch = "main" |
| 15 | +include_workspace_root = false |
| 16 | +[features] |
| 17 | +skills = true |
| 18 | +commands = true |
| 19 | +agent_docs = true |
| 20 | + |
| 21 | +[tools] |
| 22 | +show_unavailable = false |
| 23 | + |
| 24 | +[distribution] |
| 25 | +skills_paths = [".opencode/skill"] |
| 26 | +commands_paths = [ |
| 27 | + ".roo/commands", |
| 28 | + ".claude/commands", |
| 29 | + ".cursor/commands", |
| 30 | + ".opencode/command", |
| 31 | +] |
| 32 | + |
| 33 | +[distribution.commands_overrides] |
| 34 | +".cursor/commands" = "strip_frontmatter" |
| 35 | +``` |
| 36 | + |
| 37 | +--- |
| 38 | + |
| 39 | +## Workspace |
| 40 | + |
| 41 | +General workspace metadata. Section: `[workspace]` |
| 42 | + |
| 43 | +`name` |
| 44 | +: **Type:** string -- **Default:** `"AI Workspace"` |
| 45 | + |
| 46 | + Display name shown in tool UIs |
| 47 | + |
| 48 | +```toml |
| 49 | +[workspace] |
| 50 | +name = "My Project Workspace" |
| 51 | +``` |
| 52 | + |
| 53 | +--- |
| 54 | + |
| 55 | +## Repositories |
| 56 | + |
| 57 | +Controls repository status reporting at session start. Section: `[repositories]` |
| 58 | + |
| 59 | +`default_branch` |
| 60 | +: **Type:** string -- **Default:** `"main"` |
| 61 | + |
| 62 | + Fallback branch when not specified in `.gitmodules` |
| 63 | + |
| 64 | +`include_workspace_root` |
| 65 | +: **Type:** bool -- **Default:** `false` |
| 66 | + |
| 67 | + Include the workspace root repo in session status |
| 68 | + |
| 69 | +**Common customizations:** |
| 70 | + |
| 71 | +- Set `default_branch = "develop"` if your team uses `develop` as the main branch |
| 72 | +- Set `include_workspace_root = true` to also report workspace root repo status to agents |
| 73 | + |
| 74 | +--- |
| 75 | + |
| 76 | +## Session hooks |
| 77 | + |
| 78 | +Session hooks are pre-configured in each tool's config directory -- they're committed to the repo and work out of the box. No configuration needed. |
| 79 | + |
| 80 | +The session-start script runs repository status reporting and tool discovery, then injects the results into the agent's context. See [Session Hooks](development/session-hooks.md) for supported tools and details. |
| 81 | + |
| 82 | +--- |
| 83 | + |
| 84 | +## Features |
| 85 | + |
| 86 | +Enable or disable workspace features. Section: `[features]` |
| 87 | + |
| 88 | +`skills` |
| 89 | +: **Type:** bool -- **Default:** `true` |
| 90 | + |
| 91 | + Enable the skills system (`skills/` directory) |
| 92 | + |
| 93 | +`commands` |
| 94 | +: **Type:** bool -- **Default:** `true` |
| 95 | + |
| 96 | + Enable the commands system (`commands/` directory) |
| 97 | + |
| 98 | +`agent_docs` |
| 99 | +: **Type:** bool -- **Default:** `true` |
| 100 | + |
| 101 | + Enable the agent-docs system (`agent-docs/` directory) |
| 102 | + |
| 103 | +**What happens when you change these:** |
| 104 | + |
| 105 | +- **Enabling** a feature creates its directory with a README if it doesn't exist |
| 106 | +- **Disabling** a feature removes its directory **only if it's empty** (or contains just a README). |
| 107 | +If the directory has user content, pre-commit fails with instructions to manually remove the files first |
| 108 | + |
| 109 | +!!! note |
| 110 | + |
| 111 | + This prevents accidental data loss while letting you cleanly disable unused features. |
| 112 | + |
| 113 | +--- |
| 114 | + |
| 115 | +## Tools |
| 116 | + |
| 117 | +Controls the [Tool Discovery](features/tool-discovery.md) feature. Section: `[tools]` |
| 118 | + |
| 119 | +`show_unavailable` |
| 120 | +: **Type:** bool -- **Default:** `false` |
| 121 | + |
| 122 | + Show all defined tools with availability status, or only available ones |
| 123 | + |
| 124 | +**Behavior:** |
| 125 | + |
| 126 | +- `false` (default) -- Only tools found on the system PATH are shown to agents. Clean and focused. |
| 127 | +- `true` -- All tools are shown with `available="true"` or `available="false"`. Useful when you want agents to know about tools they *could* use if installed. |
| 128 | + |
| 129 | +Tools themselves are defined in `agent-tools.yaml` at the repo root, not in this config file. See [Tool Discovery](features/tool-discovery.md) for details on defining tools. |
| 130 | + |
| 131 | +--- |
| 132 | + |
| 133 | +## Distribution |
| 134 | + |
| 135 | +Controls where skills and commands are distributed for different AI tools. Section: `[distribution]` |
| 136 | + |
| 137 | +`skills_paths` |
| 138 | +: **Type:** list[str] -- **Default:** `[".opencode/skill"]` |
| 139 | + |
| 140 | + Target directories for skills symlinks |
| 141 | + |
| 142 | +`commands_paths` |
| 143 | +: **Type:** list[str] -- **Default:** *(see below)* |
| 144 | + |
| 145 | + Target directories for commands |
| 146 | + |
| 147 | +`commands_overrides` |
| 148 | +: **Type:** dict[str, str] -- **Default:** *(see below)* |
| 149 | + |
| 150 | + Override distribution method for specific command paths |
| 151 | + |
| 152 | +**Default command paths:** |
| 153 | + |
| 154 | +```toml |
| 155 | +commands_paths = [ |
| 156 | + ".roo/commands", |
| 157 | + ".claude/commands", |
| 158 | + ".cursor/commands", |
| 159 | + ".opencode/command", |
| 160 | +] |
| 161 | +``` |
| 162 | + |
| 163 | +**Default overrides:** |
| 164 | + |
| 165 | +```toml |
| 166 | +[distribution.commands_overrides] |
| 167 | +".cursor/commands" = "strip_frontmatter" |
| 168 | +``` |
| 169 | + |
| 170 | +### Distribution methods |
| 171 | + |
| 172 | +Skills and commands in their source directories (`skills/`, `commands/`) are the source of truth. The transpile scripts distribute them to tool-specific directories: |
| 173 | + |
| 174 | +| Method | When used | How it works | |
| 175 | +|--------|-----------|-------------| |
| 176 | +| **Symlink** | Default for all paths | Creates a symlink pointing to the source file/directory | |
| 177 | +| **Strip frontmatter** | `.cursor/*` paths (auto-detected) | Writes a copy with the YAML frontmatter removed | |
| 178 | + |
| 179 | +Paths starting with `.cursor/` automatically use `strip_frontmatter` without needing an explicit override. For all other paths, the default is `symlink`. |
| 180 | + |
| 181 | +### Overriding the distribution method |
| 182 | + |
| 183 | +Use `commands_overrides` to change the method for specific paths: |
| 184 | + |
| 185 | +```toml |
| 186 | +[distribution.commands_overrides] |
| 187 | +".cursor/commands" = "strip_frontmatter" # Auto-detected, but shown for clarity |
| 188 | +".my-tool/commands" = "strip_frontmatter" # Custom override for another tool |
| 189 | +``` |
| 190 | + |
| 191 | +Override keys must match a path in `commands_paths`. Valid methods: `symlink`, `strip_frontmatter`. |
| 192 | + |
| 193 | +You can also override auto-detection -- for example, to force symlinks for a `.cursor/` path: |
| 194 | + |
| 195 | +```toml |
| 196 | +[distribution.commands_overrides] |
| 197 | +".cursor/commands" = "symlink" # Override the auto-detection |
| 198 | +``` |
| 199 | + |
| 200 | +See [Commands](features/commands.md#distribution) for more details on how distribution works. |
| 201 | + |
| 202 | +### Adding a new tool target |
| 203 | + |
| 204 | +To distribute to an additional tool, add its path to the appropriate list: |
| 205 | + |
| 206 | +```toml |
| 207 | +[distribution] |
| 208 | +skills_paths = [ |
| 209 | + ".opencode/skill", |
| 210 | + ".my-tool/skills", # Add your tool's path |
| 211 | +] |
| 212 | +``` |
| 213 | + |
| 214 | +--- |
| 215 | + |
| 216 | +## How configuration is applied |
| 217 | + |
| 218 | +Configuration is applied at two points: |
| 219 | + |
| 220 | +1. **Pre-commit** (`align-workspace.py`) -- Reads `ai-workspace.toml` and: |
| 221 | + - Manages feature directories (create/remove based on `[features]`) |
| 222 | + - Renders `AGENTS.md` from the Jinja2 template |
| 223 | + - Runs skill and command validators |
| 224 | + |
| 225 | +2. **Session start** (`session-start.py`) -- Reads `ai-workspace.toml` and: |
| 226 | + - Reports repository status based on `[repositories]` settings |
| 227 | + - Discovers tools based on `[tools]` settings |
| 228 | + |
| 229 | +After changing `ai-workspace.toml`, run pre-commit to apply: |
| 230 | + |
| 231 | +```bash |
| 232 | +uv run pre-commit run --all-files |
| 233 | +``` |
| 234 | + |
| 235 | +## AGENTS.md generation |
| 236 | + |
| 237 | +`AGENTS.md` is auto-generated from a Jinja2 template and your project-specific content. See [AGENTS.md Generation](agents-md.md) for how the template system works, available template variables, and customization options. |
0 commit comments