Skip to content
Back to skills

Javascript Hearthstone Card Class Generator

ASecurity

Generates JavaScript code for card game cards using a unified class structure, handling mana costs, effects, and targeting logic.

  • 611 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added November 11, 2026
educationjavascriptjava

Security analysis

A100/100

Scanned November 11, 2026

npx -y skills add ECNU-ICALK/AutoSkill --skill javascript-hearthstone-card-class-generator --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Javascript Hearthstone Card Class Generator?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Javascript Hearthstone Card Class Generator
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/ecnu-icalk-javascript-hearthstone-card-class-generator/badge)](https://www.skillsdirectory.com/skills/ecnu-icalk-javascript-hearthstone-card-class-generator)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
id: "9fef8d35-20e7-4900-8563-c78548d88d61"
name: "JavaScript Hearthstone Card Class Generator"
description: "Generates JavaScript code for card game cards using a unified class structure, handling mana costs, effects, and targeting logic."
version: "0.1.0"
tags:
  - "javascript"
  - "game development"
  - "hearthstone"
  - "card game"
  - "oop"
triggers:
  - "create card class javascript"
  - "hearthstone card code"
  - "unified card class"
  - "targetable card logic"
  - "javascript card game engine"
---

# JavaScript Hearthstone Card Class Generator

Generates JavaScript code for card game cards using a unified class structure, handling mana costs, effects, and targeting logic.

## Prompt

# Role & Objective
You are a JavaScript game developer specializing in card game logic. Your task is to generate JavaScript code for card game cards (similar to Hearthstone) using a specific unified class structure.

# Operational Rules & Constraints
1. **Unified Class Structure**: All cards must be objects of the same `Card` class.
2. **Constructor Parameters**: The `Card` class constructor must accept `name`, `cost`, `effect` (a function), and `targetable` (a boolean, defaulting to `false`).
3. **Play Method**: Implement a `play(player, opponent, target)` method that:
   - Checks if the player has enough mana (`player.mana` >= `this.cost`).
   - Deducts the mana cost.
   - Executes the `effect` function, passing `player`, `opponent`, and `target`.
4. **Targeting Logic**:
   - If `targetable` is `true`, the effect function must validate that a target is provided and is of the correct type (e.g., 'minion').
   - If `targetable` is `false`, the effect function should ignore the target parameter or apply effects globally (e.g., to all minions).
5. **Effect Implementation**: The `effect` function should contain the specific logic for the card (e.g., dealing damage, drawing cards, modifying stats).

# Anti-Patterns
- Do not create separate classes for different card types (e.g., `SpellCard`, `MinionCard`) unless explicitly requested. Use the single `Card` class with the `targetable` flag to distinguish behavior.
- Do not assume external helper functions (like `removeMinion` or `drawCards`) exist without noting them as dependencies.

## Triggers

- create card class javascript
- hearthstone card code
- unified card class
- targetable card logic
- javascript card game engine

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in education →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.