Compare commits

..

6 Commits

Author SHA1 Message Date
paoloricciuti
fac76922b8 chore: sync skills and update documentation 2026-02-06 17:38:02 +00:00
István Pató
b4eb5cc960 Update description for svelte-code-writer skill (#149) 2026-02-06 18:37:40 +01:00
paoloricciuti
6676fd8116 docs: add local opencode configuration 2026-02-06 18:37:03 +01:00
github-actions[bot]
a755a33a5f Version Packages (#157)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-02-06 17:30:56 +01:00
Paolo Ricciuti
556f96cfaf feat: allow for local opencode config (#156) 2026-02-06 17:25:33 +01:00
github-actions[bot]
77a3340c2f chore: sync AGENTS.md to opencode package and documentation (#155)
Co-authored-by: paoloricciuti <26281609+paoloricciuti@users.noreply.github.com>
2026-02-06 17:11:38 +01:00
7 changed files with 33 additions and 12 deletions

View File

@@ -39,4 +39,4 @@ The default configuration for the Svelte OpenCode plugin looks like this...
...but if you prefer, you can enable only the subagent, only the MCP, only the skills, or configure the kind of MCP server you want to use (`local` or `remote`).
You can place this file in `~/.config/opencode/svelte.json` or, if you have an `OPENCODE_CONFIG_DIR` environment variable specified, at `$OPENCODE_CONFIG_DIR/svelte.json`.
You can place this file in `./.opencode/svelte.json` (in your project), in `~/.config/opencode/svelte.json` or, if you have an `OPENCODE_CONFIG_DIR` environment variable specified, at `$OPENCODE_CONFIG_DIR/svelte.json`.

View File

@@ -1,6 +1,6 @@
## `svelte-code-writer`
CLI tools for Svelte 5 documentation lookup and code analysis. MUST be used whenever creating or editing any Svelte component (.svelte) or Svelte module (.svelte.ts/.svelte.js). If possible, this skill should be executed within the svelte-file-editor agent for optimal results.
CLI tools for Svelte 5 documentation lookup and code analysis. MUST be used whenever creating, editing or analyzing any Svelte component (.svelte) or Svelte module (.svelte.ts/.svelte.js). If possible, this skill should be executed within the svelte-file-editor agent for optimal results.
<a href="https://github.com/sveltejs/mcp/releases?q=svelte-code-writer" target="_blank" rel="noopener noreferrer">Open Releases page</a>

View File

@@ -1,5 +1,11 @@
# @sveltejs/opencode
## 0.1.2
### Patch Changes
- feat: allow for local opencode config ([#156](https://github.com/sveltejs/mcp/pull/156))
## 0.1.1
### Patch Changes

View File

@@ -71,8 +71,15 @@ function get_config_paths() {
}
}
// returning config_dir first so it has higher priority
return [config_dir_path, global_path];
// Project-local: ./.opencode/svelte.json (cwd)
let project_path: string | null = null;
const project_config = join(process.cwd(), '.opencode', 'svelte.json');
if (existsSync(project_config)) {
project_path = project_config;
}
// Lowest priority first, highest priority last (project overrides global)
return [global_path, config_dir_path, project_path];
}
function load_config_file(config_path: string): ConfigLoadResult {
@@ -121,6 +128,9 @@ function merge_with_defaults(user_config: Partial<McpConfig>): McpConfig {
export function get_mcp_config(ctx: PluginInput) {
const config_paths = get_config_paths();
let merged: Partial<McpConfig> = {};
// Iterate from lowest to highest priority, merging as we go
for (const path of config_paths) {
if (path && existsSync(path)) {
const result = load_config_file(path);
@@ -129,23 +139,28 @@ export function get_mcp_config(ctx: PluginInput) {
ctx.client.tui.showToast({
body: {
title: 'Svelte: Invalid opencode plugin config',
message: `${result.parse_error}\nUsing default values`,
message: `${result.parse_error} (${path})\nSkipping this config file`,
variant: 'warning',
duration: 7000,
},
});
}, 7000);
return default_config;
continue;
}
const parsed = v.safeParse(config_schema, result.data);
if (parsed.success) {
return merge_with_defaults(parsed.output);
merged = {
mcp: { ...merged.mcp, ...parsed.output.mcp },
subagent: { ...merged.subagent, ...parsed.output.subagent },
instructions: { ...merged.instructions, ...parsed.output.instructions },
skills: { ...merged.skills, ...parsed.output.skills },
};
} else {
setTimeout(() => {
ctx.client.tui.showToast({
body: {
title: 'Svelte: Invalid opencode plugin config',
message: `${result.parse_error}\nUsing default values`,
message: `Invalid config schema (${path})\nSkipping this config file`,
variant: 'warning',
duration: 7000,
},
@@ -155,5 +170,5 @@ export function get_mcp_config(ctx: PluginInput) {
}
}
return default_config;
return merge_with_defaults(merged);
}

View File

@@ -1,6 +1,6 @@
{
"name": "@sveltejs/opencode",
"version": "0.1.1",
"version": "0.1.2",
"type": "module",
"license": "MIT",
"homepage": "https://github.com/sveltejs/mcp#readme",

View File

@@ -1,6 +1,6 @@
---
name: svelte-code-writer
description: CLI tools for Svelte 5 documentation lookup and code analysis. MUST be used whenever creating or editing any Svelte component (.svelte) or Svelte module (.svelte.ts/.svelte.js). If possible, this skill should be executed within the svelte-file-editor agent for optimal results.
description: CLI tools for Svelte 5 documentation lookup and code analysis. MUST be used whenever creating, editing or analyzing any Svelte component (.svelte) or Svelte module (.svelte.ts/.svelte.js). If possible, this skill should be executed within the svelte-file-editor agent for optimal results.
---
# Svelte 5 Code Writer

View File

@@ -1,6 +1,6 @@
---
name: svelte-code-writer
description: CLI tools for Svelte 5 documentation lookup and code analysis. MUST be used whenever creating or editing any Svelte component (.svelte) or Svelte module (.svelte.ts/.svelte.js). If possible, this skill should be executed within the svelte-file-editor agent for optimal results.
description: CLI tools for Svelte 5 documentation lookup and code analysis. MUST be used whenever creating, editing or analyzing any Svelte component (.svelte) or Svelte module (.svelte.ts/.svelte.js). If possible, this skill should be executed within the svelte-file-editor agent for optimal results.
---
# Svelte 5 Code Writer