ai-devkit icon indicating copy to clipboard operation
ai-devkit copied to clipboard

addSkill() crashes when skills is an object with registries field

Open codeaholicguy opened this issue 7 months ago • 1 comments

When .ai-devkit.json has registries configured in the nested format:

{
  "skills": {
    "registries": {
      "custom/repo": "https://github.com/custom/repo.git"
    }
  }
}

Running ai-devkit skill add fails because addSkill() in Config.ts assumes config.skills is always an array:

const skills = config.skills || [];
skills.some(...) // crashes — .some() doesn't exist on plain objects

Root cause: getSkillRegistries() handles both array and object shapes, but addSkill() does not. The DevKitConfig type only defines skills?: ConfigSkill[], ignoring the object-with-registries shape.

Expected: Installing a skill should work regardless of whether skills is an array or an object with a registries field.

codeaholicguy avatar Apr 15 '26 17:04 codeaholicguy

Fixed in https://github.com/codeaholicguy/ai-devkit/commit/afb847a3a2d2d4497ead5b6249f82a33f59c6943

codeaholicguy avatar Apr 15 '26 17:04 codeaholicguy