Skip to content

Upload skill bundles - #536

Open
FBalint wants to merge 8 commits into
skills-hierarchical-listfrom
skills-upload
Open

FBalint wants to merge 8 commits into
skills-hierarchical-listfrom
skills-upload

Conversation

@FBalint

@FBalint FBalint commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

Stacked on #504.

Adds support for uploading skill bundles (directories containing a SKILL.md manifest and supporting files) into the skills navigator.


Devin Review

@github-actions github-actions Bot added the gatekeeper Changes to a gatekeeper integration label Sep 21, 2026
@github-actions

Copy link
Copy Markdown

Preview: pr536-skills-upload

https://pr536-skills-upload-router.cloudflare-os-previews.workers.dev

Dashboard · deleted when this PR closes

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 3 potential issues.

Devin Review

Comment thread packages/gatekeeper-context/app/skills/UploadSkillsDialog.tsx
Comment on lines +143 to +149
collectionDocuments.push({
path: location.path,
name: "SKILL.md",
description: candidate.description.trim(),
contentType: "text/markdown",
lastUpdated: new Date(),
});

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Failed uploads reserve unused names

When createContextSkill fails, its path remains reserved in collectionDocuments. Later same-name candidates receive unnecessary suffixes despite the free destination.

Learn more

The local document list prevents candidates in one batch from choosing the same directory. It is updated before the server confirms creation, so a rejected candidate still occupies its computed directory for every later candidate in that batch.

Example: Two selected files both resolve to deployment-check. The first exceeds the server's document-size limit and fails. The second succeeds as deployment-check-2, although deployment-check was never created.

Recommended fix: Add the synthetic summary to collectionDocuments only after createContextSkill succeeds. Keep existing server conflict handling for destinations occupied by stale or concurrent data.

Devin Review


Was this helpful? React with 👍 or 👎 to provide feedback.

Comment on lines +151 to +176
try {
await context.createContextSkill(collectionId, location.path, {
description: candidate.description.trim(),
body: writeSkillUploadMetadata(
candidate.manifestBody,
location.name,
candidate.description,
),
contentType: "text/markdown",
});
} catch (error) {
nextFailures.push(`${candidate.label}: ${error instanceof Error ? error.message : "upload failed"}`);
continue;
}
created++;

const supportResults: PromiseSettledResult<void>[] = [];
for (let index = 0; index < candidate.supportingFiles.length; index += 6) {
const batch = candidate.supportingFiles.slice(index, index + 6);
supportResults.push(...await Promise.allSettled(batch.map((file) => (
context.putContextDocument(collectionId, `${location.directory}/${file.path}`, {
description: extractDescription(file.contentType, file.body) ?? "",
body: file.body,
contentType: file.contentType,
})
))));

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔍 Bundle upload remains non-atomic

Manifest creation and support writes use separate RPCs. The documented partial-upload state remains until a transactional bundle RPC replaces this sequence.

Devin Review


Was this helpful? React with 👍 or 👎 to provide feedback.

@ask-bonk

ask-bonk Bot commented Sep 21, 2026

Copy link
Copy Markdown

@FBalint Bonk workflow failed. Check the logs for details.

View workflow run · To retry, trigger Bonk again.

@ask-bonk

ask-bonk Bot commented Sep 21, 2026 •

Copy link
Copy Markdown

@maxwellpeterson Bonk workflow failed. Check the logs for details.

View workflow run · To retry, trigger Bonk again.

@FBalint
FBalint added this pull request to stack #538 September 21, 2026 11:01
): string => {
const { frontmatter, content } = splitFrontmatter(body);
let document = frontmatter === null ? new Document({}) : parseDocument(frontmatter);
if (document.errors.length > 0 || !isMap(document.contents)) document = new Document({});

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: Preserve Markdown mistaken for invalid frontmatter

splitFrontmatter() recognizes any leading pair of --- lines. For a valid standalone Markdown file that uses those as thematic rules, YAML can parse the captured instructions as a non-map, and this reset then silently discards everything between the rules. The upload reports success, but the stored SKILL.md is missing that content. When converting loose Markdown, retain the invalid/non-map block as Markdown content (or reject the file) rather than dropping it.

Comment on lines +46 to +49
if (options.inferUnknownBinary && pathContentType === "text/markdown" && !hasMarkdownExtension) {
if (file.type) {
contentType = file.type;
body = isTextContentType(contentType) ? await file.text() : await fileToBase64(file);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: Keep uploaded MIME compatible with the path-derived editor

This branch can store an unknown extension such as asset.bin as application/octet-stream with a base64 body, but DocumentEditor ignores the stored type and derives text/markdown from the path. Opening and saving that support file therefore treats the base64 as literal Markdown and rewrites its content type, so agents no longer receive the original binary data URI. The previous generic uploader explicitly stayed path-derived for this reason. Either the editor needs to honor the stored contentType end-to-end, or this upload path must use encoding compatible with contentTypeFromPath().

@ask-bonk

ask-bonk Bot commented Sep 21, 2026

Copy link
Copy Markdown

Submitted 2 actionable inline findings.

github run

@ask-bonk

ask-bonk Bot commented Sep 23, 2026

Copy link
Copy Markdown

LGTM!

github run

@ask-bonk

ask-bonk Bot commented Sep 23, 2026

Copy link
Copy Markdown

LGTM!

github run

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gatekeeper Changes to a gatekeeper integration

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant