fvtt-sheets
This skill should be used when creating or extending ActorSheet/ItemSheet classes, implementing getData or _prepareContext, binding events with activateListeners, handling drag/drop, or migrating from ApplicationV1 to ApplicationV2. Covers both legacy V1 and modern V2 patterns.
What this skill does
# Foundry VTT Sheets
**Domain:** Foundry VTT Module/System Development
**Status:** Production-Ready
**Last Updated:** 2026-01-04
## Overview
Document sheets (ActorSheet, ItemSheet) are the primary UI for interacting with game entities. Foundry supports two patterns: legacy ApplicationV1 (until V16) and modern ApplicationV2 (V12+).
### When to Use This Skill
- Creating custom character or item sheets
- Extending existing sheet classes
- Adding interactivity (rolls, item management)
- Implementing drag/drop functionality
- Migrating V1 sheets to V2
### V1 vs V2 Quick Comparison
| Aspect | V1 (Legacy) | V2 (Modern) |
|--------|-------------|-------------|
| Config | `static get defaultOptions()` | `static DEFAULT_OPTIONS` |
| Data | `getData()` | `async _prepareContext()` |
| Events | `activateListeners(html)` | `static actions` + `_onRender()` |
| Templates | Single template | Multi-part PARTS system |
| Re-render | Full sheet | Partial by part |
| Support | Until V16 | Current standard |
## ApplicationV1 Sheets
### Basic Structure
```javascript
export class MyActorSheet extends ActorSheet {
static get defaultOptions() {
return foundry.utils.mergeObject(super.defaultOptions, {
classes: ["my-system", "sheet", "actor"],
template: "systems/my-system/templates/actor-sheet.hbs",
width: 600,
height: 600,
tabs: [{
navSelector: ".sheet-tabs",
contentSelector: ".sheet-body",
initial: "description"
}],
dragDrop: [{
dragSelector: ".item-list .item",
dropSelector: null
}]
});
}
// Dynamic template based on actor type
get template() {
return `systems/my-system/templates/actor-${this.actor.type}-sheet.hbs`;
}
}
```
### getData() - Preparing Template Context
```javascript
getData() {
const context = super.getData();
const actorData = this.actor.toObject(false);
// Add data to context
context.system = actorData.system;
context.flags = actorData.flags;
context.items = actorData.items;
// Organize items by type
context.weapons = context.items.filter(i => i.type === "weapon");
context.spells = context.items.filter(i => i.type === "spell");
// Enrich HTML (sync in V1)
context.enrichedBio = TextEditor.enrichHTML(
this.actor.system.biography,
{ secrets: this.actor.isOwner, async: false }
);
return context;
}
```
**Key Points:**
- Context has NO automatic relation to document data
- Everything template needs MUST be explicitly added
- `{{system.hp.value}}` reads from context
- `name="system.hp.value"` writes to document
### activateListeners() - Event Binding
```javascript
activateListeners(html) {
// ALWAYS call super first
super.activateListeners(html);
// Skip if not editable
if (!this.isEditable) return;
// Roll handlers
html.on("click", ".rollable", this._onRoll.bind(this));
// Item management
html.on("click", ".item-create", this._onItemCreate.bind(this));
html.on("click", ".item-edit", this._onItemEdit.bind(this));
html.on("click", ".item-delete", this._onItemDelete.bind(this));
}
async _onRoll(event) {
event.preventDefault();
const element = event.currentTarget;
const { rollType, formula, label } = element.dataset;
const roll = new Roll(formula, this.actor.getRollData());
await roll.evaluate();
roll.toMessage({
speaker: ChatMessage.getSpeaker({ actor: this.actor }),
flavor: label
});
}
async _onItemCreate(event) {
event.preventDefault();
const type = event.currentTarget.dataset.type;
await this.actor.createEmbeddedDocuments("Item", [{
name: `New ${type.capitalize()}`,
type: type
}]);
}
async _onItemDelete(event) {
event.preventDefault();
const li = $(event.currentTarget).closest(".item");
const item = this.actor.items.get(li.data("itemId"));
await item.delete();
li.slideUp(200, () => this.render(false));
}
```
### Drag & Drop (V1)
```javascript
// Automatic via defaultOptions
static get defaultOptions() {
return foundry.utils.mergeObject(super.defaultOptions, {
dragDrop: [{
dragSelector: ".item-list .item",
dropSelector: null
}]
});
}
// Override handlers as needed
_onDragStart(event) {
const li = event.currentTarget;
const item = this.actor.items.get(li.dataset.itemId);
event.dataTransfer.setData("text/plain", JSON.stringify(item.toDragData()));
}
async _onDrop(event) {
const data = TextEditor.getDragEventData(event);
if (data.type === "Item") {
return this._onDropItem(event, data);
}
}
async _onDropItem(event, data) {
if (!this.actor.isOwner) return false;
const item = await Item.implementation.fromDropData(data);
// Prevent dropping on self
if (this.actor.uuid === item.parent?.uuid) return;
return this.actor.createEmbeddedDocuments("Item", [item.toObject()]);
}
```
### Tab Navigation (V1)
```html
<!-- Template structure -->
<nav class="sheet-tabs">
<a class="item" data-tab="description">Description</a>
<a class="item" data-tab="items">Items</a>
</nav>
<section class="sheet-body">
<div class="tab" data-group="primary" data-tab="description">
<!-- Description content -->
</div>
<div class="tab" data-group="primary" data-tab="items">
<!-- Items content -->
</div>
</section>
```
## ApplicationV2 Sheets
### Basic Structure
```javascript
class MyActorSheet extends foundry.applications.api.HandlebarsApplicationMixin(
foundry.applications.sheets.ActorSheetV2
) {
static DEFAULT_OPTIONS = {
classes: ["my-system", "sheet", "actor"],
tag: "form",
window: {
resizable: true
},
position: {
width: 600,
height: 600
},
actions: {
rollSkill: this.#onRollSkill,
createItem: this.#onCreateItem,
deleteItem: this.#onDeleteItem
}
}
static PARTS = {
header: {
template: "systems/my-system/templates/actor/header.hbs"
},
tabs: {
template: "templates/generic/tab-navigation.hbs"
},
description: {
template: "systems/my-system/templates/actor/description.hbs",
scrollable: [""]
},
items: {
template: "systems/my-system/templates/actor/items.hbs",
scrollable: [""]
}
}
static TABS = {
primary: {
tabs: [
{ id: "description" },
{ id: "items" }
],
labelPrefix: "MYSYS.TAB",
initial: "description"
}
}
}
```
### _prepareContext() - Async Data Preparation
```javascript
async _prepareContext(options) {
const context = await super._prepareContext(options);
// Add tabs
context.tabs = this._prepareTabs(this.tabGroups.primary);
// Add system data
context.system = this.document.system;
// Organize items
context.weapons = this.document.items.filter(i => i.type === "weapon");
context.spells = this.document.items.filter(i => i.type === "spell");
// Enrich HTML (MUST be async in V2)
context.enrichedBio = await TextEditor.enrichHTML(
this.document.system.biography,
{ async: true, relativeTo: this.document }
);
return context;
}
async _preparePartContext(partId, context) {
switch (partId) {
case "description":
case "items":
context.tab = context.tabs[partId];
break;
}
return context;
}
```
### Static Actions (V2 Event Handling)
```javascript
static DEFAULT_OPTIONS = {
actions: {
rollSkill: this.#onRollSkill,
createItem: this.#onCreateItem,
deleteItem: this.#onDeleteItem
}
}
// Action handlers MUST be static with # prefix
static #onRollSkill(event, target) {
// 'this' is the application instance
// 'target' is the clicked element
const skillId = target.dataset.skillId;
const skill = this.document.system.skills[skillId];
const roll = new Roll("1d20 + @mod", { mod: skill.value });
roll.evaluate().then(r => {
r.toMessage({
speaker: ChatMessage.getSpeaker({ actor: this.document }),
flavor: `${skill.label} Check`
});
});
}
static async #onCreateItem(event, target) {
const type = target.daRelated in General
modeling-omnistudio-epc-catalog
IncludedSalesforce Industries CME EPC product-modeling skill for Product2-based catalog creation. Use when creating EPC products, configuring product attributes, building offer bundles with Product Child Items, or reviewing EPC DataPack JSON metadata for product catalog changes. TRIGGER when: user creates or updates Product2 EPC records, AttributeAssignment payloads, AttributeMetadata/AttributeDefaultValues, Offer bundles, or ProductChildItem relationships. DO NOT TRIGGER when: designing OmniScripts/FlexCards/Integration Procedures (use building-omnistudio-omniscript, building-omnistudio-flexcard, or building-omnistudio-integration-procedure), implementing Apex business logic (use generating-apex), or troubleshooting deployment pipelines (use deploying-metadata).
relationship-science-coach
IncludedUse this skill for direct, practical adult relationship coaching: couples conflict, repair, trust, marriage, dating, flirting, attachment patterns, emotional connection, sex, desire differences, eroticism, kink negotiation, affection, love languages, breakups, and long-term passion. Draw on Gottman, EFT and Hold Me Tight, attachment science, modern sex research, Perel, Nagoski, Kerner, Schnarch, Love and Stosny, and flexible love-language tools. Be concrete and low-hedge. Redirect only for imminent danger, abuse, coercive control, minors, non-consent, self-harm, stalking, or medical/legal/psychiatric decisions.
building-sf-integrations
IncludedSalesforce integration architecture and runtime plumbing with 120-point scoring. Use this skill to set up Named Credentials, External Credentials, External Services, REST/SOAP callout patterns, Platform Events, and Change Data Capture. TRIGGER when: user sets up Named Credentials, External Services, REST/SOAP callouts, Platform Events, CDC, or touches .namedCredential-meta.xml files. DO NOT TRIGGER when: Connected App/OAuth config (use configuring-connected-apps), Apex-only logic (use generating-apex), or data import/export (use handling-sf-data).
venue-templates
IncludedAccess comprehensive LaTeX templates, formatting requirements, and submission guidelines for major scientific publication venues (Nature, Science, PLOS, IEEE, ACM), academic conferences (NeurIPS, ICML, CVPR, CHI), research posters, and grant proposals (NSF, NIH, DOE, DARPA). This skill should be used when preparing manuscripts for journal submission, conference papers, research posters, or grant proposals and need venue-specific formatting requirements and templates.
let-fate-decide
IncludedDraws the 12 Houses of the Zodiac Tarot spread to inject entropy into planning when prompts are vague, ambiguous, or casually delegated. Interprets the spread to guide next steps. Use when the user says 'let fate decide', 'YOLO', 'whatever', 'idk', or other nonchalant phrases, makes Yu-Gi-Oh references, or when you are about to arbitrarily pick between multiple reasonable approaches. Prefer over ask-questions-if-underspecified when the user's tone is casual or playful rather than precision-seeking.
net-ops
IncludedCross-platform network troubleshooting (Windows, macOS, Linux) via local or remote shell. Use for: DNS broken, can't resolve hostnames, nslookup/dig works but apps fail, NRPT, WFP, scutil, /etc/resolver, systemd-resolved, /etc/resolv.conf, NetworkManager, VPN DNS leak residue (ProtonVPN/Mullvad/WireGuard/AnyConnect), AV/firewall blocking DNS or DoH, Tailscale DNS interaction, intermittent connectivity, remote diagnostics over SSH.