creating-plugins
ما الذي تفعله
ترشد هذه المهارة إلى بناء امتدادات تسمى الإضافات لنظام إدارة المحتوى EmDash. وهي مخصصة للمطورين الذين يريدون إضافة ميزات مخصصة أو شاشات إدارة إلى موقع EmDash.
متى تستخدمها
- ✓عندما تريد إضافة ميزة جديدة إلى موقع EmDash عبر إضافة.
- ✓عندما تحتاج إلى إضافة لها شاشة إدارة خاصة بها أو مسارات API.
- ✓عندما تريد نشر إضافة يستطيع الآخرون تثبيتها من السجل.
رابط المهارة
https://github.com/emdash-cms/emdash/blob/main/skills/creating-plugins/SKILL.mdانسخه والصقه في الذكاء الاصطناعي الذي تستخدمه (Claude أو ChatGPT أو Cursor) واطلب منه اتباع التعليمات.
طريقة الاستخدام
أسهل طريقة: انسخ الرسالة والصقها في الذكاء الاصطناعي الذي تستخدمه. سيقرأ المهارة وينفّذ تعليماتها.
رسالة جاهزة للصق
لـ Claude Code أو Codex أو Cursor: شغّله داخل مجلد مشروعك وستُثبَّت المهارة.
نزّل ملف SKILL.md وضعه في مجلد مهارات وكيلك.
مثال على ما تطلبه من الذكاء الاصطناعي
“هل يمكنك مساعدتي في إنشاء إضافة EmDash تضيف نموذجًا مخصصًا إلى منطقة الإدارة؟”
5 مهارات جديدة كل أسبوع. قراءة في دقيقة واحدة.
كيف تعمل
يختار الوكيل بين إضافة معزولة وإضافة أصلية موثوقة، ويُنشئ هيكل المشروع، ثم ينفذ الخطافات والمسارات وصفحات الإدارة. وبعد ذلك يشغّل اختبارات الإضافة.
المحتوى التقني (ملف 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
- آخر تحديث
- 2/11/2026
التعليقات
- …
المزيد من المهارات من هذا المستودع
adversarial-reviewer
14kيساعد وكيلك على البحث عن أخطاء خفية وافتراضات غير آمنة في تغيير برمجي، متجاوزًا المراجعة العادية عندما تطلب ذلك.
agent-browser
14kيتيح لوكيلك اختبار صفحة ويب في متصفح حقيقي، والتحقق مما يراه المستخدمون، والتأكد من الإجراءات، والتقاط لقطات شاشة كدليل.
building-emdash-site
14kيساعد وكيلك على بناء الجزء الخاص بالموقع من مشروع EmDash CMS المبني على Astro، ويشمل المحتوى والمخطط والقوائم والتصنيفات والنشر.
emdash-cli
14kيتيح لوكيلك إدارة موقع EmDash من سطر الأوامر، ويشمل المحتوى والوسائط والقوائم والترحيلات وتصدير الموقع أو استيراده كاملًا.
مهارات مشابهة
api-connector-builder
280kيبني وكيلك اتصالات API جديدة على النمط الموجود، ويفيد عندما تحتاج إلى تكامل إضافي دون ابتكار طريقة جديدة للعمل.
api-design
280kيساعد وكيلك على تصميم واجهات REST API وفق أفضل الممارسات، ويوضح كيف تتواصل وكيف تُعرض الأخطاء وكيف تُنظَّم البيانات.
backend-patterns
280kيساعد وكيلك على أنماط بنية الخادم وتحسين قاعدة البيانات، ويفيد في بناء الشيفرة التي تعمل على الخادم أو مراجعتها.