Skills: upload a SKILL.md to create a skill - #274
Merged
Conversation
Covers the route accepting a raw SKILL.md source alongside the existing name/description/body fields, a malformed upload being rejected with a clear message and creating nothing, and the create-skill dialog's upload tab wiring through to that route.
The create dialog only ever accepted paste-in-a-form; uploading a
SKILL.md elsewhere in the product (e.g. Files) landed it as a generic
document instead of a skill. Extend the same create path rather than
building a parallel one: the dialog gains an Upload tab next to Paste,
and the registry's POST /skills route now accepts either the existing
{name, description, body} fields or a raw {source} SKILL.md, parsing
the latter with the same parseSkillMd the registry already uses to
read a skill back. A file that fails to parse is rejected with a
plain-language message and nothing is created.
A skill is still one SKILL.md per asset, so upload is single-file —
no folders, zips, or attachments.
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
SKILL.mdelsewhere in the product landed it as a generic document instead of a skill.POST /api/tenants/:id/skillsnow accepts either the existing{name, description, body, scope}fields or a raw{source, scope}SKILL.md, parsed with the sameparseSkillMdthe registry already uses to read a skill back.create-skill-dialog.tsxgains an Upload tab (Tabs+FileInputfrom@corbits/react-ui, the same compositionAddArtifactDialogalready uses) next to the existing Paste tab.SkillContentErrormessage the paste path already surfaces, and nothing is created.<name>/SKILL.mdper asset today (no attachments/blob table), so upload is deliberately one file — no folders, zips, or bundles.Test plan
packages/skills:bun test(81 pass, incl. 2 new upload-path route tests)apps/web:bun test test/skills-page.test.tsx(12 pass, incl. new upload success + malformed-upload tests, existing paste-path tests unchanged)apps/web:bunx tsc --noEmit,bunx eslinton changed files,bunx prettier --checkon changed filesapps/web: fullbun test(834 pass / 3 pre-existing unrelated failures —test/tailwind-build.test.tsrequires adist/build artifact not present in a fresh worktree)CL-6561