Markdown Converter
Agent skill for markdown-converter
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Sign in to like and favorite skills
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Build and check commands:
cargo check - Fast syntax and type checkingcargo build - Full compilationcargo run - Build and run the server (starts on port 3001)cargo test - Run unit and integration testscargo clippy - Lint checking with clippycargo fmt - Format code with rustfmtThe server runs on
http://localhost:3001 with API endpoints at /api/v1/ and WebSocket at /ws.
This is a real-time multiplayer game life tracking API built with Rust and Axum. The application supports Magic: The Gathering style games where players track life totals in real-time.
Database Layer (
src/database.rs):
Models (
src/models.rs):
Game, Player, LifeChangeWebSocket System (
src/websocket.rs):
HTTP Handlers (
src/handlers.rs):
Application State (
src/state.rs):
Dual Interface Design: Both HTTP REST API and WebSocket for different use cases
External Authentication: Uses Clerk for user management (clerk_user_id field)
Real-time State Sync: WebSocket connections automatically broadcast state changes
Game Lifecycle Management:
Detailed protocol documented in
WEBSOCKET_PROTOCOL.md. Key message types:
Connection requires
game_id and clerk_user_id query parameters.
Three main tables with foreign key relationships:
games: Core game information and lifecycle stateplayers: Player participation in games with current lifelife_changes: Audit trail of all life modificationsUses UUIDs for all primary keys and Chrono for timestamps.