Add Admin API Endpoint
Add a new endpoint or endpoints to Ghost's Admin API at `ghost/api/admin/**`.From its SKILL.md
npx -y skills add HK-hub/AgentSkills --skill Add Admin API EndpointAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
2 things to look at
- 6 stars6 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
- runs commandsInstructs the agent to run 1 command, including `cd ghost/core && yarn test:single test/e2e-api/admin/{test-file-name}`.
SKILL.md
1.0 KB, 210 tokens by cl100k_base, as published. Nobody here has run it
Create Admin API Endpoint
Instructions
- If creating an endpoint for an entirely new resource, create a new endpoint file in
ghost/core/core/server/api/endpoints/. Otherwise, locate the existing endpoint file in the same directory. - The endpoint file should create a controller object using the JSDoc type from (@tryghost/api-framework).Controller, including at minimum a
docNameand a single endpoint definition, i.e.browse. - Add routes for each endpoint to
ghost/core/core/server/web/api/endpoints/admin/routes.js. - Add basic
e2e-apitests for the endpoint inghost/core/test/e2e-api/adminto ensure the new endpoints function as expected. - Run the tests and iterate until they pass:
cd ghost/core && yarn test:single test/e2e-api/admin/{test-file-name}.
Reference
For a detailed reference on Ghost's API framework and how to create API controllers, see reference.md.
What ships with it: 3 files
47.2 KB alongside SKILL.md
- permissions.md18.2 KB
- reference.md13.6 KB
- validation.md15.3 KB