diff --git a/docs/image/sublibrary-graph.svg b/docs/image/sublibrary-graph.svg
new file mode 100644
index 00000000..7e7fe2d9
--- /dev/null
+++ b/docs/image/sublibrary-graph.svg
@@ -0,0 +1,79 @@
+
+
+
+
+
diff --git a/scripts/render-sublibrary-dependencies.sh b/scripts/render-sublibrary-dependencies.sh
new file mode 100755
index 00000000..13c5dc91
--- /dev/null
+++ b/scripts/render-sublibrary-dependencies.sh
@@ -0,0 +1,19 @@
+#!/bin/bash -ex
+
+SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
+cd $SCRIPT_DIR/..
+
+# First, install cabal-plan:
+#
+# cabal install cabal-plan
+
+
+# If the swarm.cabal file has changed, you may need to remove
+# the 'plan.json' file from the cache and regenerate.
+#
+# Note that "rm -f dist-newstyle/cache/plan.json" is insufficient;
+# we need remove the whole cache:
+rm -r dist-newstyle/cache
+cabal build
+
+cabal-plan --hide-global --hide-builtin dot --tred --root swarm | twopi -Tsvg -o docs/image/sublibrary-graph.svg
\ No newline at end of file
diff --git a/swarm.cabal b/swarm.cabal
index 166206f1..082455bf 100644
--- a/swarm.cabal
+++ b/swarm.cabal
@@ -22,8 +22,7 @@ description: Swarm is a 2D programming and resource gathering
* swarm TUI
* swarm app
- To maintain this separation, inner layers should avoid introducing
- dependencies on layers above them.
+ <>
license: BSD-3-Clause
license-file: LICENSE
@@ -39,6 +38,7 @@ extra-source-files: CHANGELOG.md
editors/vscode/syntaxes/*.json
editors/vim/*.vim
editors/vim/*.lua
+extra-doc-files: docs/image/sublibrary-graph.svg
data-dir: data/
data-files: *.yaml, worlds/*.world, scenarios/**/*.yaml, scenarios/**/*.txt, scenarios/**/*.sw, *.txt, test/language-snippets/**/*.sw