Skip to content

Keep installed skill folder name equal to the SKILL.md name - #115

Open
Arda Zeybek (ardazeybek) wants to merge 1 commit into
microsoft:release/0.9.3from
ardazeybek:fix/skill-install-name
Open

Arda Zeybek (ardazeybek) wants to merge 1 commit into
microsoft:release/0.9.3from
ardazeybek:fix/skill-install-name

Conversation

@ardazeybek

Copy link
Copy Markdown

When the install folder already exists, exportSkill writes to <name>-2/ but the frontmatter still says name: <name>. That leaves two skills with the same name in the skills folder, and the Agent Skills spec requires name to match the parent directory name. exportSkillTo (the download path) had the same suffix logic and the same mismatch.

Re-installing after renaming the skill had a related problem: the prior folder was reused whenever it was under the install root, so the new name was written into the old folder (old-name/ with name: new-name).

Changes:

  • Both export paths now share one helper that picks the final folder (with the -N suffix) and renders SKILL.md with that folder name.
  • Reuse of the previous install folder only happens when the skill's name is unchanged since that install; after a rename a fresh folder is created.

Tests: two new cases in electron/skillbuilder/placement.test.ts (collision and rename). Both fail on the base branch and pass now. npm test and npm run typecheck pass. I did not exercise the Electron UI by hand.

One thing I left alone: after a rename the old folder stays in place, since deleting a folder in the user's skills directory felt like a separate decision.

@ardazeybek

Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant