feat: curated preset builds for quick pet selection#15
Conversation
Adds 23 curated themed presets (one+ per species) that users can browse with full ASCII sprite previews instead of picking each attribute individually. Includes --preset CLI flag for non-interactive use. - New src/presets.ts with typed Preset interface and preset data - selectMode() and selectPreset() prompts with sprite + rarity preview - resolvePreset() for --preset flag (case-insensitive name matching) - Vitest tests for preset validity, coverage, and constraints - All existing flows preserved — "Customize" falls through to manual Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Will review this in the morning if all looks good it'll be in next release |
|
Hey looks like @Ahmad8864 is working on a profile system seems similar to this but more built out @Co-Messi could we do both of these in 1 pr or do you think these should be separate features |
|
I think these should stay as separate features — they solve different problems:
They don't overlap in code either — presets live in the selection/prompts layer, profiles live in config/gallery. No conflicting file changes. If anything, they work great together: pick a preset to quickly create a pet → it gets auto-saved as a profile → switch between profiles later. Happy to coordinate with @Ahmad8864 if you'd prefer a combined PR though! |
|
Agreed with @Co-Messi, these should stay separate. presets (#15) is a creation UX shortcut, profiles (#17) is post-creation management. They touch 3 common files but the changes don't overlap semantically. We could present the presets as part of the buddies gallery view by default (instead of having to save them first), but we'd need to save a salt as part of each preset in presets.ts |
…rated preset builds for quick pet selection
|
Merged manually after resolving rebase conflict (MIN_SALT_COUNT removal in interactive.ts). All tests pass. |
|
@Co-Messi Applied this to codebase ty for the PR just doing some code quality checks and fixes before I release |
Summary
Rebased onto the TypeScript rewrite (replaces #13).
descriptionfield--presetCLI flag for non-interactive use (e.g.,any-buddy --preset "Arcane Dragon" -y)New files
src/presets.ts— typedPresetinterface + 23 preset definitionstests/presets.test.ts— validates coverage, types, constraints, uniquenessModified files
src/types.ts— addedpresettoCliFlagssrc/cli.ts—--presetflag parsing + help textsrc/tui/prompts.ts—selectMode()andselectPreset()with sprite previewssrc/tui/commands/interactive.ts—resolvePreset()+selectCoreTraits()flowUX flow
Quality checks
pnpm run build— compiles cleanlypnpm run test— 149/149 tests pass (5 new preset tests)pnpm run lint— 0 errorspnpm run format:check— all files formattedpnpm run typecheck— no type errorsTest plan
any-buddy→ select "Browse presets" → verify sprite preview + correct applicationany-buddy→ select "Customize" → verify existing flow unchangedany-buddy --preset "Arcane Dragon" -y→ verify non-interactive presetany-buddy --preset "nonexistent"→ verify clear error listing available presetsany-buddy -s dragon -r legendary→ verify flags skip preset prompt entirely🤖 Generated with Claude Code