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.
JavaScript 3d3d-assets3d-modelingagent-skillsagent-toolsai-agentsasset-pipelinecligame-assetsglbgltfmcpmcp-servermodel-context-protocolprocedural-generationprocedural-modelingtext-to-3dthreejstypescript
fix(test): measure skill front matter independently of line endings
Matt Kissinger348cb9debbb3
diff --git a/.gitattributes b/.gitattributesindex ad1bbc84..3486c885 100644--- a/.gitattributes+++ b/.gitattributes@@ -1,5 +1,15 @@# Normalize line endings to LF for all text; let Git detect text vs binary.+#+# This alone is not enough: a file written with CRLF by a tool after checkout+# stays CRLF in the working copy, and anything measuring file content then gets+# a different answer locally than on a fresh LF checkout. That is how the skill+# front-matter budget in src/__tests__/mcp-payload.test.ts first failed on CI+# while passing here. That test now normalizes before it measures.* text=auto eol=lfbun.lock -diff linguist-generated=true*.png binary+*.gif binary*.glb binary+*.webp binary+*.tgz binary+*.ico binarydiff --git a/README.md b/README.mdindex 763640a8..b073e492 100644--- a/README.md+++ b/README.md@@ -257,7 +257,7 @@ does not re-emit the first nine.What sits in context permanently is small, and it is measured rather than asserted. The seven toolschemas derive to 15,839 characters of JSON Schema, call it four thousand tokens. The five skills-advertise themselves in 1,698 characters of front matter, four hundred more; their bodies come to+advertise themselves in 1,692 characters of front matter, four hundred more; their bodies come toabout eight thousand tokens between them and load only when one of them actually fires. Everythingelse a model would otherwise have to be told about building an asset lives in the engine, where itis executed rather than read.diff --git a/src/__tests__/mcp-payload.test.ts b/src/__tests__/mcp-payload.test.tsindex a5f103ea..d47cf5dd 100644--- a/src/__tests__/mcp-payload.test.ts+++ b/src/__tests__/mcp-payload.test.ts@@ -129,8 +129,14 @@ describe('always-on context cost', () => {let total = 0;let count = 0;for (const name of await readdir(dir)) {- const md = await readFile(join(dir, name, 'SKILL.md'), 'utf8');- const fm = /^---\r?\n([\s\S]*?)\r?\n---/.exec(md);+ // Normalize before measuring. The count is a claim about how much a+ // skill says about itself, and that must not change with whoever checked+ // the tree out: a CRLF working copy counts one extra character per line+ // and disagrees with CI, which is exactly how this assertion first+ // failed. `.gitattributes` keeps the tree LF; this keeps the measurement+ // honest even where it is not.+ const md = (await readFile(join(dir, name, 'SKILL.md'), 'utf8')).replace(/\r\n/g, '\n');+ const fm = /^---\n([\s\S]*?)\n---/.exec(md);if (!fm) throw new Error(`skills/${name}/SKILL.md has no front matter`);total += fm[1]!.length;count++;