instance-model

Documents the launcher root layout, instance.toml schema, options.txt layering, and JVM GC preset rules.

Updated Sep 8, 2026
One-click install
npx skills add https://github.com/Sixdd6/grid-craft-launcher --skill instance-model-sixdd6
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: instance-model
Source: https://github.com/Sixdd6/grid-craft-launcher/tree/main/.claude/skills/instance-model
Command: npx skills add https://github.com/Sixdd6/grid-craft-launcher --skill instance-model-sixdd6

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Contributors editing the gcl-core paths, config, instances, or settings modules need to know the exact on-disk layout and invariants of the launcher's data model, or they risk corrupting config.toml, instance.toml, or options.txt files. ## Core Features & Use Cases - Root and config layout: Explains GCL_ROOT resolution, the root redirect pointer, and the config.toml schema including JVM defaults and game_defaults preseed. - instance.toml schema: Documents every field including pack source, JVM block, settings_overrides, and content entries with source, kind, and enabled state. - GC preset semantics: Covers GcPreset parsing, lenient aliases, Java-version folding of zgc to zgc_generational, conflict detection with extra JVM args, and probe caching. - options.txt layering: Details the colon-separated format, preseed versus override behavior, the settings catalog, and the Override > File > Preseed > Default merge order. - Use Case: Before adding a new per-instance JVM field, read this Skill to learn that set_instance_jvm must preserve the saved GC preset and that all writes under the root must go through paths::write_atomic. ## Quick Start Read this Skill before modifying any code under gcl-core paths/, config/, instances/, or settings/ to learn the file formats and invariants you must preserve.

Frequently Asked Questions about instance-model

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add a new field to instance.toml in the launcher?▼

Add the field to the instance model in gcl-core instances, keeping it optional so older files round-trip unchanged. Write it through paths::write_atomic, never std::fs::write, and never store absolute paths since everything is relative to the instance.

How does options.txt preseed differ from settings overrides?▼

Preseed writes game_defaults only when options.txt does not yet exist, while overrides are written on every launch and replace matching key lines. The merge order for display is Override over File over Preseed over Default.

Why does a saved zgc preset show as zgc_generational?▼

From Java 23 onward both ZGC presets expand to the same -XX:+UseZGC flag, so GcPreset::for_major folds zgc onto zgc_generational. The saved value reported to pickers is the folded one, matching what the JVM actually offers.

What happens when instance.toml contains an unknown GC preset token?▼

The hand-written Deserialize loads the unknown token as Default and logs a tracing warning instead of failing. This prevents one unrecognized word from a newer build from hiding the entire instance in Instances::list.

Can a mod install leave two jars for the same project in mods/?▼

No. place_file replaces an existing entry from the same source and project_id in place, deleting its old file and any .disabled twin first, so one project always has exactly one entry and one file.

Why must files under the launcher root use write_atomic?▼

paths::write_atomic writes to a temp file and renames over the destination, so a crash mid-write never leaves a truncated config.toml or instance.toml. Direct std::fs::write calls under the root are forbidden.