MCPcopy
hub / github.com/rpamis/comet / buildL3BuildPrompt

Function buildL3BuildPrompt

scripts/context-execution-benchmark.mjs:1337–1361  ·  view source on GitHub ↗

* L3 Build Phase: Claude reads compressed handoff context → implements → tests. * Returns { usage, attempts, testResult, completed, durationMs, costUsd }.

(mode, contextFile, contextText, tier)

Source from the content-addressed store, hash-verified

1335 * Returns { usage, attempts, testResult, completed, durationMs, costUsd }.
1336 */
1337function buildL3BuildPrompt(mode, contextFile, contextText, tier) {
1338 const testCount = l3TestCountFor(tier);
1339 return [
1340 'You are implementing a dictionary module based on a Design Doc and spec.',
1341 `Mode: ${mode} | Context source: ${contextFile}`,
1342 '',
1343 'Read the handoff context below. It contains the Design Doc and spec acceptance criteria.',
1344 '',
1345 'TASK:',
1346 '1. Implement src/dictionary.js that exports a Dictionary class with methods:',
1347 ' - add(word, definition, category?) — add or overwrite a word entry',
1348 ' - getDefinition(word) — return full entry object or undefined (case-sensitive)',
1349 ' - lookup(word) — return definition string or undefined (case-insensitive)',
1350 ' - getByCategory(category) — return array of entries matching category',
1351 ' - list(options?) — return all entries sorted by word; options.excludeDeprecated filters out deprecated',
1352 ' - deprecate(word) — set deprecated=true; throws "word not found: <word>" if not found',
1353 ' - exists(word) — return boolean (case-insensitive)',
1354 '2. Do NOT modify tests/dictionary.test.js',
1355 `3. Run \`npx vitest run\` to verify. Fix failures until all ${testCount} tests pass.`,
1356 '',
1357 '<comet_handoff_context>',
1358 contextText,
1359 '</comet_handoff_context>',
1360 ].join('\n');
1361}
1362
1363async function runL3Build({ claudeCommand, model, cwd, mode, contextFile, contextText, tier, maxRetries }) {
1364 const basePrompt = buildL3BuildPrompt(mode, contextFile, contextText, tier);

Callers 1

runL3BuildFunction · 0.85

Calls 1

l3TestCountForFunction · 0.85

Tested by

no test coverage detected