docs: document external dependency support in extension models#456
Merged
docs: document external dependency support in extension models#456
Conversation
The extension model skill only mentioned importing zod, but the bundler (introduced in PR #452) resolves all Deno-compatible imports — npm:, jsr:, and https:// URLs. This was undocumented, so users (and Claude) had no guidance on using external packages in their models. Add a 'Using External Dependencies' section to the examples reference with: - A verified lodash-es example showing npm: imports in action - How bundling works (deno bundle, mtime cache, zod externalization) - Import rules table covering all supported specifiers Update SKILL.md Key Rules to mention external imports are supported, linking to the reference for details. Keeps SKILL.md lean per skill-creator guidelines.
9e11a50 to
1ae945b
Compare
There was a problem hiding this comment.
Review: Approved ✅
This is a clean documentation PR that adds valuable information about external dependency support in extension models.
Changes Reviewed
- SKILL.md: Updated Key Rules #2 to mention
npm:,jsr:,https://imports with link to examples - examples.md: Added comprehensive "Using External Dependencies" section with:
- Complete, verified
lodash-estext analyzer example - Clear bundling mechanics explanation (mtime cache, zod externalization)
- Import rules table showing what gets bundled vs externalized
- Complete, verified
Assessment
- ✅ Documentation is well-organized and follows existing patterns
- ✅ Example code follows model structure conventions
- ✅ Table of contents properly updated
- ✅ Follows skill-creator guidelines (detail in references, SKILL.md stays lean)
- ✅ No blocking issues
No changes required. Good documentation improvement that clarifies import capabilities for extension model authors.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
npm:,jsr:,https://), not justnpm:zod@4lodash-esexample showing npm package usage in a modelContext
PR #452 embedded the deno runtime and added
deno bundlefor extension modeltranspilation. This made it possible for extension models to use any npm (or
jsr/https) dependency — the bundler resolves and inlines everything except zod
(which is externalized to share
instanceofchecks with swamp).However, the
swamp-extension-modelskill only documentedimport { z } from "npm:zod@4"as the sole import, giving the impression thatno other dependencies were available. Users and Claude had no guidance on how to
bring in external packages.
All three import specifiers were tested against the actual bundler:
npm:lodash-es— bundles (298KB, 641 modules)jsr:@std/path— bundles (8.8KB, 73 modules)https://deno.land/std@0.224.0/async/delay.ts— bundles (1.2KB, 2 modules)Changes
.claude/skills/swamp-extension-model/SKILL.mdnpm:,jsr:,https://imports with alink to the examples reference
.claude/skills/swamp-extension-model/references/examples.mdlodash-estext analyzer model exampleTest plan
deno bundle --external npm:zod@4 --external npm:zod --platform deno -o /tmp/test.js extensions/models/text_analyzer.ts#using-external-dependenciesresolves correctly🤖 Generated with Claude Code