Logo van Forge Asset Pipeline

Forge Asset Pipeline

Community
Nebulavenus
forge-asset-pipeline

Zet een plug-in-gebaseerde pipeline voor assetverwerking op, met een CLI, plug-indetectie, fingerprinting op basis van content-hashes en TOML-configuratie. Gebruik dit als iemand tooling wil bouwen die bestanden incrementeel verwerkt, zoals assetpipelines, buildsystemen, generatoren voor statische websites of andere workflows voor het scannen en transformeren van bestanden.

Overzicht

UitgeverNebulavenus
Repositoryforge-gpu
Skillnaamforge-asset-pipeline
Sterren
46
Forks
7
Meegeleverde bestanden
Alleen instructies
LicentieZlib
Links
  • Instructies in Markdown

    Het model laadt het bestand SKILL.md alleen als dat nodig is. Dat kost dus alleen tokens als een verzoek daadwerkelijk bij de skill past.

  • Werkt met elk LLM

    AI-skills bestaan uit instructies in gewone Markdown, niet uit aanbiederspecifieke code. Daardoor werken ze met GPT, Claude, Gemini, Grok of een lokaal model.

  • Compleet zonder extra bestanden

    Alles wat het model nodig heeft, staat in de instructies — geen extra bestanden om te synchroniseren.

  • Open source

    Gepubliceerd door Nebulavenus op GitHub. Bekijk de bronbestanden voordat je de skill installeert.

Installatie

Installeer de AI-skill Forge Asset Pipeline in TypingMind om deze met elk LLM te gebruiken, of voeg de skill toe aan een andere agent die SKILL.md kan lezen.

1

Installeren in TypingMind

TypingMind installeert een skill rechtstreeks vanuit de GitHub-map. De app leest SKILL.md, bundelt de bijbehorende bestanden en slaat het resultaat lokaal op.

  1. Open de app en ga naar Plug-ins → Skills.
  2. Kies "Installeren via GitHub".
  3. Plak de onderstaande URL van de skillmap en bevestig.
    https://github.com/Nebulavenus/forge-gpu/tree/main/.claude/skills/forge-asset-pipeline
  4. Schakel de skill in voor elke chat waarin je de skill wilt kunnen gebruiken.
Plug-ins → Skills → Skill toevoegen → Via GitHub-URL. Plak vervolgens de map-URL en druk op Doorgaan.
2

Installeren in een andere agent

Elke agent die het Agent Skills-formaat kan lezen, kan deze skill gebruiken — kopieer de map naar de skillmap van die agent.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/Nebulavenus/forge-gpu.git /tmp/forge-gpu
mkdir -p .claude/skills
cp -r /tmp/forge-gpu/.claude/skills/forge-asset-pipeline .claude/skills/forge-asset-pipeline
Start Claude Code na het kopiëren opnieuw op, zodat de nieuwe skill wordt herkend.

Gebruik deze skill in TypingMind

Schakel Forge Asset Pipeline in voor een chat naar keuze in TypingMind en het model doet de rest. De naam en beschrijving staan in de systeemprompt. Zodra een verzoek bij de skill past, laadt het model zelf de volledige instructies. Je hoeft de skill nooit handmatig aan te roepen. Pas als het model de skill daadwerkelijk gebruikt, kost dat tokens.

Het model laadt Forge Asset Pipeline automatisch zodra een verzoek erbij past.

Werkt met elk AI-model

AI-skills zijn gewone Markdown-instructies in plaats van aanbiederspecifieke code. Daardoor is Forge Asset Pipeline niet gebonden aan het model waarvoor de skill is geschreven. Installeer de skill één keer in TypingMind en gebruik deze met GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama of een lokaal model dat je zelf draait — allemaal met je eigen API-sleutels.

  • Alleen geladen wanneer nodig

    De systeemprompt bevat alleen de naam en beschrijving. De instructies worden bij het eerste bijpassende verzoek opgehaald, dus een ongebruikte skill kost niets.

  • Wissel van model tijdens een chat

    Omdat de skill uit instructies bestaat en niet uit code, blijft deze werken als je van model wisselt — het volgende model leest hetzelfde SKILL.md-bestand.

Skillinstructies

Dit is de inhoud van SKILL.md die het model laadt. Lees deze vóór de installatie — een skill bestaat uit instructies die je model zal volgen.

forge-asset-pipeline

Scaffold a Python CLI pipeline that discovers plugins, scans source files, fingerprints them by content hash, and reports what needs processing.

