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

Function scaffoldObservability

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

Source from the content-addressed store, hash-verified

222}
223
224async function scaffoldObservability(
225 pattern: Pattern,
226 tool: Tool,
227 targetDir: string,
228 templatesRoot: string,
229 dryRun: boolean,
230) {
231 const budgetPath = path.join(targetDir, 'loop-budget.md');
232 const runLogTemplate = path.join(templatesRoot, 'loop-run-log.md.template');
233 const runLogPath = path.join(targetDir, 'loop-run-log.md');
234
235 if (!(await exists(budgetPath))) {
236 const content = buildLoopBudgetMd(pattern);
237 if (dryRun) {
238 console.log(` would write: ${budgetPath}`);
239 } else {
240 await writeFile(budgetPath, content);
241 console.log(` created: loop-budget.md`);
242 }
243 }
244
245 if (!(await exists(runLogPath))) {
246 await copyFile(runLogTemplate, runLogPath, dryRun);
247 }
248
249 await copyTemplateSkill(templatesRoot, 'SKILL.md.loop-budget', targetDir, tool, 'loop-budget', dryRun);
250}
251
252async function scaffoldConstraints(
253 targetDir: string,

Callers 1

mainFunction · 0.85

Calls 4

buildLoopBudgetMdFunction · 0.85
copyFileFunction · 0.85
copyTemplateSkillFunction · 0.85
existsFunction · 0.70

Tested by

no test coverage detected