build-ghost-app
它能做什么
这个技能引导 AI 智能体构建在 Ghost Admin 内运行的 Ghost 应用。适合希望向 Ghost 添加自己页面或工具的开发者。
适用场景
- ✓当你开始一个新的 Ghost 应用,并希望它出现在 Ghost Admin 中的时候。
- ✓当你需要编写告诉 Ghost 你的应用信息的清单文件的时候。
- ✓当你想用应用 SDK 将应用连接到 Ghost Admin 并进行安装的时候。
技能链接
https://github.com/TryGhost/Ghost/blob/main/apps/shade/dev-skill/ghost-app-ui-dev-setup/build-ghost-app/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“请帮我用 Vite 和 React 启动一个 Ghost 应用,让它显示在我的 Ghost Admin 中。”
每周 5 个新技能,1 分钟读完。
工作原理
智能体会搭建一个 Vite 和 React 项目,安装 Ghost 应用 SDK,并编写一个清单文件。然后它会在固定的本地端口上提供应用,以便 Ghost Admin 加载它。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Build a Ghost app
A Ghost app runs as a full page in a frame inside Ghost Admin. Build it in this
folder, the one with AGENTS.md, as a Vite, React and TypeScript app with npm.
These steps make it show up in Admin. For its screens, use the
build-ghost-app-ui skill.
npm create vite won't scaffold into a folder that already has files without
--overwrite, which deletes them. Scaffold into a new subfolder, then move its
files up into this folder and remove the subfolder.
Connect the app
SDK.
@tryghost/app-sdkisn't on npm yet. Install it from the folder:npm install ./vendor/tryghost-app-sdk.tgz. It brings its one dependency,@quilted/threads.Fixed port. In
vite.config.ts, setserver: { port: 5190, strictPort: true }. The install link depends on the port.Manifest. Serve it as
public/ghost-app.json, so it's athttp://localhost:5190/ghost-app.json:{ "id": "org.example.<app-slug>", "name": "<App name>", "description": "<One sentence on what the app does.>", "author": { "name": "<Author>", "url": "https://example.com" }, "accent_color": "#<six-digit hex>", "icon": { "name": "<icon-name>" }, "surfaces": [{ "type": "admin_page", "url": "/" }] }Every field is required,
author.urltoo, and Admin rejects fields it doesn't know.icon.nameis any Lucide icon name in kebab case, such asmegaphoneorlayout-list; Admin draws it onaccent_color.Connect before rendering. Admin keeps the frame hidden until the app calls
connect(), and gives up after 10 seconds. Insrc/main.tsx, await it before rendering React:import { connect, GhostAppError } from '@tryghost/app-sdk' try { const ghost = await connect() // apply ghost.theme.mode (step 5), then render the app } catch (error) { if (error instanceof GhostAppError && error.code === 'not_framed') { // Opened outside Admin: render only a short "Open this app in Ghost Admin" message } else { // Render a short "Couldn't connect to Ghost" message with error.message } }Opened directly at
http://localhost:5190/, the page isn't framed, so it shows only that message. That's expected.Theme.
ghost.theme.modeis'light'or'dark', andghost.onThemeChange(theme => …)fires when the publisher switches; it returns a function that unsubscribes. Apply the mode before the first render and follow changes. How Shade takes the mode is in thebuild-ghost-app-uiskill, at its "Light and dark theme" step.Install link. With
npm run devrunning, the publisher installs the app from:http://localhost:2368/ghost/#/apps/install?manifest=http%3A%2F%2Flocalhost%3A5190%2Fghost-app.json
Hand over
You can't open Ghost Admin yourself, so the publisher checks the app there.
When you're done, check that npm run dev starts on port 5190 and npm run build
passes, stop the dev server, and give them the install link with anything they
should check in Admin.
常见问题
应用使用哪个端口?
该技能在严格模式下将应用设置为 5190 端口,因为安装链接依赖该端口。
清单文件放在哪里?
它放在 public 文件夹中,名为 ghost-app.json,因此会在应用的本地地址下提供。
这个技能涵盖应用的界面吗?
不涵盖。该技能会指向另一个 build-ghost-app-ui 技能来处理界面。
详情
作者的原始描述
Connect a Ghost app to Ghost Admin with the app SDK, and serve its manifest and install link. Use when building a Ghost app, connecting it to Admin, writing its manifest or installing it.
repo: TryGhost/Ghost
热度
- GitHub 星标
- 56k
- 排名
- #3280
- 许可证
- MIT
- 更新时间
- 2026/11/2
评论
- …
同一仓库的更多技能
tinybird-cli-guidelines
56k指导你的智能体使用 Tinybird CLI 命令进行本地开发、分支工作、构建、部署和数据管理。
tinybird
56k教你的智能体为数据源、管道、端点和物化视图编写 Tinybird 文件格式、SQL 规则和性能模式。
build-ghost-app-ui
56k帮你的智能体使用 Ghost 的设计系统 Shade 构建 Ghost 应用的界面,并将它指向正确的文档和技能。
shade-imports
56k帮你的智能体从正确的路径导入 Shade 组件,并正确设置其样式表和 ShadeApp。