MCPcopy Create free account
hub / github.com/SethGammon/Citadel / executeClaudeScenario

Function executeClaudeScenario

scripts/skill-bench.js:647–676  ·  view source on GitHub ↗

* Run a scenario against the real Claude CLI. * Returns { output: string, error: string|null, timedOut: boolean }

(scenario, claudeCmd, tmpDir)

Source from the content-addressed store, hash-verified

645 * Returns { output: string, error: string|null, timedOut: boolean }
646 */
647function executeClaudeScenario(scenario, claudeCmd, tmpDir) {
648 const [bin, ...binArgs] = claudeCmd.split(' ');
649 try {
650 const output = execFileSync(
651 bin,
652 [...binArgs, '--plugin-dir', PLUGIN_ROOT, '--print', '--dangerously-skip-permissions', scenario.input],
653 {
654 cwd: tmpDir,
655 timeout: scenario.timeout,
656 encoding: 'utf8',
657 env: {
658 ...process.env,
659 CLAUDE_PROJECT_DIR: tmpDir,
660 CLAUDE_CODE_SUBPROCESS_ENV_SCRUB: '1',
661 },
662 maxBuffer: 10 * 1024 * 1024, // 10MB
663 }
664 );
665 return { output, error: null, timedOut: false };
666 } catch (err) {
667 if (err.killed) {
668 return { output: err.stdout || '', error: 'timed out', timedOut: true };
669 }
670 return {
671 output: err.stdout || '',
672 error: err.message || 'unknown error',
673 timedOut: false,
674 };
675 }
676}
677
678function executeCodexScenario(scenario, codexCmd, tmpDir) {
679 const outputPath = path.join(tmpDir, '.planning', 'benchmark-results', `${scenario.skill}-${scenario.name}-codex.md`);

Callers 2

runScenarioFunction · 0.85
mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected