Compare commits

..

9 Commits

Author SHA1 Message Date
Paolo Ricciuti
aa0d173db0 Merge branch 'main' into prompt-improvements 2025-12-17 17:57:16 +01:00
Paolo Ricciuti
48d43a0e76 chore: add changesets
Refined the prompt to optimize token consumption.
2025-12-17 17:54:58 +01:00
Paolo Ricciuti
1124aefa4b chore: apply suggestions from code review
Co-authored-by: Stanislav Khromov <stanislav.khromov+github@gmail.com>
2025-12-17 17:54:31 +01:00
paoloricciuti
a6fc42ec56 fix: use partial match because for some reason github is weird 2025-12-17 16:44:39 +01:00
paoloricciuti
34ab5c075d fix: remove console.log 2025-12-17 16:24:47 +01:00
paoloricciuti
d2242a1d2c chore: dependencies 2025-12-17 16:18:56 +01:00
paoloricciuti
b3561dcb2d chore: use in memory transport and add playground link tests 2025-12-17 16:18:49 +01:00
paoloricciuti
3f70809ce6 chore: use tmcp utils where possible 2025-12-17 16:18:28 +01:00
paoloricciuti
2d7da648e3 fix: improve prompt to reduce token usage 2025-12-17 16:17:44 +01:00
6 changed files with 10 additions and 14 deletions

View File

@@ -0,0 +1,5 @@
---
"@sveltejs/mcp-server": patch
---
fix: improve prompt to reduce token usage

View File

@@ -12,7 +12,7 @@ This prompt should be used whenever you are asking the model to work on a Svelte
<summary>Copy the prompt</summary>
```md
You are a Svelte expert tasked to build components and utilities for Svelte developers. If you need documentation for anything related to Svelte you can invoke the tool `get-documentation` with one of the following paths. However: before invoking the `get-documentation` tool, try to answer the users query using your own knowledge and the `svelte-autofixer` tool. Be mindful of how many section you request, since it is token-intensive!
You are a Svelte expert tasked to build components and utilities for Svelte developers. If you need documentation for anything related to Svelte you can invoke the tool `get-documentation` with one of the following paths:
<available-docs>
- title: Overview, use_cases: project setup, creating new svelte apps, scaffolding, cli tools, initializing projects, path: cli/overview
@@ -153,7 +153,6 @@ You are a Svelte expert tasked to build components and utilities for Svelte deve
- title: Context, use_cases: shared state, avoiding prop drilling, component communication, theme providers, user context, authentication state, configuration sharing, deeply nested components, path: svelte/context
- title: Lifecycle hooks, use_cases: component initialization, cleanup tasks, timers, subscriptions, dom measurements, chat windows, autoscroll features, migration from svelte 4, path: svelte/lifecycle-hooks
- title: Imperative component API, use_cases: project setup, client-side rendering, server-side rendering, ssr, hydration, testing, programmatic component creation, tooltips, dynamic mounting, path: svelte/imperative-component-api
- title: Hydratable data, use_cases: use title and path to estimate use case, path: svelte/hydratable
- title: Testing, use_cases: testing, quality assurance, unit tests, integration tests, component tests, e2e tests, vitest setup, playwright setup, test automation, path: svelte/testing
- title: TypeScript, use_cases: typescript setup, type safety, component props typing, generic components, wrapper components, dom type augmentation, project configuration, path: svelte/typescript
- title: Custom elements, use_cases: web components, custom elements, component library, design system, framework-agnostic components, embedding svelte in non-svelte apps, shadow dom, path: svelte/custom-elements
@@ -193,8 +192,6 @@ You are a Svelte expert tasked to build components and utilities for Svelte deve
</available-docs>
These are the available documentation sections that `list-sections` will return, you do not need to call it again.
Every time you write a Svelte component or a Svelte module you MUST invoke the `svelte-autofixer` tool providing the code. The tool will return a list of issues or suggestions. If there are any issues or suggestions you MUST fix them and call the tool again with the updated code. You MUST keep doing this until the tool returns no issues or suggestions. Only then you can return the code to the user.
This is the task you will work on:

View File

@@ -9,7 +9,7 @@ import { prompt } from 'tmcp/utils';
* if needed (it will always be invoked manually so it's up to you to provide the arguments).
*/
function svelte_task(available_docs: string, task: string) {
return `You are a Svelte expert tasked to build components and utilities for Svelte developers. If you need documentation for anything related to Svelte you can invoke the tool \`get-documentation\` with one of the following paths. However: before invoking the \`get-documentation\` tool, try to answer the users query using your own knowledge and the \`svelte-autofixer\` tool. Be mindful of how many section you request, since it is token-intensive!
return `You are a Svelte expert tasked to build components and utilities for Svelte developers. If you need documentation for anything related to Svelte you can invoke the tool \`get_documentation\` with one of the following paths. However: before invoking the \`get_documentation\` tool, try to answer the users query using your own knowledge and the \`svelte-autofixer\` tool. Be mindful of how many section you request, since it is token-intensive!
<available-docs>
${available_docs}

View File

@@ -1,11 +1,5 @@
# @sveltejs/mcp
## 0.1.14
### Patch Changes
- fix: improve prompt to reduce token usage ([#124](https://github.com/sveltejs/mcp/pull/124))
## 0.1.13
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@sveltejs/mcp",
"version": "0.1.14",
"version": "0.1.13",
"type": "module",
"license": "MIT",
"mcpName": "dev.svelte/mcp",

View File

@@ -9,7 +9,7 @@
"subfolder": "packages/mcp-stdio",
"source": "github"
},
"version": "0.1.14",
"version": "0.1.13",
"websiteUrl": "https://svelte.dev/docs/mcp/overview",
"icons": [
{
@@ -25,7 +25,7 @@
{
"registryType": "npm",
"identifier": "@sveltejs/mcp",
"version": "0.1.14",
"version": "0.1.13",
"runtimeHint": "npx",
"transport": {
"type": "stdio"