| name | server-restart |
| description | Restart the FOUNDATION dev server via PM2, with optional Vite/SvelteKit cache clean. Use after config changes, when the Vite SSR module runner goes zombie (transport invoke timed out), or when the user asks for a restart. |
| disable-model-invocation | false |
Server Restart
Full stop → (optional cache clean) → start cycle for the PM2 process foundation-dev.
Steps
- Stop — follow
/server-stop (PM2 stop+delete + orphan sweep).
- Cache clean (when indicated) — clean BEFORE starting if any of:
pm2 logs foundation-dev or the user reported transport invoke timed out ... vite:invoke fetchModule (Vite SSR zombie — recurring issue in this repo);
- previous boot stalled at
MCP server listening with zero [STARTUP] lines and zero [FRONTEND] lines (webview never loaded);
- the user explicitly asked for a clean restart.
Clean:
Remove-Item -Recurse -Force node_modules\.vite, .svelte-kit -ErrorAction SilentlyContinue (.svelte-kit is regenerated by svelte-kit sync on next start).
- Start — follow
/server-start (PM2 start + readiness poll).
- Report — whether cache was cleaned (and why), readiness confirmation.
Rules
- ALWAYS prefer this skill over manual kill/start sequences.
- NEVER
pm2 restart foundation-dev directly — it skips the orphan sweep and the zombie diagnosis; the stop→start path is canonical.