MCPcopy
hub / github.com/codeaashu/claude-code / getSkills

Function getSkills

src/commands.ts:355–400  ·  view source on GitHub ↗
(cwd: string)

Source from the content-addressed store, hash-verified

353)
354
355async function getSkills(cwd: string): Promise<{
356 skillDirCommands: Command[]
357 pluginSkills: Command[]
358 bundledSkills: Command[]
359 builtinPluginSkills: Command[]
360}> {
361 try {
362 const [skillDirCommands, pluginSkills] = await Promise.all([
363 getSkillDirCommands(cwd).catch(err => {
364 logError(toError(err))
365 logForDebugging(
366 'Skill directory commands failed to load, continuing without them',
367 )
368 return []
369 }),
370 getPluginSkills().catch(err => {
371 logError(toError(err))
372 logForDebugging('Plugin skills failed to load, continuing without them')
373 return []
374 }),
375 ])
376 // Bundled skills are registered synchronously at startup
377 const bundledSkills = getBundledSkills()
378 // Built-in plugin skills come from enabled built-in plugins
379 const builtinPluginSkills = getBuiltinPluginSkillCommands()
380 logForDebugging(
381 `getSkills returning: ${skillDirCommands.length} skill dir commands, ${pluginSkills.length} plugin skills, ${bundledSkills.length} bundled skills, ${builtinPluginSkills.length} builtin plugin skills`,
382 )
383 return {
384 skillDirCommands,
385 pluginSkills,
386 bundledSkills,
387 builtinPluginSkills,
388 }
389 } catch (err) {
390 // This should never happen since we catch at the Promise level, but defensive
391 logError(toError(err))
392 logForDebugging('Unexpected error in getSkills, returning empty')
393 return {
394 skillDirCommands: [],
395 pluginSkills: [],
396 bundledSkills: [],
397 builtinPluginSkills: [],
398 }
399 }
400}
401
402/* eslint-disable @typescript-eslint/no-require-imports */
403const getWorkflowCommands = feature('WORKFLOW_SCRIPTS')

Callers 1

commands.tsFile · 0.85

Calls 5

toErrorFunction · 0.85
logForDebuggingFunction · 0.85
getBundledSkillsFunction · 0.85
logErrorFunction · 0.50

Tested by

no test coverage detected