Imported from meekmachine/embody (
AGENTS.md). Install upstream withnpx skills add meekmachine/embody. Copyright stays with the author.
Embody contributor instructions
Source-only repository
- Commit Rust, TypeScript, configuration, tests, and documentation. Do not commit
dist/,target/,node_modules/, npm tarballs,.wasmbinaries, or other generated output. - Run
npm run check:generatedbefore committing. CI runs the same deterministic tracked-file guard. - Treat
Cargo.lockandpackage-lock.jsonas source-controlled dependency inputs; update them intentionally when dependencies change.
Build and package contract
- Install with
npm ci, then usenpm run buildto generate the complete package indist/. A clean checkout has nodist/directory. - Build before
npm testornpm run typecheck: the public loader is typed from the wasm-bindgen declarations generated indist/wasm/. Rebuild after changing Rust exports; do not commit or hand-maintain a copy of those signatures. - Build once per source SHA. After the build, use
npm run test:packageto validate the existing output; package checks and publishing lifecycle scripts must never invoke another build. npm run test:exports,npm run test:pack,npm run check:dist,prepack, andprepublishOnlyare consumers of the existingdist/. If one reports missing output, runnpm run buildexplicitly rather than adding a hidden rebuild.- Never restore
dist/from a cache. npm and Cargo caches accelerate dependency downloads and compiler intermediates only; they are not package artifacts or a source of truth.
CI and immutable previews
.github/workflows/pr-checks.ymlis the only build/publish workflow. Its single job installs once, tests Rust, builds the Rust/Wasm and JavaScript package once, tests TypeScript against the generated bindings, validates that output, then publishes that exact output to pkg.pr.new.- Non-draft pull requests publish a preview whose install URL includes the Embody commit SHA. Main pushes, manual dispatches, and
publish-pkg-pr-newrepository dispatches publish the checked-out SHA without creating a PR comment. - Keep preview dependencies immutable: use the pkg.pr.new URL containing the full requested commit SHA. Do not use mutable branch URLs and do not make downstream repositories install Embody from a Git/codeload dependency, because Git installs would need Rust/Wasm build tooling.
Coordinating Polymer changes
- Open the Embody PR and wait for its
Verify built packagejob to publish the SHA preview. - In the dependent Polymer branch, set the Embody dependency to the exact pkg.pr.new SHA URL printed by Embody CI. Commit Polymer's lockfile update with that temporary preview pin.
- Build and publish Polymer from its own CI; LoomLarge should consume Polymer's immutable preview, not compile Embody transitively.
- Merge in dependency order: Embody first, then replace Polymer's preview URL with the intended stable Embody release/version before Polymer's stable release, then update LoomLarge.
- For staging or production coordination that needs an older/main SHA republished, send repository dispatch event
publish-pkg-pr-newwithclient_payload.sha, or run the workflow manually withref. Always pass a concrete commit SHA when another repository will consume the result.