st-gen-image-promptlisted
Install: claude install-skill haingt-dev/agent
# ST Gen Image Prompt — Magnum-free image prompt builder
Generate complete booru-tag image prompt cho SillyTavern. Replaces Magnum Mode 4 extraction. Output paste-ready for ST `🎨 Freestyle` button (Mode FREE=6 pass-through).
**Workflow:**
1. Read chat context (last N msgs từ ST chat .jsonl) HOẶC `--describe '<custom>'`
2. Read identity baseline từ `data/identity-baselines/<CharName>.txt`
3. Generate booru tags theo NoobAI XL conventions
4. Verify tags qua Danbooru DB (lazy fetch ~5MB CSV vào `~/.cache/`)
5. Output paste-ready prompt + verification report
## Constants
```
ST_DATA = /home/haint/Projects/home-server/sillytavern/data/default-user
SKILL_DIR = ~/.claude/skills/st-gen-image-prompt
SKILL_DATA = $SKILL_DIR/data
CACHE_DIR = ~/.cache/st-gen-image-prompt
DEFAULT_LAST_N = 10
TAG_DB_URL = https://raw.githubusercontent.com/DominikDoom/a1111-sd-webui-tagcomplete/main/tags/danbooru.csv
TAG_DB_TTL_DAYS = 30
MIN_TAG_COUNT = 50
```
---
## Phase 0: Parse Arguments
Extract from `$ARGUMENTS`:
- `CharName` = first non-flag positional. If absent → auto-detect from latest `chats/<dir>/*.jsonl` mtime.
- `--describe '<text>'` → custom scene (overrides chat reading)
- `--last N` → number of chat messages to read (default 10)
- `--no-clipboard` → skip auto-copy to clipboard (default = auto-copy enabled)
Validate:
- Char folder `chats/<CharName>/` exists OR `--describe` given. If neither → error.
---
## Phase 1: Gather Context
**Step 0 — Ensure tag DB cache:**
```python
import