Skip to content

Commit 58f7da6

Browse files
committed
docs: document the plural forms
1 parent 5a199b0 commit 58f7da6

8 files changed

Lines changed: 57 additions & 53 deletions

File tree

packages/web/src/content/docs/agents.mdx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -157,10 +157,10 @@ Configure agents in your `opencode.json` config file:
157157

158158
You can also define agents using markdown files. Place them in:
159159

160-
- Global: `~/.config/opencode/agent/`
161-
- Per-project: `.opencode/agent/`
160+
- Global: `~/.config/opencode/agents/`
161+
- Per-project: `.opencode/agents/`
162162

163-
```markdown title="~/.config/opencode/agent/review.md"
163+
```markdown title="~/.config/opencode/agents/review.md"
164164
---
165165
description: Reviews code for quality and best practices
166166
mode: subagent
@@ -419,7 +419,7 @@ You can override these permissions per agent.
419419

420420
You can also set permissions in Markdown agents.
421421

422-
```markdown title="~/.config/opencode/agent/review.md"
422+
```markdown title="~/.config/opencode/agents/review.md"
423423
---
424424
description: Code review without edits
425425
mode: subagent
@@ -637,7 +637,7 @@ Do you have an agent you'd like to share? [Submit a PR](https://github.com/anoma
637637

638638
### Documentation agent
639639

640-
```markdown title="~/.config/opencode/agent/docs-writer.md"
640+
```markdown title="~/.config/opencode/agents/docs-writer.md"
641641
---
642642
description: Writes and maintains project documentation
643643
mode: subagent
@@ -659,7 +659,7 @@ Focus on:
659659

660660
### Security auditor
661661

662-
```markdown title="~/.config/opencode/agent/security-auditor.md"
662+
```markdown title="~/.config/opencode/agents/security-auditor.md"
663663
---
664664
description: Performs security audits and identifies vulnerabilities
665665
mode: subagent

packages/web/src/content/docs/commands.mdx

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ Custom commands are in addition to the built-in commands like `/init`, `/undo`,
1515

1616
## Create command files
1717

18-
Create markdown files in the `command/` directory to define custom commands.
18+
Create markdown files in the `commands/` directory to define custom commands.
1919

20-
Create `.opencode/command/test.md`:
20+
Create `.opencode/commands/test.md`:
2121

22-
```md title=".opencode/command/test.md"
22+
```md title=".opencode/commands/test.md"
2323
---
2424
description: Run tests with coverage
2525
agent: build
@@ -42,7 +42,7 @@ Use the command by typing `/` followed by the command name.
4242

4343
## Configure
4444

45-
You can add custom commands through the OpenCode config or by creating markdown files in the `command/` directory.
45+
You can add custom commands through the OpenCode config or by creating markdown files in the `commands/` directory.
4646

4747
---
4848

@@ -79,10 +79,10 @@ Now you can run this command in the TUI:
7979

8080
You can also define commands using markdown files. Place them in:
8181

82-
- Global: `~/.config/opencode/command/`
83-
- Per-project: `.opencode/command/`
82+
- Global: `~/.config/opencode/commands/`
83+
- Per-project: `.opencode/commands/`
8484

85-
```markdown title="~/.config/opencode/command/test.md"
85+
```markdown title="~/.config/opencode/commands/test.md"
8686
---
8787
description: Run tests with coverage
8888
agent: build
@@ -112,7 +112,7 @@ The prompts for the custom commands support several special placeholders and syn
112112

113113
Pass arguments to commands using the `$ARGUMENTS` placeholder.
114114

115-
```md title=".opencode/command/component.md"
115+
```md title=".opencode/commands/component.md"
116116
---
117117
description: Create a new component
118118
---
@@ -138,7 +138,7 @@ You can also access individual arguments using positional parameters:
138138

139139
For example:
140140

