webiny-api-architect
What it does
This skill gives your AI the main rules for building backend code on the Webiny API. It is for developers writing extensions that add business logic to a Webiny project.
When to use it
- βWhen you build any backend feature or extension for a Webiny API.
- βWhen you need to decide between a service and a use case for a piece of logic.
- βWhen you want to organize a new backend feature into the right folders and registrations.
Skill link
https://github.com/webiny/webiny-js/blob/next/skills/user-skills/api/api-architect/SKILL.mdCopy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.
How to use
The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.
Ready-to-paste message
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agentβs skills folder.
Example of what to ask your AI
βBuild a backend feature in Webiny that calculates shipping costs, following the project's architecture rules.β
5 new skills a week. 1 minute to read.
How it works
The skill explains the difference between services and use cases, how features are named by business purpose, and how they are registered in the dependency container. It also lists common mistakes to avoid.
Technical content (original SKILL.md)
Original text by the author, straight from GitHub.
API Architecture Patterns
TL;DR
API extensions use createFeature to register features into the DI container. Each feature is a vertical slice with abstractions, implementations, and a feature.ts registration file. The key abstractions are Services (multi-method, singleton) and UseCases (single-method orchestrators, transient). Repositories handle persistence via CMS. Features are named by business capability, files inside by technical responsibility.
Working Context
This skill applies to both extension developers (working in extensions/) and core developers (working in packages/). The architecture patterns are identical β only imports and registration differ.
Extensions (extensions/) |
Core (packages/) |
|
|---|---|---|
| Imports | webiny/api, webiny/api/cms/model, etc. |
@webiny/feature/api, @webiny/api-headless-cms/..., etc. |
| Catalog paths | Use the Import: path |
Use the Source: path |
| Entry point | export default createFeature(...) in a file targeted by <Api.Extension src={...}> |
createFeature registered by the package initializer |
| GraphQL schemas | export default GraphQLSchemaFactory.createImplementation(...) β registered via container.register() inside the entry point's createFeature |
Same pattern, but imported from @webiny/handler-graphql |
Detect which context you're in by checking the file path: extensions/ β extension mode, packages/ β core mode.
Architecture Overview
Extension (root) ββ registers ββ> Features + GraphQL Schemas + Models
Feature ββ registers ββ> UseCase | Service | EventHandler + Repository
UseCase ββ depends on ββ> Service | Repository (+ EventPublisher)
Repository ββ depends on ββ> CMS Use Cases (GetModel, CreateEntry, etc.)
Service ββ depends on ββ> external APIs, other Services
- Extension: Top-level entry point. Registers all features, GraphQL schemas, and CMS models.
- Feature: A vertical slice. Registers its use cases, services, repositories, and event handlers.
- UseCase: Single-method orchestrator (
execute()). Coordinates services, repositories, and events. Transient scope. - Service: Multi-method abstraction for external API calls or cohesive domain logic. Singleton scope.
- Repository: Persistence layer using CMS as storage. Singleton scope.
- EventHandler: Thin orchestrator reacting to domain events. Delegates to services/use cases.
- GraphQL Schema: Defines types, inputs, queries, and mutations. Resolvers delegate to use cases.
- CMS Model: Defines the data schema stored in headless CMS.
Services vs UseCases
Services
Multi-method abstractions for external API calls or cohesive domain logic. A service groups related operations that belong together.
// abstractions.ts
export interface ILingotekService {
translate(documentId: string, targetLocale: string): Promise<Result<void, Error>>;
getTranslationStatus(documentId: string): Promise<Result<TranslationStatus, Error>>;
deleteProject(projectId: string): Promise<Result<void, Error>>;
}
export const LingotekService = createAbstraction<ILingotekService>("MyExt/LingotekService");
export namespace LingotekService {
export type Interface = ILingotekService;
}
- Registered in singleton scope (
.inSingletonScope()) - Located in:
features/{serviceName}/orfeatures/services/{serviceName}/ - One service per external system or cohesive domain area
- If async bootstrap is needed (loading settings from CMS, fetching remote config): use the ServiceProvider pattern β a provider abstraction with
async getService()that lazily initializes and caches the service. Consumers inje
FAQ
What is the difference between a service and a use case?
A service has several methods and is shared, while a use case has one method for a single operation.
How are features named?
Features are named by business capability, and the files inside by their technical role.
Does it cover the admin side?
No. Admin patterns are covered by separate Webiny admin skills.
Details
Original description by the author
The hub skill for all API/backend architecture in Webiny. Covers architecture overview, Services vs UseCases, feature naming and organization, feature structure templates, DI decision tree, anti-patterns, createFeature, createAbstraction, container registration, domain errors, entity patterns, naming conventions, scoping rules, and code conventions. Use this skill for ANY backend API work β it references sub-skills for deep implementation details.
repo: webiny/webiny-js
Popularity
- GitHub stars
- 8.1k
- Ranking position
- #12583
- License
- β
- Updated
- 11/2/2026
Comments
- β¦
More skills from this repository
prd-to-plan
8.1kHelps your agent turn a product requirements document into a phased plan of small end-to-end slices, saved as a Markdown file.
webiny-admin-architect
8.1kTeaches your agent how to build admin screens for the Webiny platform, using its business logic layers and presenter pattern.
webiny-admin-permissions
8.1kTeaches your agent to add permission controls to Webiny admin screens, including auto-generated permission forms and hide-or-show checks.
webiny-form-model
8.1kTeaches your agent to build forms in Webiny using a declarative field builder, layouts, validation and conditional rules.
Similar skills
api-connector-builder
280kHas your agent build new API connections following the existing pattern. Use when you need to add one more integration without creating a new way of doing things.
api-design
280kHelps your agent design REST APIs following best practices. It's useful for defining how APIs communicate, how errors are shown, and how to organize data.
backend-patterns
280kHelps your agent with server-side architecture patterns and database optimization. It's useful for building or reviewing code that runs on the server.