# Ecryme (FoundryVTT) — agent notes **This is a FoundryVTT Game System** (not a module), id `fvtt-ecryme`. Compatible with Foundry v13–v14. Requires `babele` and `lib-wrapper`. ## Quick commands | Command | What | |---------|------| | `npm run build` | Compile `styles/ecryme.less` → `css/ecryme.css` via Gulp | | `npm run watch` | Watch `styles/**/*.less` and rebuild | No other npm scripts exist. **No tests, no linter, no typechecker, no TypeScript.** Pure JS ES modules, no bundling. ## Project structure ``` modules/ # JS source (loaded directly by Foundry, no build step) ecryme-main.js # Entry point — registers documents, sheets, hooks, templates actors/ # Actor document + sheet classes (pc, npc, annency) items/ # Item document + sheet classes (equipment, weapon, trait, spec, maneuver) models/ # Foundry DataModels (extends TypeDataModel) — schema definitions dialogs/ # Roll/confrontation dialog classes app/ # Combat, commands, hotbar, summary app common/ # Config constants + utility helpers (798-line utility) templates/ # Handlebars sheets (actors/, items/, chat/, dialogs/) styles/ # LESS source files (ecryme.less imports all partials) lang/ # fr.json, en.json localization packs/ # LevelDB compendium packs (specialisation, equipment, traits, scenes, maneuvers, help) translated/fr/ # Babele translation JSON files for compendium content images/ # Assets, icons, UI css/ # Compiled CSS output (committed despite being in .gitignore) ``` ## Architecture - **App v1 sheets** (`foundry.appv1.sheets.ActorSheet`/`ItemSheet`), not ApplicationV2 - **DataModels** replace the deprecated `template.json` (kept as `template.json.SAVED`) - Actor types: `pc`, `npc`, `annency` - Item types: `equipment`, `weapon`, `trait`, `specialization`, `maneuver` - ES module imports use relative paths with `.js` extension - Custom combat class extends `Combat` with its own initiative formula - Socket enabled (`"socket": true` in `system.json`) ## Conventions (verified from codebase) - **JS files**: kebab-case (`ecryme-actor.js`) - **Classes**: PascalCase (`EcrymeActor`) - **Templates**: kebab-case `.hbs` (`actor-sheet.hbs`) - **Barrel files**: `_module.js` - **Hooks**: init → register classes/sheets/templates; ready → welcome msg/scene import; babele.init → register translation dir ## Release Gitea CI (`.gitea/workflows/release.yaml`) triggers on published release. Zips the source tree directly — JS is used as-is, no build step for JS. CSS must be pre-compiled before release.