|
| 1 | +# Configuration |
| 2 | + |
| 3 | +The workspace is configured via `ai-workspace.toml` at the repository root. Most settings have sensible defaults - distribution paths must be explicitly configured for your project. |
| 4 | + |
| 5 | +## Full example |
| 6 | + |
| 7 | +Here's a complete config file showing all settings. |
| 8 | +Distribution paths (`skills_paths`, `commands_paths`) default to empty and must be configured for your tools: |
| 9 | + |
| 10 | +```toml |
| 11 | +[repositories] |
| 12 | +include_workspace_root = false |
| 13 | + |
| 14 | +[features] |
| 15 | +skills = true |
| 16 | +commands = true |
| 17 | +agent_docs = true |
| 18 | + |
| 19 | +[tools] |
| 20 | +show_unavailable = false |
| 21 | + |
| 22 | +[distribution] |
| 23 | +skills_paths = [".opencode/skill"] |
| 24 | +commands_paths = [ |
| 25 | + ".claude/commands", |
| 26 | + ".cursor/commands", |
| 27 | + ".opencode/command", |
| 28 | +] |
| 29 | + |
| 30 | +[distribution.commands_overrides] |
| 31 | +".cursor/commands" = "strip_frontmatter" |
| 32 | +``` |
| 33 | + |
| 34 | +--- |
| 35 | + |
| 36 | +## Repositories |
| 37 | + |
| 38 | +Controls repository status reporting at session start. Section: `[repositories]` |
| 39 | + |
| 40 | +`include_workspace_root` |
| 41 | +: **Type:** bool - **Default:** `false` |
| 42 | + |
| 43 | + Include the workspace root repo in session status |
| 44 | + |
| 45 | +The default branch for each submodule is auto-detected at session start. If detection fails (e.g., a submodule uses a non-standard default branch like `develop`), set the `branch` field in `.gitmodules` for that submodule. |
| 46 | +See [Repositories](repositories.md#default-branch-detection) for details. |
| 47 | + |
| 48 | +--- |
| 49 | + |
| 50 | +## Session hooks |
| 51 | + |
| 52 | +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. |
| 53 | + |
| 54 | +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. |
| 55 | + |
| 56 | +--- |
| 57 | + |
| 58 | +## Features |
| 59 | + |
| 60 | +Enable or disable workspace features. Section: `[features]` |
| 61 | + |
| 62 | +`skills` |
| 63 | +: **Type:** bool - **Default:** `true` |
| 64 | + |
| 65 | + Enable the skills system (`skills/` directory) |
| 66 | + |
| 67 | +`commands` |
| 68 | +: **Type:** bool - **Default:** `true` |
| 69 | + |
| 70 | + Enable the commands system (`commands/` directory) |
| 71 | + |
| 72 | +`agent_docs` |
| 73 | +: **Type:** bool - **Default:** `true` |
| 74 | + |
| 75 | + Enable the agent-docs system (`agent-docs/` directory) |
| 76 | + |
| 77 | +**What happens when you change these:** |
| 78 | + |
| 79 | +- **Enabling** a feature creates its directory with a README if it doesn't exist |
| 80 | +- **Disabling** a feature removes its directory **only if it's empty** (or contains just a README). |
| 81 | +If the directory has user content, pre-commit fails with instructions to manually remove the files first |
| 82 | + |
| 83 | +!!! note |
| 84 | + |
| 85 | + This prevents accidental data loss while letting you cleanly disable unused features. |
| 86 | + |
| 87 | +--- |
| 88 | + |
| 89 | +## Tools |
| 90 | + |
| 91 | +Controls the [Tool Discovery](features/tool-discovery.md) feature. Section: `[tools]` |
| 92 | + |
| 93 | +`show_unavailable` |
| 94 | +: **Type:** bool - **Default:** `false` |
| 95 | + |
| 96 | + Show all defined tools with availability status, or only available ones |
| 97 | + |
| 98 | +**Behavior:** |
| 99 | + |
| 100 | +- `false` (default) - Only tools found on the system PATH are shown to agents. Clean and focused. |
| 101 | +- `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. |
| 102 | + |
| 103 | +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. |
| 104 | + |
| 105 | +--- |
| 106 | + |
| 107 | +## Distribution |
| 108 | + |
| 109 | +Controls where skills and commands are distributed for different AI tools. Section: `[distribution]` |
| 110 | + |
| 111 | +Distribution paths default to empty - you must explicitly configure them for the tools you use. |
| 112 | + |
| 113 | +`skills_paths` |
| 114 | +: **Type:** list[str] - **Default:** `[]` |
| 115 | + |
| 116 | + Target directories for skills symlinks |
| 117 | + |
| 118 | +`commands_paths` |
| 119 | +: **Type:** list[str] - **Default:** `[]` |
| 120 | + |
| 121 | + Target directories for commands |
| 122 | + |
| 123 | +`commands_overrides` |
| 124 | +: **Type:** dict[str, str] - **Default:** `{}` |
| 125 | + |
| 126 | + Override distribution method for specific command paths. Keys are paths from `commands_paths`, values are distribution methods (`symlink` or `strip_frontmatter`). Overrides for paths not yet in `commands_paths` are kept for future use (a warning is printed during distribution). |
| 127 | + |
| 128 | +### Distribution methods |
| 129 | + |
| 130 | +Skills and commands in their source directories (`skills/`, `commands/`) are the source of truth. The transpile scripts distribute them to tool-specific directories: |
| 131 | + |
| 132 | +| Method | How it works | |
| 133 | +|--------|-------------| |
| 134 | +| **Symlink** | Default for all paths. Creates a symlink pointing to the source file/directory. | |
| 135 | +| **Strip frontmatter** | Writes a copy with the YAML frontmatter removed. Use for tools that don't parse frontmatter. | |
| 136 | + |
| 137 | +The `strip_frontmatter` method is needed for tools that send frontmatter to the LLM as part of the prompt instead of parsing it as metadata. For example, at the time of writing, [Cursor](https://cursor.com/docs/context/commands) doesn't support frontmatter metadata in commands. |
| 138 | + |
| 139 | +### Configuring distribution |
| 140 | + |
| 141 | +Add your tool's paths to the appropriate list. Use `commands_overrides` to set `strip_frontmatter` for tools that need it: |
| 142 | + |
| 143 | +```toml |
| 144 | +[distribution] |
| 145 | +skills_paths = [ |
| 146 | + ".opencode/skill", |
| 147 | +] |
| 148 | +commands_paths = [ |
| 149 | + ".claude/commands", |
| 150 | + ".cursor/commands", |
| 151 | + ".opencode/command", |
| 152 | +] |
| 153 | + |
| 154 | +[distribution.commands_overrides] |
| 155 | +".cursor/commands" = "strip_frontmatter" |
| 156 | +``` |
| 157 | + |
| 158 | +See [Commands](features/commands.md#distribution) for more details on how distribution works. |
| 159 | + |
| 160 | +--- |
| 161 | + |
| 162 | +## How configuration is applied |
| 163 | + |
| 164 | +Configuration is applied at two points: |
| 165 | + |
| 166 | +1. **Pre-commit** (`align-workspace.py`) - Reads `ai-workspace.toml` and: |
| 167 | + - Manages feature directories (create/remove based on `[features]`) |
| 168 | + - Renders `AGENTS.md` from the Jinja2 template |
| 169 | + - Runs skill and command validators |
| 170 | + |
| 171 | +2. **Session start** (`session-start.py`) - Reads `ai-workspace.toml` and: |
| 172 | + - Reports repository status based on `[repositories]` settings |
| 173 | + - Discovers tools based on `[tools]` settings |
| 174 | + |
| 175 | +After changing `ai-workspace.toml`, run pre-commit to apply: |
| 176 | + |
| 177 | +```bash |
| 178 | +uv run pre-commit run --all-files |
| 179 | +``` |
| 180 | + |
| 181 | +## AGENTS.md generation |
| 182 | + |
| 183 | +`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