MCPcopy Create free account
hub / github.com/Zoo-Code-Org/Zoo-Code / getSkillsForMode

Method getSkillsForMode

src/services/skills/SkillsManager.ts:184–209  ·  view source on GitHub ↗

* Get skills available for the current mode. * Resolves overrides: project > global, mode-specific > generic. * * @param currentMode - The current mode slug (e.g., 'code', 'architect')

(currentMode: string)

Source from the content-addressed store, hash-verified

182 * @param currentMode - The current mode slug (e.g., 'code', 'architect')
183 */
184 getSkillsForMode(currentMode: string): SkillMetadata[] {
185 const resolvedSkills = new Map<string, SkillMetadata>()
186
187 for (const skill of this.skills.values()) {
188 // Check if skill is available in current mode:
189 // - modeSlugs undefined or empty = available in all modes ("Any mode")
190 // - modeSlugs array with values = available only if currentMode is in the array
191 const isAvailableInMode = this.isSkillAvailableInMode(skill, currentMode)
192 if (!isAvailableInMode) continue
193
194 const existingSkill = resolvedSkills.get(skill.name)
195
196 if (!existingSkill) {
197 resolvedSkills.set(skill.name, skill)
198 continue
199 }
200
201 // Apply override rules
202 const shouldOverride = this.shouldOverrideSkill(existingSkill, skill)
203 if (shouldOverride) {
204 resolvedSkills.set(skill.name, skill)
205 }
206 }
207
208 return Array.from(resolvedSkills.values())
209 }
210
211 /**
212 * Check if a skill is available in the given mode.

Callers 5

getSkillContentMethod · 0.95
executeMethod · 0.80
getDiscoveredCommandsFunction · 0.80
getSkillsSectionFunction · 0.80

Calls 5

shouldOverrideSkillMethod · 0.95
fromMethod · 0.80
getMethod · 0.65
setMethod · 0.65

Tested by

no test coverage detected