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

Function copyTemplateVerifier

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

Source from the content-addressed store, hash-verified

136}
137
138async function copyTemplateVerifier(
139 templatesRoot: string,
140 targetDir: string,
141 tool: Tool,
142 dryRun: boolean,
143) {
144 const verifierPaths: Record<Tool, string> = {
145 grok: path.join(targetDir, '.grok', 'skills', 'loop-verifier', 'SKILL.md'),
146 claude: path.join(targetDir, '.claude', 'agents', 'loop-verifier.md'),
147 codex: path.join(targetDir, '.codex', 'agents', 'verifier.toml'),
148 opencode: path.join(targetDir, 'skills', 'loop-verifier', 'SKILL.md'),
149 };
150 const dest = verifierPaths[tool];
151 if (await exists(dest)) return;
152
153 if (tool === 'codex') {
154 const src = path.join(templatesRoot, 'SKILL.md.verifier');
155 const body = await readFile(src, 'utf8');
156 const toml = `name = "loop-verifier"\ndescription = "Independent verification agent for loop-produced changes."\n\n[system_prompt]\ncontent = """\n${body}\n"""\n`;
157 if (dryRun) {
158 console.log(` would write verifier: ${dest}`);
159 return;
160 }
161 await mkdir(path.dirname(dest), { recursive: true });
162 await writeFile(dest, toml);
163 console.log(` created: ${dest} (from verifier template)`);
164 return;
165 }
166
167 const src = path.join(templatesRoot, 'SKILL.md.verifier');
168 await copyFile(src, dest, dryRun);
169}
170
171async function copyL2Templates(
172 pattern: Pattern,

Callers 1

copyL2TemplatesFunction · 0.85

Calls 2

copyFileFunction · 0.85
existsFunction · 0.70

Tested by

no test coverage detected