add-dependency
Add a third-party library to Lodestone - pinned to an exact version, verified by hash, license-checked and documented. Use whenever new code needs a library that isn't fetched yet.
SKILL.md.claude/skills/add-dependency/SKILL.md
GitHubAdd a Dependency
- Check the license - only permissive licenses are allowed: MIT, BSD, zlib, Apache 2.0, public domain or CC0. Anything else needs the user's decision first (see
AGENTS.md). Checkdocs/TechStack.md#libraries- the library may already be planned, with a chosen version policy. - Pick an exact version - a release tag, or a specific commit when releases are stale (as for sol2). Never a branch.
- Hash the archive - download the release archive (GitHub:
https://github.com/<owner>/<repo>/archive/refs/tags/<tag>.tar.gz, or.../archive/<commit>.tar.gz) into an empty scratch directory, and compute its SHA256 (sha256sum, orGet-FileHashon Windows). If the project publishes checksums, compare against them. - Declare it in
cmake/Dependencies.cmake:
and add it to# <name> - <what it's for> (<license>) ls_declare_dependency(<name> URL <archive URL> SHA256 <hash> ) set(<OPTION> <value> CACHE BOOL "" FORCE) # turn off the dependency's tests, examples and install rulesFetchContent_MakeAvailable(). If it has no CMake build, define its target afterFetchContent_MakeAvailable(), as Lua's is. - Respect the layering - link it only to the targets that need it.
LodestoneCoremust never link GLFW, nvrhi, miniaudio or anything that needs a window, GPU or audio device (docs/Architecture.md#targets-and-layering). - Document it - add the library, version, license, purpose and whether it ships in exported games to
THIRD_PARTY_LICENSES.md, with the full license text from the archive. Add it todocs/TechStack.md#librariesif it isn't listed. - Test it - build every configuration on your platform and run the tests (
build-and-testskill). CI checks the other platforms. If the library throws exceptions, catch them where Lodestone calls it and returnstd::expectederrors (docs/CodeStyle.md#error-handling).