feat(publish): allow uploading a skill folder directly - #757
Merged
Merged
Conversation
Publishing required a hand-made .zip. Local agent skills live as folders, and repackaging them by hand often smuggles in tool metadata (__MACOSX/, .DS_Store, ...) that clutters the package (#737). Add an "upload a folder" option to the publish dropzone: pick a folder (webkitdirectory), and the browser packages it into a clean STORE-method zip via a dependency-free writer, dropping VCS/build/OS junk (.git/, node_modules/, __pycache__/, .DS_Store, ...). The resulting zip flows through the exact same upload/publish path, and the server already strips a single root directory, so paths are preserved as-is. Packaging (folder-zip.ts) is isolated and unit-tested (CRC-32 vectors, zip structure, junk filtering); the UploadZone gains an optional onFolderSelect prop so existing callers are unaffected. Closes #737 Signed-off-by: FenjuFu <92919259+FenjuFu@users.noreply.github.com>
FenjuFu
force-pushed
the
feat/folder-upload
branch
from
August 25, 2026 12:16
198a907 to
0fbc55f
Compare
Signed-off-by: XiaoSeS <87064762+XiaoSeS@users.noreply.github.com>
XiaoSeS
force-pushed
the
feat/folder-upload
branch
from
August 26, 2026 09:25
647d77b to
e1c18e8
Compare
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.
What
Let publishers upload a skill folder directly, instead of hand-zipping it first — closes #737.
Why
Publishing only accepted a
.zip. Skills on disk (and every local agent skill) are folders, and the "zip it up first" step routinely smuggles in tool/OS metadata (__MACOSX/,.DS_Store, …) that bloats the package and the file-count limit.How
webkitdirectory) hands the raw files to the publish flow, which packages them client-side into a clean.zipand feeds it into the existing upload path — no new endpoint, same validation.folder-zip.tsis a small dependency-free ZIP writer (STORE method + CRC-32). Skill packages are small text files, so STORE keeps this free of any new npm dependency. It drops VCS/build/OS junk (.git/,.svn/,.hg/,node_modules/,__pycache__/,.DS_Store,._*,Thumbs.db, …) that a real on-disk folder carries.my-skill/SKILL.md); the server already strips a single root directory (SkillPackageArchiveExtractor.stripSingleRootDirectory) and ignores OS-metadata entries, so the archive lands exactly like a hand-made zip.Scope / safety
UploadZonegains an optionalonFolderSelectprop; existing usage is unchanged and the drag-a-zip path is untouched.webkitdirectory/directoryattributes are set imperatively (via a ref effect) to avoid an untyped JSX cast.folder-zip.tsand unit-tested (folder-zip.test.ts): CRC-32 against known ISO-HDLC vectors, local/central/EOCD ZIP structure, junk filtering, and the empty-folder error.enandzh.Closes #737