Aller au contenu
Skillpedia
Sites et interfaces (frontend)56k · #3280

build-ghost-app

Ce qu’il fait

Cette compétence guide un agent d'IA dans la construction d'une application Ghost qui fonctionne à l'intérieur de Ghost Admin. Elle s'adresse aux développeurs qui veulent ajouter leur propre page ou outil à Ghost.

Quand l’utiliser

  • ✓Quand vous démarrez une nouvelle application Ghost et voulez qu'elle apparaisse dans Ghost Admin.
  • ✓Quand vous devez écrire le fichier manifeste qui indique à Ghost ce qu'est votre application.
  • ✓Quand vous voulez relier votre application à Ghost Admin avec le SDK d'application et l'installer.

Lien du skill

https://github.com/TryGhost/Ghost/blob/main/apps/shade/dev-skill/ghost-app-ui-dev-setup/build-ghost-app/SKILL.md

Copiez-le et collez-le dans votre IA (Claude, ChatGPT ou Cursor) en lui demandant de suivre les instructions.

Comment l’utiliser

Le plus simple : copiez le message et collez-le dans votre IA. Elle lit le skill et suit les instructions.

Message prêt à coller

Utilise ce skill pour m’aider : https://github.com/TryGhost/Ghost/blob/main/apps/shade/dev-skill/ghost-app-ui-dev-setup/build-ghost-app/SKILL.md Lis le fichier SKILL.md de ce lien et suis ses instructions pour ma tâche.
Envie que votre IA trouve seule des skills comme celui-ci ?Installez le MCP gratuit de Skillpedia : une ligne, et elle cherche parmi 15 000+ skills avant chaque tâche.Installer en 1 minute →

Exemple de demande à votre IA

“Je veux démarrer une application Ghost avec Vite et React qui s'affiche à l'intérieur de mon Ghost Admin.”

5 nouveaux skills par semaine. 1 minute de lecture.

Comment ça marche

L'agent met en place un projet Vite et React, installe le SDK d'application Ghost et écrit un fichier manifeste. Il sert ensuite l'application sur un port local fixe pour que Ghost Admin puisse la charger.

Contenu technique (SKILL.md original)

Texte original de l’auteur, en anglais, directement depuis 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

  1. SDK. @tryghost/app-sdk isn't on npm yet. Install it from the folder: npm install ./vendor/tryghost-app-sdk.tgz. It brings its one dependency, @quilted/threads.

  2. Fixed port. In vite.config.ts, set server: { port: 5190, strictPort: true }. The install link depends on the port.

  3. Manifest. Serve it as public/ghost-app.json, so it's at http://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.url too, and Admin rejects fields it doesn't know. icon.name is any Lucide icon name in kebab case, such as megaphone or layout-list; Admin draws it on accent_color.

  4. Connect before rendering. Admin keeps the frame hidden until the app calls connect(), and gives up after 10 seconds. In src/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.

  5. Theme. ghost.theme.mode is 'light' or 'dark', and ghost.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 the build-ghost-app-ui skill, at its "Light and dark theme" step.

  6. Install link. With npm run dev running, 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.

Questions fréquentes

Quel port l'application utilise-t-elle ?

La compétence fixe l'application sur le port 5190 en mode strict, car le lien d'installation dépend de ce port.

Où se trouve le fichier manifeste ?

Il est placé dans le dossier public sous le nom ghost-app.json, afin d'être servi à l'adresse locale de l'application.

Cette compétence couvre-t-elle les écrans de l'application ?

Non. La compétence renvoie vers une compétence distincte, build-ghost-app-ui, pour les écrans.

Détails

Description originale de l’auteur

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

Popularité

Étoiles GitHub
56k
Position au classement
#3280
Licence
MIT
Mis à jour
02/11/2026

Ce skill vous est-il utile ?

0

Connectez-vous pour voter.

Commentaires

  • …

Autres skills de ce dépôt

Skills similaires