ink-playing-cardslisted
Install: claude install-skill gfargo/skills
# ink-playing-cards v1.0.0
React component library for terminal-based card games with Ink 6 (React 19 for CLIs). Provides UI components, hooks, contexts, and game systems.
```bash
npm install ink-playing-cards
# deps: ink ^6.0.0, react ^19.0.0 — requires Node >= 20
```
## Architecture
All state flows through `DeckProvider` (React context + `useReducer`). Zones are immutable `TCard[]` arrays. The `useDeck` hook wraps dispatch.
```text
DeckProvider
├── zones.deck: TCard[]
├── zones.hands: Record<string, TCard[]>
├── zones.discardPile: TCard[]
├── zones.playArea: TCard[]
├── players: string[]
├── eventManager / effectManager
└── dispatch(DeckAction)
```
## Quick Start
```tsx
import React from 'react'
import { render, Box, Text, useInput } from 'ink'
import { DeckProvider, useDeck, useHand, CardStack } from 'ink-playing-cards'
const Game = () => {
const { deck, shuffle, draw } = useDeck()
const { hand, playCard, discard } = useHand('player1')
React.useEffect(() => { shuffle(); draw(5, 'player1') }, [])
useInput((input) => { if (input === 'd') draw(1, 'player1') })
return (
<Box flexDirection="column">
<Text>Deck: {deck.length}</Text>
<CardStack cards={hand} name="Hand" isFaceUp maxDisplay={5} />
</Box>
)
}
render(<DeckProvider><Game /></DeckProvider>)
```
## Types
```ts
type TCard = CardProps | CustomCardProps // every card has a unique `id`
type BaseCardProps = {
id: string; effects?: CardEffect[]; faceUp?: boolean; selected?: boo