Skills

Creating Plugins

Create EmDash CMS plugins with sandboxed hooks, routes, storage, content and media...

Install

npx skills add emdash-cms/emdash --skill creating-plugins -g -a claude-code -y
Repository
emdash-cms/emdash14.1k
Category
Design
Updated
3d ago
License
MIT
Context cost
Mediumabout 2,531 tokens
Runs scripts
No, instructions only

What it does

Create EmDash CMS plugins with sandboxed hooks, routes, storage, content and media APIs, MCP tools, and declarative admin UI, or native React and Astro extensions. Use when scaffolding or implementing an EmDash plugin.

Creating EmDash plugins

Build against the API that reaches the intended execution mode. Source types and production-boundary tests take precedence over examples in this skill when they disagree.

Choose a format

FormatRuntime sourceAdmin UIDistribution
Sandboxedsrc/plugin.ts default-exports a SandboxedPluginBlock Kit pages, widgets, saved-entry panels, and actionsPlugin CLI and registry
NativedefinePlugin() / createPlugin()React, Block Kit, and Astro componentsTrusted site dependency only

Use a sandboxed plugin unless the feature needs host-process access, React admin code, Astro rendering components, raw page fragments, or custom Portable Text block definitions. Native plugins run with the site's authority and cannot be installed from the registry.

Scaffold a sandboxed plugin

pnpm dlx @emdash-cms/plugin-cli init my-plugin
cd my-plugin
pnpm install
pnpm run test

The manifest is the identity and trust contract. Runtime hooks and routes live in src/plugin.ts; the CLI generates descriptors, manifests, and bundles. Do not create a separate descriptor factory or sandbox-entry.ts.

import type { SandboxedPlugin } from "emdash/plugin";

const plugin: SandboxedPlugin = {
	hooks: {
		"content:afterSave": async (event, ctx) => {
			ctx.log.info("Content saved", { id: event.content.id });
		},
	},
};

export default plugin;
Read the whole SKILL.md on GitHub

More in Design