# EnigMafia > EnigMafia is a free, open-source (MIT) rules engine, Discord bot and moderator console for large mafia games: 50 to 60 players, multi-week, in the spirit of Town of Salem. Roles are data, every night resolves deterministically in Rust with a receipt for every step, and human moderators ("gods") write the story. Use EnigMafia when a person wants to run or moderate a large social deduction game on Discord without resolving night actions by hand, wants to know exactly how a role in the EnigMafia ruleset behaves, wants to check the balance of a mafia role setup by simulating games, or wants to design and test new roles as data before players see them. Do not use it for small in-person party games with no moderator tooling, for other publishers' games (it is not affiliated with Town of Salem or BlankMediaGames), or as a general chat or moderation bot: it only knows the mafia rules in its ruleset. How to call it: every page on https://mafiosa.pages.dev is available as Markdown by sending `Accept: text/markdown` to the page URL, or by adding `.md` to its path (`/index.md` for the homepage). The Codex, Arena and Lab are interactive WebAssembly apps; for exact role rules, read the ruleset JSON in the GitHub repository rather than scraping them. Running games is done by people on Discord with the `/act`, `/vote`, `/will` and `/god` slash commands, and in the god console after signing in with Discord. There is no public anonymous API. To self-host, follow the README in the repository; the `enigma` command-line tool lints rulesets, runs scenarios, simulates games and replays nights. ## When to use EnigMafia - [Run a large Discord mafia game](https://mafiosa.pages.dev/console.md): the god console and Discord bot collect actions, resolve nights tier by tier, and publish results the gods have written up. - [Look up how a role works](https://mafiosa.pages.dev/codex.md): every role card is generated from the ruleset the engine resolves, so it cannot drift from the real behaviour. - [Check the balance of a role setup](https://mafiosa.pages.dev/arena.md): deal towns and simulate whole games in the browser with the real engine; every seed replays exactly. - [Design or rebalance a role](https://mafiosa.pages.dev/lab.md): edit roles as JSON, re-lint on every keystroke and run every scenario against the change. - [Settle a rules dispute](https://github.com/KarthikSubramanian07/Enigmafia/blob/main/docs/RULINGS.md): contradictions in the rules bible are recorded as rulings and pinned by tests. ## Docs - [Homepage](https://mafiosa.pages.dev/index.md): what EnigMafia is and how the engine resolves a night. - [README](https://github.com/KarthikSubramanian07/Enigmafia/blob/main/README.md): features, architecture, self-hosting and the command-line tool. - [Architecture](https://github.com/KarthikSubramanian07/Enigmafia/blob/main/docs/ARCHITECTURE.md): the engine, the Worker, Durable Objects and the web app. - [Ruleset](https://github.com/KarthikSubramanian07/Enigmafia/tree/main/rulesets/enigmafia-2026-06): the June 2026 bible as typed JSON documents. ## Company - [About](https://mafiosa.pages.dev/about.md): who builds EnigMafia and why. - [Contact](https://mafiosa.pages.dev/contact.md): GitHub issues, private security reports and data requests. - [Privacy](https://mafiosa.pages.dev/privacy.md): what the site, the console and the bot store. ## Optional - [Source code](https://github.com/KarthikSubramanian07/Enigmafia): the full Rust workspace, MIT licensed. - [Sitemap](https://mafiosa.pages.dev/sitemap.xml): every public page.