|
| 1 | +--- |
| 2 | +name: add-set |
| 3 | +description: Add a new TCG Pocket expansion set to the project. Use when asked to add a new set, expansion, or pack. |
| 4 | +argument-hint: [set-id] |
| 5 | +allowed-tools: Read, Write, Edit, Glob, Grep |
| 6 | +--- |
| 7 | + |
| 8 | +# Add New Set |
| 9 | + |
| 10 | +Start by asking the user for the following details (ask all in one message): |
| 11 | + |
| 12 | +1. **Set display name** – e.g. `Paldean Wonders` |
| 13 | +2. **Set ID** – e.g. `B2a` (used in URLs and card IDs) |
| 14 | +3. **Internal ID** – the next integer after the current highest non-promo internalId in `frontend/src/lib/CardsDB.ts` (read the file to determine this automatically and suggest it) |
| 15 | +4. **Pack name(s)** – internal key(s) without spaces, lowercase, e.g. `paldeanwonderspack`. If there are multiple packs, ask for all of them. |
| 16 | +5. **Pack display name(s)** – the human-readable pack name(s), e.g. `Paldean Wonders` |
| 17 | +6. **Pack color(s)** – hex color(s), e.g. `#78b9c0`. Rule: saturation 37.5%, value 75%, hue distance ≥ 3.33% (12 steps) from all existing packs. Read CardsDB.ts to find existing colors and suggest a valid new one. |
| 18 | +7. **Tradeable?** – yes/no (default: yes) |
| 19 | +8. **Openable?** – yes/no (default: yes) |
| 20 | +9. **Contains shinies?** – yes/no (default: yes) |
| 21 | +10. **Contains babies?** – yes/no (default: no) |
| 22 | +11. **Cards per pack** – number (default: 5) |
| 23 | + |
| 24 | +Once you have all the details, perform **all** of the following steps: |
| 25 | + |
| 26 | +--- |
| 27 | + |
| 28 | +## Step 1 — `frontend/src/types/index.ts` |
| 29 | + |
| 30 | +Add the new set ID to the front of the `expansionIds` array: |
| 31 | +```ts |
| 32 | +export const expansionIds = ['<NEW_ID>', 'B2a', ...] as const |
| 33 | +``` |
| 34 | + |
| 35 | +--- |
| 36 | + |
| 37 | +## Step 2 — `frontend/assets/themed-collections/<ID>-missions.json` |
| 38 | + |
| 39 | +Create the file with an empty array: |
| 40 | +```json |
| 41 | +[] |
| 42 | +``` |
| 43 | + |
| 44 | +--- |
| 45 | + |
| 46 | +## Step 3 — `frontend/src/lib/CardsDB.ts` |
| 47 | + |
| 48 | +**3a.** Add import at the bottom of the existing imports block: |
| 49 | +```ts |
| 50 | +const <IdCamel>Missions = await import('../../assets/themed-collections/<ID>-missions.json') |
| 51 | +``` |
| 52 | + |
| 53 | +**3b.** Add missions variable after the last existing missions variable: |
| 54 | +```ts |
| 55 | +const <idCamel>Missions: Mission[] = <IdCamel>Missions.default as Mission[] |
| 56 | +``` |
| 57 | + |
| 58 | +**3c.** Add the expansion entry after the previous set and before the promo sets comment: |
| 59 | +```ts |
| 60 | +{ |
| 61 | + name: '<nameLowercase>', |
| 62 | + id: '<ID>', |
| 63 | + internalId: <internalId>, |
| 64 | + packs: [{ name: '<packname>', color: '<color>' }], |
| 65 | + missions: <idCamel>Missions, |
| 66 | + tradeable: <true|false>, |
| 67 | + openable: <true|false>, |
| 68 | + packStructure: { |
| 69 | + containsShinies: <true|false>, |
| 70 | + containsBabies: <true|false>, |
| 71 | + cardsPerPack: <number>, |
| 72 | + }, |
| 73 | +}, |
| 74 | +``` |
| 75 | + |
| 76 | +--- |
| 77 | + |
| 78 | +## Step 4 — `scripts/scraper.ts` |
| 79 | + |
| 80 | +**4a.** Add each pack name to the `packs` array (before `'allcards'`): |
| 81 | +```ts |
| 82 | +'<packname>', |
| 83 | +``` |
| 84 | + |
| 85 | +**4b.** Add the set to `rarityOverrides` (empty for now — fill in after scraping): |
| 86 | +```ts |
| 87 | +<ID>: [], |
| 88 | +``` |
| 89 | +Place it in the correct alphabetical/sequential position among the other set IDs. |
| 90 | + |
| 91 | +--- |
| 92 | + |
| 93 | +## Step 5 — Locale files: `sets.json` (all 6 locales) |
| 94 | + |
| 95 | +Files: `frontend/public/locales/{en-US,es-ES,it-IT,pt-BR,de-DE,fr-FR}/common/sets.json` |
| 96 | + |
| 97 | +For **en-US**, add after the previous set's entry: |
| 98 | +```json |
| 99 | +"<nameLowercase>": "<Display Name>", |
| 100 | +``` |
| 101 | +And in the ID-suffixed section, add after the previous set's suffixed entry: |
| 102 | +```json |
| 103 | +"<nameLowercase>(<idLower>)": "<Display Name> (<ID>)", |
| 104 | +``` |
| 105 | + |
| 106 | +For **all other locales**, append at the end (before the closing `}`): |
| 107 | +```json |
| 108 | +"<nameLowercase>": "<Display Name>", |
| 109 | +"<nameLowercase>(<idLower>)": "<Display Name> (<ID>)" |
| 110 | +``` |
| 111 | +Use the English display name as a placeholder for non-English locales. |
| 112 | + |
| 113 | +--- |
| 114 | + |
| 115 | +## Step 6 — Locale files: `packs.json` (all 6 locales) |
| 116 | + |
| 117 | +Files: `frontend/public/locales/{en-US,es-ES,it-IT,pt-BR,de-DE,fr-FR}/common/packs.json` |
| 118 | + |
| 119 | +For **en-US**, add before `"everypack"`: |
| 120 | +```json |
| 121 | +"<packname>": "<Pack Display Name>", |
| 122 | +``` |
| 123 | + |
| 124 | +For **all other locales**, append at the end (before the closing `}`): |
| 125 | +```json |
| 126 | +"<packname>": "<Pack Display Name>" |
| 127 | +``` |
| 128 | + |
| 129 | +--- |
| 130 | + |
| 131 | +## Naming conventions |
| 132 | + |
| 133 | +- `<nameLowercase>` = display name lowercased with all spaces removed, e.g. `Paldean Wonders` → `paldeanwonders` |
| 134 | +- `<idLower>` = set ID lowercased, e.g. `B2a` → `b2a` |
| 135 | +- `<IdCamel>` = set ID as camelCase import name, e.g. `B2a` → `B2aMissions` |
| 136 | +- `<idCamel>` = set ID as camelCase variable, e.g. `B2a` → `b2aMissions` |
| 137 | + |
| 138 | +## Important notes |
| 139 | + |
| 140 | +- `internalId` must **never change** after a set is released — the DB encoding depends on it. |
| 141 | +- Promo sets use internalIds 192+ to avoid conflicts with regular sets. |
| 142 | +- After all edits are done, remind the user that shiny card rarity ranges in `rarityOverrides` in `scripts/scraper.ts` should be filled in once the set's card list is confirmed. |
0 commit comments