en un clic
add-endpoint
// Use when adding a new API endpoint, route, or HTTP handler. ALWAYS use for new Fastify controller endpoints.
// Use when adding a new API endpoint, route, or HTTP handler. ALWAYS use for new Fastify controller endpoints.
Interview the user relentlessly about a plan or design until reaching shared understanding, resolving each branch of the decision tree. Use when user wants to stress-test a plan, get grilled on their design, or mentions "grill me".
Design system for Activepieces (open-source AI automation platform, "open source replacement for Zapier"). Use whenever designing, mocking, or building UI for Activepieces — the web app (flow builder, runs, connections, dashboard), docs, or marketing surfaces. Provides brand purple `#8142E3`, Inter type ramp with `sm` (14px) as body default, Tailwind neutrals, Lucide icons, Shadcn/Radix primitive conventions, the signature dotted-canvas builder background, and a recreated web UI kit.
Use when creating a new database table, entity, or data model. ALWAYS use for any new TypeORM EntitySchema creation.
Use when the user asks to add a feature, implement functionality, or build something spanning database, API, and frontend. ALWAYS use for multi-layer feature work.
Creates TypeORM database migrations for the Activepieces server. Use when the user asks to add a column, create a table, add an index, or make any schema change to the database.
Maintains feature documentation in .agents/features/ and performs mandatory feature overlap detection before any new feature is proposed. Also builds a shared domain vocabulary for Activepieces. Use when the user asks to define domain terms, build a glossary, harden terminology, create ubiquitous language, references "domain model" or "DDD", or asks about adding a new feature.
| name | add-endpoint |
| description | Use when adding a new API endpoint, route, or HTTP handler. ALWAYS use for new Fastify controller endpoints. |
Create endpoint for $ARGUMENTS.
Read the pattern: Open packages/server/api/src/app/tables/table/table.controller.ts as reference.
Create or update controller using FastifyPluginAsyncZod:
export const myController: FastifyPluginAsyncZod = async (fastify) => {
fastify.post('/', CreateRequest, async (request) => {
return myService(request.log).create({
projectId: request.projectId,
request: request.body,
})
})
}
Define route config AFTER the controller (not inline):
const CreateRequest = {
config: {
security: securityAccess.project(
[PrincipalType.USER, PrincipalType.ENGINE, PrincipalType.SERVICE],
Permission.WRITE_MY_FEATURE,
{ type: ProjectResourceType.BODY },
),
},
schema: {
tags: ['my-feature'],
body: CreateMyFeatureRequest, // Zod schema from @activepieces/shared
response: { [StatusCodes.CREATED]: MyFeature },
},
}
Security access (pick one):
securityAccess.project(principals, permission, { type: ProjectResourceType.X }) — project-scopedsecurityAccess.platformAdminOnly(principals) — admin onlysecurityAccess.publicPlatform(principals) — any platform membersecurityAccess.public() — no authCreate module and register in app.ts:
export const myModule: FastifyPluginAsyncZod = async (app) => {
app.addHook('preSerialization', entitiesMustBeOwnedByCurrentProject)
await app.register(myController, { prefix: '/v1/my-features' })
}
Add Permission if new: add to Permission enum in @activepieces/shared.
Verify: npm run lint-dev