Repository navigation
fix: keep the bundle under 1 MiB and set directory listing links - #89
Merged
Merged
Conversation
The Claude plugin directory reads files only up to 1 MiB as text, so the 1.2 MB bundle held every version for a reviewer as code it couldn't inspect. zod re-exports all of its error-message locales (about 280 KB), and the server only uses English, which zod configures itself. Bundle only the English locale, which brings bundle.js to about 917 KB, and fail the bundle build at 1 MiB so CI catches growth before a release. The directory reads listing links from plugin.json and, without them, guessed a support URL from the README that it then rejected. Set documentationUrl, supportUrl, privacyPolicyUrl, and termsOfServiceUrl, and point the README's support section at the same channels as SUPPORT.md. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
🟢 Approval recommended
The changes consistently address the directory validation findings without introducing unresolved issues.
0 open findings
What changed in this PR
Adds safeguards and metadata needed for Claude plugin directory validation.
Changes:
- Trims unused Zod locales and enforces a 1 MiB bundle limit.
- Adds explicit directory listing URLs.
- Aligns support documentation and tests.
| File | Description |
|---|---|
scripts/build-bundle.mjs |
Keeps only Zod’s English locale and checks bundle size. |
plugin/.claude-plugin/plugin.json |
Adds directory listing URLs. |
plugin/README.md |
Documents bundle limits and support channels. |
src/__tests__/plugin.test.ts |
Validates listing URL presence and HTTPS format. |
CLAUDE.md |
Documents the bundle-size convention. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
With the locked dependencies (zod 4.6.5, MCP SDK 1.32.0), dropping zod's extra locales still left the bundle at 1,062,693 bytes, over the 1 MiB limit, so bundle-compat failed. The SDK's server uses ajv, about 270 KB with its dependencies, only to validate form elicitation responses, and this server never elicits. Replace the SDK's ajv provider with a validator that throws if it is ever used, which brings the bundle to 781,077 bytes. A test checks that the server source doesn't use elicitation. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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
Address two findings from validating the
pluginfolder in the Claude plugin directory portal after #87:scripts/bundle.js(over the 1 MiB read limit)"Bundle under 1 MiB
The bundle was 1,210,603 bytes.
scripts/build-bundle.mjsnow leaves out two parts of the dependencies that the server never uses. It stays unminified and readable.z.locales, but it configures English itself (config(en())), and nothing switches locales. The build replaceszod/v4/locales/index.jswith a module that re-exports onlyen.elicitInputinserver/index.js), and this server never elicits. The build replacesvalidation/ajv-provider.jswith a validator that throws if it is ever used. A new test inplugin.test.tschecks that the server source doesn't use elicitation.With the locked dependencies (zod 4.6.5, MCP SDK 1.32.0), the bundle drops to 781,077 bytes (0.74 MiB). Dropping the locales alone left it at 1,062,693 bytes, still over the limit.
bundle-compatrunsnpm run bundleon every PR, so CI catches dependency growth before a release. If an SDK update moves either replaced file, the bundle grows and this check fails.plugin/scripts/bundle.jsitself isn't committed here. The next release PR regenerates it, so the hold should clear onmainonce that release merges.The pre-submission checklist mentions 256 KiB, but the validator reported a 1 MiB read limit. Staying under 1 MiB should let it read the bundle, which we'll confirm by validating again after the release.
Directory listing links
The directory reads listing links from
plugin.json(manifest reference). Without them, it took a URL out of the README text, backtick included, and rejected it.plugin/.claude-plugin/plugin.jsonnow sets these fields:documentationUrlhttps://github.com/DeployGate/deploygate-agent-plugin#readmesupportUrlhttps://github.com/DeployGate/deploygate-agent-plugin/blob/main/SUPPORT.mdprivacyPolicyUrlhttps://deploygate.com/terms/privacytermsOfServiceUrlhttps://deploygate.com/termsThe privacy and terms URLs match the Codex manifest. The README's support section now matches SUPPORT.md: the Help Center for questions about the service, GitHub Issues for the plugin, and help@deploygate.com for security reports.
Findings left for the reviewer
DEPLOYGATE_API_TOKENin theci-setupreferences and the GitHub Actions templates. They run on the user's CI provider and go to deploygate.com, or to Apple for code signing.KEYCHAIN_PASSWORDis a temporary keychain password that stays on the CI runner.Test plan
npm run build && npm testwith the locked dependencies (484 tests pass)npm run bundleproduces a 781,077-byte bundle, andscripts/smoke-bundle.mjspasses (58 tools)upload_appwith invalid arguments on the trimmed bundle returns zod's English validation messagesclaude plugin validate ./pluginpasses🤖 Generated with Claude Code