- commit
- 1b891100b6a88f26960bde2dc1d7f90f40563555
- parent
- 7e8cdaa634403808cbf030317d669e0532499a69
- author
- Dami <dami.etoile@gmail.com>
| M | CLAUDE.md | 34 | ++++++++++++++++++++++++++++++ |
@@ -41,6 +41,12 @@ just fmt # gofumpt -w .
4141 just tidy # go mod tidy4242 ```4343 44+### VHS GIF Previews45+```bash46+just vhs # generate all game preview GIFs (requires vhs + ffmpeg + ttyd)47+vhs vhs/menu.tape # generate a single GIF48+```49+4450 ## Architecture4551 4652 ### Core Application Structure@@ -147,6 +153,34 @@ All Go code must pass `gofumpt` (strict superset of `gofmt`) and `golangci-lint`
147153 148154 All colors must use `lipgloss.AdaptiveColor{Light: "X", Dark: "Y"}` with ANSI 256 palette numbers. Avoid hex colors (`#rrggbb`) — they require true-color support and don't adapt to terminal background.149155 156+### VHS Tape Files (`vhs/`)157+158+Each game has a `.tape` file in `vhs/` that generates a GIF preview using [charmbracelet/vhs](https://github.com/charmbracelet/vhs). All tapes share a common preamble:159+160+```tape161+Set FontSize 13162+Set Width 854163+Set Height 480164+Set Padding 40165+Set Theme "Catppuccin Mocha"166+167+Env COLORTERM "truecolor"168+Env CLICOLOR_FORCE "1"169+Env CI ""170+```171+172+The three `Env` lines are required for CI color support. `termenv` (used by lipgloss/bubbletea) checks `CI` env var and returns no-color when set — GitHub Actions sets `CI=true`. `COLORTERM=truecolor` sets the color profile, and `CLICOLOR_FORCE=1` is a fallback.173+174+Each tape uses a `Hide` block to build the binary and clear the screen before `Show`ing the gameplay commands. Use `Ctrl+L` (not `clear`) to clear the screen in the hidden block.175+176+GIFs are not tracked in git — they are generated by CI and committed via PR.177+178+### CI/CD Workflows179+180+- **`ci.yml`**: Runs tests and linting on PRs and pushes to main.181+- **`release.yml`**: GoReleaser builds on tagged releases.182+- **`vhs.yml`**: Generates VHS GIF previews. Triggers on release, `workflow_dispatch`, or pushes to main that change `vhs/*.tape`. Creates a PR (`chore/regenerate-vhs-gifs` branch) with the updated GIFs rather than pushing directly to main (required by branch protection rules).183+150184 ## Module Information151185 152186 - **Module path**: `github.com/FelineStateMachine/puzzletea`