Skip to content

docs: document external dependency support in extension models#456

Merged
stack72 merged 1 commit intomainfrom
docs/extension-model-external-deps
Feb 24, 2026
Merged

docs: document external dependency support in extension models#456
stack72 merged 1 commit intomainfrom
docs/extension-model-external-deps

Conversation

@stack72
Copy link
Copy Markdown
Contributor

@stack72 stack72 commented Feb 24, 2026

Summary

  • Document that extension models support all Deno-compatible imports (npm:, jsr:, https://), not just npm:zod@4
  • Add a verified lodash-es example showing npm package usage in a model
  • Explain how the bundling pipeline works (auto-bundle, mtime cache, zod externalization)
  • Add import rules table covering all supported specifiers

Context

PR #452 embedded the deno runtime and added deno bundle for extension model
transpilation. 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 instanceof checks with swamp).

However, the swamp-extension-model skill only documented
import { z } from "npm:zod@4" as the sole import, giving the impression that
no 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.md

.claude/skills/swamp-extension-model/references/examples.md

  • Added "Using External Dependencies" section with:
    • A complete, verified lodash-es text analyzer model example
    • "How bundling works" explanation (deno bundle, mtime cache, zod externalization)
    • Import rules table showing what gets bundled vs externalized
  • Updated table of contents with correct anchor link

Test plan

  • Verify the lodash-es example bundles: deno bundle --external npm:zod@4 --external npm:zod --platform deno -o /tmp/test.js extensions/models/text_analyzer.ts
  • Verify skill SKILL.md link to #using-external-dependencies resolves correctly
  • Review that SKILL.md stays lean (detail in references, per skill-creator guidelines)

🤖 Generated with Claude Code

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.
@stack72 stack72 force-pushed the docs/extension-model-external-deps branch from 9e11a50 to 1ae945b Compare February 24, 2026 23:36
Copy link
Copy Markdown

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-es text analyzer example
    • Clear bundling mechanics explanation (mtime cache, zod externalization)
    • Import rules table showing what gets bundled vs externalized

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.

@stack72 stack72 merged commit 31c12b2 into main Feb 24, 2026
3 checks passed
@stack72 stack72 deleted the docs/extension-model-external-deps branch February 24, 2026 23:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant