Foundry Module for DSA to import actors from a PDF
  • JavaScript 92%
  • Handlebars 5.1%
  • CSS 2.5%
  • Nix 0.4%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-04-28 18:51:00 +00:00
.claude fix: correct Vorteile/Nachteile duplication and combatskill field reference 2026-04-11 00:06:59 +02:00
.github/workflows ci: trigger release workflow on GitHub Release publish 2026-04-28 20:48:54 +02:00
.husky chore: add husky pre-commit hook (build, test, lint) and eslint config 2026-04-10 13:10:13 +02:00
docs feat: improve PDF text robustness and item resolution 2026-04-10 20:55:10 +02:00
foundry-data feat: add Docker Foundry dev instance with module bind-mount 2026-04-10 13:10:13 +02:00
languages fix: address 30+ quality issues and bugs across all modules 2026-04-12 18:22:47 +02:00
scripts fix(e2e): address final review issues — page guard, button selector scope, vm-modules flag, comments 2026-04-10 13:10:14 +02:00
src fix: address 30+ quality issues and bugs across all modules 2026-04-12 18:22:47 +02:00
styles fix: display herkunft items in NPC sheet header and add profession text field 2026-04-10 13:10:14 +02:00
templates fix: display herkunft items in NPC sheet header and add profession text field 2026-04-10 13:10:14 +02:00
tests fix: address 30+ quality issues and bugs across all modules 2026-04-12 18:22:47 +02:00
.env.example feat: add Docker Foundry dev instance with module bind-mount 2026-04-10 13:10:13 +02:00
.envrc feat: add dev environment (nix flake, pnpm, vite) 2026-04-10 13:10:13 +02:00
.gitignore chore: ignore coverage/test-results dirs, mark all e2e tasks completed 2026-04-10 13:10:14 +02:00
CLAUDE.md feat: improve PDF text robustness and item resolution 2026-04-10 20:55:10 +02:00
docker-compose.yml feat: complete DSA5 Statblock Importer v0.1.0 2026-04-10 13:10:14 +02:00
eslint.config.js fix: address 30+ quality issues and bugs across all modules 2026-04-12 18:22:47 +02:00
flake.lock feat: add dev environment (nix flake, pnpm, vite) 2026-04-10 13:10:13 +02:00
flake.nix feat: add dev environment (nix flake, pnpm, vite) 2026-04-10 13:10:13 +02:00
LICENSE chore: add Apache 2.0 license 2026-04-10 13:15:18 +02:00
module.json chore: update module.json for release v0.1.0 2026-04-28 18:51:00 +00:00
package.json fix(e2e): address final review issues — page guard, button selector scope, vm-modules flag, comments 2026-04-10 13:10:14 +02:00
playwright.config.js chore: add @playwright/test, playwright.config.js; exclude e2e from vitest 2026-04-10 13:10:14 +02:00
pnpm-lock.yaml chore: add @playwright/test, playwright.config.js; exclude e2e from vitest 2026-04-10 13:10:14 +02:00
README.md Update README to simplify test instructions 2026-04-10 21:05:00 +02:00
vite.config.js chore: add @playwright/test, playwright.config.js; exclude e2e from vitest 2026-04-10 13:10:14 +02:00
vitest.config.js test: add Vitest setup and PDF statblock fixtures 2026-04-10 13:10:13 +02:00

DSA5 Statblock Importer

A Foundry VTT module that imports DSA5 NPC statblocks from PDF text into fully configured actors — attributes, combat skills, talents, special abilities, advantages, disadvantages, weapons, armor, and biography all in one step.

Requires: Foundry VTT v13+ · DSA5 system · German-language DSA5 compendiums

Demo


Features

  • Paste raw statblock text copied from DSA5 adventure PDFs
  • Parses all NPC data: attributes, derived values, weapons, armor, combat techniques, talents, special abilities, advantages, disadvantages, languages, and scripts
  • Fuzzy-matches items against installed DSA5 compendiums (exact → Levenshtein approximate → missing)
  • Review and edit everything before creating the actor
  • Override any compendium match by dragging the correct item into the review dialog
  • Drag Spezies, Kultur, and Profession items from the compendium (or type a free-text profession name)
  • Builds rich GM notes from the fluff and gossip sections of the statblock

Installation

Install via the Foundry module manager using the manifest URL:

https://raw.githubusercontent.com/Semptic/DSA5-Statblock-Importer/main/module.json

Or download the repository and place it in your Data/modules/dsa5-statblock-importer/ directory.


Usage

  1. Open the Actors sidebar in Foundry.
  2. Click the Statblock importieren button at the top.
  3. Paste the statblock text into the three sections:
    • Stats — the attribute/combat block
    • Fluff — background, motivation, appearance
    • Gerüchte — gossip entries (optional)
  4. Click Analysieren. The module parses the text and resolves compendium items.
  5. In the review dialog:
    • Edit attributes or comma-separated lists directly
    • Drag compendium items onto any row to override a match
    • Drag or type Spezies, Kultur, and Profession in the Herkunft section
    • Click Neu analysieren to re-resolve after edits
  6. Click Erstellen to create the actor and open its sheet.

Statblock Format

The importer expects the standard DSA5 statblock layout as found in official Pegasus Press adventures (copy-pasted from PDF). Example:

Swafrieda Eldridsdottir
MU 12 KL 11 IN 12 CH 11
FF 11 GE 12 KO 11 KK 10
LeP 27 AsP– KaP– INI 12+1W6
SK1 ZK 0 AW6 GS8
Waffenlos: AT 10 PA6 TP 1W6 RW kurz
Messer: AT 10 PA4 TP 1W6+1 RWkurz
Kurzbogen: FK 10 LZ1 TP 1W6+4 RW10/50/80
RS/BE 0/0
Sonderfertigkeiten: keine
Vorteile/Nachteile: Schlechte Eigenschaft (Rachsucht)
Talente: Einschüchtern 0, Körperbeherrschung
4, Kraftakt 2, Menschenkenntnis
2, Selbstbeherrschung 2, Sinnesschärfe
4, Überreden 4, Verbergen 3,
Willenskraft 4
Kampfverhalten: Im Kampf zeigt Swafrieda
ein tollkühnes Verhalten.
Flucht: Swafrieda flieht bei drei Stufen
Schmerz.
Schmerz +1 bei: 20 LeP, 14 LeP, 7 LeP, 5 oder weniger LeP

Development

Prerequisites

  • Nix with flakes enabled (provides Node.js 22 + pnpm)
  • Docker (for e2e tests against a local Foundry instance)

Commands

# Install dependencies
nix develop --command pnpm install

# Build
nix develop --command pnpm build

# Unit tests (pure parser logic, no Foundry needed)
nix develop --command pnpm test

# Unit tests with coverage
nix develop --command pnpm test:coverage

# E2e tests (requires Foundry running via docker-compose)
docker-compose up -d
nix develop --command pnpm test:e2e

License

Apache 2.0