Skills

Webiny V5 To V6 Migration

Migration patterns for converting v5 Webiny code to v6 architecture.

Install

npx skills add webiny/webiny-js --skill webiny-v5-to-v6-migration -g -a claude-code -y
Repository
webiny/webiny-js8.1k
Category
AI and agents
Updated
5d ago
License
See repository
Context cost
Mediumabout 3,000 tokens
Runs scripts
No, instructions only

What it does

Migration patterns for converting v5 Webiny code to v6 architecture. Use this skill when migrating existing v5 plugins to v6 features, converting context plugins to DI services, adapting v5 event subscriptions to v6 EventHandlers, or understanding how v5 patterns translate to v6. Targeted at AI agents performing migrations.

v5 → v6 Migration Patterns

Overview

v6 replaces v5's plugin-based architecture with feature-based DI. The key shifts:

v5 Conceptv6 Equivalent
ContextPlugincreateAbstraction + createImplementation (Service)
Plugin arraycreateFeature + container.register()
context.myServiceDI injection via constructor
onEntryAfterCreate.subscribe()EventHandler feature
new GraphQLSchemaPlugin()GraphQLSchemaFactory.createImplementation()

Pattern 1: Context Plugin → DI Service

v5

new ContextPlugin(async context => {
  context.lingotekService = {
    translate: async (docId, locale) => {
      /* ... */
    },
    getStatus: async docId => {
      /* ... */
    },
    deleteProject: async projectId => {
      /* ... */
    }
  };
});

v6

// features/lingotekService/abstractions.ts
import { createAbstraction } from "webiny/api";

export interface ILingotekService {
  translate(docId: string, locale: string): Promise<Result<void, Error>>;
  getStatus(docId: 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;
}

// features/lingotekService/LingotekService.ts
class LingotekServiceImpl implements LingotekService.Interface {
  constructor(private buildParams: BuildParams.Interface) {}
Read the whole SKILL.md on GitHub

More in AI and agents