Files
skills/plugins/library-navigator/skills/.orphaned/sp-create-suaveplan-plugin/SKILL.md
2026-06-09 21:06:27 +01:00

2.4 KiB

name, description
name description
sp-create-suaveplan-plugin Interactive scaffold for new Suaveplan API plugins — generates plugin.json, definePlugin body, tests, vitest configs, migrations, and README.

sp-create-suaveplan-plugin

Symbol Kind Responsibility
scaffold Function Interactive CLI that prompts for isolation tier, capabilities, DB engine, then generates the full plugin skeleton
generate Function Programmatic variant of scaffold; returns an in-memory list of GeneratedFile records
PromptAnswersSchema / validateAnswers Function Zod schema + validator for scaffold inputs (IsolationTier, CapabilitySelection, DatabaseEngine)
answersForFixture Function Pre-canned prompt answers for test fixtures
renderTree Function Renders the scaffolded file tree as a visual tree string
SCAFFOLD_CODES Constant Error-code registry via @suaveplan/error defineCodes

File Structure: packages/api-stack/api/create-suaveplan-plugin/src/{bin,generator,prompt,templates}/

Sibling packages:

  • @suaveplan/wasm-compiler-javy — WASM compiler for compiled plugins
  • @suaveplan/testing-integration-postgres — Postgres fixture for integration tests
  • @suaveplan/testing-integration-surrealdb — SurrealDB fixture for integration tests

Patterns:

Quick Start (CLI):

npx create-suaveplan-plugin
# interactive prompts → generates complete plugin skeleton

Programmatic generation:

import { generate, validateAnswers } from "create-suaveplan-plugin/generator";
const answers = validateAnswers({ isolationTier: "sandboxed", capabilities: ["rest"], databaseEngine: "sqlite" });
const files = generate(answers);

Constraints:

  • CLI entrypoint: create-suaveplan-plugin bin
  • Subpath exports: /error-codes, /prompt, /generator
  • Generates plugin.json, definePlugin body, host test, integration test, vitest configs, migrations, README
  • Integration tests wired to matching testing-integration-{postgres,sqlite,surrealdb} fixture
  • No @suaveplan/* runtime dependencies other than @suaveplan/error

Checklist:

  • scaffold generates a testable plugin skeleton from interactive prompts
  • generate returns in-memory GeneratedFile records without writing to disk
  • validateAnswers rejects invalid isolation tiers or capability combinations
  • Output includes plugin.json, host test, and integration test