creating-plugins

A guide for building EmDash CMS plugins, which add custom behavior and content features to a website management system. It covers plugin structure, settings, storage, admin screens, API routes, and custom text blocks.

In plain words
What is it for?
Use it to scaffold or implement an EmDash plugin, such as one with admin pages, content hooks, custom settings, API endpoints, or custom Portable Text blocks.
Why use it?
It gives you the expected structure and options for extending EmDash without having to work them out from scratch.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/emdash-cms/emdash/creating-plugins
Any agent
npx skills add emdash-cms/emdash --skill creating-plugins
Clone the repo
git clone --depth 1 https://github.com/emdash-cms/emdash

Made for: Claude Code, Codex.

Per session 62 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 4,740 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 2 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00062 $0.04740
Opus 5 $0.00031 $0.02370
Sonnet 5 $0.00012 $0.00948
Haiku 4.5 $0.00006 $0.00474

Measured yesterday against content hash 140f98dd25a7, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade B, and why

creating-plugins scanned grade B with 2 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Sends data to an external URLmediumData exfiltration

A POST to an outside endpoint may be telemetry or may be exfiltration; either way the mod talks to somewhere, and you should know where.

await ctx.http.fetch("https://api.analytics.example.com/track", { method: "POST",

Runs shell commandslowCapability

Expected in a hook, worth knowing in a rule or an instructions file.

Key constraint for sandbox compatibility: **no Node.js built-ins** (`fs`, `path`, `child_process`, etc.) in backend code. Use Web APIs instead.
skills/creating-plugins/SKILL.md · 460 lines

How it starts

The opening of the file, as written. The whole thing — 460 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Creating EmDash Plugins

EmDash plugins extend the CMS with hooks, storage, settings, admin UI, API routes, and custom Portable Text block types. All plugins are TypeScript packages.

Plugin Types

EmDash has two plugin formats:

Type Format Admin UI Where it runs
Standard definePlugin({ hooks, routes }) Block Kit Isolate on Cloudflare, in-process elsewhere
Native createPlugin() / definePlugin() with id+version React or Block Kit Always in host isolate

Standard is the default. Most plugins should use it. Standard plugins can be published to the marketplace and work in both trusted and sandboxed modes.

Native is an escape hatch for plugins that need React admin components, direct DB access, or custom Astro components. Native plugins can only run in plugins: [] -- they cannot be sandboxed or published to the marketplace.

Plugin Anatomy

Every plugin has two parts that run in different contexts:

  1. Plugin descriptor (PluginDescriptor) — returned by the factory function in index.ts. Declares metadata (id, version, capabilities, storage). Runs at build time in Vite (imported in astro.config.mjs). Must be side-effect-free.
  2. Plugin definition (definePlugin()) — contains the runtime logic (hooks, routes). Runs at request time on the deployed server. Has access to the full plugin context (ctx). Lives in a separate file (typically sandbox-entry.ts).

These must be in separate entrypoints because they execute in completely different environments:

my-plugin/
├── src/
│   ├── index.ts            # Descriptor factory (runs in Vite at build time)
│   ├── sandbox-entry.ts    # Plugin definition with definePlugin() (runs at deploy time)
│   ├── admin.tsx            # Admin UI exports (React) — optional, native only
│   └── astro/               # Site-side rendering components — optional, native only
│       └── index.ts         # Must export `blockComponents`
├── package.json
└── tsconfig.json

Read the full file on GitHub · 460 lines

Files

What ships with it

7 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 460 lines · 62 tokens per session scan B 140f98dd25a7

Subscribe to this mod's changes

creating-plugins is a skill published in the GitHub repository emdash-cms/emdash (12,111 stars, last pushed 3d ago), licensed MIT. It adds 62 tokens to every session and 4,740 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it B with 2 findings (sends data to an external url, runs shell commands). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

wordpress-plugin-to-emdash

Port a WordPress plugin to EmDash CMS. Use this skill when asked to migrate, convert, or port a WordPress plugin, theme functionality, or custom post type to EmDash. Provides concept mapping and implementation patterns.

EngDawood/emdash-claude-plugin · 52 tokens

building-emdash-site

Build and customize EmDash CMS sites on Astro. Use when creating pages, defining collections, writing seed files, querying content, rendering Portable Text, setting up menus/taxonomies/widgets, configuring deployment, or any task involving an EmDash-powered Astro site. Assumes basic Astro knowledge but provides all…

EngDawood/emdash-claude-plugin · 70 tokens

emdash-cli

Use the EmDash CLI to manage content, schema, media, and more. Use this skill when you need to interact with a running EmDash instance from the command line — creating content, managing collections, uploading media, generating types, or scripting CMS operations.

EngDawood/emdash-claude-plugin · 56 tokens

emdash-github-actions

Sets up GitHub Actions CI/CD workflows for EmDash plugins — TypeScript type-checking, ESLint linting, Vitest testing, npm publishing, and automated releases. ALWAYS use this skill when a user wants to create, add, set up, or configure GitHub Actions, CI/CD, automated checks, or deployment workflows for an EmDash…

EngDawood/emdash-claude-plugin · 234 tokens

adversarial-reviewer

Adversarial code review that assumes bugs exist and hunts for them. Use when asked to review code, find bugs, audit for correctness, stress-test a PR, or when someone says "tear this apart" or "what's wrong with this". Give no benefit of the doubt — every line is guilty until proven innocent.

EngDawood/emdash-claude-plugin · 71 tokens

agent-browser

Browser automation for testing and verification. Use when you need to interact with web UIs, verify visual changes, fill forms, or capture screenshots.

EngDawood/emdash-claude-plugin · 32 tokens