Skip to content

fix(skills): resolve code review issues — migration guard, config safety, type cleanup#280

Open
mykolanehrych wants to merge 2 commits into
codemie-ai:mainfrom
mykolanehrych:EPMCDME-11906_fix_setup_skills_profile
Open

fix(skills): resolve code review issues — migration guard, config safety, type cleanup#280
mykolanehrych wants to merge 2 commits into
codemie-ai:mainfrom
mykolanehrych:EPMCDME-11906_fix_setup_skills_profile

Conversation

@mykolanehrych
Copy link
Copy Markdown
Contributor

@mykolanehrych mykolanehrych commented May 5, 2026

EPMCDME-11906, EPMCDME-11925

Summary

  1. Moved skills and assistants from per-profile to top-level config (migration 004)
  2. Updated skill directory slugs to a unique format with project and scope suffix (migration 005)
  3. Auto-sync registered skills on agent startup

Spec

skills-assistants-top-level.md

QA Guide

qa-migration-skills-assistants.md

@mykolanehrych mykolanehrych force-pushed the EPMCDME-11906_fix_setup_skills_profile branch from d2ac7a8 to 082b3e9 Compare May 5, 2026 17:57
- Add `codemie setup skills` CLI command for interactive skill registration
- Migrate codemieSkills/codemieAssistants to top-level config (migration 004)
- Add skill slug format migration with project/scope suffix (migration 005)
- Add unique slug generation in claude-skill-generator
- Extract shared selection UI and helpers from assistants/skills setup
- Fix assistant summary display and setup API alignment
- Add auto-sync on agent startup with setup disclaimer

Generated with AI

Co-Authored-By: codemie-ai <codemie.ai@gmail.com>
@mykolanehrych mykolanehrych force-pushed the EPMCDME-11906_fix_setup_skills_profile branch from 082b3e9 to df066c9 Compare May 5, 2026 18:06
@mykolanehrych mykolanehrych changed the title fix(skills): resolve code review issues — migration guard, config safety, type cleanup fix(skills): resolve code review issues — migration guard, config safety, type cleanup May 5, 2026
await ConfigLoader.saveProfile(profileName, config);
configLocation = `global (~/.codemie/codemie-cli.config.json)`;
}
const configLocation = storageScope === 'local'
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks like this is not the right place for getting the config location.
I suggest it to be moved somewhere to config class so it's reusable.
Also I suggest the storage scopes to be an emum

*/
function generateName(skill: SkillDetail): string {
const baseName = skill.name.toLowerCase()
.replace(/[^a-z0-9]+/g, '-')
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I suggest we move teh regexps to constants.
That way we can understand what they do by the constant name

const base = baseName || skill.id.toLowerCase().replace(/[^a-z0-9]+/g, '-');

const projectSuffix = skill.project
? `-${skill.project.toLowerCase().replace(/[^a-z0-9]+/g, '-').replace(/^-+|-+$/g, '')}`
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Or event better - let's move them to separate functions, e.x. sanitazeSkillName or smth

await ConfigLoader.saveSkillsToProjectConfig(workingDir, storageScope, updatedSkills);

const configLocation = storageScope === 'local'
? `${workingDir}/.codemie/codemie-cli.config.json`
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Duplicate code for fetching the config location

);
if (hasProfileLevelSkills && !globalConfig.codemieSkills?.length) {
throw new Error(
'005-skill-slug-format migration requires migration 004 (move-skills-to-top-level) to have run first. ' +
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is there a way we can save the applied migrations so we don't have to do the manual checks? Smth like alembic so we store the last migration id or smth.

Also I suggest investigating the already existing libaries, maybe there is some that can fit here.
https://github.com/sequelize/umzug that I found bit haven't used so not sure

Comment thread src/utils/config.ts
if (config.profiles[profileName]) {
config.profiles[profileName].codemieSkills = skills;
if (scope === 'global') {
const config = await this.loadMultiProviderConfig();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

How about we do the loadProviderConfig(scope) function and then let it take the globa/local logic, maybe use subfunctions? So we don't have to do if scope === else ... every time

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.

2 participants