-
Notifications
You must be signed in to change notification settings - Fork 1
Add a Zod schema adapter for prompt inputs #9
Copy link
Copy link
Open
Labels
adapterSchema/model adapters (Zod, OpenAI, etc.)Schema/model adapters (Zod, OpenAI, etc.)enhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomershelp wantedExtra attention is neededExtra attention is needed
Description
Activity
Metadata
Metadata
Assignees
Labels
adapterSchema/model adapters (Zod, OpenAI, etc.)Schema/model adapters (Zod, OpenAI, etc.)enhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomershelp wantedExtra attention is neededExtra attention is needed
Context
promptkit's
definePromptcurrently accepts a free-formvalidatefunction. That's flexible but verbose for the common case where you just want to declare a schema and get types + validation for free.Proposal
Add an optional
schemaadapter so users can write:The Zod schema would be used to:
validate).templateviaz.infer.Implementation notes
src/adapters/zod.ts, exported viapromptkit/zod(a subpath export — needs a new entry inpackage.jsonexports).tests/adapters/zod.test.ts.Acceptance
promptkit/zodsubpath export works.schemaoption inferstemplateinput type.ValidationError.Good first issue?
Yes — well-scoped, mostly additive. Happy to pair on the design.
/label "good first issue" "help wanted" "adapter" "enhancement"