@sveltejs/opencode 0.0.2 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +75 -0
- package/package.json +1 -1
package/README.md
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
# @sveltejs/opencode
|
|
2
|
+
|
|
3
|
+
OpenCode plugin for Svelte that provides the Svelte MCP server, a specialized file editor subagent and instruction files.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
Add `@sveltejs/opencode` to your OpenCode config (either global or local):
|
|
8
|
+
|
|
9
|
+
```json
|
|
10
|
+
{
|
|
11
|
+
"$schema": "https://opencode.ai/config.json",
|
|
12
|
+
"plugin": ["@sveltejs/opencode"]
|
|
13
|
+
}
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
That's it! You now have the Svelte MCP server and the file editor subagent configured automatically.
|
|
17
|
+
|
|
18
|
+
## Features
|
|
19
|
+
|
|
20
|
+
### Svelte MCP Server
|
|
21
|
+
|
|
22
|
+
The plugin automatically configures the [Svelte MCP server](https://mcp.svelte.dev) which provides:
|
|
23
|
+
|
|
24
|
+
- **list-sections** - Discover available Svelte 5 and SvelteKit documentation sections
|
|
25
|
+
- **get-documentation** - Retrieve full documentation content for specific sections
|
|
26
|
+
- **svelte-autofixer** - Analyze Svelte code and get issues/suggestions
|
|
27
|
+
- **playground-link** - Generate Svelte Playground links with provided code
|
|
28
|
+
|
|
29
|
+
### Svelte File Editor Subagent
|
|
30
|
+
|
|
31
|
+
A specialized subagent (`svelte-file-editor`) that is automatically used when creating, editing, or reviewing `.svelte`, `.svelte.ts`, or `.svelte.js` files. It fetches relevant documentation and validates code using the Svelte MCP server tools.
|
|
32
|
+
|
|
33
|
+
### Agent Instructions
|
|
34
|
+
|
|
35
|
+
The plugin injects instructions that teach the agent how to effectively use the Svelte MCP tools.
|
|
36
|
+
|
|
37
|
+
## Configuration
|
|
38
|
+
|
|
39
|
+
The default configuration:
|
|
40
|
+
|
|
41
|
+
```json
|
|
42
|
+
{
|
|
43
|
+
"$schema": "https://raw.githubusercontent.com/sveltejs/mcp/refs/heads/main/packages/opencode/schema.json",
|
|
44
|
+
"mcp": {
|
|
45
|
+
"type": "remote",
|
|
46
|
+
"enabled": true
|
|
47
|
+
},
|
|
48
|
+
"subagent": {
|
|
49
|
+
"enabled": true
|
|
50
|
+
},
|
|
51
|
+
"instructions": {
|
|
52
|
+
"enabled": true
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
### Configuration Options
|
|
58
|
+
|
|
59
|
+
| Option | Type | Default | Description |
|
|
60
|
+
| ---------------------- | ----------------------- | ---------- | -------------------------------------------------------------------------------- |
|
|
61
|
+
| `mcp.type` | `"remote"` \| `"local"` | `"remote"` | Use the remote server at `mcp.svelte.dev` or run locally via `npx @sveltejs/mcp` |
|
|
62
|
+
| `mcp.enabled` | `boolean` | `true` | Enable/disable the MCP server |
|
|
63
|
+
| `subagent.enabled` | `boolean` | `true` | Enable/disable the Svelte file editor subagent |
|
|
64
|
+
| `instructions.enabled` | `boolean` | `true` | Enable/disable agent instructions injection |
|
|
65
|
+
|
|
66
|
+
### Config File Location
|
|
67
|
+
|
|
68
|
+
Place your configuration at one of these locations:
|
|
69
|
+
|
|
70
|
+
- `~/.config/opencode/svelte.json` (global)
|
|
71
|
+
- `$OPENCODE_CONFIG_DIR/svelte.json` (if `OPENCODE_CONFIG_DIR` is set, takes priority)
|
|
72
|
+
|
|
73
|
+
## License
|
|
74
|
+
|
|
75
|
+
MIT
|