fix: use SKILL.md name as skill directory name instead of server slug - #144
Merged
Conversation
…slug When skills are fetched via HTTP, the server-provided skill_slug was used as the directory name, but the SKILL.md frontmatter name field could differ, making the skill unrecognizable. Now installSkillZip reads the SKILL.md name after extraction and renames the directory accordingly, with a _slug-map.json to support uninstall-by-slug lookup. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
5 tasks
jeff-r2026
added a commit
that referenced
this pull request
Jul 8, 2026
…r slug (#162) * fix(local-agent): name HTTP-synced skills by SKILL.md name, not server slug When skills are delivered over the HTTP local-agent path, the directory was named after the server-provided skill_slug. But the SKILL.md `name:` frontmatter is what the AI tool uses to identify a skill, and the two can differ — so a skill synced as slug "skillsaaa" landed at ~/.codebuddy/skills/skillsaaa and was unrecognizable. The git-native path already fixed this in skill-command.ts (#144); this brings the HTTP path (local-agent.ts) in line. - resolveSkillDirName() reads the SKILL.md name after extraction and uses it as the on-disk directory name when it differs from the slug, passing path-safety validation; falls back to the slug when the name is missing/equal/unsafe. - The manifest records dir_name (keyed by slug) so uninstall_skill can locate and remove the SKILL.md-name directory when the backend only knows the slug. Not a regression from #161 — verified by building the prior internal release and reproducing identical slug-based naming; this is a pre-existing gap in the HTTP path since it was introduced. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * test(local-agent): wrap zip body in Buffer for BodyInit type compat CI's @types/node types `zipSync`'s return as `Uint8Array<ArrayBufferLike>`, which is not assignable to `BodyInit` in `new Response(...)`. Wrap it in `Buffer.from()` (a valid BodyInit) so `tsc --noEmit` passes across type versions. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
4 tasks
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
installSkillZip()现在读取 SKILL.md frontmatter 的name:字段,当其与服务端skill_slug不同时,将安装目录重命名为 SKILL.md 中的名称_slug-map.json映射文件(slug → 实际目录名),支持uninstall_skill按 slug 正确查找被重命名的目录Test plan
installSkillZip测试覆盖:slug/name 不匹配重命名、无 name 降级、不安全 name 降级、重装清理executeSkillCommand测试覆盖 slug map uninstall🤖 Generated with Claude Code