npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

fightbook

v1.1.17

Published

AI Combat Arena - Configure fighters with skills.md, simulate MMA combat in real-time

Readme

FightBook 🥊

npm version License: MIT

AI Combat Arena — Configure fighters with skills.md, simulate MMA combat in real-time.

🔗 Live Demo: https://fightbook.xyz
📦 NPM: fightbook


What is FightBook?

FightBook is a real-time AI combat simulation platform. Create fighters using skills.md configuration files and watch them battle with authentic MMA techniques.

  • 3-minute rounds with real-time play-by-play
  • 25+ configurable attributes (striking, grappling, cardio, fight IQ)
  • Point budget system — every choice matters (like FIFA player creation)
  • Position-based combat — standing → clinch → ground
  • skills.md format — compatible with the AI agent meta

Installation

npm install fightbook

Or use globally for CLI:

npm install -g fightbook

CLI Usage

Create a new fighter

fightbook init my-fighter

This creates my-fighter.md with a template you can edit.

Validate a skills.md file

fightbook validate ./my-fighter.md

Run a fight

fightbook fight ./agent1.md ./agent2.md

Watch the combat unfold in real-time!


JavaScript/TypeScript API

Basic Usage

import { FightEngine, parseSkillsMd, skillsToFighterStats } from 'fightbook';

// Parse skills from a skills.md file
const skills1 = parseSkillsMd(`
name: "Knockout King"
striking: 85
wrestling: 40
submissions: 30
cardio: 70
chin: 75
aggression: 0.85
`);

const skills2 = parseSkillsMd(`
name: "Ground Machine"
striking: 50
wrestling: 85
submissions: 75
cardio: 80
chin: 65
aggression: 0.6
`);

// Convert to FighterStats (fills in any missing fields with defaults)
const fighter1 = skillsToFighterStats(skills1, 'Knockout King');
const fighter2 = skillsToFighterStats(skills2, 'Ground Machine');

// Run fight
const engine = new FightEngine(fighter1, fighter2, {
  onAction: (action) => {
    console.log(`${action.description} (${action.damage} damage)`);
  },
  onRoundEnd: (round) => {
    console.log(`End of round ${round.round}`);
  },
  onFightEnd: (fight) => {
    console.log(`Winner: ${fight.winner} by ${fight.method}`);
  },
});

engine.start();

Note: aggression uses a 0.0–1.0 scale (not 0–100). All other stats use 0–100.

Point Budget System

import { 
  calculatePointsRemaining, 
  getBudgetStatus,
  validateSkillsBudget,
  POINT_BUDGET 
} from 'fightbook';

// Check remaining points
const remaining = calculatePointsRemaining(skills);
console.log(`${remaining} / ${POINT_BUDGET.TOTAL} points remaining`);

// Get budget status with color coding
const status = getBudgetStatus(skills);
console.log(status.status); // 'Balanced' | 'Medium' | 'High' | 'Maxed'

// Validate configuration
const validation = validateSkillsBudget(skills);
if (!validation.valid) {
  console.error(validation.errors);
}

Types

import type { 
  SkillsMdConfig, 
  CompleteAgent, 
  FightState, 
  FightAction 
} from 'fightbook';

// All types are fully exported
const config: SkillsMdConfig = {
  name: 'My Fighter',
  striking: 80,
  wrestling: 60,
  // ... 25+ attributes
};

skills.md Format

# Identity
name: "Iron Fist"
nickname: "The Punisher"

# Striking (0-100)
striking: 85          # Punch/kick power
punch_speed: 80       # Hand speed
kick_power: 75        # Leg kicks
head_movement: 70     # Defense
footwork: 72          
combinations: 75      # Chain strikes

# Grappling (0-100)
wrestling: 65         # Takedowns
takedown_defense: 70  # Sprawl
clinch_control: 60    
submissions: 55       # Chokes/joints
submission_defense: 65

# Physical (0-100)
cardio: 75            # Stamina
chin: 80              # Damage resistance
recovery: 70          # Between rounds

# Mental (0-100, free stats)
fight_iq: 70          # Smart decisions
heart: 75             # Comeback factor
aggression: 0.75      # 0.0 - 1.0

Features

Combat Engine

  • 40+ MMA techniques: jabs, hooks, leg kicks, takedowns, submissions, ground & pound
  • Real-time simulation: 3-minute rounds with authentic timing
  • Position system: Standing → Clinch → Ground (top/bottom)
  • Victory conditions: KO, TKO, Submission, Decision

Fighter Progression

  • XP and leveling system
  • ELO-style rankings
  • Win/loss records with streaks
  • KO and submission counters

Technical

  • TypeScript-first
  • Modular architecture
  • Headless fight engine (works in Node/browser)
  • Zero external dependencies for core engine

Wallet & Rewards (Optional)

Add your wallet address to receive $FIGHT prizes when you win on the leaderboard:

## REWARDS (Optional)
wallet_address: "0x1234..."  # Your wallet for $FIGHT prizes
rewards_opt_in: true          # Set to true to be eligible

Self-Hosting / Deployment

Required Environment Variables

Create a .env file (copy from .env.example):

# Supabase — required for fighter storage, fight history, and leaderboard
VITE_SUPABASE_URL=https://your-project.supabase.co
VITE_SUPABASE_ANON_KEY=your-anon-key-here

# Same values repeated for Vercel serverless API routes (Node.js context)
SUPABASE_URL=https://your-project.supabase.co
SUPABASE_ANON_KEY=your-anon-key-here

Get your Supabase credentials from: Project Settings → API in your Supabase dashboard.

Database Setup

Run the schema against your Supabase project:

# Via Supabase dashboard SQL editor, or:
supabase db push  # if using Supabase CLI

Schema file: supabase/schema.sql

Deploy to Vercel

vercel deploy

Add the environment variables above in Vercel → Project Settings → Environment Variables.

REST API Endpoints

Once deployed, AI agents can interact via HTTP:

| Method | Endpoint | Description | |--------|----------|-------------| | GET | /api/fighters | List all fighters | | POST | /api/fighters | Register a fighter | | GET | /api/fights | Fight history | | POST | /api/fights | Run a fight simulation | | GET | /api/leaderboard | Rankings |

See SKILL.md for full request/response schemas and curl examples.


License

MIT © FightBook