refactor: split assets

This commit is contained in:
2026-04-27 19:12:29 +07:00
parent 2d1dbccd28
commit 9eda551aea
425 changed files with 1506 additions and 1415 deletions
+26 -9
View File
@@ -41,7 +41,10 @@ src/
styles/main.css — Tailwind source with A4/print styles
templates/space-base.html — Shared base template reference
assets/ — images (hero, footer, icons, items, backgrounds)
assets/
themes/{theme-name}/ — per-theme asset folders
CLAUDE.md — theme asset inventory and usage rules
hero-images/, footers/, icons/... — theme-specific images
output/pdf/ — generated PDFs (gitignored)
```
@@ -55,6 +58,23 @@ Each task type lives in `tasks/{type-name}/` with its own CLAUDE.md, scripts, ed
**Type-specific rules** (layout details, asset conventions, generation algorithms) live in each type's own CLAUDE.md — NOT in this file. Read `tasks/{type}/CLAUDE.md` before working on any task of that type.
## Themes
Assets are organized by theme under `assets/themes/{name}/`. Each theme has its own CLAUDE.md describing available assets, color palettes, and generation rules.
Current themes:
- **nms** — No Man's Sky space theme (asteroids, spaceships, planets). Used by all current task types.
When creating a new task type, choose a theme and document it in the type's CLAUDE.md (`**Theme:** {name}`). Theme assets are referenced directly in templates: `/assets/themes/{name}/{category}/{file}`.
### Raw vs Ready Assets
For newly generated assets, use the `raw/` subfolder convention:
- **Raw** (`items/{category}/raw/`) — intermediate files (e.g., generated images with white backgrounds)
- **Ready** (`items/{category}/`) — final production assets (transparent PNGs, processed images)
Existing assets are not retroactively classified.
## Document File Set
Each document instance consists of up to 4 files in `tasks/{type}/docs/`:
@@ -73,8 +93,9 @@ Each document instance consists of up to 4 files in `tasks/{type}/docs/`:
## Creating New Task Types
1. Create folder `tasks/{type-name}/`
2. Create `CLAUDE.md` with type-specific rules
3. Create `scripts/generate.mjs` — template + data → output pipeline
2. Choose a theme — record in the type's CLAUDE.md (`**Theme:** {name}`)
3. Create `CLAUDE.md` with type-specific rules
4. Create `scripts/generate.mjs` — template + data → output pipeline
4. Create `editor.html` importing `src/editor/editor-core.js` + type-specific logic
5. Create `scripts/` for any validation/generation utilities
6. Add section to `tasks/index.html`
@@ -324,13 +345,9 @@ Use the `/gen-image` skill to generate images via the Banatie API. Auth via `BAN
### Reference Policy
When generating new assets for `assets/items/`, use existing images from the same subfolder as `--ref` to maintain visual consistency. The gen-image skill's default policy is to ask before using refs — this project overrides that: use refs automatically for items in the same asset group.
When generating new assets, use existing images from the same theme subfolder as `--ref` to maintain visual consistency. The gen-image skill's default policy is to ask before using refs — this project overrides that: use refs automatically for items in the same asset group.
Style reference chain:
- `assets/items/asteroids/` — use any existing asteroid as ref
- `assets/items/crystals/` — use any existing crystal as ref
- `assets/icons/` — generate independently (icon packs have their own pipeline)
- `assets/hero-images/`, `assets/footers/`, `assets/backgrounds/` — generate independently
See the active theme's CLAUDE.md for the full reference policy. Current theme: `assets/themes/nms/CLAUDE.md`.
## Background Removal