metaobjects-prompts

Declares typed LLM prompt templates with deterministic rendering, drift verification, and generated response parsers.

1|Updated May 14, 2026
One-click install
npx skills add https://github.com/metaobjectsdev/metaobjects --skill metaobjects-prompts-metaobjectsdev
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: metaobjects-prompts
Source: https://github.com/metaobjectsdev/metaobjects/tree/main/agent-context/skills/metaobjects-prompts
Command: npx skills add https://github.com/metaobjectsdev/metaobjects --skill metaobjects-prompts-metaobjectsdev

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Prompt text scattered across services as concatenated strings drifts silently from the data it consumes, breaks prompt caches with stray whitespace, and produces untyped LLM replies that fail at runtime. This Skill treats a prompt as code: a declared typed payload, external provider-resolved text, deterministic rendering, and build-time drift checks. ## Core Features & Use Cases - Typed template declaration: Define template.prompt and template.output nodes with @payloadRef, @textRef, @format, and @responseRef so payload bloat becomes a visible diff. - Deterministic render and drift gate: Render Mustache templates byte-identically across TypeScript, Java, Kotlin, C#, and Python, and fail the build when a {{field}} reference does not resolve against the payload. - Parser-on-receipt and response-format fragments: Generate typed parsers (Zod, Jackson, kotlinx.serialization, System.Text.Json, Pydantic) plus a "produce your answer like this" fragment for every responding prompt. - Use Case: Declare a WelcomePrompt with a WelcomePayload value object, render it through a filesystem text provider, call any LLM client, and parse the reply into a typed record — with CI failing if the template and payload drift apart. ## Quick Start Declare a template.prompt with a payload value object and text reference in your MetaObjects metadata, then ask the agent to wire the render, parser, and output-prompt generators for your project's language.

Frequently Asked Questions about metaobjects-prompts

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I declare a typed LLM prompt template in MetaObjects?

Declare a template.prompt node with @payloadRef pointing to an object.value or sourceless object.projection, and @textRef as a group/source logical reference. The payload fields are the prompt's typed surface, and a provider resolves the text at runtime.

How do I parse an LLM response into a typed object?

Add @responseRef to the template.prompt and codegen emits a typed parser per language: Zod parse/safeParse in TypeScript, Jackson in Java, kotlinx.serialization in Kotlin, System.Text.Json in C#, and Pydantic in Python. Strict parsing is JSON-only; XML replies get a tolerant extract path.

Does MetaObjects generate the LLM API call itself?

No. Codegen intentionally emits no provider or LLM-call layer per ADR-0024. You bring your own caller such as the Vercel AI SDK, Spring AI, LangChain4j, Microsoft.Extensions.AI, or LiteLLM, and MetaObjects owns the typed render, parse, and record steps.

How does prompt drift detection work in CI?

The verify step resolves each template's text, parses every Mustache {{...}} reference, and checks it exists on the payload field tree. Any unresolved reference fails the build, catching template-versus-payload drift before deployment.

What is the difference between template.prompt and template.output?

template.prompt targets LLMs and supports an inbound half via @responseRef with a generated parser. template.output is outbound-only for emails, documents, and exports, and never gets a parser; putting @responseFormat or @promptStyle on it is a load error.

When should I avoid branching prompt text in code?

Never branch prose in services. Encode varying vocabulary as typed payload fields, gate whole blocks with boolean section flags, and select per-variant text through the provider seam only when wording genuinely diverges, keeping every variant snapshot-testable.