Skip to content

armgit / kiln

Public Imported from GitHub
0

Build and revise procedural 3D assets with your coding agent. Local MCP server, CLI and TypeScript engine with rendered review, editable source and GLB export.

docs(skills): explain optional SDK install for generated workspaces (#179)

Matt Kissinger4d896d02b1a2
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 7851a2d3..946161a8 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -15,6 +15,11 @@ does not publish a package.
and units, and that all are advisory. `DELIVERY_COLLIDER_NO_OVERLAP` is
collider-to-geometry overlap, not contact between colliders
([#199](https://github.com/instruktlabs/kiln/issues/199)).
+- Document optional SDK setup for generated workspaces. The compose and QA integration
+ references gain an "Optional SDK use" paragraph: a workspace has no `package.json`, so
+ `@instruktlabs/kiln/render` and `/composer` fail with `ERR_MODULE_NOT_FOUND` until the
+ author installs `@instruktlabs/kiln` pinned to the runtime version in use; CLI/MCP-only
+ authoring is unchanged ([#179](https://github.com/instruktlabs/kiln/issues/179)).
## 1.4.0 (2026-10-23)
diff --git a/docs/sdk.md b/docs/sdk.md
index b97fc904..91be545a 100644
--- a/docs/sdk.md
+++ b/docs/sdk.md
@@ -3,6 +3,9 @@
This describes the v1 package contract. Examples use `@instruktlabs/kiln`; install
a published version or a qualified local archive as described in the
[installation guide](install.md). Use documentation matching the installed version.
+A workspace made by `kiln-init` has no `package.json`, so `import '@instruktlabs/kiln/render'`
+fails there until you install the package pinned to the Kiln runtime version you use; CLI/MCP
+authoring does not need it.
## Imports
diff --git a/skills/kiln-compose-scene/references/composition-api.md b/skills/kiln-compose-scene/references/composition-api.md
index 6de569aa..8cb178c5 100644
--- a/skills/kiln-compose-scene/references/composition-api.md
+++ b/skills/kiln-compose-scene/references/composition-api.md
@@ -27,3 +27,7 @@ Call `inspectGlbIntegration(bytes)` for actual bounds and integration metadata.
`findOverlaps(boxes, options)` returns candidate AABB intersections; `isOverlapFree` returns a boolean, and `summarizeOverlaps(violations)` formats findings. Options select `mode: 'footprint'` (default, ignores Y) or `'volume'`, with optional tolerance. Use world-space boxes and stable instance IDs. Footprint checks are insufficient for stacked or overhead objects.
The simpler `worldAabbFromLocal` path assumes uniform scale and Y rotation. For arbitrary rotated/nonuniform placements, compute world bounds from all eight local corners with the full transform rather than forcing that shape into a narrower helper.
+
+## Optional SDK use
+
+SDK composition is optional; CLI/MCP-only authoring never needs it. A generated workspace has no `package.json`, so a script that imports `@instruktlabs/kiln/render` or `@instruktlabs/kiln/composer` fails with `ERR_MODULE_NOT_FOUND` until the author installs the package in the workspace (or another project that script runs from): `npm install @instruktlabs/kiln@<version>`, pinned to the Kiln runtime in use. Read that version from `kiln --version` when it exists, from the `serverInfo.version` the MCP server reports, or from the `version` in the `package.json` beside the `dist/` folder holding the `dist/mcp-server.mjs` the MCP config names; `npm ls @instruktlabs/kiln` shows an existing install. Import only the public subpaths above; do not guess files under `dist/` or `lib/`.
diff --git a/skills/kiln-qa-asset/references/integration-checks.md b/skills/kiln-qa-asset/references/integration-checks.md
index 8d3271b2..38ee2313 100644
--- a/skills/kiln-qa-asset/references/integration-checks.md
+++ b/skills/kiln-qa-asset/references/integration-checks.md
@@ -6,6 +6,10 @@ These library APIs run in the destination project's TypeScript toolchain, not in
Kiln authors metres, +X forward, +Y up, +Z right. Confirm importer conversion in the destination. Ground correction must be applied in the frame it describes, especially under rotated/scaled parents. Bounds alone cannot prove that feet, wheels, or collision geometry make the intended contact.
+## Optional SDK use
+
+Library checks are optional; CLI/MCP-only QA never needs them. A generated workspace has no `package.json`, so a script importing `@instruktlabs/kiln/render` fails with `ERR_MODULE_NOT_FOUND` until the package is installed where the script runs: `npm install @instruktlabs/kiln@<version>`, pinned to the Kiln runtime in use. Take the version from `kiln --version` when it exists, the MCP server's `serverInfo.version`, or the `version` in the `package.json` beside the `dist/` folder holding the `dist/mcp-server.mjs` the MCP config names; `npm ls @instruktlabs/kiln` shows an existing install. Import only documented public subpaths, never guessed `dist/` or `lib/` files.
+
## Host-declared checks
Before authoring, read `kiln_discover({ capabilities: true })`. When
diff --git a/src/__tests__/skill-resources.test.ts b/src/__tests__/skill-resources.test.ts
index a57e37a9..58c6bd0b 100644
--- a/src/__tests__/skill-resources.test.ts
+++ b/src/__tests__/skill-resources.test.ts
@@ -47,3 +47,26 @@ it('builds the shipped reusable frame and updates its attachment through one par
expect(nearAfter.position.toArray()).toEqual(nearBefore.position.toArray());
expect(nearAfter.getObjectByName('Joint_TopAttachment')!.position.y).toBe(2.6);
});
+
+// A generated workspace has no package.json, so the public SDK subpaths named in the
+// optional compose and QA references do not resolve until the author installs the
+// package (#179). The guidance must stay optional, pinned, and limited to real exports.
+it.each([
+ 'kiln-compose-scene/references/composition-api.md',
+ 'kiln-qa-asset/references/integration-checks.md',
+])('explains the optional pinned SDK install in %s using only exported subpaths', (name) => {
+ const text = readFileSync(resolve(skillRoot, name), 'utf8');
+ const section = text.match(/^## Optional SDK use\n([\s\S]*?)(?=^## |(?![\s\S]))/m)?.[1] ?? '';
+ expect(section).toContain('package.json');
+ expect(section).toContain('ERR_MODULE_NOT_FOUND');
+ expect(section).toContain('npm install @instruktlabs/kiln@<version>');
+ expect(section).toMatch(/CLI\/MCP/);
+ expect(section).toMatch(/serverInfo|npm ls/);
+ const exported = Object.keys(
+ JSON.parse(readFileSync(resolve(skillRoot, '../package.json'), 'utf8')).exports,
+ ).map((key) => `@instruktlabs/kiln${key.slice(1)}`);
+ for (const match of text.matchAll(/@instruktlabs\/kiln(?:\/[a-z][\w-]*)+/g)) {
+ expect(exported).toContain(match[0]);
+ }
+ expect(text).not.toMatch(/dist\/index\.m?js/);
+});