Generates C# IWidgetMigration and IWidgetPropertyMigration extension code for custom widget/section type transformations during KX13→XbyK migration.
Ships in kentico-kx13-migration. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Produces ready-to-use C# code files for the Migration.Tool.Extensions project. Takes the migration plan output from the migrate-content-plan skill — or a direct text description — as input.
references/widget-migration-api.md for the complete API patterns, annotated code samples, and decision guides.assets/WIDGET_MIGRATION_EXAMPLE.cs for a complete annotated reference implementation showing all patterns.../_shared/references/migration-tool.md.../_shared/references/migration-docs.md.IWidgetMigration or IWidgetPropertyMigration.Determine the set of classes needed:
IWidgetMigration class per source widget or section type (or per consolidation group when multiple source types map to one target).IWidgetPropertyMigration class per distinct property transformation pattern that is reusable across widgets or needs to be delegated via the propertyMigrations dictionary.ServiceCollectionExtensions class (or addition to existing) for DI registration.Kentico.Widget.RichText, Kentico.FormWidget) — these migrate automatically.IWidgetPropertyMigration transforms.IWidgetMigration for any widget that needs property transforms via IWidgetPropertyMigration — even if the widget identifier is unchanged. The migration tool only invokes standalone IWidgetPropertyMigration classes when API Discovery provides EditingFormControlModel metadata for the property. If a KX13 widget property lacks an [EditingComponent(...)] attribute, EditingFormControlModel is null and the property migration is silently skipped. An IWidgetMigration that delegates properties via the propertyMigrations dictionary uses a separate code path (explicitMigrations) that does not depend on API Discovery.MigrateWidget when the property transformation is simple and specific to one widget (e.g., int→string ratio). Only create a separate IWidgetPropertyMigration when the transformation is reusable or needs to be delegated.WidgetFileMigration (media files, Rank 100,000), WidgetPathSelectorMigration (path selectors, Rank 100,001), and WidgetPageSelectorMigration (page selectors, Rank 100,002) handle common conversions automatically. Only create a custom IWidgetPropertyMigration to override a built-in when the default conversion target is wrong (e.g., page selector → ContentItemReference instead of WebPageRelatedItem).For each migration, generate a class implementing IWidgetMigration:
Rank — use values < 100,000 (built-in defaults use 100,000+). Use small integers (1, 2, 3...) with gaps for future insertions.ShallMigrate — match on identifier.TypeIdentifier using string.Equals with StringComparison.InvariantCultureIgnoreCase. For multi-site scenarios, also filter on context.SiteId.MigrateWidget — change value["type"] to the target identifier, restructure value["variants"][0]["properties"] as a new JObject, populate the propertyMigrations dictionary for properties needing further conversion.IServiceCollection extension method for DI registration in a separate static class (not inside the migration class itself — migration classes use primary constructors for DI injection, which makes them non-static, and C# requires extension methods to be in static classes).For IWidgetPropertyMigration classes:
ShallMigrate — match on propertyName or context.EditingFormControlModel?.FormComponentIdentifier. Do NOT use context.ComponentIdentifier — this property does not exist on WidgetPropertyMigrationContext. The context record only has SiteId and EditingFormControlModel.MigrateWidgetProperty — transform the JToken value and return a WidgetPropertyMigrationResult.IServiceCollection extension method for DI registration in a separate static class (same rule as IWidgetMigration — see above).Generate or update the ServiceCollectionExtensions static class:
AddTransient<IWidgetMigration, T>() for each widget migration (NOT AddSingleton).AddTransient<IWidgetPropertyMigration, T>() for each property migration (NOT AddSingleton).Kentico.Widget.RichText, Kentico.FormWidget) do not need custom code.QuerySourceInstanceApi appsettings prerequisite.Migration.Tool.Extensions project to verify the generated code compiles without errors.After a successful build, verify all generated migrations are properly registered:
ServiceCollectionExtensions class and confirm every IWidgetMigration has a corresponding AddTransient<IWidgetMigration, T>() call (NOT AddSingleton — widget migrations are not safe as singletons).ServiceCollectionExtensions class and confirm every IWidgetPropertyMigration has a corresponding AddTransient<IWidgetPropertyMigration, T>() call.AddSingleton instead of AddTransient, fix and rebuild.Save files to the user-specified path (default: Migration.Tool.Extensions/WidgetMigrations/ — generated code belongs in the Migration.Tool.Extensions project, matching the Migration.Tool.Extensions.WidgetMigrations namespace).
Provide a summary table using this format:
| File | Pattern | Rank | Handles |
|---|---|---|---|
HeroContentWidgetMigration.cs | IWidgetMigration | 1 | Maps Acme.HeroWidget → Acme.HeroBanner, creates content item for image |
Ask if any migrations need adjustment and iterate on feedback.
widget-migration-api.md — do not invent methods or types that don't exist.value["type"] for the type identifier, ((JArray)value["variants"]!)[0]["properties"] for the property bag.WidgetFileMigration (media files) and WidgetPageSelectorMigration (page selectors) in the propertyMigrations dictionary rather than reimplementing conversion logic.Migration.Tool.Extensions.WidgetMigrations (user can override).{TargetWidgetName}WidgetMigration.cs for widget migrations, {Concern}PropertyMigration.cs for property migrations.Source_/Target_ prefix convention from the example.TODO comments for values unknown at generation time (e.g., media GUID lookups, resource key resolution dictionaries, content item GUIDs).Rank < 100,000 to take priority over the built-in (100,000+). The ShallMigrate of the custom migration should match the same FormComponentIdentifier (via Kx13FormComponents constants) as the built-in it replaces.IWidgetMigration and IWidgetPropertyMigration code only — IClassMapping, IFieldMigration, ContentItemDirectorBase, and appsettings configuration are separate extension points covered by other skills.AddTransient for DI registration — never AddSingleton. Widget migrations are not safe to reuse as singletons.ShallMigrate must use StringComparison.InvariantCultureIgnoreCase — widget type identifiers are case-insensitive.Kentico.Widget.RichText, Kentico.FormWidget) — they migrate automatically.WidgetFileMigration, WidgetPathSelectorMigration, WidgetPageSelectorMigration) before writing custom IWidgetPropertyMigration classes — only override when the default conversion target is wrong.IWidgetMigration interface as widgets — there is no separate section migration interface.WidgetPropertyMigrationContext only has SiteId and EditingFormControlModel — there is no ComponentIdentifier property. Do not try to filter by widget type in IWidgetPropertyMigration.ShallMigrate. If you need widget-type-scoped property transforms, do them inline in the IWidgetMigration.MigrateWidget method or delegate via the propertyMigrations dictionary (which is already widget-scoped).IWidgetPropertyMigration requires API Discovery — the migration tool's VisualBuilderPatcher only calls GetWidgetPropertyMigration (rank-based lookup) when the property has a non-null EditingFormControlModel from API Discovery. KX13 widget properties without [EditingComponent(...)] attributes produce null EditingFormControlModel, silently skipping all property migrations. Always pair standalone IWidgetPropertyMigration classes with an IWidgetMigration that explicitly delegates via propertyMigrations to guarantee execution regardless of API Discovery metadata.static classes — migration classes that use primary constructors (for DI injection of ILogger, ModelFacade, etc.) are non-static. C# requires extension methods to be defined in non-generic static classes. Place the Add{MigrationName} extension method in a companion static class {MigrationName}Extensions in the same file.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
widget-migration, kentico-migration, code-generation, csharp
14 skills in this plugin
/migrate-code-componentMigrates a reusable shared component (header, footer, navigation, breadcrumbs, etc.) from a Kentico Xperience 13 project to Xperience by Kentico. Locates the component in the source project and migrates it together with all dependencies. Use when migrating shared layout elements like headers, footers, or navigation./migrate-code-globalMigrates global code from a Kentico Xperience 13 project to Xperience by Kentico. Sets up the target project structure, generates code files, and migrates shared code including localization, styles, business logic, and project startup configuration. Use when starting a KX13 to XbyK codebase migration./migrate-/kentico-kx13-migration:migrate-content-widgets [migration-plan-path]from kentico-kx13-migration
npx claudepluginhub kentico/xperience-by-kentico-kenticopilot --plugin kentico-kx13-migrationOther plugins' skills for the same job