Skip to content

Conversation

@christso
Copy link
Collaborator

@christso christso commented Dec 7, 2025

Summary

Add definePromptTemplate SDK wrapper to @agentv/eval that mirrors defineCodeJudge. Update orchestrator to execute .ts/.js prompt files as subprocesses.

Changes

SDK (@agentv/eval):

  • Added PromptTemplateInputSchema in packages/eval/src/schemas.ts
  • Created definePromptTemplate wrapper in packages/eval/src/prompt-template.ts
  • Exported new types: definePromptTemplate, PromptTemplateInput, PromptTemplateInputSchema, PromptTemplateHandler

Core (@agentv/core):

  • Updated LlmJudgeEvaluatorConfig to include config and resolvedPromptPath
  • Added executePromptTemplate function in orchestrator.ts
  • Updated resolveCustomPrompt to detect and execute .ts/.js files
  • Updated evaluator parser to pass through config and skip validation for executable prompts

Testing:

  • Added unit tests for PromptTemplateInputSchema (14 tests)
  • Added integration tests for executable prompt templates (3 tests)

Example:

  • Created examples/features/prompt-template-sdk/ with TypeScript prompt template example

Test plan

  • bun run build passes
  • bun run typecheck passes
  • bun run lint passes
  • bun test passes (369 tests)

🤖 Generated with Claude Code

@christso christso marked this pull request as draft December 7, 2025 23:25
@christso christso added the enhancement New feature or request label Jan 13, 2026
…t templates

Add TypeScript/JavaScript support for custom evaluator prompts using the
same subprocess pattern as code judges.

Changes:
- Add PromptTemplateInputSchema and definePromptTemplate to @agentv/eval
- Update orchestrator to execute .ts/.js prompt files as subprocesses
- Add config and resolvedPromptPath to LlmJudgeEvaluatorConfig
- Skip validation for executable prompt templates in evaluator parser
- Add unit tests for PromptTemplateInputSchema
- Add integration tests for executable prompt templates
- Add example in examples/features/prompt-template-sdk/

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@christso christso force-pushed the feat/ts-prompt-templates branch from 4e912bd to 40e8fc6 Compare January 28, 2026 07:24
@christso christso marked this pull request as ready for review January 28, 2026 07:25
christso and others added 3 commits January 28, 2026 07:31
Move OpenSpec to archive after implementation is complete.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Archive change to openspec/changes/archive/2026-01-28-adopt-ts-template-prompts/
- Create new spec openspec/specs/custom-evaluator-prompts/

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Reuse CodeJudgeInputSchema for PromptTemplateInputSchema (consistent payloads)
- Add timeout support to executePromptTemplate (prevents hanging scripts)
- Validate non-empty output from prompt templates
- Throw error for missing .ts/.js prompt template files (fail-fast)
- Update tests to reflect required fields

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants