Skip to content

About

Interactive CLI to scaffold .opencode/ with frameworks, MCP tools, and skills

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

opcup

Interactive CLI to scaffold an .opencode/ folder with frameworks, MCP tools, and skills for any project.

Works in new or existing repos.

Quick Start

npx opcup

Run it in any project directory — it prompts you to select frameworks, MCP tools, and skills.

A .opencode/ folder is generated automatically.

What You Get

.opencode/
├── opencode.json       # plugins + MCP config
├── package.json        # dependencies (when a framework is selected)
├── .gitignore          # bun.lock(b), node_modules, package-lock.json, tokens/
├── .npmrc              # package-lock=false
├── commands/           # 36 Svelte + 3 generic skills
├── docs/               # bundled Svelte + example documentation
└── tokens/             # MCP token placeholders (when an MCP is selected)

OpenCode picks these up automatically.

No manual setup needed.

Available Options

Category Options
Frameworks Svelte 5 / SvelteKit 3 — @sveltejs/opencode plugin + 36 skills
MCP Tools Sanity (mcp.sanity.io)
Generic Skills Pure Commit (auto-group commits), Env Safety (secrets), Docs Conventions

Generic Skills

Skill Description
purecommit.md Auto-group changed files by topic into logical commits
env.md Environment variable safety — never expose secrets in terminal output
docs.md Writing documentation guidelines — numbered headings, Why/What/How code blocks

Svelte Skills

When Svelte is selected, 36 command files are generated covering the full Svelte 5 + SvelteKit 3 API:

Skill Topics
svelte.md Runes, routing, data loading, forms, SvelteKit
explicit-env-vars.md $app/env/private, $app/env/public, src/env.ts
attach.md {@attach ...} — modern replacement for use:action
function-bindings.md bind:value={get, set} — function bindings
parallel-loading.md Data loading, invalidation, getRequestEvent
error-handling.md handleError kinds (app/framework/validation/unknown), App.Error
loading-states.md $effect.pending(), settled(), tick()
reactive-classes.md SvelteMap, SvelteSet, SvelteURL, MediaQuery
hydratable-imperative.md hydratable(), mount(), hydrate(), fork()
images.md @sveltejs/enhanced-img, CDN images, LCP best practices
context-state.md createContext(), snapshots, {#key} blocks
motion-transitions.md Spring, Tween, 8 built-in transitions, easing
template-styling.md Declaration tags, svelte:* elements, scoped/global styles
typescript-svelte.md Generic $props, Component/ComponentProps types
remote-fns-advanced.md query.batch, query.live, single-flight mutations
platform.md Accessibility, icons, auth, service workers, observability
async-svelte.md await in components, synchronized updates, $state.eager
remote-functions.md Full remote functions: query, form, command, prerender
testing.md Vitest, Playwright, mount(), flushSync()
custom-elements.md Web components, $host, shadow modes
performance.md Waterfalls, preloading, optimization
packaging.md @sveltejs/package, exports map, TypeScript
adapters.md Node, Cloudflare, Netlify, Vercel deployment
glossary.md CSR, SSR, SSG, hydration, ISR, edge
debugging.md VS Code, Chrome DevTools breakpoints
compiler-errors.md Complete error code reference
runtime-errors.md All runtime errors and warnings
type-defs.md Full SvelteKit 3 TypeScript API reference (@sveltejs/kit/*, $app/*)
faq.md Svelte + SvelteKit troubleshooting
compiler-warnings.md A11y checks, CSS warnings, deprecated features
svelte-5-migration.md Upgrade guide: Svelte 4 → 5
browser-support.md Minimum browser versions
svelte-events.md on() from svelte/events for event delegation
svelte-easing.md 30 easing functions for custom transitions
migrating-to-sveltekit-3.md SvelteKit 2 → 3 migration — deps, config, API moves
svelte-all.md Meta-command — loads the other 35 files at once

Use /svelte in OpenCode for quick reference, or /svelte-all to load the complete knowledge base.

Merge and Overwrite

If .opencode/ already exists, you can choose how to proceed:

Mode Behavior
Merge Adds missing commands, docs, and token placeholders, and merges plugins, MCP configs, and dependencies. Existing entries are never overwritten. Safe for adding to a configured project.
Overwrite Wipes commands/ and docs/, then regenerates everything from your new selection. tokens/ is removed only when no MCP is selected; existing token files are otherwise preserved.

In Overwrite mode, opencode.json and package.json are regenerated from your selection, so stale plugins and MCP configs are removed (if no framework is selected, no package.json is written). Merge mode only adds missing entries.

Requirements

  • Node.js 20+
  • Generated SvelteKit 3 skills target Node.js 22.17+

Development

npm test              # run the test suite (node:test)
npm run test:coverage # same, with a coverage report
npm run check         # format check, lint, pack validation, and tests

License

MIT © robots4life

About

Interactive CLI to scaffold .opencode/ with frameworks, MCP tools, and skills

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Contributors

Languages