/fvtt-dev:fvtt-v13-migrationfrom fvtt-dev
This skill should be used when the user asks to "migrate to V13", "upgrade to Foundry V13", "update module for V13", "fix V13 compatibility", "convert to ESM", "use DataModel", or mentions V13-specific patterns like hook signature changes, actor.system vs actor.data.data, or Application V2. Provides comprehensive Foundry VTT V13 development patterns and migration guidance.
Ships in fvtt-dev. 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.
None: SKILL.md is the whole skill.
Domain: Foundry VTT Module/System Development Status: Production-Ready Last Updated: 2026-01-05
This guide covers V13-specific patterns and migration from earlier versions. For modules targeting V13, follow these guidelines.
require) to ESM (import/export)actor.data.data to actor.system)ALWAYS use foundry.abstract.DataModel for defining data structures instead of plain JavaScript objects. DataModels provide:
DataSchemaExample:
class MyModuleData extends foundry.abstract.DataModel {
static defineSchema() {
const fields = foundry.data.fields;
return {
name: new fields.StringField({ required: true, blank: false }),
value: new fields.NumberField({ initial: 0, min: 0 }),
enabled: new fields.BooleanField({ initial: true })
};
}
}
Foundry V13 uses ECMAScript Modules (ESM) exclusively. Your code must:
import and export statements (NO require())"esmodules" in your manifest (NOT "scripts").js extensions in import paths when importing relative filesExample manifest entry:
{
"esmodules": ["scripts/module.js"],
"scripts": []
}
ALWAYS use game.i18n.localize() or game.i18n.format() for user-facing text. Never hardcode English strings.
// BAD
ui.notifications.info("Item created successfully");
// GOOD
ui.notifications.info(game.i18n.localize("MYMODULE.Notifications.ItemCreated"));
// For dynamic values
const message = game.i18n.format("MYMODULE.Notifications.ItemCreatedWithName", {
name: itemName
});
Localization files go in lang/en.json:
{
"MYMODULE.Notifications.ItemCreated": "Item created successfully",
"MYMODULE.Notifications.ItemCreatedWithName": "Item {name} created successfully"
}
Many hooks in V13 have different argument signatures than V12. Always check the current API documentation.
Example: createToken Hook
// V12 (OLD - WRONG in V13)
Hooks.on("createToken", (scene, tokenData, options, userId) => { });
// V13 (CORRECT)
Hooks.on("createToken", (tokenDocument, options, userId) => { });
V13 distinguishes between Document classes (e.g., Actor, Item) and their data models:
actor.name, item.systemactor.system to access system-specific data defined in your DataModelactor.data.data (deprecated pattern from V10)// BAD (V10 pattern)
const hp = actor.data.data.attributes.hp.value;
// GOOD (V13 pattern)
const hp = actor.system.attributes.hp.value;
Active Effects in V13 use a cleaner structure:
document.effects (EffectCollection)await actor.createEmbeddedDocuments("ActiveEffect", [effectData])key (path to property) and mode (add, multiply, override, etc.)const effectData = {
name: game.i18n.localize("MYMODULE.Effects.Blessed"),
icon: "icons/magic/light/beam-rays-yellow.webp",
changes: [{
key: "system.attributes.ac.bonus",
mode: CONST.ACTIVE_EFFECT_MODES.ADD,
value: "2"
}],
duration: { rounds: 10 }
};
await actor.createEmbeddedDocuments("ActiveEffect", [effectData]);
V13 has reorganized canvas layers. Use the correct layer references:
canvas.tokens - TokenLayercanvas.tiles - TilesLayercanvas.lighting - LightingLayercanvas.grid - GridLayerDialog construction now prefers Application V2 patterns in some contexts, but classic Dialogs still work:
new Dialog({
title: game.i18n.localize("MYMODULE.Dialog.Title"),
content: `<p>${game.i18n.localize("MYMODULE.Dialog.Content")}</p>`,
buttons: {
yes: {
icon: '<i class="fas fa-check"></i>',
label: game.i18n.localize("MYMODULE.Dialog.Confirm"),
callback: () => { /* action */ }
},
no: {
icon: '<i class="fas fa-times"></i>',
label: game.i18n.localize("MYMODULE.Dialog.Cancel")
}
},
default: "yes"
}).render(true);
When defining DataModel schemas, use these field types from foundry.data.fields:
StringField - Text dataNumberField - Numeric values (integers or floats)BooleanField - True/false valuesObjectField - Nested objectsArrayField - Arrays of valuesSchemaField - Nested DataModel schemaHTMLField - Sanitized HTML contentFilePathField - File paths (images, sounds, etc.)ColorField - Color values (hex strings)AngleField - Angles in degreesAlphaField - Alpha transparency (0-1)game.user.isGM or document permission checksfromUuidSync() or fromUuid() - For reliable document referencesYour module.json or system.json must declare V13 compatibility:
{
"id": "my-module",
"title": "My Module",
"version": "1.0.0",
"compatibility": {
"minimum": "13",
"verified": "13",
"maximum": "13"
},
"esmodules": ["scripts/init.js"],
"languages": [
{
"lang": "en",
"name": "English",
"path": "lang/en.json"
}
]
}
console.log() liberally, or set up proper logging with CONFIG.debugCONFIG.debug.hooks = true to see all hook executionsRemember: When in doubt, check the official Foundry VTT V13 API documentation at https://foundryvtt.com/api/
"esmodules" (not "scripts").js extensionsdefineSchema()document.system (not data.data)game.i18n.localize()Last Updated: 2026-01-05 Status: Production-Ready Maintainer: ImproperSubset
What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
17 skills in this plugin
/fvtt-active-effectsThis skill should be used when creating or applying Active Effects, working with effect changes and modes (ADD, MULTIPLY, OVERRIDE, CUSTOM), implementing duration tracking for combat, or handling effect transfer from items to actors./fvtt-applicationsThis skill should be used when creating custom windows with ApplicationV2, building forms with FormApplication, using Dialog for prompts, understanding the render lifecycle, or migrating from Application v1 to ApplicationV2./fvtt-canvasThis skill should be used when working with the Foundry canvas, PIXI.js rendering, canvas layers, placeable objects (tokens, tiles, drawings), render flags for performance, or canvas lifecycle hooks like canvasReady.npx claudepluginhub impropersubset/hh-agentics --plugin fvtt-dev