Add a feature to a product end to end, in order: entity, composition, migration, contract, routes and roles, admin view, app view, strings, tests, pnpm verify. Each step points at the reference module, tasks.
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 Feature?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/buffape-ape-add-feature)
---
name: ape-add-feature
description: "Add a feature to a product end to end, in order: entity, composition, migration, contract, routes and roles, admin view, app view, strings, tests, pnpm verify. Each step points at the reference module, tasks."
---
# Add a feature
The reference module, `tasks`, is every step done once: one table, a list and a create route for members, an operators' list with a role, an admin view, an app view, English and Spanish, a route test and view tests. `ape create --example` adds it to a new product; otherwise read it in `node_modules/@buffcore/cli/templates/example/` (in BuffCore, `packages/cli/templates/example/`), laid out as the product is. Copy its shape and name things for your feature. Each step links the skill with the detail.
A feature with screens, the console's too, starts with every one of them approved as a prototype (the ape-prototype skill); steps 6 and 7 wire the views approved there. Asking another module a question (is this member paying?) is a call to a function it exports (the ape-add-module skill), and Stripe payments, feedback and the waitlist come as extensions (the ape-add-extension skill), not as steps here.
1. **Entity.** `apps/api/src/modules/<key>/entity.ts`, like `apps/api/src/modules/tasks/entity.ts`: `primaryId` from `@buffcore/db` for the ID, a plain `uuid` column for another module's row (an account), `p.datetime()` for a moment (UTC) and `p.date()` for a day with no time (a due day: the string `'2026-10-13'` in code, `z.iso.date()` in the contract, `formatDate` on a screen; the time zone convention is in `docs/LOCALIZATION.md`), and a `toX` that turns a row into the contract's shape. One entity per table, all in this file while it stays short. Sensitive fields: the ape-add-module skill.
2. **Manifest and composition.** `apps/api/src/modules/tasks/manifest.ts`: `defineModule` with `scope: 'app'`, its entities, migrations and routes, and its part of privacy (`onExportAccount` and `onDeleteAccount` from `@buffcore/modules/privacy`, in `contributes`) when the rows belong to an account. Start `migrations/index.ts` as `export default [];`. Add the module to `apps/api/src/app.ts` after BuffCore's modules; the migration step needs it there. Rows that must exist before anything happens (a list a member picks from) are `seeds: { minimal }`; tests create every other row through the routes (the ape-add-module skill).
3. **Migration.** `pnpm ape migrate create <key> init` writes `migrations/0001-init.ts` for every table at once (`apps/api/src/modules/tasks/migrations/0001-init.ts`); add it to `apps/api/src/modules/tasks/migrations/index.ts`, read `up` and `down`, then `pnpm ape migrate`, `pnpm ape migrate down`, `pnpm ape migrate` (the ape-migration skill).
4. **Contract.** `apps/api/src/modules/tasks/contract.ts`: the record as a Zod object, and one `route` per route with `route`, `cursorQuery` and `page` from `@buffcore/contracts` (a list takes `cursorQuery` and answers `page(item)`). The admin and the app import this file by a relative path.
5. **Routes and roles.** `apps/api/src/modules/tasks/routes.ts`: `handle`, `callerAccountId`, `pageOf` and `forbidden` from `@buffcore/server`; list them in the manifest's `routes`. Members' routes are signed in by default; an operator route names `roles`, each declared in `apps/api/src/app.ts` as `identity: { roles }` and named in the admin catalog as `admin.roles.<role>`: reuse a role when the same person does the job, declare a new one when another does. An operator's write carries a `name` and an `action` mark (a member's own write none). The skill also shows a list over two of the module's tables, a list paged by another column and a unique clash answered `409` (the ape-add-route skill).
6. **Admin view and wiring.** `apps/admin/src/TasksScreen.tsx`: the view (props in, UI out) and the screen that feeds it with `usePagedRoute` from `@buffcore/admin-shell`; registered in `apps/admin/src/main.tsx` under `sections` with the route's `roles` (the ape-admin-screen skill).
7. **App view and wiring.** The view in `apps/app/src/screens/TasksView.tsx`; the route `apps/app/src/app/tasks.tsx` feeds it with `useRoute` and `useAction` from `@buffcore/sdk/react`; Home opens it (`apps/app/src/screens/HomeView.tsx`, `apps/app/src/app/index.tsx`) (the ape-app-screen skill).
8. **Strings.** Every word through `t()`, in English and Spanish: the words the server sends (an error's sentence, an action's title) in the module's own `locales/en.ts` and `es.json`, passed as the manifest's `catalog`; the admin's in `apps/admin/src/i18n/en.ts` and `es.json` beside it, the app's in `apps/app/src/i18n/en.ts` and `es.json`; then `pnpm ape i18n check` (the ape-add-translations skill).
9. **Tests.** The route test `apps/api/src/modules/tasks/tasks.test.ts`: `createProductTestApp`, `actAs`, `owner` and `member` from `@buffcore/modules/testing`, covering who may call each route, a refused input and its part of privacy. The view tests `apps/admin/src/views.test.tsx` and `apps/app/src/screens/TasksView.test.tsx`: each state, Spanish once and `en-XA` once (the ape-add-translations skill); they run on `viewTests` from `@buffcore/ui/vitest`, which empties the page after each test.
10. **Check.** Claude Code's format hook formats each file it writes and orders its imports (another agent runs `pnpm format`), and `pnpm lint` checks every file; then `pnpm ape manifest` (lists the module, its routes, roles and screens), then `pnpm verify`. Run tests with `pnpm test`, never `vitest` directly. Last, `pnpm test` writes each app's lines, branches, functions and statements to its `coverage/coverage-summary.json`: raise the floors in `apps/api/vitest.config.ts`, `apps/admin/vitest.config.ts` and `apps/app/vitest.config.mts` to those figures rounded down to whole numbers, in the same change.