Add a service the product runs beside its API: a Node process or a container (an image pinned by digest, or a Dockerfile in services/<name>), with its port, health check, size, count and volume, declared once in buffcore.config.ts's processes; ape dev, CI, ape server setup and ape deploy run it, backups hold its volume, ape services sizes it; a hosting change.
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Ape Add Service?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/buffape-ape-add-service)
---
name: ape-add-service
description: "Add a service the product runs beside its API: a Node process or a container (an image pinned by digest, or a Dockerfile in services/<name>), with its port, health check, size, count and volume, declared once in buffcore.config.ts's processes; ape dev, CI, ape server setup and ape deploy run it, backups hold its volume, ape services sizes it; a hosting change."
---
# Adding a service
**Postgres before another store.** Most needs fit the product's own tables (search, queues, files through the bucket). A container is for what Node and Postgres can't do (a Python model, a speech engine). A new store means a second thing to back up, restore and keep consistent with the database: say so in the change's plan.
## 1. Plan it as a hosting change
A new service, a bigger size or more copies is a change of `type: hosting` in `plan/changes/` (the `ape-plan-change` skill), listing the process under `touches: services`, and in its words the services and sizes it adds. A person with the right approves it before it ships.
## 2. Declare it once, in `buffcore.config.ts`
Everything that runs it reads `processes` (FEATURES.md, "One file says what a product uses"):
```ts
processes: [
{ name: 'worker', entry: 'src/worker.ts' }, // a Node process
{
name: 'speech',
build: 'services/speech', // a folder with its Dockerfile, its build context
// or: image: 'python:3.13.9-alpine@sha256:…', an image pinned by its digest
port: 4410, // http://127.0.0.1:4410, the same everywhere
health: ['python', 'health.py'], // run inside it; exit 0 once it is healthy
size: { cpus: 0.5, memoryMb: 512 }, // its limit, wherever it runs
count: 1, // how many in production; one in development and CI
volume: '/data', // where it keeps data, if it does: backed up
},
],
```
- **The image:** in a Dockerfile, start `FROM` an exact version pinned by its digest, never a moving tag. A container gets none of the product's settings or secrets.
- **The port** is on 127.0.0.1 only: the API calls it there, in development, CI and on the server alike. Pick one in the product's own block (44xx for a product on 44). A container with a port runs once (`count: 1`); `count` above one is for a container without one.
- **The health check** is a command its image has (`wget`, `python`, `curl`); `ape dev`, CI and `ape deploy` wait for it.
- **The size** is a limit: too little and it is stopped. A Node process may declare one too; without it, it counts as an estimate and runs unlimited.
- **The volume** is the only place its data survives a restart or a deploy, and the backups hold it. A store that must be copied while still (a database) needs its own dump: ask BuffCore first (the `ape-request` skill).
`defineProduct` names anything wrong with the declaration when the product starts.
## 3. Run it
- **`pnpm ape dev`** builds it and starts it with the Docker services, waits for its health check, and shows its output as `[speech]`. It keeps running with the Docker services; `pnpm services:down` stops them all.
- **`pnpm ape services`** lists every process with its size and count, and the totals for development and production; `--json` for tools, and the `ape mcp` tool `services_list` for agents.
- **CI** runs `pnpm ape services up`, which starts the same services and containers before the checks.
- **Test what calls it** with a fake of its answers, as any outside service: tests never need the container.
## 4. Ship it
1. **`pnpm ape server setup <server> …`** again: it writes the server's stack from `processes`. Until then `ape deploy` refuses, saying what differs.
2. **`pnpm ape deploy <server>`** builds its image from the commit, ships it with the product's and starts it. Its volume stays from one deploy to the next; when a deploy rolls back, its image goes back with the product's, and the volume stays as it is.
3. **The backups:** `ape backup` holds its volume, and `ape backup test` unpacks it into a scratch volume, checking its size. `ape backup restore` puts a volume back only when it is empty or missing.