Dayz import mod

From DayZ-n-Chill/Agentic-Z · View interactive version

Dayz import mod is an AI agent skill from the GitHub repository DayZ-n-Chill/Agentic-Z. Links a DayZ mod folder kept elsewhere on disk into workspace/<ModName>/, or clones a GitHub link there, and creates its P:\\<ModName>\\ junction, so build, launch and clean skills work on it, offering to add missing scaffold files. Refuses Steam Workshop links; for a mod you only have as PBOs it cl

How to use this skill

Skill file

<!-- skill-dir-note -->

Path note: <skill-dir> in commands below is the absolute path of this skill's folder. When the agent loads this skill the harness exposes the skill's base directory; substitute it before running. Sibling skills are reached via <skill-dir>\..\dayz-X\.

/dayz-import-mod

Bring an existing DayZ mod into Agentic-Z without copying it. The skill creates a directory link at workspace/<ModName>/ pointing at your external folder (and the matching P:\<ModName>\ junction) so all the DayZ skills - /dayz-build-pbo, /dayz-launch-workbench, /dayz-clean-workspace, etc. - operate on it like a native scaffold. Then it scans for missing scaffold pieces and asks per-piece whether to fill them in.

Use this when:

Paste a GitHub link instead of a path and the repo is cloned straight into workspace/<ModName>/ (see "GitHub links" below). A Steam Workshop link is refused.

Alternative: clone your mod directly into workspace/<ModName>/. It then still needs the P:\<ModName>\ link that build and launch skills check for: run /dayz-add-scaffold <ModName> --piece junction, then /dayz-add-scaffold <ModName> for any missing scaffold files.

Follow skills/_shared/dayz-conventions.md.

How to run

python "<skill-dir>\import_mod.py" [--source <path>] [--name <ModName>] [--scaffold | --no-scaffold] [--author <handle>]

| Argument | Required? | Notes |

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

| --source <path> | yes (or interactive) | Path to the existing mod folder (absolute or relative, ~ expanded), or a GitHub link to clone. If omitted on an interactive console, the skill prompts Path or GitHub link:; the answer goes through the same Workshop and GitHub-link checks as --source. |

| --name <ModName> | no | Override the name the mod is imported under. Defaults to the source folder's basename, validated against [A-Za-z][A-Za-z0-9_]{0,63}. Required if the basename has spaces or other invalid characters. |

| --scaffold | no | Auto-yes for every "scaffold this missing piece?" prompt. Required for non-TTY use when missing pieces would otherwise prompt. |

| --no-scaffold | no | Auto-no - link only, never write into the source folder. |

| --author <handle> | no | Author handle for a scaffolded config.cpp, cached for future runs. Same resolution chain as /dayz-new-mod (flag, cache, prompt) and used only when config.cpp is written. Pass it on a non-TTY run with --scaffold when no handle is cached yet. |

What it does

  1. Takes the source from --source or the prompt, refuses a Steam Workshop link, then gates on /dayz-preflight.
  2. Resolves and validates the source path (must exist, be a directory, not be inside <repo>/workspace/, not be a UNC path).
  3. Derives the mod name (from --name or source basename), validates the name pattern.
  4. Refuses if workspace/<Name>/ already exists, or if P:\<Name>\ exists pointing somewhere else (auto-cleans a stale link pointing at our about-to-be-created workspace/<Name>/).

