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.
Build settings — AF-T30 — built (membrane)
Built membrane under E1 (R17): Directory.Build.props gives the library, CLI and tests one language, warning and licence policy, joining E1 to E3 (c209afd, e4b5a29).
Debt from the comb (MAT-T484)
Open stories under the built epics, built with no behaviour change.
- AF-T31 (E1):
PortraitCropperborrowsBackgroundCleaner.AlphaBoundingBox; one alpha-bounds helper (AF-T26 requires it). - AF-T32 (E2): the normalise transform is written in both mesh paths; computed once (AF-T28 requires it).
E4. Every project's art through one pipeline — AF-T17 — MS-164
Membranes (built): AF-T34 joins F4.3's docs to the installed CLI (07c30e0); AF-T33 joins E4's features in one run from a scratch folder (recorded run in its close note; its defect fix 48ae226, R76). The owner's sign-off AF-T24 requires both (R51). Steward check AF-T29 closed wont-do as covered by AF-T19 (R52).
F4.1 Installed where every project can call it — AF-T18 — MS-164
- T4.1.1 assetforge on R: — AF-T19 — built (
run.ps1,run.bat) Acceptance: Given Redeploy fromrun.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 — built 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. Evidence:assetforge cut(ToleranceCleaner.cs,PortraitFramer.cs); on two portraits it is pixel-identical toremove_bg.pyplusfit_canvas. Pointing the Studio at it is GGS-T72.
F4.2 Safe to distribute — AF-T20 — MS-164
- T4.2.1 Licence-clean dependencies — AF-T21 — built Acceptance: Given the package references, then each licence is recorded in docs and allows Release builds. Evidence:
docs/overview.md"Licences", read from each package's nuspec (ImageSharp 2.1.13 Apache-2.0, AssimpNet MIT with native Assimp BSD-3-Clause, SharpGLTF MIT).
F4.3 Polish and release 1.0 — AF-T22 — MS-164
- T4.3.1 Docs current — AF-T23 — built (requires AF-T19, AF-T21, AF-T26, AF-T28):
docs/overview.mdrewritten for 1.0 - 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 (built): 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. Built:
assetforge mesh normalize --engine gltf|unity|unreal|godot|<profile.json>(EngineProfile.cs; root pivot and engine units per metre, applied once inNormalizeTransformfor both mesh paths); facing stays glTF's +Z front, which each engine's glTF importer maps, plus the per-pack--yaw. Proving it in an engine is US-T1087 (SpaceGod.Unreal).
- S AF-T28 Normalise meshes for any engine (built): 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. Built:
Filed after this spec was written (MAT-T478)
Open tickets filed after the last spec pass, listed under their parent until the spec tree is rendered from the plan (M.TIX-T535).
- Under (none)
- AF-T29 () MS-164 check #2 (exists) fails: assetforge installed at R:\MindAttic\Apps\AssetF
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; single-source 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 |
| 2026-11-30 | MAT-T478 spec drift repaired: 1 open tickets filed after the spec listed in section 4 | MAT-T478 |
| 2026-12-01 | Build-up plan phase: comb 11 of 11 read; built membrane AF-T30; debt AF-T31, T32; membranes AF-T33, T34; AF-T23 requires AF-T28 | MAT-T484 |
| 2026-12-01 | Build phase: AF-T31, AF-T32 (debt) built; AF-T19 run menu; AF-T26 assetforge cut built, pixel-identical to the Studio's Python
|
MAT-T484 |
| 2026-12-01 | Build phase: AF-T28 engine profiles (--engine, --pivot) built in the shared transform
|
MAT-T484 |
| 2026-12-01 | Build phase: AF-T21 licences recorded; the stale ImageSharp v4 commercial-licence note removed | MAT-T484 |
| 2026-12-01 | Build phase: AF-T23 docs current (install, every command and its output, consumers, licences); AGENTS.md purpose line | MAT-T484 |
| 2026-12-01 | Build phase: membranes AF-T34 and AF-T33 closed on a recorded run against the installed CLI; ledger 18 of 18 | MAT-T484 |