Required inputs
- Exact Skyrim runtime and compiler.
- Source script, import roots, flags file, and output directory.
- Owning quest, alias, magic effect, or form.
- Required script-extender libraries and versions.
- Save-upgrade expectations.
Architecture rules
- Choose the smallest lifecycle owner that matches the behavior.
- Prefer events and registered callbacks over polling loops.
- Unregister listeners and timers when the object stops owning them.
- Avoid expensive work in frequently firing events.
- Treat properties and VMAD attachment as part of the plugin contract.
- Use
Game.GetFormFromFileor a verified soft-dependency pattern when a dependency is optional. - Preserve property names and persisted state across updates unless a migration is provided.
- Use MCM Helper as the default for new configuration menus when the installed stack supports it; verify its exact schema from installed examples. Maintain SKI_ConfigBase as a legacy fallback and do not auto-migrate an existing menu without a save/configuration migration plan.
- Ship a debug switch from the first build (an MCM toggle or GlobalVariable, off by default). When it is on, write through one helper to
Debug.OpenUserLog("<ModName>")/Debug.TraceUser("<ModName>", msg): the mod version on init and update, resolved settings, state changes and every failed lookup or soft dependency. Tell the user the file isDocuments\My Games\Skyrim Special Edition\Logs\Script\User\<ModName>.0.logand needs[Papyrus] bEnableLogging=1(plusbEnableTrace=1forDebug.Trace).
Workflow
- Map the script lifecycle and all external calls.
- Inspect the exact declaration scripts for every dependency.
- Implement source changes in the versioned workspace.
- Compile with explicit import order. Use
scripts/compile_papyrus.ps1or the project's equivalent. - Treat a successful compile as necessary but not sufficient.
- Check VMAD attachment, properties, event registration, save upgrade, and runtime logs.
- Package matching PSC and PEX policy intentionally. Do not ship stale PEX files.
Adult projects
Preserve explicit technical strings, events, and intended adult-only behavior. Do not sanitize the implementation. Exclude child races, child actors, age-ambiguous characters, and real-person sexual content from adult systems.
Evidence standard
Use this hierarchy for version-sensitive facts:
- The active project's
ENVIRONMENT.md,TASK.md, installed framework version, and build files. - Official upstream documentation or source for that exact version.
- Known-good files from the user's installed mod library, read-only.
- Direct inspection of the relevant ESM, ESP, DLL, script, log, or archive.
Do not substitute memory, an old example, or a plausible token. Record the evidence path or URL in VALIDATION.md.
Runtime storage references
references/papyrusutil.mdreferences/jcontainers.mdreferences/runtime-data-storage-selection.md