Also refuses, before linking anything, when scaffold pieces are missing, stdin is not an interactive console, and neither --scaffold nor --no-scaffold was passed.

  1. Creates workspace/<Name> → source path (symlink, junction fallback).
  2. Creates P:\<Name>\ → workspace/<Name> (matching /dayz-new-mod's pattern, so /dayz-clean-workspace can detect it via the existing junction-target check). If this fails, the workspace link is rolled back.

Then, like /dayz-new-mod, points the /dayz-init project cache at this project and records <Name> as the active /dayz-init mod (last_intent.mod_name in dayz-init-state.json).

  1. Scans for missing scaffold pieces (config.cpp, $PBOPREFIX$, workbench/dayz.gproj).
  2. For each missing piece:
  1. Each "yes" is written by /dayz-add-scaffold's writer, called in-process (one writer for both skills, and preflight runs only once). If a write fails or the writer skips the piece (for example config.cpp needs an author handle, none is cached and --author was not passed on a non-TTY run, or workbench/ is skipped because DayZ Tools is not detected), the links stay in place, the skill names each failed piece with its retry command (/dayz-add-scaffold <ModName> --piece <piece>) and exits 1.

GitHub links

--source (and the prompt) also takes a GitHub link (github.com/<owner>/<repo>, optionally /tree/<branch> or /tree/<branch>/<folder>) or any other git remote. git must be on PATH.

Accepted link forms, naming, clone reuse and cleanup steps: references/github-and-cleanup.md.

Workshop links

A Steam Workshop link (steamcommunity.com/sharedfiles/filedetails/?id=... or steam://url/CommunityFilePage/...) is refused before preflight runs. A Workshop item holds the packed mod: PBOs with binarized models and configs, often signed or protected by its author, so there is no source in it to work on. The message says to import your own source folder or repo instead, or to ask the author for the source and their permission. To learn from the packed mod without importing it, see "Studying a packed mod" below.

Studying a packed mod

For a mod you have only as PBOs (a Workshop download, a third-party release), classify each PBO from its header first. It never extracts or decompresses anything, so it is safe on a read-only Workshop folder, and like the rest of the study it does not need P:\:

python "<skill-dir>\pbo_inventory.py" <file.pbo | folder> [more ...] [--json] [--no-trailer]

| Argument | Required? | Notes |

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

| <file.pbo \| folder> | yes, one or more | A folder is searched for .pbo files at any depth. |

| --json | no | One JSON list with every field per PBO, for the study's ledger. |

| --no-trailer | no | Skips the checksum trailer, which hashes the whole file; use it on very large PBOs. |

It reads each header with dayz-build-pbo\pbo_entries.py and prints, per PBO:

[OK]    ...\addons\TheirMod.pbo
       prefix: TheirMod   entries: 4   payload: 12,345 bytes
       kind:   deployable mod (config plus scripts, models or layouts)
       types:  .bin 1, .c 1, .p3d 1, .paa 1

1 PBO(s): 1 mod

| Kind | Rule | Meaning |

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

| deployable mod | A non-empty config.bin or config.cpp, plus at least one .c, .p3d or .layout | Worth the full sweep. |

| config-only | A non-empty config and none of those | Mounts but ships no code or model. A scripts mod packed without its .c files looks like this (the post-build gates reference of /dayz-build-pbo). |

| source asset distribution | No usable config, and archives or source art (.rar, .zip, .7z, .fbx, .blend, .max, .obj, .psd, .spp, .tga) | Nothing the game loads. Catalog it; do not sweep it as a mod. |

| data only | No config and no source art | Loaded only if another PBO refers to its files. |

Warnings: an empty config entry, compressed entries (prove the extractor decoded them), GUID-like or unsafe entry names (path traversal, a drive letter, a Windows device name, a control character: signs of obfuscation or of a PBO that should not be extracted over existing files), and a missing checksum trailer. Exit code 1 when a file is not a readable PBO or none was found, otherwise 0. Outside an agent session, scripts\dayz\pbo-inventory.bat runs it with the same arguments.

Then extract with Mikero's ExtractPbo into a scratch folder and sweep the files with a path:line ledger until no new pattern turns up. Findings are facts about that mod, never copied files.

References

| Question | File |

|---|---|

| Which git links are accepted, how clones are named and reused, and how an import is removed? | references/github-and-cleanup.md |

| How do I extract a packed mod and sweep it, step by step, and when has the study converged? | references/study-a-packed-mod.md |

| What goes in the study's queue.md, seen.json, findings.jsonl and skill_changes.md, how is novelty classified, where does a finding go, and what does the final report hold? | references/extraction-ledger.md |

| What goes wrong (trusting names, a class the recovery dropped, an extraction that left the payload compressed), how do I read a .p3d without py3d, and what changes on Linux? | references/extraction-pitfalls.md |

Output

... (preflight output)

Path or GitHub link: C:\Users\me\repos\MyMod
[OK]    Source validated: C:\Users\me\repos\MyMod
[INFO]  Derived mod name: MyMod
[OK]    workspace\MyMod -> C:\Users\me\repos\MyMod (junction)
[OK]    P:\MyMod -> workspace\MyMod (junction)

Scaffolding check:
  [OK]    config.cpp present
  [WARN]  $PBOPREFIX$ missing (needed for /dayz-build-pbo)
  [WARN]  workbench/dayz.gproj missing (needed for /dayz-launch-workbench --mod)

  Add $PBOPREFIX$ to your source folder? [y/N]: y
[OK]    $PBOPREFIX$ written
  Add workbench/dayz.gproj to your source folder? [y/N]: y
[OK]    workbench/dayz.gproj written (mod paths + filesystem mounts injected)
[OK]    workbench/DayZSetting.xml copied

Next steps:
  - Open in Workbench: /dayz-launch-workbench --mod MyMod
  - Build: /dayz-build-pbo MyMod
  - Remove the import (keeps your source intact): /dayz-clean-workspace --mod MyMod

An existing $PBOPREFIX$ must hold exactly the mod name, because /dayz-build-pbo packs under that prefix and refuses anything else. Many published mods use a prefix such as Author\MyMod. The import still finishes, but the check prints a warning and the build step names the fix:

Scaffolding check:
  [OK]    config.cpp present
  [OK]    $PBOPREFIX$ present
  [WARN]  $PBOPREFIX$ is 'Author\MyMod', not 'MyMod', so /dayz-build-pbo will refuse it.
          Set the file to the single line MyMod and make config.cpp paths start with MyMod\.
...
Next steps:
  - Build: set $PBOPREFIX$ to MyMod, then /dayz-build-pbo MyMod

Refuses to run if

Stale-junction auto-clean

Same behavior as /dayz-new-mod: if P:\<Name>\ exists as a junction pointing at the about-to-be-created workspace/<Name>/, the stale link is removed and the skill proceeds. Handles the case where a prior import was cleaned up but the junction wasn't.

Cleanup behavior

/dayz-clean-workspace --mod <Name> recognizes an imported mod: it removes the workspace/<Name>/ link and the P:\<Name>\ junction and never touches your source folder. Details, including cloned imports: references/github-and-cleanup.md.

Do not

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.