@sveltejs/opencode 0.1.5 → 0.1.6
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 +50 -13
- package/index.ts +1 -1
- package/package.json +1 -1
- package/skills/svelte-core-bestpractices/SKILL.md +1 -1
package/README.md
CHANGED
|
@@ -36,39 +36,76 @@ The plugin injects instructions that teach the agent how to effectively use the
|
|
|
36
36
|
|
|
37
37
|
## Configuration
|
|
38
38
|
|
|
39
|
-
|
|
39
|
+
Create `svelte.json` to customize how the plugin configures MCP, the Svelte subagent, instructions, and skills.
|
|
40
40
|
|
|
41
41
|
```json
|
|
42
42
|
{
|
|
43
|
-
"$schema": "https://
|
|
43
|
+
"$schema": "https://svelte.dev/opencode/schema.json",
|
|
44
44
|
"mcp": {
|
|
45
45
|
"type": "remote",
|
|
46
46
|
"enabled": true
|
|
47
47
|
},
|
|
48
48
|
"subagent": {
|
|
49
|
-
"enabled": true
|
|
49
|
+
"enabled": true,
|
|
50
|
+
"agents": {
|
|
51
|
+
"svelte-file-editor": {
|
|
52
|
+
"model": "anthropic/claude-sonnet-4-20250514",
|
|
53
|
+
"temperature": 0.7,
|
|
54
|
+
"top_p": 0.9,
|
|
55
|
+
"maxSteps": 20
|
|
56
|
+
}
|
|
57
|
+
}
|
|
50
58
|
},
|
|
51
59
|
"instructions": {
|
|
52
60
|
"enabled": true
|
|
61
|
+
},
|
|
62
|
+
"skills": {
|
|
63
|
+
"enabled": ["svelte-code-writer", "svelte-core-bestpractices"]
|
|
53
64
|
}
|
|
54
65
|
}
|
|
55
66
|
```
|
|
56
67
|
|
|
68
|
+
### Defaults
|
|
69
|
+
|
|
70
|
+
If omitted, the plugin uses these defaults:
|
|
71
|
+
|
|
72
|
+
- `mcp.type`: `"remote"`
|
|
73
|
+
- `mcp.enabled`: `true`
|
|
74
|
+
- `subagent.enabled`: `true`
|
|
75
|
+
- `subagent.agents`: `{}`
|
|
76
|
+
- `instructions.enabled`: `true`
|
|
77
|
+
- `skills.enabled`: `true`
|
|
78
|
+
|
|
57
79
|
### Configuration Options
|
|
58
80
|
|
|
59
|
-
| Option
|
|
60
|
-
|
|
|
61
|
-
| `mcp.type`
|
|
62
|
-
| `mcp.enabled`
|
|
63
|
-
| `subagent.enabled`
|
|
64
|
-
| `
|
|
81
|
+
| Option | Type | Default | Description |
|
|
82
|
+
| ------------------------------------------------ | --------------------- | ---------- | ---------------------------------------------------------------------------------------------- |
|
|
83
|
+
| `mcp.type` | `"remote" \| "local"` | `"remote"` | Use `https://mcp.svelte.dev/mcp` (`remote`) or run `@sveltejs/mcp` via `npx` (`local`). |
|
|
84
|
+
| `mcp.enabled` | `boolean` | `true` | Enable or disable the Svelte MCP server entry. |
|
|
85
|
+
| `subagent.enabled` | `boolean` | `true` | Enable or disable registration of the `svelte-file-editor` subagent. |
|
|
86
|
+
| `subagent.agents.svelte-file-editor.model` | `string` | main agent | Override the model used by the Svelte file editor subagent. |
|
|
87
|
+
| `subagent.agents.svelte-file-editor.temperature` | `number` | unset | Set temperature for the subagent. |
|
|
88
|
+
| `subagent.agents.svelte-file-editor.top_p` | `number` | unset | Set top-p sampling for the subagent. |
|
|
89
|
+
| `subagent.agents.svelte-file-editor.maxSteps` | `number` | unlimited | Limit the number of steps the subagent can execute. |
|
|
90
|
+
| `instructions.enabled` | `boolean` | `true` | Enable or disable automatic instruction-file injection. |
|
|
91
|
+
| `skills.enabled` | `boolean \| string[]` | `true` | Enable all skills (`true`), disable all skills (`false`), or enable only specific skill names. |
|
|
92
|
+
|
|
93
|
+
### Supported Skill Names
|
|
94
|
+
|
|
95
|
+
When using `skills.enabled` as an array, these built-in names are currently available:
|
|
96
|
+
|
|
97
|
+
- `svelte-code-writer`
|
|
98
|
+
- `svelte-core-bestpractices`
|
|
99
|
+
|
|
100
|
+
### Config File Locations and Precedence
|
|
65
101
|
|
|
66
|
-
|
|
102
|
+
The plugin reads from these files (lowest priority first, highest priority last):
|
|
67
103
|
|
|
68
|
-
|
|
104
|
+
- `~/.config/opencode/svelte.json`
|
|
105
|
+
- `$OPENCODE_CONFIG_DIR/svelte.json` (when `OPENCODE_CONFIG_DIR` is set)
|
|
106
|
+
- `.opencode/svelte.json` in the current project
|
|
69
107
|
|
|
70
|
-
|
|
71
|
-
- `$OPENCODE_CONFIG_DIR/svelte.json` (if `OPENCODE_CONFIG_DIR` is set, takes priority)
|
|
108
|
+
If the same key is defined in multiple files, the later location overrides earlier ones.
|
|
72
109
|
|
|
73
110
|
## License
|
|
74
111
|
|
package/index.ts
CHANGED
|
@@ -78,7 +78,7 @@ export const svelte_plugin: Plugin = async (ctx) => {
|
|
|
78
78
|
mode: 'subagent',
|
|
79
79
|
prompt: `You are a Svelte 5 expert responsible for writing, editing, and validating Svelte components and modules. You have access to the Svelte MCP server which provides documentation and code analysis tools. Always use the tools from the svelte MCP server to fetch documentation with \`get_documentation\` and validating the code with \`svelte_autofixer\`. If the autofixer returns any issue or suggestions try to solve them.
|
|
80
80
|
|
|
81
|
-
If the MCP tools are not available you can use the \`svelte-code-
|
|
81
|
+
If the MCP tools are not available you can use the \`svelte-code-writer\` skill to learn how to use the \`@sveltejs/mcp\` cli to access the same tools.
|
|
82
82
|
|
|
83
83
|
If the skill is not available you can run \`npx @sveltejs/mcp@latest -y --help\` to learn how to use it.
|
|
84
84
|
|
package/package.json
CHANGED
|
@@ -134,7 +134,7 @@ The CSS in a component's `<style>` is scoped to that component. If a parent comp
|
|
|
134
134
|
</style>
|
|
135
135
|
```
|
|
136
136
|
|
|
137
|
-
If this impossible (for example, the child component comes from a library) you can use `:global` to override styles:
|
|
137
|
+
If this is impossible (for example, the child component comes from a library) you can use `:global` to override styles:
|
|
138
138
|
|
|
139
139
|
```svelte
|
|
140
140
|
<div>
|