Caution
This project is currently under development.
A full-stack collectible card game engine and ecosystem built around the My Little Pony: CCG ruleset.
PonyCCG is a Discord-native card game platform featuring automated card ingestion, deckbuilding, and planned gameplay systems. It is an attempt at transforming unstructured game logic into a structured ruleset using LLM-assisted automation.
One of the core challenges was converting existing card databases into a structured ruleset that can be usable by a game engine. In order to address this, a simple LLM two-step processing pipeline was created to turn metadata scraped from the amazing dataset from Ponyhead.
Using Cheerio, cards were scraped one-by-one and ingressed into a PostgreSQL database as structured rows via Drizzle. [source]
For each card, the extracted human-readable card ability text is then processed through a transformation pipeline using structured outputs with gpt-5.4-nano, transforming it into a validated JSON representation of game mechanics, including triggers, costs, zones, and operations. Sample of the output of this transformation below:
{
"name": "Twilight Sparkle, Gala Greeter",
"start_side": {
"home_limit": 3,
"keywords": [],
"abilities": [
{
"trigger": {
"event": "card_played",
"card_type": "event",
},
"operations": [
{
"op": "flip",
"target": "self",
},
{
"op": "exhaust",
"target": "self",
}
]
}
]
},
"boosted_side": {
"home_limit": 4,
"keywords": ["Studious"],
"abilities": [
{
"trigger": {
"event": "card_moved",
"to_zone": "problem"
},
"operations": [
{
"op": "move",
"target": "opponent",
"destination_zone": "problem",
"filter": {
"card_type": "friend",
"zone": "problem"
}
}
]
}
]
}
}Compared to the original card page
Zod schemas are used to minimize hallucinated mechanics and ensure generated data remains compatible with the game engine. [source]
Using the web interface hosted in web/, users can authenticate via Discord OAuth2 and build a MLP:CCG deck.
Before running any scripts, ensure that you have correctly configured your working directory.
npm install
# ingress destination
export DATABASE_URL=<your-url-here>
# if using LLM transformation
export OPENAI_KEY=<your-key-here>npm run scraper:runScrapes all the cards on Ponyhead and inserts them into your database at DATABASE_URL
npm run llm:inferTurns the card text from the cards in your database into actual gameplay rules by processing them through gpt-5.4-nano. Rulesets are then stored in the ruleSet JSON column.
PonyCCG is not currently being maintained as of July 2026. In the future, I plan to have the following features completed end-to-end:
- Nuxt frontend completed
- Playable game with the Discord bot
- On-demand SVG renderer for game canvas