MCPcopy Index your code
hub / github.com/cobusgreyling/loop-engineering / copyTemplateSkill

Function copyTemplateSkill

tools/loop-init/src/cli.ts:118–136  ·  view source on GitHub ↗
(
  templatesRoot: string,
  templateFile: string,
  targetDir: string,
  tool: Tool,
  skillName: string,
  dryRun: boolean,
)

Source from the content-addressed store, hash-verified

116}
117
118async function copyTemplateSkill(
119 templatesRoot: string,
120 templateFile: string,
121 targetDir: string,
122 tool: Tool,
123 skillName: string,
124 dryRun: boolean,
125) {
126 const src = path.join(templatesRoot, templateFile);
127 const destByTool: Record<Tool, string> = {
128 grok: path.join(targetDir, '.grok', 'skills', skillName, 'SKILL.md'),
129 claude: path.join(targetDir, '.claude', 'skills', skillName, 'SKILL.md'),
130 codex: path.join(targetDir, '.codex', 'skills', skillName, 'SKILL.md'),
131 opencode: path.join(targetDir, 'skills', skillName, 'SKILL.md'),
132 };
133 const dest = destByTool[tool];
134 if (await exists(dest)) return;
135 await copyFile(src, dest, dryRun);
136}
137
138async function copyTemplateVerifier(
139 templatesRoot: string,

Callers 3

copyL2TemplatesFunction · 0.85
scaffoldObservabilityFunction · 0.85
scaffoldConstraintsFunction · 0.85

Calls 2

copyFileFunction · 0.85
existsFunction · 0.70

Tested by

no test coverage detected