creating-plugins
Fungsinya
Skill ini memandu pembuatan ekstensi, yang disebut plugin, untuk sistem manajemen konten EmDash. Skill ini ditujukan untuk pengembang yang ingin menambah fitur atau layar admin khusus pada situs EmDash.
Kapan dipakai
- ✓Saat Anda ingin menambah fitur baru pada situs EmDash melalui plugin.
- ✓Saat Anda membutuhkan plugin dengan layar admin atau rute API sendiri.
- ✓Saat Anda ingin menerbitkan plugin agar bisa dipasang orang lain dari registri.
Link skill
https://github.com/emdash-cms/emdash/blob/main/skills/creating-plugins/SKILL.mdSalin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.
Cara pakai
Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.
Pesan siap tempel
Untuk Claude Code, Codex, atau Cursor: jalankan di folder proyek, lalu skill langsung terpasang.
Unduh SKILL.md lalu taruh di folder skill agen Anda.
Contoh permintaan ke AI
“Bisakah Anda membantu saya membuat plugin EmDash yang menambahkan formulir khusus di area admin?”
5 skill baru setiap minggu. 1 menit baca.
Cara kerjanya
Agent memilih antara plugin sandbox dan plugin native tepercaya, menyiapkan kerangka proyek, lalu menerapkan hook, rute dan halaman admin. Setelah itu agent menjalankan pengujian plugin.
Konten teknis (SKILL.md asli)
Teks asli dari pembuat, dalam bahasa Inggris, langsung dari 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 |
Pertanyaan umum
Apa perbedaan plugin sandbox dan plugin native?
Plugin sandbox berjalan dengan akses terbatas dan bisa dipasang dari registri, sedangkan plugin native berjalan dengan wewenang penuh situs dan hanya cocok untuk kode tepercaya.
Apakah skill ini menyediakan proyek awal?
Ya. Sebuah perintah plugin membuat proyek awal.
Bisakah plugin menambahkan layar React?
Plugin native dapat memakai komponen React dan Astro untuk halaman admin dan halaman situs.
Detail
Deskripsi asli dari pembuat
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
Popularitas
- Bintang GitHub
- 14k
- Peringkat
- #11247
- Lisensi
- MIT
- Diperbarui
- 2/11/2026
Komentar
- …
Skill lain dari repositori ini
adversarial-reviewer
14kMembantu agent Anda memburu bug tersembunyi dan asumsi yang tidak aman dalam perubahan kode, melampaui tinjauan biasa saat Anda memintanya.
agent-browser
14kMemungkinkan agent Anda menguji halaman web di browser sungguhan, memeriksa apa yang dilihat pengguna, memverifikasi aksi, dan mengambil tangkapan layar sebagai bukti.
building-emdash-site
14kMembantu agent Anda membangun sisi situs dari proyek EmDash CMS di atas Astro, mencakup konten, skema, menu, taksonomi, dan deployment.
emdash-cli
14kMemungkinkan agent Anda mengelola situs EmDash dari baris perintah, termasuk konten, media, menu, migrasi, serta ekspor atau impor situs secara penuh.
Skill serupa
api-connector-builder
280kMembuat agent Anda membangun koneksi API baru mengikuti pola yang sudah ada. Gunakan saat ingin menambah integrasi lagi tanpa membuat cara baru.
api-design
280kMembantu agent Anda merancang REST API sesuai praktik terbaik. Berguna untuk mengatur cara API berkomunikasi, menampilkan error, dan mengorganisasi data.
backend-patterns
280kMembantu agent Anda dengan pola arsitektur sisi server dan optimasi database. Berguna untuk membangun atau meninjau kode yang berjalan di server.