Vpk manifest hygiene

From deadlock-mod-manager/deadlock-mod-manager · View interactive version

Vpk manifest hygiene is an AI agent skill from the GitHub repository deadlock-mod-manager/deadlock-mod-manager. Keep the `.dmm.json` VPK manifest in sync with VPK files on disk. Use when writing or changing Rust code that creates, moves, renames, enables, disables, or deletes VPKs in a profile's addons directory, such as vpk_manager, mods.rs, or profiles.rs.

How to use this skill

Skill file

VPK Manifest Hygiene

Every mutation to VPK files on disk must be followed by a corresponding update to the ProfileVpkManifest (.dmm.json). Skipping this causes state drift: the manifest no longer reflects reality, leading to ghost mods, missing mods, and broken enable/disable cycles.

The Manifest

The Rule

If you touch VPKs on disk, you must update and save the manifest in the same operation.

Concretely, any code path that does one of the following must call the corresponding manifest method and then manifest.save():

| Disk operation | Manifest call |

| ---------------------------- | ------------------------------------------------------------------------ |

| Install / enable VPKs | manifest.mark_enabled(mod_id, current_vpks, original_vpk_names, order) |

| Disable VPKs (prefix-rename) | manifest.mark_disabled(mod_id, disabled_vpks, original_vpk_names) |

| Uninstall / delete VPKs | manifest.remove_mod(mod_id) |

| Reorder VPKs | Update order via mark_enabled for affected mods |

| Replace / swap VPK files | mark_enabled or mark_disabled depending on final state |

Existing Patterns to Follow

Look at the current call sites for reference:

Every one of these loads the manifest, mutates it, and saves it atomically (write-to-tmp then rename). Follow the same pattern.

Checklist for Code Review

When reviewing or writing code that touches VPK files:

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.