refactor: split assets
|
|
@ -48,7 +48,8 @@
|
|||
"Bash(sort -t'\\(' -k2 -n)",
|
||||
"Bash(grep -o 'scale\\(3.50\\).\\\\{0,200\\\\}')",
|
||||
"Bash(python3 -c ':*)",
|
||||
"Bash(grep -r \"margin.*-\\\\|negative\" tasks/*/CLAUDE.md)"
|
||||
"Bash(grep -r \"margin.*-\\\\|negative\" tasks/*/CLAUDE.md)",
|
||||
"Bash(grep -c '/assets/themes/nms/' tasks/*/docs/*.template.html)"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
|
|
|||
35
CLAUDE.md
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,63 @@
|
|||
# NMS (No Man's Sky) Theme
|
||||
|
||||
Space exploration theme inspired by No Man's Sky. Dark cosmic backgrounds, asteroid fields, cargo freighters, planet panoramas.
|
||||
|
||||
## Asset Inventory
|
||||
|
||||
| Category | Path | Count | Description |
|
||||
|----------|------|-------|-------------|
|
||||
| Hero images | `hero-images/spaceship{1-9}.{jpeg,png}` | 15 | Spaceships for page headers |
|
||||
| Splitters | `hero-images/splitters/splitter{1-9}.png` | 9 | Splitting ship variants |
|
||||
| Footers - Planets | `footers/planet{1-9}.jpeg` | 9 | Planet panoramas |
|
||||
| Footers - Cabins | `footers/cabin{1-9}.jpeg` | 9 | Ship interior views |
|
||||
| Icons Pack 1 | `icons/pack1/` | 60 | Minerals & plants (space-exploration) |
|
||||
| Icons Pack 2 | `icons/pack2/` | 60 | Elements (space-exploration) |
|
||||
| Icons Pack 3 | `icons/pack3-asteroids/` | 16 | Colored asteroid icons |
|
||||
| Icons Pack 4 | `icons/pack4-cargobay/` | 9 | Cargo bay icons |
|
||||
| Asteroids | `items/asteroids/` | 17 | Full-size colored asteroid images |
|
||||
| Asteroid shapes | `items/asteroid-shapes/` | 16 | Line-art asteroid silhouettes |
|
||||
| Freighters | `items/freighters/` | 30 | Ships and pods |
|
||||
| Plants | `items/plants/` | 6 | Decorative plant icons |
|
||||
| Stones | `items/stones/` | 6 | Stone/mineral textures |
|
||||
| Elements | `items/elements/` | 4 | Element icons |
|
||||
|
||||
**Legacy:** `icons/pack1-2-unused/` (136 files) — superseded by pack2, kept for reference.
|
||||
|
||||
## Usage in Templates
|
||||
|
||||
All paths relative to project root:
|
||||
- HTML templates: `/assets/themes/nms/{category}/{file}`
|
||||
- Generator scripts (from docs/): `../../assets/themes/nms/{category}/{file}`
|
||||
- Generator scripts (from project root): `assets/themes/nms/{category}/{file}`
|
||||
|
||||
## Color Palette
|
||||
|
||||
| Element | Class |
|
||||
|---------|-------|
|
||||
| Title text | `text-indigo-950` |
|
||||
| Subtitle | `text-indigo-400` |
|
||||
| Card border | `border-indigo-100` |
|
||||
| Answer underline | `border-indigo-300` |
|
||||
| Card bg gradient | `from-white to-indigo-50/40` |
|
||||
| Badges | `bg-indigo-600` |
|
||||
|
||||
## Adding New Assets
|
||||
|
||||
1. Generate via `/gen-image` with `--ref` from same category for visual consistency
|
||||
2. Save raw output (white background) to `items/{category}/raw/`
|
||||
3. Run `pnpm remove-bg` if transparent background needed
|
||||
4. Move final PNG to `items/{category}/`
|
||||
|
||||
## Reference Policy
|
||||
|
||||
- `items/asteroids/` — use any existing asteroid as `--ref`
|
||||
- `items/crystals/` — use any existing crystal as `--ref`
|
||||
- `icons/` — generate independently (icon packs have their own pipeline)
|
||||
- `hero-images/`, `footers/`, `backgrounds/` — generate independently
|
||||
|
||||
## Cargo Bay Image Generation
|
||||
|
||||
Proven approach for generating `cargo-bayN.jpeg` from `spaceshipN.jpeg`:
|
||||
- **Ref**: use original `spaceshipN.jpeg` first, then iterate using the generated `cargo-bayN.jpeg` as ref
|
||||
- **Template**: `illustration`, **Aspect**: `16:9`, **Flag**: `--no-enhance`
|
||||
- **Key prompt elements**: describe the ship's unique features, emphasize "NO landing gear", "rear engines glow", "open cargo bay hatch", "flying in zero gravity", "white background", "concept art illustration style"
|
||||
|
Before Width: | Height: | Size: 1.4 MiB After Width: | Height: | Size: 1.4 MiB |
|
Before Width: | Height: | Size: 1.3 MiB After Width: | Height: | Size: 1.3 MiB |
|
Before Width: | Height: | Size: 1.5 MiB After Width: | Height: | Size: 1.5 MiB |
|
Before Width: | Height: | Size: 1.6 MiB After Width: | Height: | Size: 1.6 MiB |
|
Before Width: | Height: | Size: 1.6 MiB After Width: | Height: | Size: 1.6 MiB |
|
Before Width: | Height: | Size: 1.4 MiB After Width: | Height: | Size: 1.4 MiB |
|
Before Width: | Height: | Size: 1.4 MiB After Width: | Height: | Size: 1.4 MiB |
|
Before Width: | Height: | Size: 1.5 MiB After Width: | Height: | Size: 1.5 MiB |
|
Before Width: | Height: | Size: 1.7 MiB After Width: | Height: | Size: 1.7 MiB |
|
Before Width: | Height: | Size: 754 KiB After Width: | Height: | Size: 754 KiB |
|
Before Width: | Height: | Size: 837 KiB After Width: | Height: | Size: 837 KiB |
|
Before Width: | Height: | Size: 843 KiB After Width: | Height: | Size: 843 KiB |
|
Before Width: | Height: | Size: 1.0 MiB After Width: | Height: | Size: 1.0 MiB |
|
Before Width: | Height: | Size: 1.4 MiB After Width: | Height: | Size: 1.4 MiB |
|
Before Width: | Height: | Size: 1024 KiB After Width: | Height: | Size: 1024 KiB |
|
Before Width: | Height: | Size: 1.3 MiB After Width: | Height: | Size: 1.3 MiB |
|
Before Width: | Height: | Size: 1.2 MiB After Width: | Height: | Size: 1.2 MiB |
|
Before Width: | Height: | Size: 1.3 MiB After Width: | Height: | Size: 1.3 MiB |
|
Before Width: | Height: | Size: 2.2 MiB After Width: | Height: | Size: 2.2 MiB |
|
Before Width: | Height: | Size: 587 KiB After Width: | Height: | Size: 587 KiB |
|
Before Width: | Height: | Size: 627 KiB After Width: | Height: | Size: 627 KiB |
|
Before Width: | Height: | Size: 1.4 MiB After Width: | Height: | Size: 1.4 MiB |
|
Before Width: | Height: | Size: 169 KiB After Width: | Height: | Size: 169 KiB |
|
Before Width: | Height: | Size: 548 KiB After Width: | Height: | Size: 548 KiB |
|
Before Width: | Height: | Size: 501 KiB After Width: | Height: | Size: 501 KiB |
|
Before Width: | Height: | Size: 622 KiB After Width: | Height: | Size: 622 KiB |
|
Before Width: | Height: | Size: 746 KiB After Width: | Height: | Size: 746 KiB |
|
Before Width: | Height: | Size: 726 KiB After Width: | Height: | Size: 726 KiB |
|
Before Width: | Height: | Size: 1.6 MiB After Width: | Height: | Size: 1.6 MiB |
|
Before Width: | Height: | Size: 494 KiB After Width: | Height: | Size: 494 KiB |
|
Before Width: | Height: | Size: 1.1 MiB After Width: | Height: | Size: 1.1 MiB |
|
Before Width: | Height: | Size: 1.7 MiB After Width: | Height: | Size: 1.7 MiB |
|
Before Width: | Height: | Size: 379 KiB After Width: | Height: | Size: 379 KiB |
|
Before Width: | Height: | Size: 706 KiB After Width: | Height: | Size: 706 KiB |
|
Before Width: | Height: | Size: 620 KiB After Width: | Height: | Size: 620 KiB |
|
Before Width: | Height: | Size: 701 KiB After Width: | Height: | Size: 701 KiB |
|
Before Width: | Height: | Size: 893 KiB After Width: | Height: | Size: 893 KiB |
|
Before Width: | Height: | Size: 580 KiB After Width: | Height: | Size: 580 KiB |
|
Before Width: | Height: | Size: 737 KiB After Width: | Height: | Size: 737 KiB |
|
Before Width: | Height: | Size: 527 KiB After Width: | Height: | Size: 527 KiB |
|
Before Width: | Height: | Size: 817 KiB After Width: | Height: | Size: 817 KiB |
|
Before Width: | Height: | Size: 665 KiB After Width: | Height: | Size: 665 KiB |
|
Before Width: | Height: | Size: 73 KiB After Width: | Height: | Size: 73 KiB |
|
Before Width: | Height: | Size: 92 KiB After Width: | Height: | Size: 92 KiB |
|
Before Width: | Height: | Size: 91 KiB After Width: | Height: | Size: 91 KiB |
|
Before Width: | Height: | Size: 80 KiB After Width: | Height: | Size: 80 KiB |
|
Before Width: | Height: | Size: 98 KiB After Width: | Height: | Size: 98 KiB |
|
Before Width: | Height: | Size: 87 KiB After Width: | Height: | Size: 87 KiB |
|
Before Width: | Height: | Size: 97 KiB After Width: | Height: | Size: 97 KiB |
|
Before Width: | Height: | Size: 94 KiB After Width: | Height: | Size: 94 KiB |
|
Before Width: | Height: | Size: 102 KiB After Width: | Height: | Size: 102 KiB |
|
Before Width: | Height: | Size: 93 KiB After Width: | Height: | Size: 93 KiB |
|
Before Width: | Height: | Size: 89 KiB After Width: | Height: | Size: 89 KiB |
|
Before Width: | Height: | Size: 84 KiB After Width: | Height: | Size: 84 KiB |
|
Before Width: | Height: | Size: 92 KiB After Width: | Height: | Size: 92 KiB |
|
Before Width: | Height: | Size: 96 KiB After Width: | Height: | Size: 96 KiB |
|
Before Width: | Height: | Size: 90 KiB After Width: | Height: | Size: 90 KiB |
|
Before Width: | Height: | Size: 88 KiB After Width: | Height: | Size: 88 KiB |
|
Before Width: | Height: | Size: 83 KiB After Width: | Height: | Size: 83 KiB |
|
Before Width: | Height: | Size: 70 KiB After Width: | Height: | Size: 70 KiB |
|
Before Width: | Height: | Size: 73 KiB After Width: | Height: | Size: 73 KiB |
|
Before Width: | Height: | Size: 85 KiB After Width: | Height: | Size: 85 KiB |
|
Before Width: | Height: | Size: 72 KiB After Width: | Height: | Size: 72 KiB |
|
Before Width: | Height: | Size: 70 KiB After Width: | Height: | Size: 70 KiB |
|
Before Width: | Height: | Size: 81 KiB After Width: | Height: | Size: 81 KiB |
|
Before Width: | Height: | Size: 66 KiB After Width: | Height: | Size: 66 KiB |
|
Before Width: | Height: | Size: 79 KiB After Width: | Height: | Size: 79 KiB |
|
Before Width: | Height: | Size: 69 KiB After Width: | Height: | Size: 69 KiB |
|
Before Width: | Height: | Size: 81 KiB After Width: | Height: | Size: 81 KiB |
|
Before Width: | Height: | Size: 71 KiB After Width: | Height: | Size: 71 KiB |
|
Before Width: | Height: | Size: 79 KiB After Width: | Height: | Size: 79 KiB |
|
Before Width: | Height: | Size: 68 KiB After Width: | Height: | Size: 68 KiB |
|
Before Width: | Height: | Size: 89 KiB After Width: | Height: | Size: 89 KiB |
|
Before Width: | Height: | Size: 84 KiB After Width: | Height: | Size: 84 KiB |
|
Before Width: | Height: | Size: 92 KiB After Width: | Height: | Size: 92 KiB |
|
Before Width: | Height: | Size: 81 KiB After Width: | Height: | Size: 81 KiB |
|
Before Width: | Height: | Size: 87 KiB After Width: | Height: | Size: 87 KiB |
|
Before Width: | Height: | Size: 91 KiB After Width: | Height: | Size: 91 KiB |
|
Before Width: | Height: | Size: 74 KiB After Width: | Height: | Size: 74 KiB |
|
Before Width: | Height: | Size: 86 KiB After Width: | Height: | Size: 86 KiB |
|
Before Width: | Height: | Size: 80 KiB After Width: | Height: | Size: 80 KiB |
|
Before Width: | Height: | Size: 86 KiB After Width: | Height: | Size: 86 KiB |
|
Before Width: | Height: | Size: 86 KiB After Width: | Height: | Size: 86 KiB |
|
Before Width: | Height: | Size: 95 KiB After Width: | Height: | Size: 95 KiB |
|
Before Width: | Height: | Size: 93 KiB After Width: | Height: | Size: 93 KiB |
|
Before Width: | Height: | Size: 103 KiB After Width: | Height: | Size: 103 KiB |
|
Before Width: | Height: | Size: 99 KiB After Width: | Height: | Size: 99 KiB |
|
Before Width: | Height: | Size: 99 KiB After Width: | Height: | Size: 99 KiB |
|
Before Width: | Height: | Size: 112 KiB After Width: | Height: | Size: 112 KiB |
|
Before Width: | Height: | Size: 104 KiB After Width: | Height: | Size: 104 KiB |
|
Before Width: | Height: | Size: 109 KiB After Width: | Height: | Size: 109 KiB |
|
Before Width: | Height: | Size: 94 KiB After Width: | Height: | Size: 94 KiB |
|
Before Width: | Height: | Size: 96 KiB After Width: | Height: | Size: 96 KiB |
|
Before Width: | Height: | Size: 91 KiB After Width: | Height: | Size: 91 KiB |
|
Before Width: | Height: | Size: 107 KiB After Width: | Height: | Size: 107 KiB |
|
Before Width: | Height: | Size: 117 KiB After Width: | Height: | Size: 117 KiB |
|
Before Width: | Height: | Size: 109 KiB After Width: | Height: | Size: 109 KiB |