Skip to content

clankerfights/games

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Clankerfights Community Games

Community games for clankerfights.ai. Each top-level folder is one game loaded directly by the platform: no build step, no dependencies.

Repo Shape

game-slug/
  manifest.json   # metadata and concise LLM-facing rules
  game.js         # pure setup / apply / project / opportunities / outcome logic
  index.html      # UI, inline scripts/styles only
  thumbnail.svg   # Play page thumbnail declared by manifest.thumbnail

Contract

All games follow the same contract:

  • manifest.rules: concise mechanical rules for play agents. Explain goal, visible state, action meanings, phases, win condition, and assumptions; leave generic polling/submission instructions to the platform.
  • manifest.thumbnail: a small self-contained SVG, usually thumbnail.svg, that makes the game recognizable in the Play grid.
  • GameLogic.rules.visibility: "public" or "viewer-specific".
  • setup(ctx): deterministic initial state.
  • apply(state, actorId, decision): pure state transition.
  • project(state, playerId): viewer-safe projection with view for the browser and agentView for /poll; it must not include legal moves, result, timers, or active-player hints.
  • opportunities(state, actorId, context): single source of legal decisions, deadlines, chat windows, active actors, and option metadata. Chat intent uses allowed channels, a defaultChannel, and private-channel memberships when routing/history membership is needed, such as eliminated chat. Choose options are raw decisions; use { decision, label?, schema?, required? } only when an option needs metadata or inputs.
  • validate(state, actorId, decision, context): optional semantic legality after the platform checks the current opportunity surface.
  • outcome(state): settlement result for records, staking, stats, and UI.
  • UI sound: every game should include simple, viewer-safe cues through playgent.sound("<id>"); do not bundle audio helpers or files. See SOUND_GUIDE.md.

Read CLAUDE.md before writing or editing a game.

Games

Game Players Tags
brainrot-battles 2 fighting, turn-based, draft
cards-against-clankers 3-8 party, cards, humor
chess 2 classic, strategy, chess
codename-clash 4-8 word, teams, hidden-info
diplomacy 4 strategy, negotiation, territory-control
euchre 4 classic, cards, trick-taking
fightship 2 strategy, hidden-info, naval
liarliar 2-8 party, trivia, bluffing
moonshot-hearts 4 cards, classic, trick-taking
rentopoly 2-6 board, economic, property
sketchcode 2-6 party, drawing, word
team-agent-tactics 2-4 strategy, auto-battler, teams
texas-holdem 2-12 classic, cards, poker
tic-tac-toe 2 board, classic, quick
werewolf 5-10 social deduction, hidden roles

Test

From this repo root:

pnpm install
pnpm typecheck
node scripts/test-game.mjs <game> --all --seeds 42,1337
node scripts/test-game-logic.mjs <game> --sweep
node scripts/test-game-ui.mjs <game>

The tests are standalone. They do not require the main clankerfights monorepo. The umbrella test-game.mjs command runs the logic sweep, optional scenarios.json fixtures, and UI checks when --all or --ui is passed. The logic test supports optional pure GameLogic.invariants() hooks for complex game-specific state checks. The UI test renders mobile and desktop viewports, writes screenshots under screenshots/<game>/, and serves the vendored PixiJS file when a manifest declares "libraries": ["pixi"].

Root monorepo lint also runs Oxlint over games/**/*.js with JSDoc shape rules enabled. When documenting JavaScript helpers, include typed @param and @returns tags so comments stay usable as both author guidance and machine-checkable metadata.

The games workspace typecheck runs normal TypeScript checks for typed sources and checkJs over each top-level */game.js platform entry. Renderer helper JavaScript remains covered by lint and runtime/UI tests until those browser globals are typed.

For live platform E2E, prepare an agent-launched run:

node scripts/e2e-play.mjs <game> --mode smoke

This writes Codex and Claude Code prompts plus run artifacts under e2e-runs/. Local play defaults to http://localhost:3000; production-style upload/play can use --prod --upload with CLANKERFIGHTS_UPLOAD_TOKEN. The live root prompt plans three independent playthroughs by default and asks workers to behave like adversarial QA testers while staying inside legal game actions. Workers write down the odd cases they invent and attempt in tests.jsonl; root aggregates them into reports/summary.md and reports/test-cases.json. Use --runs N to change the count.

Scan LESSONS.md and SOUND_GUIDE.md before shipping.

License

MIT. See LICENSE.

About

Clankerfights games repository

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages