[5541] fix(frontend): Fix skill description parsing and bundled file editing - #5564
Conversation
…dled-file editors Uploading a skill package with a folded YAML description showed the literal ">-" in the Description field, and edits made just before switching bundled files were dropped by the shared editor's 300 ms debounce. - Parse SKILL.md frontmatter with js-yaml; accept name/description only as strings, and fall back to the body alone on invalid YAML. - Key the bundled-file editor by selected index and disable its debounce so a file switch cannot cancel a pending edit or leak undo history. - Cover the parser table in unit tests and the full upload flow in a new Playwright acceptance spec with an in-memory zip fixture. Claude-Session: https://claude.ai/code/session_017pBNyrqbAFZhWG9WTQ9siv
|
@coderabbitai review |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (7)
💤 Files with no reviewable changes (1)
📝 WalkthroughSummary by CodeRabbit
WalkthroughSkill uploads now parse YAML frontmatter with ChangesSkill upload reliability
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
✅ Action performedReview finished.
|
Railway Preview Environment
|
Context
Uploading a complete skill package (a
SKILL.mdplus resource files) broke in two ways (#5541). A folded YAML description showed up as the literal>-in the Description field, because the old parser read a single line with a regex. And text typed into a bundled file was silently lost when you clicked another file within 300 ms, because the shared editor's debounce throws away its pending value when the selection changes underneath it.Changes
parseSkillMarkdownnow parses the frontmatter withjs-yaml. It acceptsnameanddescriptiononly when YAML returns strings, trims them, and treats invalid YAML as "no metadata" while keeping the Markdown body.Before, this frontmatter
put
>-in the Description field. After, the field shows "Run the agent release gate. Use it before a release."The bundled-file editor in
SkillFormViewis now keyed by the selected file index, so every file gets a fresh editor instance and undo history cannot bleed across files. It also gets a newdisableDebounceprop on the localCodeEditor, passed through to the shared editor, so keystrokes reach form state immediately and a file switch cannot cancel a pending edit.@agenta/uiis unchanged (the underlyingSharedEditorImplalready supports the prop), and the only otherCodeEditorconsumer keeps the 300 ms default.Known tradeoffs: leaving a file drops that editor's cursor, scroll, and undo history (the content is kept). And a
SKILL.mdwhose frontmatter is invalid YAML as a whole (for example an unquoteddescription: Use when: needed) now loses both fields instead of salvaging individual lines; the body is preserved and the fields stay editable by hand.Tests
tests/unit/skillUpload.test.ts. 280 package tests, typecheck, build, and lint pass.acceptance/agent-skills/skill-folder-upload.spec.ts: uploads an in-memory zip, asserts the folded description, per-file content isolation, the type-then-switch race, and save/reopen. Passed against a live EE dev stack.agent-release-gatepackage: rapid file switching, fast typing followed by an immediate switch, a 5,000-character insertion, a path rename (no editor remount), file removal returning toSKILL.md, and layout checks at 1440x900 and 1024x768.What to QA
SKILL.mdusesdescription: >-across several lines. The Description field shows the folded sentence, not>-.Closes #5541
https://claude.ai/code/session_017pBNyrqbAFZhWG9WTQ9siv