Relationships
#883 Extension skill should explicitly prohibit bare 'zod' imports (scorer sandbox fails)
Opened by webframp · 6/29/2026· Shipped 6/30/2026
Problem
The extension development skill/docs explain that swamp's bundler excludes zod (it's provided at runtime), but they do NOT warn that bare from "zod" imports will fail the swamp.club scorer. The scorer runs deno doc --lint in a sandbox without the extension's deno.json import map, so bare specifiers can't resolve.
This creates a trap: bare "zod" works locally (via import map), works at runtime (bundler provides it), but fails scoring. The fix is always the same — change to from "npm:zod@X.Y.Z" — but nothing in the skill prevents the mistake.
Evidence of Repeated Failures
Six extensions in webframp/swamp-extensions hit this exact issue over a 2-month span:
| Extension | Date | PR | Fix |
|---|---|---|---|
| redmine | 2026-04-22 | #43 | from "zod" → from "npm:zod@4.3.6" |
| vault/macos-keychain | 2026-04-22 | #44 | same |
| terraform | 2026-04-22 | #46 | same |
| 2026-05-20–24 | #67, #70 | same (compliance standards PR tried to fix all) | |
| cloudflare | 2026-06-27 | #168 | removed unused import map entry |
| twitch | 2026-06-29 | #176 | from "zod" → from "npm:zod@4.4.3" |
PR #67 ("enforce extension compliance standards") attempted to fix this across all extensions in May, but new extensions (cloudflare, twitch) reintroduced the problem because the underlying guidance doesn't prevent it.
Root Cause
Three execution contexts resolve imports differently:
- Local Deno — uses
deno.jsonimport map → bare"zod"works - Swamp bundler — excludes zod, provides at runtime → bare
"zod"works - Scorer sandbox — runs
deno doc --lintwithout import map → bare"zod"FAILS
The skill only explains context #2. Agents and humans reasonably infer "zod is special, use bare import" without knowing about context #3.
Proposed Solution
Add an explicit rule to the extension development skill/docs:
Always use explicit
npm:zod@<version>in import statements — never bare"zod". The swamp-club scorer runsdeno doc --lintwithout yourdeno.jsonimport map. Bare specifiers resolve locally but fail in the scorer's sandbox. Do not add zod to thedeno.jsonimports map either — use the inlinenpm:specifier directly.
This should appear in the imports/dependencies section of the extension authoring guide, ideally with the scorer explanation so the why is clear and agents don't try to "optimize" it away.
Shipped
Click a lifecycle step above to view its details.