( templatesRoot: string, targetDir: string, tool: Tool, dryRun: boolean, )
| 136 | } |
| 137 | |
| 138 | async 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 | |
| 171 | async function copyL2Templates( |
| 172 | pattern: Pattern, |
no test coverage detected