fix(registry): extract skill content from ZIP archive#22
Merged
Conversation
…file The .skill file is a ZIP archive containing SKILL.md, but the announce endpoint was reading the ZIP binary as UTF-8 text and regex-matching for YAML frontmatter. This always failed, storing content as null. Now uses AdmZip to extract SKILL.md from the archive before parsing.
Move ZIP extraction + frontmatter body parsing from inline route handler into extractSkillContent() utility with 9 unit tests covering nested/root SKILL.md, edge cases (CRLF, no frontmatter, empty body), and error resilience (corrupted ZIP).
JoeCardoso13
approved these changes
Feb 26, 2026
Contributor
JoeCardoso13
left a comment
There was a problem hiding this comment.
Clean fix — correct root cause, minimal diff, good test coverage.
Minor nitpicks (non-blocking):
- Observability — When
extractSkillContent()returnsundefined, the route handler proceeds silently. Alog.warnwould help debug content extraction failures in production. - Robustness — The frontmatter regex (
[\s\S]*?non-greedy) could mismatch if YAML content contains a literal\n---\nline. Unlikely in practice; same regex as before, so not a regression. - Test coverage — No test for deeply nested paths (e.g.,
a/b/c/SKILL.md). TheendsWithlogic handles it, but it's undocumented by tests. - Error handling — The
try/catchinextractSkillContentonly wraps theAdmZipconstructor, butgetData()can also throw. Consider widening it to cover the full function body so thestring | undefinedreturn contract holds. The route handler's outertry/catchprevents any real damage.
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
.skillfiles are ZIP archives containingSKILL.md, but the announce endpoint was reading the ZIP binary as raw UTF-8 text and regex-matching for YAML frontmatter — which always failed silently, storingcontentasnull/skills/@nimblebraininc/upjack-app-builder) only showed tags/metadata with no skill body contentAdmZip(already a dependency) to extractSKILL.mdfrom the archive before parsing frontmatterTest plan
pnpm typecheckandpnpm testpass (65/65 tests passing locally)upjack-app-builder) and verify the API returns non-nullcontent