When to use this skill

  • Setting up an asset processing pipeline for a game or graphics project
  • Building any file-processing CLI that needs incremental builds
  • Creating a plugin-based tool where new file types are added without modifying core code
  • When someone asks for "a build system", "asset pipeline", "file processor", or "incremental build tool"

Key concepts

ConceptImplementation
ConfigurationTOML file parsed with tomllib, typed PipelineConfig dataclass
Plugin systemAssetPlugin base class, PluginRegistry with name + extension lookup
Discoveryimportlib scans a directory for .py files, registers subclasses
FingerprintingSHA-256 content hash (not timestamps) for correctness and portability
CacheJSON file mapping relative paths to hex digests
ClassificationNEW (not cached), CHANGED (hash differs), UNCHANGED (hash matches)

Architecture

text
pipeline.toml ──> CLI (__main__.py)
                   │
                   ├──> Plugin Discovery (plugins/*.py)
                   │        register by name + extension
                   │
                   └──> Scanner (scanner.py)
                            │
                            ├── walk source directory
                            ├── fingerprint (SHA-256)
                            ├── compare against cache
                            └── classify: NEW / CHANGED / UNCHANGED

Correct order

  1. Create the project structure (pyproject.toml, pipeline/ package)
  2. Implement config.py — TOML loader with typed dataclass
  3. Implement plugin.py — base class, registry, file-based discovery
  4. Implement scanner.py — fingerprinting, cache, scan function
  5. Implement __main__.py — CLI that ties them together
  6. Create example plugins in plugins/
  7. Create pipeline.toml with sensible defaults

Project structure template

text
<project>/
  pipeline.toml              # TOML configuration
  pyproject.toml             # Python package definition
  pipeline/
    __init__.py
    __main__.py              # CLI entry point (argparse)
    config.py                # TOML config loader
    plugin.py                # AssetPlugin base, PluginRegistry, discovery
    scanner.py               # File scanning and fingerprinting
  plugins/
    <type>.py                # One file per asset type
  tests/
    test_config.py
    test_plugin.py
    test_scanner.py

Ready-to-use templates

config.py — core pattern

python
import sys
from dataclasses import dataclass, field
from pathlib import Path

if sys.version_info >= (3, 11):
    import tomllib
else:
    try:
        import tomllib
    except ModuleNotFoundError:
        import tomli as tomllib

@dataclass
class PipelineConfig:
    source_dir: Path          # where raw source files live
    output_dir: Path          # where processed files go
    cache_dir: Path           # fingerprint cache location
    plugin_settings: dict[str, dict] = field(default_factory=dict)
    raw: dict = field(default_factory=dict, repr=False)

class ConfigError(Exception):
    pass

def load_config(path: Path) -> PipelineConfig:
    if not path.exists():
        raise ConfigError(f"Configuration file not found: {path}")
    try:
        with open(path, "rb") as f:
            raw = tomllib.load(f)
    except tomllib.TOMLDecodeError as exc:
        raise ConfigError(f"Invalid TOML in {path}: {exc}") from exc

    pipeline = raw.get("pipeline", {})
    plugin_settings = {k: v for k, v in raw.items()
                       if k != "pipeline" and isinstance(v, dict)}
    return PipelineConfig(
        source_dir=Path(pipeline.get("source_dir", "assets/raw")),
        output_dir=Path(pipeline.get("output_dir", "assets/processed")),
        cache_dir=Path(pipeline.get("cache_dir", ".forge-cache")),
        plugin_settings=plugin_settings,
        raw=raw,
    )

plugin.py — core pattern

python
import importlib
import importlib.util
from dataclasses import dataclass, field
from pathlib import Path

@dataclass
class AssetResult:
    source: Path              # original source file
    output: Path              # processed output file
    metadata: dict = field(default_factory=dict)

class AssetPlugin:
    name: str = ""            # human-readable identifier
    extensions: list[str] = []  # e.g. [".png", ".jpg"]

    def process(self, source: Path, output_dir: Path, settings: dict) -> AssetResult:
        raise NotImplementedError

class PluginRegistry:
    def __init__(self):
        self._plugins: dict[str, AssetPlugin] = {}
        self._ext_map: dict[str, AssetPlugin] = {}

    def register(self, plugin: AssetPlugin) -> None:
        # Validate: non-empty name, no duplicate name, no duplicate extensions
        self._plugins[plugin.name] = plugin
        for ext in plugin.extensions:
            self._ext_map[ext.lower()] = plugin

    def get_by_extension(self, ext: str) -> AssetPlugin | None:
        return self._ext_map.get(ext.lower())

    def discover(self, plugins_dir: Path) -> int:
        count = 0
        for py_file in sorted(plugins_dir.glob("*.py")):
            if py_file.name.startswith("_"):
                continue
            spec = importlib.util.spec_from_file_location(
                f"plugins.{py_file.stem}", py_file)
            module = importlib.util.module_from_spec(spec)
            spec.loader.exec_module(module)
            for name in dir(module):
                attr = getattr(module, name)
                if (isinstance(attr, type) and issubclass(attr, AssetPlugin)
                        and attr is not AssetPlugin and attr.name):
                    self.register(attr())
                    count += 1
        return count

scanner.py — core pattern

python
import hashlib
import json
from dataclasses import dataclass
from enum import Enum, auto
from pathlib import Path

HASH_CHUNK_SIZE = 65536  # 64 KiB read chunks

class FileStatus(Enum):
    NEW = auto()        # not in cache
    CHANGED = auto()    # hash differs from cache
    UNCHANGED = auto()  # hash matches cache

@dataclass
class ScannedFile:
    path: Path            # absolute path
    relative: Path        # relative to source_dir
    extension: str        # lowercase, with dot
    fingerprint: str      # SHA-256 hex digest
    status: FileStatus

def fingerprint_file(path: Path) -> str:
    h = hashlib.sha256()
    with open(path, "rb") as f:
        while chunk := f.read(HASH_CHUNK_SIZE):
            h.update(chunk)
    return h.hexdigest()

class FingerprintCache:
    def __init__(self, path: Path):
        self._path = path
        self._data = json.loads(path.read_text()) if path.exists() else {}

    def get(self, rel: Path) -> str | None:
        return self._data.get(rel.as_posix())

    def set(self, rel: Path, fp: str) -> None:
        self._data[rel.as_posix()] = fp

    def save(self) -> None:
        self._path.parent.mkdir(parents=True, exist_ok=True)
        self._path.write_text(json.dumps(self._data, indent=2, sort_keys=True))

def scan(source_dir, extensions, cache):
    results = []
    for path in sorted(source_dir.rglob("*")):
        if not path.is_file() or path.suffix.lower() not in extensions:
            continue
        rel = path.relative_to(source_dir)
        fp = fingerprint_file(path)
        cached = cache.get(rel)
        status = (FileStatus.NEW if cached is None
                  else FileStatus.CHANGED if cached != fp
                  else FileStatus.UNCHANGED)
        results.append(ScannedFile(path, rel, path.suffix.lower(), fp, status))
    return results

Writing a plugin

python
# plugins/texture.py
from pipeline.plugin import AssetPlugin, AssetResult
from pathlib import Path

class TexturePlugin(AssetPlugin):
    name = "texture"
    extensions = [".png", ".jpg", ".tga", ".bmp"]

    def process(self, source: Path, output_dir: Path, settings: dict) -> AssetResult:
        output = output_dir / source.name
        # ... actual processing here ...
        return AssetResult(source=source, output=output)

pipeline.toml

toml
[pipeline]
source_dir = "assets/raw"
output_dir = "assets/processed"
cache_dir  = ".forge-cache"

[texture]
max_size = 2048
generate_mipmaps = true

[mesh]
deduplicate = true

bundler.py — bundle packing and reading

python
from pathlib import Path
from pipeline.bundler import BundleWriter, BundleReader, create_bundle

# Write a bundle
writer = BundleWriter(Path("game.forgepak"))
writer.add("textures/brick.png", brick_bytes)
writer.add_file(Path("hero.fmesh"), "meshes/hero.fmesh",
                dependencies=["textures/brick.png"])
manifest = writer.finalize()

# Read a bundle (random access)
with BundleReader(Path("game.forgepak")) as reader:
    data = reader.read("textures/brick.png")

# Bundle an entire directory
manifest = create_bundle(
    output_dir=Path("assets/processed"),
    bundle_path=Path("assets/bundles/game.forgepak"),
)

CLI bundling

bash
forge-pipeline bundle                              # bundle all processed assets
forge-pipeline bundle -o game.forgepak --level 9   # custom output, higher compression
forge-pipeline info game.forgepak                  # inspect bundle contents

Common mistakes

MistakeFix
Using file timestamps for change detectionUse SHA-256 content hashes — timestamps break on git clone, CI, and file copy
Hardcoding plugin list in core codeUse file-based discovery with importlib — drop a .py file to add a type
Storing absolute paths in the cacheUse POSIX-style relative paths so the cache is portable across machines
Not validating plugin registrationCheck for duplicate names and duplicate extensions — silent conflicts cause confusion
Missing tomllib fallback for Python < 3.11Guard with sys.version_info and fall back to tomli
Skipping _-prefixed plugin filesConvention: _-prefixed files are internal helpers, not plugins

Reference

Based on Asset Lesson 01 — Pipeline Scaffold and Asset Lesson 05 — Asset Bundles.

Veelgestelde vragen

Wat doet de AI-skill Forge Asset Pipeline?

Zet een plug-in-gebaseerde pipeline voor assetverwerking op, met een CLI, plug-indetectie, fingerprinting op basis van content-hashes en TOML-configuratie. Gebruik dit als iemand tooling wil bouwen die bestanden incrementeel verwerkt, zoals assetpipelines, buildsystemen, generatoren voor statische websites of andere workflows voor het scannen en transformeren van bestanden.

Waarom Forge Asset Pipeline gebruiken in TypingMind?

Omdat je deze skill één keer installeert en met elk model kunt gebruiken. Forge Asset Pipeline bestaat uit gewone Markdown in plaats van aanbiederspecifieke code. Dezelfde skill werkt dus met GPT-5, Claude, Gemini, Grok of een lokaal model. Ook als je midden in een chat van model wisselt, blijft de skill werken. TypingMind werkt met je eigen API-sleutels, dus je betaalt aanbieders rechtstreeks in plaats van een abonnement per gebruikersplek af te sluiten. Je skills en chats blijven in je eigen opslag.

Hoe installeer ik Forge Asset Pipeline in TypingMind?

Open Plug-ins → Skills → Installeren vanaf GitHub in TypingMind en plak https://github.com/Nebulavenus/forge-gpu/tree/main/.claude/skills/forge-asset-pipeline. TypingMind leest het bestand SKILL.md en installeert het als een skill die je per chat kunt inschakelen.

Welke AI-modellen kunnen Forge Asset Pipeline gebruiken?

Elk model dat je in TypingMind koppelt. AI-skills bestaan uit gewone Markdown-instructies in plaats van aanbiederspecifieke code. GPT, Claude, Gemini, Grok en lokale modellen kunnen deze skill dus allemaal laden wanneer een verzoek erbij past.

Hoeveel AI-modellen kan ik met Forge Asset Pipeline gebruiken?

Zoveel als je wilt. Je kunt Forge Asset Pipeline gebruiken met elk model dat skills ondersteunt, zoals GPT, Claude, Gemini, Grok, DeepSeek, Mistral of Llama. Allemaal in TypingMind met je eigen API-sleutels.

Is de AI-skill Forge Asset Pipeline gratis?

Ja. Deze skill is door Nebulavenus op GitHub gepubliceerd onder de licentie Zlib. Je betaalt alleen je eigen AI-aanbieder voor de tokens die je gebruikt.

Wat zijn AI-skills?

Een AI-skill is een herbruikbare bundel instructies die een AI-model leert hoe het één specifieke taak moet uitvoeren. De skill volgt het open Agent Skills-formaat: het bestand SKILL.md bevat de naam en beschrijving van de skill. Daarnaast kan de skill scripts, sjablonen of referentiebestanden bevatten die het model nodig heeft. Het model leest de instructies alleen als je verzoek bij de skill past. Een geïnstalleerde skill kost dus niets zolang deze niet wordt gebruikt.

Waarin verschillen AI-skills van plug-ins of MCP-servers?

Een plug-in of MCP-server geeft een model nieuwe tools om aan te roepen: code die ergens wordt uitgevoerd en een resultaat teruggeeft. Een AI-skill geeft het model juist kennis en een werkwijze: hoe het een taak moet aanpakken, welke stappen het moet volgen en hoe goede uitvoer eruitziet. Skills bestaan uit gewone Markdown en hebben dus geen server, API-sleutel of runtime nodig. Ze werken met elk model.

Bekijk alles

Maak nu je eigen AI-werkruimte

Schrijf je in voor onze nieuwsbrief en blijf op de hoogte van nieuwe functies en toekomstige weggeefacties 👇