Web damage calc workspace for Pokemon Champions / VGC-style doubles. Prompt-first. Client-side calc. UI act more like editor, less like old-school form.
Pokémon names, sprites, game data, and related trademarks are the property of Nintendo, Creatures Inc., Game Freak, and The Pokémon Company. Usage statistics are sourced from Smogon and Pokémon Showdown. This project is not affiliated with, endorsed by, or sponsored by any of these parties.
- Parse compact matchup prompts like:
politoed !muddy-water @mystic-water x incineroar @assault-vest ~rain
- Resolve Pokemon, forms, megas, moves, items, abilities, status, HP, field states, multi-hit counts
- Calculate damage client-side with 3 default bulk outputs:
Min BulkMid BulkMax Bulk
- Support Pokemon Champions SP-based set editing
- Provide searchable editing for species, item, ability, moves, nature, SP spread
- Use current Champions meta snapshots for autocomplete and defaults
- Next.js 16
- React 19
- TypeScript
- Zustand
- Tailwind CSS v4
@smogon/calc@pkmn/dex/@pkmn/mods/@pkmn/img- Jest + Testing Library
Canonical shape:
{attacker} !{move} [attacker tokens...] x {defender} [defender tokens...] [global tokens...]Example:
politoed !muddy-water @mystic-water x incineroar ~rainCommon tokens:
!move#set-namefor saved/shared set by nickname or species id@item%75for current HP in segmentsp:32/0/1/13/1/19for explicit Champions SP spread[Ability Name]~rain,~sun,~grassy-terrain,~trick-room*for crit+1to+6/-1to-6for relevant attacking or defending stagesspe+1tospe+6/spe-1tospe-6burn,paralysis,poison,sleep,freeze!bullet-seed(3)for multi-hit count
Full grammar:
- Segment-scoped prompt grammar
- Fuzzy Pokemon and move matching
- Searchable suggestions with keyboard navigation
- Client-side damage calc
- Mega form support
- Regulation-aware legal species filtering
- Pokemon summary cards with sprite, stats, item, ability, move, set editing
- SP-aware set editor for Pokemon Champions
- Shareable calc URLs that restore prompt + relevant custom sets
- Meta-driven autocomplete data
Runtime no fetch live competitive data. Runtime read committed snapshots under src/data/. Local scripts generate those files.
Main runtime data files:
src/data/pokemon.gen9.jsonsrc/data/moves.gen9.jsonsrc/data/learnsets.gen9.jsonsrc/data/vgc-meta.jsonsrc/data/form-aliases.jsonsrc/data/regulations/active.jsonsrc/data/regulations/regulation-m-b.json
Full source inventory:
Install deps:
npm installStart dev server:
npm run devOpen:
http://localhost:3000Optional bug-report issue pipeline:
cp .env.example .env.localSet GITHUB_BUG_REPORT_TOKEN in .env.local to enable the in-app Report bug form. The token needs issue creation access for the target repo.
Set GITHUB_BUG_REPORT_REPO if you want reports to land somewhere other than leandromesq/unburden.
Set the repository secret DISCORD_BUG_REPORT_WEBHOOK_URL in GitHub Actions so new app-created issues are forwarded to Discord.
Optional public tester links:
NEXT_PUBLIC_DISCORD_INVITE_URLNEXT_PUBLIC_FEEDBACK_URLNEXT_PUBLIC_DONATE_URL
These are public by design and safe to expose to the browser.
Lint:
npm run lintTests:
npm test -- --runInBandCoverage:
npm test -- --coverage --runInBandDead code:
npm run knipQlty:
qlty check --all
qlty smells --allBuild:
npm run buildGitHub Actions:
.github/workflows/validation.ymlruns lint, coverage tests, dead-code check, production build on push tomain.github/workflows/data-freshness.ymlruns snapshot freshness check on demand and monthlyleandromesq/unburden/.github/workflows/issues-to-discord.ymlforwards app-created GitHub bug reports to Discord when new issues open
Regenerate structural static data:
npm run generate:dataRegenerate Champions meta profiles:
npm run generate:vgc-metaRegenerate all:
npm run generate:allnpm run dev- local dev servernpm run build- production buildnpm run start- production servernpm run lint- ESLintnpm test- Jestnpm run test:watch- Jest watch modenpm run knip- dead code / unused exportsnpm run generate:data- regenerate Pokemon / move / learnset snapshotsnpm run generate:vgc-meta- regenerate Champions meta snapshotnpm run generate:all- regenerate all data snapshots
Build-time sources:
@pkmn/dexand@pkmn/mods/championsfor Pokemon Champions species, moves, abilities, learnsets, items, and regulation snapshots- Smogon Champions VGC usage statistics for competitive usage/meta
Runtime external assets:
- Pokemon Showdown sprite URLs generated by
@pkmn/img
Runtime data modules:
src/lib/data/pokemon.tssrc/lib/data/moves.tssrc/lib/data/learnsets.tssrc/lib/data/items.tssrc/lib/data/regulations.tssrc/lib/data/form-aliases.tssrc/lib/data/vgc-meta.ts
Key directories:
src/app- Next.js app entrypoints and global stylessrc/components- UI componentssrc/lib- parser, calc, data loading, grammar, utilitiessrc/store- Zustand storessrc/data- committed runtime snapshots and regulation filesscripts- snapshot generation scriptsdocs- prompt grammar and data-source docs
- Active regulation lives in
src/data/regulations/active.json active.jsonstores regulation id, roster hash, optional last verification date- Regulation M-B legality lives in
src/data/regulations/regulation-m-b.json - Meta defaults and suggestions come from generated
src/data/vgc-meta.json - Images load from external sprite/artwork sources at runtime. Gameplay/meta data no.
Standard Next.js deploy.
Typical flow:
npm install
npm run build
npm run startWant hosted previews fast. Use Vercel. Repo already shaped like standard Next.js app.