# Mod Creation Toolkit

This document covers `TODOS.phase-72.72.14.1.13`: the local toolkit for
creating, testing, building, and packaging `.mayamod` projects.

## Toolkit Layout

The default project template lives at
`V2/ue/Tools/modding/templates/basic-mayamod`. It contains a valid starter
`manifest.json`, `scripts/bootstrap.lua`, `preview/thumbnail.png`, and starter
`assets/` and `docs/` folders.

The command-line tools are:

- `V2/ue/Tools/create-v2-mayamod-project.py` for scaffolding a project from the
  template.
- `V2/ue/Tools/build-v2-mayamod.py` for validating the project and producing a
  `.mayamod` archive.
- `V2/ue/Tools/package-v2-mayamod.py` for deterministic package creation.
- `V2/ue/Tools/serve-v2-mayamod.py` for local HTTP testing via `/healthz`,
  `/catalog.json`, and `/manifest.json`.

The shared library is `V2/ue/Tools/modding/mayamod_toolkit.py`.

## Authoring Flow

Create a local project:

```bash
python3 V2/ue/Tools/create-v2-mayamod-project.py \
  --mod-id community.toolkit.sample \
  --display-name "Toolkit Sample" \
  --author "Oshun Mod SDK" \
  --publisher-id oshun.modsdk \
  --output-dir /tmp/community.toolkit.sample \
  --force
```

Build and package it:

```bash
python3 V2/ue/Tools/build-v2-mayamod.py \
  --project-root /tmp/community.toolkit.sample \
  --output-dir /tmp/community.toolkit.sample/dist
```

Serve it locally for loader and browser smoke testing:

```bash
python3 V2/ue/Tools/serve-v2-mayamod.py \
  --project-root /tmp/community.toolkit.sample \
  --port 8765
```

The packager refreshes asset and script SHA-256 fields, updates manifest and
content integrity fields, writes deterministic ZIP metadata, and keeps package
paths rooted under the allowed `.mayamod` folders.

## Runtime Plan Surface

`UV2ModLoadingBlueprintLibrary::BuildDefaultModCreationToolkitTemplate` exposes
the default toolkit artifact paths. `BuildModCreationToolkitRequest` and
`EvaluateModCreationToolkit` build a validated plan with project-template,
create-project, build-script, local-server, and packaging-tool readiness. The
plan includes concrete command strings and a local testing URL for tooling UIs
or developer automation.

## Verification

```bash
python3 V2/ue/Tools/check-v2-mod-creation-toolkit.py
python3 V2/ue/Tools/check-v2-mod-loading-system.py
python3 V2/ue/Tools/check-v2-ci-workflow.py
python3 V2/tools/validate-v2-docs.py
python3 -m py_compile V2/ue/Tools/check-v2-mod-creation-toolkit.py V2/ue/Tools/create-v2-mayamod-project.py V2/ue/Tools/build-v2-mayamod.py V2/ue/Tools/package-v2-mayamod.py V2/ue/Tools/serve-v2-mayamod.py V2/ue/Tools/modding/mayamod_toolkit.py
python3 -m json.tool V2/ue/Content/V2/Modding/ModCreationToolkit_V2_Contract.json
python3 -m json.tool V2/ue/Tools/modding/templates/basic-mayamod/manifest.json
```
