llm-fighter
CLAUDE.md16 starsChanged 16 months agoMITView on GitHub
LLM Fighter is a platform for evaluating LLM agentic capabilities through strategic combat games. The system consists of: The game engine includes comprehensive validation and error handling. When making changes:
The file
We split this CLAUDE.md into the rules it gives an agent
3 rules. About 0 are common, 3 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 105
Test game logic with various skill combinations
- Distinctive: line 106
Verify violation detection and penalty application
- Distinctive: line 107
Check LLM agent communication and tool usage
≈ “Common” is an estimate: at least 1 in 5 of the 12,729 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Project Overview
LLM Fighter is a platform for evaluating LLM agentic capabilities through strategic combat games. The system consists of:
- Frontend (ui/): React + TypeScript + Vite web application
- Backend (api/): Cloudflare Workers API with D1 database
- Game Engine: Turn-based combat system with skill-based gameplay
Architecture
Frontend Stack
- Framework: React 19 with TypeScript
- Build Tool: Vite with TanStack Router for routing
- Styling: Tailwind CSS with Radix UI components
- State Management: TanStack Query for server state
Backend Stack
- Runtime: Cloudflare Workers with Hono framework
- Database: Cloudflare D1 (SQLite-based)
- API: OpenAPI-compatible endpoints using chanfana
- Auth: GitHub OAuth integration
Game System
- Engine:
ui/src/lib/game/engine.ts- Core game state management and validation - Config:
ui/src/lib/game/config.ts- Game configuration and skill definitions - LLM Interface:
ui/src/lib/game/llm.ts- Agent creation and communication - Runner:
ui/src/lib/game/runner.ts- Battle orchestration
Development Commands
Frontend (ui/)
# Development server (proxies API to production)
npm run dev
# Build for production
npm run build
# Lint code
npm run lint
# Preview production build
npm run previewBackend (api/)
# Development server
npm run dev
# Deploy to Cloudflare
npm run deploy
# Generate types from Wrangler
npm run cf-typegenKey Components
Game Engine (ui/src/lib/game/engine.ts)
- GameEngine class: Manages turn-based combat, validates moves, tracks state
- Skills: quickStrike, heavyBlow, barrier, rejuvenate, ultimateNova, skipTurn
- Violation System: Penalizes invalid moves with turn skips
- Resource Management: HP/MP system with cooldowns and regeneration
LLM Agent System (ui/src/lib/game/llm.ts)
- LLMAgent class: Handles communication with OpenAI-compatible APIs
- Tool System: Uses
thinkinganduseSkilltools for agent interaction - Prompt Generation: Builds detailed game state context for agents
API Endpoints (api/src/endpoints/)
- Game result CRUD operations
- Public game data access
- Authentication-protected user operations
Game Rules Summary
- Resources: 600 HP, 120 MP, +6 MP regeneration per turn
- Skills: Each has MP cost, cooldown, and effects (damage/heal/barrier)
- Violations: Invalid moves result in 3-turn penalties
- Victory: Last agent standing wins
- Barrier Mechanic: 50% damage reduction for one incoming attack
Database Schema
- games: Core game records with configurations and results
- users: GitHub OAuth user accounts
- sessions: Authentication session management
Important Files
ui/src/lib/game/prompts/system-v1.md: Default system prompt for LLM agentsui/src/routes/docs/design.md: Comprehensive system design documentationapi/migrations/: Database schema migrationsapi/wrangler.jsonc: Cloudflare Workers configuration
Testing
The game engine includes comprehensive validation and error handling. When making changes:
- Test game logic with various skill combinations
- Verify violation detection and penalty application
- Check LLM agent communication and tool usage
- Validate API endpoints with authentication flows
Deployment
- Frontend: Built to
ui/dist/and served as Cloudflare Workers assets - Backend: Deployed as Cloudflare Worker with D1 database and KV storage
- Domain: Custom domain configured in wrangler.jsonc
Security Considerations
- API keys are sanitized in agent configurations (replaced with "*")
- GitHub OAuth handles authentication
- Database queries use parameterized statements
- CORS and domain restrictions in place
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

