MCPcopy
hub / github.com/Fission-AI/OpenSpec / getToolSkillStatus

Function getToolSkillStatus

src/core/shared/tool-detection.ts:87–108  ·  view source on GitHub ↗
(projectRoot: string, toolId: string)

Source from the content-addressed store, hash-verified

85 * Checks which skill files exist for a tool.
86 */
87export function getToolSkillStatus(projectRoot: string, toolId: string): ToolSkillStatus {
88 const tool = AI_TOOLS.find((t) => t.value === toolId);
89 if (!tool?.skillsDir) {
90 return { configured: false, fullyConfigured: false, skillCount: 0 };
91 }
92
93 const skillsDir = path.join(projectRoot, tool.skillsDir, 'skills');
94 let skillCount = 0;
95
96 for (const skillName of SKILL_NAMES) {
97 const skillFile = path.join(skillsDir, skillName, 'SKILL.md');
98 if (fs.existsSync(skillFile)) {
99 skillCount++;
100 }
101 }
102
103 return {
104 configured: skillCount > 0,
105 fullyConfigured: skillCount === SKILL_NAMES.length,
106 skillCount,
107 };
108}
109
110/**
111 * Gets the skill status for all tools with skillsDir configured.

Callers 4

getToolStatesFunction · 0.85
getToolVersionStatusFunction · 0.85
getConfiguredToolsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected