HOI4 Modding Agent Skill
Use this skill when working on Hearts of Iron IV mods.
Operating Model
Treat HOI4 mods as Paradox data-script projects, not normal software projects.
Prioritize:
- small loadable edits
- existing project conventions
- valid folder structure
- unique IDs
- correct event namespaces
- correct scopes
- localization for all visible player-facing content
error.log-driven debugging
- compatibility with the current mod structure
Avoid:
- large speculative rewrites
- inventing syntax when a nearby project or vanilla-style pattern exists
- editing vanilla installation files directly
- copying proprietary game files or assets into public repositories
- adding GFX references without checking whether sprites/files exist
- adding visible UI content without localization keys
First Actions
Before editing:
- Inspect the active mod root.
- Identify the descriptor file and mod folder.
- Identify relevant country tags, file prefixes, event namespaces, idea prefixes, and localization prefixes.
- Search nearby files for existing conventions.
- Determine whether the requested change affects focus trees, events, decisions, ideas, history, localization, GFX, scripted effects, scripted triggers, map/state data, or descriptor files.
- If debugging, inspect
error.log before guessing from symptoms.
Reference Loading
Read the relevant reference files only when needed:
references/01-folder-structure.md for mod layout and descriptor issues.
references/02-paradox-script.md for Paradox script syntax, braces, scopes, triggers, and effects.
references/03-focus-trees.md for national focus trees.
references/04-events.md for event namespaces, event IDs, options, and event firing.
references/05-decisions.md for decision categories, visibility, availability, costs, and effects.
references/06-ideas-and-modifiers.md for ideas, national spirits, modifiers, and add_ideas.
references/07-countries-history-states.md for country setup, history files, states, and related references.
references/08-localization.md for localization files, keys, formatting, and visible text.
references/09-gfx-interface-icons.md for sprites, focus icons, .gfx, .dds, .tga, and interface references.
references/10-scripted-effects-triggers.md for reusable scripted logic and expected scopes.
references/11-debugging-error-log.md for debugging workflows.
references/13-common-failure-modes.md for known HOI4 modding mistakes.
Examples
Use examples/ for small original ABC placeholder snippets and examples/broken-cases/ for debugging patterns. Treat examples as educational starting points, not files to paste blindly into every mod.
Editing Checklist
Before finishing, verify:
- IDs are unique in the affected files.
- Event IDs match declared namespaces.
- Visible focus, event, decision, idea, and GUI text has localization.
- Localization keys match script references.
- Braces are balanced.
- Effects and triggers are used in valid scopes.
- Focus prerequisites reference existing focuses.
- Event calls reference existing events.
- Idea additions reference existing ideas.
- GFX references point to existing sprites/files or clearly marked placeholders.
- The change does not silently overwrite vanilla files unless intended.
- The change avoids bundling proprietary game assets.
- Do not claim in-game validation unless HOI4 was actually launched and tested.
Debugging Workflow
When a mod does not load or content does not appear:
- Check whether the mod is enabled in the active playset.
- Check descriptor and path issues.
- Read
error.log.
- Fix parse and syntax errors first.
- Fix missing or invalid scope errors.
- Fix missing localization.
- Fix missing sprite or GFX references.
- If HOI4 can be launched, test the smallest affected feature in-game. Otherwise, report this as a manual test step for the user.
- Summarize remaining risks.
If error.log is unavailable, ask the user for the relevant excerpt or explain what to inspect manually.
Response Format
When done, report:
- files changed
- IDs added or modified
- localization keys added
- what to test in HOI4
- likely risks
- whether validation was static-only or actually tested in-game
1---2name: hoi4-modding3description: Creates, edits, reviews, and debugs Hearts of Iron IV mods. Use for HOI4 focus trees, events, decisions, ideas, countries, states, history files, localization, GFX/interface references, scripted effects/triggers, descriptors, mod folder structure, and error.log issues.4license: MIT5---67# HOI4 Modding Agent Skill89Use this skill when working on Hearts of Iron IV mods.1011## Operating Model1213Treat HOI4 mods as Paradox data-script projects, not normal software projects.1415Prioritize:1617- small loadable edits18- existing project conventions19- valid folder structure20- unique IDs21- correct event namespaces22- correct scopes23- localization for all visible player-facing content24- `error.log`-driven debugging25- compatibility with the current mod structure2627Avoid:2829- large speculative rewrites30- inventing syntax when a nearby project or vanilla-style pattern exists31- editing vanilla installation files directly32- copying proprietary game files or assets into public repositories33- adding GFX references without checking whether sprites/files exist34- adding visible UI content without localization keys3536## First Actions3738Before editing:39401. Inspect the active mod root.412. Identify the descriptor file and mod folder.423. Identify relevant country tags, file prefixes, event namespaces, idea prefixes, and localization prefixes.434. Search nearby files for existing conventions.445. Determine whether the requested change affects focus trees, events, decisions, ideas, history, localization, GFX, scripted effects, scripted triggers, map/state data, or descriptor files.456. If debugging, inspect `error.log` before guessing from symptoms.4647## Reference Loading4849Read the relevant reference files only when needed:5051- `references/01-folder-structure.md` for mod layout and descriptor issues.52- `references/02-paradox-script.md` for Paradox script syntax, braces, scopes, triggers, and effects.53- `references/03-focus-trees.md` for national focus trees.54- `references/04-events.md` for event namespaces, event IDs, options, and event firing.55- `references/05-decisions.md` for decision categories, visibility, availability, costs, and effects.56- `references/06-ideas-and-modifiers.md` for ideas, national spirits, modifiers, and `add_ideas`.57- `references/07-countries-history-states.md` for country setup, history files, states, and related references.58- `references/08-localization.md` for localization files, keys, formatting, and visible text.59- `references/09-gfx-interface-icons.md` for sprites, focus icons, `.gfx`, `.dds`, `.tga`, and interface references.60- `references/10-scripted-effects-triggers.md` for reusable scripted logic and expected scopes.61- `references/11-debugging-error-log.md` for debugging workflows.62- `references/13-common-failure-modes.md` for known HOI4 modding mistakes.6364## Examples6566Use `examples/` for small original ABC placeholder snippets and `examples/broken-cases/` for debugging patterns. Treat examples as educational starting points, not files to paste blindly into every mod.6768## Editing Checklist6970Before finishing, verify:7172- IDs are unique in the affected files.73- Event IDs match declared namespaces.74- Visible focus, event, decision, idea, and GUI text has localization.75- Localization keys match script references.76- Braces are balanced.77- Effects and triggers are used in valid scopes.78- Focus prerequisites reference existing focuses.79- Event calls reference existing events.80- Idea additions reference existing ideas.81- GFX references point to existing sprites/files or clearly marked placeholders.82- The change does not silently overwrite vanilla files unless intended.83- The change avoids bundling proprietary game assets.84- Do not claim in-game validation unless HOI4 was actually launched and tested.8586## Debugging Workflow8788When a mod does not load or content does not appear:89901. Check whether the mod is enabled in the active playset.912. Check descriptor and path issues.923. Read `error.log`.934. Fix parse and syntax errors first.945. Fix missing or invalid scope errors.956. Fix missing localization.967. Fix missing sprite or GFX references.978. If HOI4 can be launched, test the smallest affected feature in-game. Otherwise, report this as a manual test step for the user.989. Summarize remaining risks.99100If `error.log` is unavailable, ask the user for the relevant excerpt or explain what to inspect manually.101102## Response Format103104When done, report:105106- files changed107- IDs added or modified108- localization keys added109- what to test in HOI4110- likely risks111- whether validation was static-only or actually tested in-game