141-
```md title=".opencode/command/create-file.md"
141+
```md title=".opencode/commands/create-file.md"
142142
---
143143
description: Create a new file with content
144144
---
@@ -167,7 +167,7 @@ Use _!`command`_ to inject [bash command](/docs/tui#bash-commands) output into y
167167

168168
For example, to create a custom command that analyzes test coverage:
169169

170-
```md title=".opencode/command/analyze-coverage.md"
170+
```md title=".opencode/commands/analyze-coverage.md"
171171
---
172172
description: Analyze test coverage
173173
---
@@ -180,7 +180,7 @@ Based on these results, suggest improvements to increase coverage.
180180

181181
Or to review recent changes:
182182

183-
```md title=".opencode/command/review-changes.md"
183+
```md title=".opencode/commands/review-changes.md"
184184
---
185185
description: Review recent changes
186186
---
@@ -199,7 +199,7 @@ Commands run in your project's root directory and their output becomes part of t
199199

200200
Include files in your command using `@` followed by the filename.
201201

202-
```md title=".opencode/command/review-component.md"
202+
```md title=".opencode/commands/review-component.md"
203203
---
204204
description: Review component
205205
---

packages/web/src/content/docs/config.mdx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,10 @@ Config sources are loaded in this order (later sources override earlier ones):
5151

5252
This means project configs can override global defaults, and global configs can override remote organizational defaults.
5353

54+
:::note
55+
The `.opencode` and `~/.config/opencode` directories use **plural names** for subdirectories: `agents/`, `commands/`, `modes/`, `plugins/`, `skills/`, `tools/`, and `themes/`. Singular names (e.g., `agent/`) are also supported for backwards compatibility.
56+
:::
57+
5458
---
5559

5660
### Remote
@@ -330,7 +334,7 @@ You can configure specialized agents for specific tasks through the `agent` opti
330334
}
331335
```
332336

333-
You can also define agents using markdown files in `~/.config/opencode/agent/` or `.opencode/agent/`. [Learn more here](/docs/agents).
337+
You can also define agents using markdown files in `~/.config/opencode/agents/` or `.opencode/agents/`. [Learn more here](/docs/agents).
334338

335339
---
336340

@@ -394,7 +398,7 @@ You can configure custom commands for repetitive tasks through the `command` opt
394398
}
395399
```
396400

397-
You can also define commands using markdown files in `~/.config/opencode/command/` or `.opencode/command/`. [Learn more here](/docs/commands).
401+
You can also define commands using markdown files in `~/.config/opencode/commands/` or `.opencode/commands/`. [Learn more here](/docs/commands).
398402

399403
---
400404

@@ -530,7 +534,7 @@ You can configure MCP servers you want to use through the `mcp` option.
530534

531535
[Plugins](/docs/plugins) extend OpenCode with custom tools, hooks, and integrations.
532536

533-
Place plugin files in `.opencode/plugin/` or `~/.config/opencode/plugin/`. You can also load plugins from npm through the `plugin` option.
537+
Place plugin files in `.opencode/plugins/` or `~/.config/opencode/plugins/`. You can also load plugins from npm through the `plugin` option.
534538

535539
```json title="opencode.json"
536540
{

packages/web/src/content/docs/custom-tools.mdx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,16 @@ Tools are defined as **TypeScript** or **JavaScript** files. However, the tool d
1717

1818
They can be defined:
1919

20-
- Locally by placing them in the `.opencode/tool/` directory of your project.
21-
- Or globally, by placing them in `~/.config/opencode/tool/`.
20+
- Locally by placing them in the `.opencode/tools/` directory of your project.
21+
- Or globally, by placing them in `~/.config/opencode/tools/`.
2222

2323
---
2424

2525
### Structure
2626

2727
The easiest way to create tools is using the `tool()` helper which provides type-safety and validation.
2828

29-
```ts title=".opencode/tool/database.ts" {1}
29+
```ts title=".opencode/tools/database.ts" {1}
3030
import { tool } from "@opencode-ai/plugin"
3131

3232
export default tool({
@@ -49,7 +49,7 @@ The **filename** becomes the **tool name**. The above creates a `database` tool.
4949

5050
You can also export multiple tools from a single file. Each export becomes **a separate tool** with the name **`<filename>_<exportname>`**:
5151

52-
```ts title=".opencode/tool/math.ts"
52+
```ts title=".opencode/tools/math.ts"
5353
import { tool } from "@opencode-ai/plugin"
5454

5555
export const add = tool({
@@ -112,7 +112,7 @@ export default {
112112

113113
Tools receive context about the current session:
114114

115-
```ts title=".opencode/tool/project.ts" {8}
115+
```ts title=".opencode/tools/project.ts" {8}
116116
import { tool } from "@opencode-ai/plugin"
117117

118118
export default tool({
@@ -136,7 +136,7 @@ You can write your tools in any language you want. Here's an example that adds t
136136

137137
First, create the tool as a Python script:
138138

139-
```python title=".opencode/tool/add.py"
139+
```python title=".opencode/tools/add.py"
140140
import sys
141141

142142
a = int(sys.argv[1])
@@ -146,7 +146,7 @@ print(a + b)
146146

147147
Then create the tool definition that invokes it:
148148

149-
```ts title=".opencode/tool/python-add.ts" {10}
149+
```ts title=".opencode/tools/python-add.ts" {10}
150150
import { tool } from "@opencode-ai/plugin"
151151

152152
export default tool({
@@ -156,7 +156,7 @@ export default tool({
156156
b: tool.schema.number().describe("Second number"),
157157
},
158158
async execute(args) {
159-
const result = await Bun.$`python3 .opencode/tool/add.py ${args.a} ${args.b}`.text()
159+
const result = await Bun.$`python3 .opencode/tools/add.py ${args.a} ${args.b}`.text()
160160
return result.trim()
161161
},
162162
})

packages/web/src/content/docs/modes.mdx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -87,10 +87,10 @@ Configure modes in your `opencode.json` config file:
8787

8888
You can also define modes using markdown files. Place them in:
8989

90-
- Global: `~/.config/opencode/mode/`
91-
- Project: `.opencode/mode/`
90+
- Global: `~/.config/opencode/modes/`
91+
- Project: `.opencode/modes/`
9292

93-
```markdown title="~/.config/opencode/mode/review.md"
93+
```markdown title="~/.config/opencode/modes/review.md"
9494
---
9595
model: anthropic/claude-sonnet-4-20250514
9696
temperature: 0.1
@@ -268,9 +268,9 @@ You can create your own custom modes by adding them to the configuration. Here a
268268

269269
### Using markdown files
270270

271-
Create mode files in `.opencode/mode/` for project-specific modes or `~/.config/opencode/mode/` for global modes:
271+
Create mode files in `.opencode/modes/` for project-specific modes or `~/.config/opencode/modes/` for global modes:
272272

273-
```markdown title=".opencode/mode/debug.md"
273+
```markdown title=".opencode/modes/debug.md"
274274
---
275275
temperature: 0.1
276276
tools:
@@ -294,7 +294,7 @@ Focus on:
294294
Do not make any changes to files. Only investigate and report.
295295
```
296296

