本文へスキップ
Skillpedia
APIとサーバー(バックエンド)14k · #11247

creating-plugins

できること

このスキルは、EmDashコンテンツ管理システム向けの拡張機能であるプラグインの作り方を案内します。EmDashサイトに独自の機能や管理画面を追加したい開発者向けです。

使う場面

  • ✓プラグインを通してEmDashサイトに新しい機能を追加したいとき。
  • ✓独自の管理画面やAPIのルートを持つプラグインが必要なとき。
  • ✓ほかの人がレジストリからインストールできるプラグインを公開したいとき。

スキルのリンク

https://github.com/emdash-cms/emdash/blob/main/skills/creating-plugins/SKILL.md

コピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。

使い方

いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。

貼り付け用メッセージ

このスキルを使って手伝ってください:https://github.com/emdash-cms/emdash/blob/main/skills/creating-plugins/SKILL.md このリンクのSKILL.mdファイルを読んで、私の作業でその指示に従ってください。
こういうスキルを、AIが自分で見つけてくれたら?無料のSkillpedia MCPをインストール。1行で、作業の前に15,000+のスキルから探してくれます。1分でインストール →

AIへの頼み方の例

“管理画面に独自のフォームを追加するEmDashプラグインを作る手伝いをしてください。”

毎週5つの新しいスキル。1分で読めます。

仕組み

エージェントは、サンドボックス型とトラステッドなネイティブのプラグインのどちらかを選び、プロジェクトの雛形を作り、フック、ルート、管理ページを実装します。そのあとプラグインのテストを実行します。

技術的な内容(元のSKILL.md)

作者による元のテキスト(英語)をGitHubからそのまま表示しています。

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

Format Runtime source Admin UI Distribution
Sandboxed src/plugin.ts default-exports a SandboxedPlugin Block Kit pages, widgets, saved-entry panels, and actions Plugin CLI and registry
Native definePlugin() / createPlugin() React, Block Kit, and Astro components Trusted 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;

Import authoring types from emdash/plugin with import type. The CLI bundles value imports such as pluginRoute() and pluginResponse() from emdash/plugin and portableTextToMarkdown() from emdash/client. Sandboxed runtime code can use Web APIs but not Node.js built-ins.

Declare access

Declare every host API in emdash-plugin.jsonc. Adding authority, exposing a route publicly, or adding MCP tools requires renewed administrator approval.

Capability Grants
schema:read Public collection and field definitions
admin.editor-draft:read Selected unsaved field values after an explicit editor interaction
admin.editor-draft:patch Host-validated unsaved field changes proposed for editor review
content:read Content identity, translations, and published public URLs
content:revisions:read Retained revision data; implies content read
content:write Create, update, delete, and translation creation; implies read
content:publish Revision-fenced publish, unpublish, schedule, and unschedule; implies read
content:restore Revision-fenced reads and restoration of trashed content
hooks.content-policy:register Pre-publish, pre-schedule, and pre-unpublish policy hooks
taxonomies:read Taxonomy definitions, terms, and entry assignments
taxonomies:write Term creation and assignment deltas; implies read
bylines:read Public byline profiles and single or batched entry credits
redirects:read Versioned redirect inspection
redirects:write Versioned redirect creation, update, and deletion; implies read
comments:read Stored non-trashed comments and their personal data
comments:moderate Expected-status moderation; implies read
media:read Ready-media metadata and authenticated asset URLs
media:bytes:read Bounded media bytes and content hashes
`m
よくある質問

サンドボックス型とネイティブのプラグインの違いは何ですか?

サンドボックス型は限られたアクセスで動き、レジストリからインストールできます。ネイティブのプラグインはサイトの全権限で動くので、信頼できるコードにのみ向いています。

開始用のプロジェクトは用意されますか?

はい。プラグインのコマンドで開始用のプロジェクトを作成できます。

Reactの画面も追加できますか?

ネイティブのプラグインは、管理画面やサイトのページにReactとAstroのコンポーネントを使えます。

詳細

作者による元の説明

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.

repo: emdash-cms/emdash

人気

GitHubのスター
14k
ランキング
#11247
ライセンス
MIT
更新日
2026/11/2

このスキルは役に立ちますか?

0

ログイン して投票しましょう。

コメント

  • …

このリポジトリの他のスキル

似ているスキル