← 返回列表
全部 Skill›开发 Development›pokemon-team-builder

pokemon-team-builder

作者 @fhfh022 · 语言 en
Guides the development of the PokéStrat (Pokémon Team Builder & Strategy Analyzer) application using React (Vite), Express, and Firebase with TypeScript.
开发 Development前端开发通用待翻译
最近源活动
—
检测 SKILL.md 语言
en
星标 ★
1
分支 Fork
0
安装选项
提示
指令
使用 AI 助手安装
将下面的提示复制到你正在使用的 AI 助手中。
下载完整 Skill 目录(含全部配套文件)。 下载压缩包 ↓
SKILL.md 原文预览

PokéStrat: Developer & Agent Guide

This skill provides instructions, formulas, and architectural references for building the PokéStrat (Pokémon Team Builder & Strategy Analyzer) project.


🛠️ Tech Stack & Setup Recommendations

Use the following stack and libraries to build this project:

  • Frontend: React (Vite) + TypeScript + Tailwind CSS + Lucide Icons
  • UI Components: Radix UI / Shadcn UI (for clean sliders, dialogs, and autocomplete inputs)
  • State Management: Zustand (lightweight and TypeScript-friendly)
  • Data Fetching/Caching: TanStack Query (@tanstack/react-query) for caching PokeAPI calls
  • Form Validation: React Hook Form + Zod (for validation of stats, EVs, and inputs)
  • Data Visualization: Recharts (for the Radar/Spider chart of team stats)
  • Backend: Node.js + Express + TypeScript
  • Database/Auth: Firebase Client SDK (or Firebase Admin SDK on the backend)

📐 Math & Formula Specifications

When writing code for Pokémon stats calculation, use the official Gen 3+ formulas.

1. Stats Calculation (Non-HP)

For Attack, Defense, Special Attack, Special Defense, and Speed:

$$\text{Stat} = \left\lfloor \left( \frac{(2 \times \text{Base} + \text{IV} + \lfloor \text{EV}/4 \rfloor) \times \text{Level}}{100} + 5 \right) \times \text{Nature Modifier} \right\rfloor$$

  • Base: The base stat value fetched from PokeAPI.
  • IV (Individual Value): Integer from 0 to 31 (Default: 31).
  • EV (Effort Value): Integer from 0 to 252 (Total EVs across all stats cannot exceed 508).
  • Level: Typically 50 or 100 (Default: 50 for VGC / competitive standard).
  • Nature Modifier:
  • 1.1 if Nature boosts the stat.
  • 0.9 if Nature hinders the stat.
  • 1.0 if Nature is neutral.

2. HP Calculation

For the HP stat (except for Shedinja, which is always 1):

$$\text{HP} = \left\lfloor \frac{(2 \times \text{Base} + \text{IV} + \lfloor \text{EV}/4 \rfloor) \times \text{Level}}{100} \right\rfloor + \text{Level} + 10$$


📊 Database Schema (Firestore)

Collection: users

interface UserProfile {
  uid: string;
  email: string;
  displayName: string;
  createdAt: Date;
}

Collection: teams

interface PokemonMember {
  name: string;
  spriteUrl: string;
  ability: string;
  item: string;
  nature: string;
  types: string[]; // e.g. ["fire", "flying"]
  evs: { hp: number; atk: number; def: number; spa: number; spd: number; spe: number };
  ivs: { hp: number; atk: number; def: number; spa: number; spd: number; spe: number };
  moves: string[]; // Max 4 move names
}

interface SavedTeam {
  id: string;
  userId: string;
  teamName: string;
  pokemons: PokemonMember[]; // Max 6 pokemons
  createdAt: any; // Firestore Timestamp
  updatedAt: any; // Firestore Timestamp
}

🧬 Strategy Analyzer Engine Logic (Backend)

The backend Express app should analyze the team payload (SavedTeam) and return:

  1. Type Weaknesses Matrix:
  • Calculate how many Pokémon in the team are weak to each of the 18 types.
  • Flag elements where $\ge 3$ Pokémon share a weakness without a counter-resistance.
  1. Move Type Coverage:
  • Check if the 24 selected moves (6 Pokémon $\times$ 4 moves) can deal Super Effective damage ($\ge 2\times$) to all 18 defensive types.
  1. Role Distribution:
  • Analyze stats & moves to categorize team members:
  • Sweeper: High Speed + High Attack or Sp. Atk.
  • Wall / Pivot: High HP + High Defense or Sp. Defense.
  • Utility / Support: Has status moves (e.g., *Thunder Wave, Tailwind, Reflect*).
评论
Ffhfh022
fhfh022
fhfh022/E-commerce
查看 GitHub 仓库 查看作者的其他 Skill
来源信息
作者@fhfh022
所属大类开发 Development / 前端开发
国内可用性通用
最近源活动—
风险提示无
提示:风险标签为程序静态扫描结果,仅作提示,不代表安全认证。安装前请阅读 SKILL.md 及其引用的脚本、权限,自行判断是否可信。