AssetForge/SPEC
AssetForge — Product specification
The complete product, written down before it is built (MAT-T360, MAT-T476). Every ID below is a ticket; the tree mirrors this file one to one.
docs/RELEASE.mdsays which part the current milestone delivers.
1. Product definition
In docs/ECOSYSTEM.md AssetForge owns the art pipeline platform concern. It is one engine (MindAttic.AssetForge) and one command line (assetforge) that clean backgrounds, frame portraits and normalise 3D meshes, so no game or app re-solves these steps. The finished product is that engine, installed from R:, licence-clean and documented, called by every project's own import scripts.
2. Scope boundary
2.1 In the product
Background cleanup with per-file mode override; face and figure crop framing; static and skinned mesh normalisation to glTF 2.0; the assetforge CLI; an R: install through the shared run menu.
2.2 Never in the product
- Project-specific logic (a game's class lists, UI geometry, import orchestration): it belongs in the consuming repo, calling AssetForge (AGENTS.md rule).
- Automatic bridging across fine line work in
Autocleanup: tried and reverted because it merges true background through the subject's outline; the per-fileBorderOnly/Skipoverride is the answer. - Commercial-licence dependencies (e.g. ImageSharp v3+ under the Six Labors split licence).
3. Users and roles
Project pipelines and scripts (GridGame.Unity portraits, game mesh imports) call the CLI or library; the owner runs it by hand on new art and signs off.
4. Requirements
Status: built (closed ticket with evidence) or MS-164 (approved).
E1. Clean, framed 2D art — AF-T2 — built
F1.1 Background cleanup — AF-T3 — built
- S1.1.1 Remove a background automatically — AF-T4 — built As a project pipeline, I want a background removed with clean alpha, so that art drops into a game as is. Acceptance: Given a portrait on a plain background, when
assetforge cleanruns in Auto mode, then the background is transparent and the subject's edges keep their colour. Evidence:BackgroundCleaner.cs, c209afd. - S1.1.2 Choose the cleanup mode per file — AF-T5 — built Acceptance: Given art with fine internal line work, when the mode is BorderOnly or Skip, then no internal line work is erased. Evidence:
BackgroundMode, overview "Known limitation".
F1.2 Portrait framing — AF-T6 — built
- S1.2.1 Frame a face or figure crop — AF-T7 — built Acceptance: Given a portrait, when
assetforge crop --kind Face|Figureruns, then it returns the crop rectangle. Evidence:PortraitCropper.cs.
E2. Normalised 3D meshes — AF-T8 — built
F2.1 Static mesh normalisation — AF-T9 — built
- S2.1.1 Normalise a mesh offline — AF-T10 — built Acceptance: Given any mesh Assimp reads, when
assetforge mesh normalizeruns, then the output is centred, scaled to the target length and yawed. Evidence:MeshNormalizer.cs, 6d03cc9, 7e20da9. - S2.1.2 Real glTF 2.0 output — AF-T11 — built Acceptance: Given a normalised mesh, when it is written, then it is valid binary glTF 2.0 with correct accessors. Evidence: 3619b33, c338d4f, fddafad.
F2.2 Skinned and animated meshes — AF-T12 — built
- S2.2.1 Normalise a skinned mesh — AF-T13 — built Acceptance: Given a rigged, animated glTF, when it is normalised, then skinning and clips still play. Evidence:
GltfMeshNormalizer.cs, aa9f6a6.
E3. One command for every project — AF-T14 — built
F3.1 The assetforge command line — AF-T15 — built
- S3.1.1 Run any step from the command line — AF-T16 — built Acceptance: Given the CLI, when
clean,cropormesh normalizeis run, then it calls the library step. Evidence:MindAttic.AssetForge.Cli/Program.cs.
E4. Every project's art through one pipeline — AF-T17 — MS-164
F4.1 Installed where every project can call it — AF-T18 — MS-164
- T4.1.1 assetforge on R: — AF-T19 — MS-164 Acceptance: Given Redeploy from
run.bat, then the CLI is atR:\MindAttic\Apps\AssetForge\{Debug,Release}.
F4.4 One clean-up and crop step for every project — AF-T25 — MS-164
- S4.4.1 Clean up and crop images — AF-T26 — MS-164 As a project pipeline, I want one AssetForge step that removes a background, trims whitespace and cuts and centres a portrait into its frame, so that no project keeps its own copy (GridGame.Studio's
tools/remove_bg.pyandtools/portrait_cut.pytoday; related GGS-T50, GGS-T9). Acceptance: Given a portrait on a flat background, when the step runs, then the background is gone (edge-connected flood fill with a calculated tolerance, or colour-to-alpha unmixing), whitespace is trimmed, and the figure is cut and centred in its frame. Acceptance: Given GridGame.Studio's paste-to-replace, when it is pointed at this step, then its results match the Python tools it replaces.
F4.2 Safe to distribute — AF-T20 — MS-164
- T4.2.1 Licence-clean dependencies — AF-T21 — MS-164 Acceptance: Given the package references, then each licence is recorded in docs and allows Release builds.
F4.3 Polish and release 1.0 — AF-T22 — MS-164
- T4.3.1 Docs current — AF-T23 — MS-164 (requires AF-T19, AF-T21, AF-T26)
- T4.3.2 Owner sign-off: real art — AF-T24 — MS-164 (requires AF-T23)
Added by MAT-T477 (owner stories and cross-repo links)
- F AF-T27 Mesh normalisation for every engine (epic AF-T17)
- S AF-T28 Normalise meshes for any engine: SpaceGod.Unreal's US-T1087 requires it. Given a purchased mesh with the wrong pivot, scale or forward axis, when a project imports it through AssetForge with its engine profile, then the mesh lands at the engine's scale and facing with a clean root, identically for every project.
5. Non-functional requirements
.NET 10; offline; no network calls; deterministic output for the same input and options; NUnit tests (MindAttic.AssetForge.Tests).
6. Interfaces and dependencies
Platform it uses: MindAttic.Agency (run menu and deploy-lib, shipping), MindAttic.Tickets (the plan). Libraries: SixLabors.ImageSharp 2.1.13, AssimpNet 5.0.0-beta1, SharpGLTF.Toolkit 1.0.7. Consumers: game and app import scripts; each consumer's adoption is a story in that consumer's repo that requires AF-T17.
7. Release sequence
One milestone, MS-164 "AssetForge 1.0: the one art pipeline". It is the finished product: a library and tool are done at a stable, documented version their consumers use.
8. Change log
| Date | Change to scope | Ticket |
|---|---|---|
| 2026-11-30 | Specification written from the overview, AGENTS.md, code and git history; built work recorded as E1-E3; MS-164 created; source-to-sea rubric applied (outcome epics, capability features, one owner per concern) | MAT-T476 |
| 2026-11-30 | F4.4 / AF-T26 "Clean up and crop images": AssetForge owns the image clean-up and crop that GridGame.Studio's remove_bg.py and portrait_cut.py duplicate (coordinator request); the Studio's adoption story is to be filed in GridGame.Studio and requires AF-T26
|
MAT-T476 |
| 2026-11-30 | MAT-T477 owner story for SpaceGod.Unreal | MAT-T477 |