webiny-api-architect
하는 일
이 스킬은 Webiny API에서 백엔드 코드를 만들 때 따를 주요 규칙을 AI에게 줍니다. Webiny 프로젝트에 비즈니스 로직을 추가하는 확장 기능을 쓰는 개발자를 위한 스킬입니다.
사용하는 경우
- ✓Webiny API를 위한 백엔드 기능이나 확장 기능을 만들 때.
- ✓어떤 로직을 서비스로 만들지 유스케이스로 만들지 정해야 할 때.
- ✓새 백엔드 기능을 올바른 폴더와 등록 위치에 구성하려는 경우.
스킬 링크
https://github.com/webiny/webiny-js/blob/next/skills/user-skills/api/api-architect/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“Webiny 프로젝트에 배송비를 계산하는 백엔드 기능을 만들어 주세요. 프로젝트의 아키텍처 규칙을 따라 주세요.”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
이 스킬은 서비스와 유스케이스의 차이를 설명하고, 기능을 비즈니스 목적에 따라 이름 짓는 방법과 의존성 컨테이너에 등록하는 방법을 보여 줍니다. 피해야 할 흔한 실수도 나열합니다.
기술 내용 (원본 SKILL.md)
작성자의 영어 원문을 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
자주 묻는 질문
서비스와 유스케이스의 차이는 무엇인가요?
서비스는 여러 메서드를 가지고 공유되며, 유스케이스는 하나의 작업을 위한 메서드 하나를 가진다고 스킬이 설명합니다.
기능은 어떻게 이름 짓나요?
기능은 비즈니스 역량에 따라 이름 짓고, 내부 파일은 기술적 역할에 따라 이름 짓습니다.
관리자 쪽도 다루나요?
아닙니다. 관리자 패턴은 별도의 Webiny 관리자 스킬이 다룹니다.
상세 정보
작성자의 원본 설명
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
인기도
- GitHub 스타
- 8.1k
- 순위
- #12583
- 라이선스
- —
- 업데이트
- 2026. 11. 2.
댓글
- …
이 저장소의 다른 스킬
prd-to-plan
8.1k에이전트가 제품 요구사항 문서를 작고 끝까지 이어지는 조각들로 된 단계별 계획으로 바꿔 Markdown 파일로 저장하도록 돕습니다.
webiny-admin-architect
8.1k에이전트에게 Webiny 플랫폼의 관리자 화면을 비즈니스 로직 계층과 프레젠터 패턴으로 만드는 방법을 가르칩니다.
webiny-admin-permissions
8.1k에이전트에게 Webiny 관리자 화면에 권한 제어를 추가하는 법을 가르칩니다. 스키마에서 권한 양식을 자동 생성하고 표시 여부를 확인합니다.
webiny-form-model
8.1k에이전트에게 선언형 필드 빌더, 레이아웃, 검증, 조건부 규칙으로 Webiny 양식을 만드는 법을 가르칩니다.
비슷한 스킬
api-connector-builder
280k에이전트가 기존 패턴을 따라 새로운 API 연결을 만들도록 합니다. 새로운 방식을 도입하지 않고 연동을 하나 더 추가할 때 씁니다.
api-design
280k에이전트가 모범 사례에 따라 REST API를 설계하도록 돕습니다. API가 통신하는 방식, 오류를 보여 주는 방식, 데이터를 정리하는 방식을 정하는 데 유용합니다.
backend-patterns
280k에이전트가 서버 쪽 아키텍처 패턴과 데이터베이스 최적화를 다루도록 돕습니다. 서버에서 실행되는 코드를 만들거나 검토할 때 유용합니다.