Architecture
Naming rules for code in the CentraKit monorepo, and the renames that brought the code in line with them.
These rules apply to every app and package. Database names follow Supabase schema.
define* and create*. A define* function returns a declarative value, such as a Zod schema built from arguments. A create* function returns a runtime instance, such as a service or a request context.<Thing>Options without a verb, such as RequestContextOptions, not CreateRequestContextOptions.ApiPage, OpenApi, McpServer, ChatUiMessage. Third-party names keep their own spelling, such as OpenAPIPageData from Fumadocs.customer), and API resources and routes are plural (/customers).listTasks becomes the tool list_tasks.Temporal from @workspace/foundation/temporal in contracts and services.pnpm docs:drift fails when a doc page still uses a retired name. It skips this page and the decision records, which keep the old names on purpose.
| Old name | New name |
|---|---|
mcp-handler | createMcpHandler from @modelcontextprotocol/server |
MCP tool listTasks (every tool) | list_tasks (snake case of the operation ID) |
framer-motion | motion/react |
date-fns and @date-fns/tz | Temporal from @workspace/foundation/temporal |
AISearch*, useAISearchOpen | AiSearch*, useAiSearchOpen |
APIPage | ApiPage |
WebMCP component | WebMcp |
renderOpenAPIOperations | renderOpenApiOperations |
ChatUIMessage* | ChatUiMessage* |
Docs ChatUIMessage | DocsChatMessage |
TeamSwitcher | OrganizationSwitcher |
createListResponseSchema | defineListResponseSchema |
createPublicApiListResponseSchema | definePublicApiListResponseSchema |
createOpaqueIdSchema | defineOpaqueIdSchema |
createCustomerLocationNameSchema | defineCustomerLocationNameSchema |
CreateRequestContextOptions | RequestContextOptions |
CreateRequestContextFromSupabaseOptions | RequestContextFromSupabaseOptions |
CreateActingUserRequestContextOptions | ActingUserRequestContextOptions |
CreateAdminContextOptions | AdminContextOptions |
CreateApiClientOptions | ApiClientOptions |
CreateEmailServiceOptions | EmailServiceOptions |
CreateNextConfigOptions | NextConfigOptions |
Last updated on