forge-asset-pipeline
Scaffold a plugin-based asset processing pipeline with CLI, plugin discovery, content-hash fingerprinting, and TOML configuration. Use when someone needs to…
от Nebulavenus★ 51 звезда на GitHub
Установить forge-asset-pipeline в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Об этом скилле
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
| Concept | Implementation |
|---|---|
| Configuration | TOML file parsed with tomllib, typed PipelineConfig dataclass |
| Plugin system | AssetPlugin base class, PluginRegistry with name + extension lookup |
| Discovery | importlib scans a directory for .py files, registers subclasses |
| Fingerprinting | SHA-256 content hash (not timestamps) for correctness and portability |
| Cache | JSON file mapping relative paths to hex digests |
| Classification | NEW (not cached), CHANGED (hash differs), UNCHANGED (hash matches) |
Architecture
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
- Create the project structure (
pyproject.toml,pipeline/package) - Implement
config.py— TOML loader with typed dataclass - Implement
plugin.py— base class, registry, file-based discovery - Implement
scanner.py— fingerprinting, cache, scan function - Implement
__main__.py— CLI that ties them together - Create example plugins in
plugins/ - Create
pipeline.tomlwith sensible defaults
Project structure template
<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
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
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
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл forge-asset-pipeline?
Scaffold a plugin-based asset processing pipeline with CLI, plugin discovery, content-hash fingerprinting, and TOML configuration. Use when someone needs to build tooling that processes files incrementally — asset pipelines, build systems, static site generators, or any scan-and-transform workflow.
Как установить скилл forge-asset-pipeline?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл forge-asset-pipeline запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
doc-coauthoring
AnthropicGuide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision…
academy-guide
AnthropicStop and check this skill before finishing any reply to a question about how to use Claude or a Claude product — it recommends matching courses, tutorials…
internal-comms
AnthropicA set of resources to help me write all kinds of internal communications, using the formats that my company likes to use. Claude should use this skill…
skill-development
AnthropicThis skill should be used when the user wants to "create a skill", "add a skill to plugin", "write a new skill", "improve skill description", "organize skill…