Forcing AI to narrate, not decide.
AI-powered narrative solo RPG engine. You write the action. Dice determine outcomes. AI writes the world. NPCs remember you, threats and clocks advance on their own, stories have structure.
The AI is the narrator — constrained by mechanics, handed its facts by the engine, never in control of the rules. Config-driven, provider-independent, screen reader accessible.
git clone https://github.com/aradix85/straightjacket.git
cd straightjacket
python run.pyCreates a venv, installs dependencies, downloads any game data file that is missing from data/, starts the server at http://localhost:8081. Set your API key(s) as environment variables: each provider under ai.providers in config.yaml names its variable in api_key_env. On startup the server checks that every configured model is offered by its provider and stops with a clear message if one is not.
You type what your character does. An AI classifier reads it and picks the move and stat, choosing only from the moves the engine allows in that situation. The engine rolls the dice and applies every mechanical consequence. An AI narrator writes the scene within those constraints. The AI never rolls, never decides whether an action succeeds, never moves resources, and never controls the player character. That's the straightjacket.
Not everything is engine-decided yet: docs/divergences.md lists what the narrator still invents where a system could decide, each with the roadmap step that takes it over.
Mechanics drawn from Ironsworn/Starforged (action rolls, momentum, bonds), Mythic GME 2e (chaos factor, scene structure, random events), the Adventure Crafter (plot structure and turning points), and Blades in the Dark (position & effect, clocks).
Text-in, text-out, and built for screen readers from the start by a blind developer: accessibility is structural, not cosmetic. ARCHITECTURE.md describes how the interface does it.
- ARCHITECTURE.md — the core idea, turn pipeline, code map, state, configuration, interface
- CONTRIBUTING.md — workflow, project rules, code standards, testing
- docs/ai.md, docs/mechanics.md, docs/settings.md, docs/divergences.md, docs/elvira.md — the AI layer, the game mechanics, settings and character creation, deliberate departures from the source rulebooks and the design document, and the test player Elvira
- ORIGINS.md — where the project comes from, and credits
- SECURITY.md — API key handling, input sanitization, session model
- CHANGELOG.md — release log since September 2026; earlier releases are in git history
- roadmap.md — internal working doc: what gets built next, and in what order
- AUDIT.md — internal working doc: how the codebase is audited against its principles
- Narrative RPG Engine design document — the theoretical concept this project puts into practice, published on itch.io
The engine code is AGPL-3.0.
Game data ships under its own licenses, separate from the engine code:
Datasworn rulesets in data/. The Ironsworn, Ironsworn: Delve, and Ironsworn: Starforged content (classic.json, delve.json, starforged.json) is by Shawn Tomkin, used under CC BY 4.0 — the subset Tomkin Press has placed under the commercial-permissive license. The Sundered Isles content (sundered_isles.json) is by Shawn Tomkin, used under CC BY-NC-SA 4.0 — non-commercial, share-alike. Source: Datasworn by rsek. Tomkin Press licensing details: tomkinpress.com/pages/licensing.
Mythic and Crafter content in data/. The Mythic GME 2e content (mythic_gme_2e.json) and Adventure Crafter content (adventure_crafter.json) are based on works by Tana Pigeon, published by Word Mill Games, and licensed for use under CC BY-NC 4.0. See wordmillgames.com/license.html for the full terms — the license covers text only, not art or trade dress, and prohibits commercial use.
Mechanics also referenced in the engine, not redistributed as data: Blades in the Dark by John Harper (position & effect, clocks); the AIMS framework by Gnome Stew (Agenda, Instinct, Moves, Secrets). See ORIGINS.md for full credits.
Note on the engine license. The AGPL-3.0 license on the engine code does not override the non-commercial clauses on sundered_isles.json, mythic_gme_2e.json, and adventure_crafter.json. Anyone redistributing this repository commercially must remove or replace those files first.