297-
```markdown title="~/.config/opencode/mode/refactor.md"
297+
```markdown title="~/.config/opencode/modes/refactor.md"
298298
---
299299
model: anthropic/claude-sonnet-4-20250514
300300
temperature: 0.2

packages/web/src/content/docs/permissions.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ Refer to the [Granular Rules (Object Syntax)](#granular-rules-object-syntax) sec
174174

175175
You can also configure agent permissions in Markdown:
176176

177-
```markdown title="~/.config/opencode/agent/review.md"
177+
```markdown title="~/.config/opencode/agents/review.md"
178178
---
179179
description: Code review without edits
180180
mode: subagent

packages/web/src/content/docs/plugins.mdx

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ There are two ways to load plugins.
1919

2020
Place JavaScript or TypeScript files in the plugin directory.
2121

22-
- `.opencode/plugin/` - Project-level plugins
23-
- `~/.config/opencode/plugin/` - Global plugins
22+
- `.opencode/plugins/` - Project-level plugins
23+
- `~/.config/opencode/plugins/` - Global plugins
2424

2525
Files in these directories are automatically loaded at startup.
2626

@@ -57,8 +57,8 @@ Plugins are loaded from all sources and all hooks run in sequence. The load orde
5757

5858
1. Global config (`~/.config/opencode/opencode.json`)
5959
2. Project config (`opencode.json`)
60-
3. Global plugin directory (`~/.config/opencode/plugin/`)
61-
4. Project plugin directory (`.opencode/plugin/`)
60+
3. Global plugin directory (`~/.config/opencode/plugins/`)
61+
4. Project plugin directory (`.opencode/plugins/`)
6262

6363
Duplicate npm packages with the same name and version are loaded once. However, a local plugin and an npm plugin with similar names are both loaded separately.
6464

@@ -85,7 +85,7 @@ Local plugins and custom tools can use external npm packages. Add a `package.jso
8585

8686
OpenCode runs `bun install` at startup to install these. Your plugins and tools can then import them.
8787

88-
```ts title=".opencode/plugin/my-plugin.ts"
88+
```ts title=".opencode/plugins/my-plugin.ts"
8989
import { escape } from "shescape"
9090

9191
export const MyPlugin = async (ctx) => {
@@ -103,7 +103,7 @@ export const MyPlugin = async (ctx) => {
103103

104104
### Basic structure
105105

106-
```js title=".opencode/plugin/example.js"
106+
```js title=".opencode/plugins/example.js"
107107
export const MyPlugin = async ({ project, client, $, directory, worktree }) => {
108108
console.log("Plugin initialized!")
109109

@@ -215,7 +215,7 @@ Here are some examples of plugins you can use to extend opencode.
215215

216216
Send notifications when certain events occur:
217217

218-
```js title=".opencode/plugin/notification.js"
218+
```js title=".opencode/plugins/notification.js"
219219
export const NotificationPlugin = async ({ project, client, $, directory, worktree }) => {
220220
return {
221221
event: async ({ event }) => {
@@ -240,7 +240,7 @@ If you’re using the OpenCode desktop app, it can send system notifications aut
240240

241241
Prevent opencode from reading `.env` files:
242242

243-
```javascript title=".opencode/plugin/env-protection.js"
243+
```javascript title=".opencode/plugins/env-protection.js"
244244
export const EnvProtection = async ({ project, client, $, directory, worktree }) => {
245245
return {
246246
"tool.execute.before": async (input, output) => {
@@ -258,7 +258,7 @@ export const EnvProtection = async ({ project, client, $, directory, worktree })
258258

259259
Plugins can also add custom tools to opencode:
260260

261-
```ts title=".opencode/plugin/custom-tools.ts"
261+
```ts title=".opencode/plugins/custom-tools.ts"
262262
import { type Plugin, tool } from "@opencode-ai/plugin"
263263

264264
export const CustomToolsPlugin: Plugin = async (ctx) => {
@@ -292,7 +292,7 @@ Your custom tools will be available to opencode alongside built-in tools.
292292

293293
Use `client.app.log()` instead of `console.log` for structured logging:
294294

295-
```ts title=".opencode/plugin/my-plugin.ts"
295+
```ts title=".opencode/plugins/my-plugin.ts"
296296
export const MyPlugin = async ({ client }) => {
297297
await client.app.log({
298298
service: "my-plugin",
@@ -311,7 +311,7 @@ Levels: `debug`, `info`, `warn`, `error`. See [SDK documentation](https://openco
311311

312312
Customize the context included when a session is compacted:
313313

314-
```ts title=".opencode/plugin/compaction.ts"
314+
```ts title=".opencode/plugins/compaction.ts"
315315
import type { Plugin } from "@opencode-ai/plugin"
316316

317317
export const CompactionPlugin: Plugin = async (ctx) => {
@@ -335,7 +335,7 @@ The `experimental.session.compacting` hook fires before the LLM generates a cont
335335

336336
You can also replace the compaction prompt entirely by setting `output.prompt`:
337337

338-
```ts title=".opencode/plugin/custom-compaction.ts"
338+
```ts title=".opencode/plugins/custom-compaction.ts"
339339
import type { Plugin } from "@opencode-ai/plugin"
340340

341341
export const CustomCompactionPlugin: Plugin = async (ctx) => {

packages/web/src/content/docs/skills.mdx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ Skills are loaded on-demand via the native `skill` tool—agents see available s
1313
Create one folder per skill name and put a `SKILL.md` inside it.
1414
OpenCode searches these locations:
1515

16-
- Project config: `.opencode/skill/<name>/SKILL.md`
17-
- Global config: `~/.config/opencode/skill/<name>/SKILL.md`
16+
- Project config: `.opencode/skills/<name>/SKILL.md`
17+
- Global config: `~/.config/opencode/skills/<name>/SKILL.md`
1818
- Project Claude-compatible: `.claude/skills/<name>/SKILL.md`
1919
- Global Claude-compatible: `~/.claude/skills/<name>/SKILL.md`
2020

@@ -23,9 +23,9 @@ OpenCode searches these locations:
2323
## Understand discovery
2424

2525
For project-local paths, OpenCode walks up from your current working directory until it reaches the git worktree.
26-
It loads any matching `skill/*/SKILL.md` in `.opencode/` and any matching `.claude/skills/*/SKILL.md` along the way.
26+
It loads any matching `skills/*/SKILL.md` in `.opencode/` and any matching `.claude/skills/*/SKILL.md` along the way.
2727

28-
Global definitions are also loaded from `~/.config/opencode/skill/*/SKILL.md` and `~/.claude/skills/*/SKILL.md`.
28+
Global definitions are also loaded from `~/.config/opencode/skills/*/SKILL.md` and `~/.claude/skills/*/SKILL.md`.
2929

3030
---
3131

@@ -71,7 +71,7 @@ Keep it specific enough for the agent to choose correctly.
7171

7272
## Use an example
7373

74-
Create `.opencode/skill/git-release/SKILL.md` like this:
74+
Create `.opencode/skills/git-release/SKILL.md` like this:
7575

7676
```markdown
7777
---

0 commit comments

Comments
 (0)