absorb-mod
Absorb an external Stellaris mod into StellarisPlus by backing it up, analyzing its contents, integrating files, resolving conflicts, and validating the result. Also supports undoing a previous absorption. Use when user says "absorb mod", "integrate mod", "merge mod", "import mod", "add Workshop mod
Install
mkdir -p .claude/skills/absorb-mod && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/15172" && unzip -o skill.zip -d .claude/skills/absorb-mod && rm skill.zipInstalls to .claude/skills/absorb-mod
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
Absorb an external Stellaris mod into StellarisPlus by backing it up, analyzing its contents, integrating files, resolving conflicts, and validating the result. Also supports undoing a previous absorption. Use when user says "absorb mod", "integrate mod", "merge mod", "import mod", "add Workshop mod", "include mod", "copy mod into StellarisPlus", "undo absorb", "remove mod", "revert mod", "unmerge mod", "de-integrate mod", or wants to incorporate or remove a Stellaris mod (by Workshop ID, folder path, or zip file) in this project.About this skill
Absorb Mod
Purpose & Scope
Integrate an external Stellaris mod into StellarisPlus, or undo a previous absorption. Covers the full lifecycle: locate, backup, analyze, merge, validate, and credit.
- Reference docs:
doc/mod_load_reference.md,doc/mod_defines_reference.md,doc/mod_mechanics_reference.md. - Always absorb the entire mod. Partial absorption is not allowed (creates broken cross-references).
Naming Conventions
- Merged files follow load-order prefix rules from
doc/mod_load_reference.md. - Prefer
zz_sp_prefix (LIOS) for files that must override vanilla. - Prefer
00_sp_prefix (FIOS) for files that must win first. - Preserve incoming mod's key names inside blocks; do not rename without updating all references.
Error Handling
- Never overwrite an existing backup without user confirmation.
- Version mismatch (
supported_version): warn user about potentially outdated scripting. - Ambiguous conflict ownership: stop and ask one concise question.
Testing
- Run
& "tools/stellarisplus-quality-gate.ps1"after integration. - Cross-reference check: verify script-to-localisation, script-to-GFX, GFX-to-DDS, inline_script calls, and event refs in on_actions.
- Run
merge-local-filesonly after quality gate is green.
Security
- Add the absorbed mod to
credits.mdwith name, Workshop ID, source path, and author. Extendtools/credits_date_probes.jsonwhen needed, then runtools/stellarisplus-refresh-credits-dates.ps1. - Update
descriptor.modonly to add newtagsif applicable.
Absorption Workflow
Phase 1 -- Locate and Backup
-
Resolve source:
Input Source path Workshop ID C:\Program Files (x86)\Steam\steamapps\workshop\content\281990\<id>\Folder path As-is Zip file Extract to $env:TEMP, finddescriptor.modinside -
Backup to
backup/<id>/. -
Parse
descriptor.mod: extractname,tags,supported_version,remote_file_id.
Phase 2 -- Inventory and Analysis
-
Build file manifest -- categorize all files in backup:
Pattern Category common/**/*.txtGameplay script events/*.txtEvent script interface/*.gfx,*.guiGFX/GUI localisation/**/*.ymlLocalisation gfx/**,sound/**,flags/**Assets *.mod,thumbnail.*Metadata (skip) -
Detect conflicts -- for each file, check if the same relative path exists in workspace:
Conflict Action None Direct copy Identical content Skip Both override vanilla differently Merge review Both define same custom content Manual merge -
Check load-order -- flag prefix clashes per
doc/mod_load_reference.md. -
Check scripted variables -- flag shadowed
@variabledefinitions (same name, different value). -
Report conflict table to user and wait for approval.
Phase 3 -- Integration
After user confirms:
- Copy non-conflicting files preserving directory structure.
- Merge conflicting files by type:
- Scripts (
common/**/*.txt): read both fully; combine blocks, deduplicate; preserve brace nesting. If both override vanilla, integrate both change-sets. - Localisation (
.yml): add new keys; for duplicates keep ours; maintainl_english:header and:0format. - GFX (
.gfx): add new sprites; for duplicate names keep ours and warn. - GUI (
.gui): merge widget trees; new widgets at correct nesting; modified widgets merge properties (keep our positioning). Flag major hierarchy restructures for visual check. - Assets (
gfx/,sound/): copy directly; if exists, ask user which to keep.
- Scripts (
- Adjust load order -- rename prefixes if needed per
doc/mod_load_reference.md. - Resolve variable conflicts -- present shadowed vars to user; user picks value.
Phase 4 -- Validation
- Run
& "tools/stellarisplus-quality-gate.ps1"and fix all issues. - Cross-reference check: verify script-to-localisation, script-to-GFX, GFX-to-DDS, inline_script calls, event refs in on_actions.
- Multi-language localisation: if incoming mod has only English,
copy English strings as fallback to
l_braz_por,l_french,l_german,l_polish,l_russian,l_simp_chinese,l_spanish.
Phase 5 -- Finalize
-
Update
credits.mdwith mod name, Workshop ID, source path, author. Add a probe entry for the Workshop ID intools/credits_date_probes.jsonwhen grep/path heuristics help. -
Run
& "tools/stellarisplus-refresh-credits-dates.ps1"to fillLast updateddates from git history. -
Update
descriptor.modonly to add newtagsif applicable. -
Report summary:
Metric Count Files copied / merged / skipped X / X / X Conflicts resolved X Validation errors fixed X merge-local-files: folders merged / files removed X / X
Decision Rules
| Situation | Rule |
|---|---|
| Both mods override same vanilla file | Merge both change-sets carefully |
| Incoming contradicts SP design (slot counts, BPV) | Flag for user decision |
Version mismatch (supported_version) | Warn user about outdated scripting |
| Large mod (hundreds of files) | Summarize conflicts, offer detailed breakdown |
Undo Absorption
Reverses a previously absorbed mod. Triggered by "undo absorb", "remove mod", etc.
-
Identify mod -- match Workshop ID or name against
credits.md; confirmbackup/<id>/exists. -
Build removal manifest using backup as reference:
Situation Action Direct-copy, unchanged since absorption Delete Direct-copy, modified since Flag for review Content merged into shared file Extract and remove absorbed content Binary asset unique to absorbed mod Delete Shared with another absorbed mod Keep (flag) -
Present manifest to user, wait for confirmation.
-
Remove direct-copy files and empty parent dirs.
-
Unmerge shared files -- remove blocks/keys matching backup; validate brace balance after each.
-
Clean up references -- fix or remove broken localisation keys, GFX sprites, event hooks, orphaned variables.
-
Update
credits.md-- remove entry. -
Optionally remove
backup/<id>/(ask user). -
Run
& "tools/stellarisplus-quality-gate.ps1", fix issues, report summary.