MCPcopy Create free account
hub / github.com/Snapchat/Valdi / install

Function install

npm_modules/cli/src/utils/skillsAdapters.ts:104–118  ·  view source on GitHub ↗
(skillName: string, content: string, meta: SkillMeta, resourceDir?: string)

Source from the content-addressed store, hash-verified

102 return fs.existsSync(claudeDir);
103 },
104 install(skillName: string, content: string, meta: SkillMeta, resourceDir?: string) {
105 cleanupLegacyPluginArtifacts();
106 const skillDir = path.join(getClaudeSkillsDir(), skillName);
107 fs.mkdirSync(skillDir, { recursive: true });
108 const frontmatter = `---\nname: ${meta.name}\ndescription: ${meta.description}\n---\n\n`;
109 fs.writeFileSync(path.join(skillDir, 'SKILL.md'), frontmatter + content, 'utf8');
110
111 if (resourceDir) {
112 for (const entry of fs.readdirSync(resourceDir, { withFileTypes: true })) {
113 if (entry.isDirectory()) {
114 copyDirSync(path.join(resourceDir, entry.name), path.join(skillDir, entry.name));
115 }
116 }
117 }
118 },
119 remove(skillName: string) {
120 const skillDir = path.join(getClaudeSkillsDir(), skillName);
121 if (fs.existsSync(skillDir)) {

Callers 3

mainFunction · 0.85
mainFunction · 0.85
valdiCLIRunFunction · 0.85

Calls 7

getClaudeSkillsDirFunction · 0.85
copyDirSyncFunction · 0.85
writeFileSyncMethod · 0.80
cwdMethod · 0.80
joinMethod · 0.45
isDirectoryMethod · 0.45

Tested by

no test coverage detected