gwillish/dhmodels
This is a Swift Package built to support creating tools for the TTRPG Daggerheart.
What's inside
DHModels
Pure value types (structs and enums) that model Daggerheart catalog and encounter data.
DHKit — @Observable stores
@MainActor observable classes for UI integration. Depends on DHModels and swift-log.
validate-dhpack — CLI tool
Command-line tool that validates one or more .dhpack files against the DHPackContent decoder and reports pass/fail:
swift run validate-dhpack my-pack.dhpackContent packs
Community and homebrew content is distributed as .dhpack files — plain JSON containing adversaries, environments, or both.
The JSON Schema for .dhpack is at schemas/dhpack.schema.json. Add "$schema" to your pack file to enable validation and autocomplete in VS Code:
{
"$schema": "https://cdn.jsdelivr.net/gh/gwillish/DHModels@main/schemas/dhpack.schema.json",
"adversaries": [ ... ]
}Use validate-dhpack to check a pack file against the decoder:
swift run validate-dhpack my-pack.dhpackA complete field reference is in docs/dhpack-format.md.
Adding to your project
// Package.swift
.package(url: "https://github.com/gwillish/DHModels.git", from: "0.2.0"),
// Apple-platform app target
.product(name: "DHKit", package: "DHModels"),
// Linux / server target (models only)
.product(name: "DHModels", package: "DHModels"),Building and testing
# Build both library targets
swift build
# Run all tests
swift test
# Model tests only
swift test --filter DHModelsTestsSee CLAUDE.md for the full development guide.
License & Attribution
The DHModels package source code is licensed under the MIT License.
This package bundles adversary and environment data from the Daggerheart System Reference Document 1.0, used under the Darrington Press Community Gaming License (DPCGL):
This product includes materials from the Daggerheart System Reference Document 1.0, © Critical Role, LLC. under the terms of the Darrington Press Community Gaming (DPCGL) License. More information can be found at https://www.daggerheart.com. There are no previous modifications by others.
Full DPCGL license text: https://darringtonpress.com/license/
This project is not affiliated with, endorsed by, or sponsored by Darrington Press, LLC or Critical Role, LLC. Daggerheart is a trademark of Critical Role, LLC.
Package Metadata
Repository: gwillish/dhmodels
Default branch: main
README: README.md