You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 614da76
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: fixtures/agent-context-conformance/java-kotlin-react-tanstack/expected/.claude/skills/metaobjects-prompts/SKILL.md
+16-2Lines changed: 16 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -166,7 +166,8 @@ drift at build time instead of letting a prompt silently degrade.
166
166
`@textRef` is a 2-layer logical reference `group/source` (folder/file,
167
167
table/key, collection/document). The prompt text itself **never lives in
168
168
metadata** — at runtime a configured **provider** resolves the reference to the
169
-
actual Mustache text:
169
+
actual template text (Mustache in every port; Python and TypeScript also accept Jinja, see
170
+
below):
170
171
171
172
- a filesystem provider (L1 = folder, L2 = file) — the dev default:
172
173
`lobby/welcome` → `<root>/lobby/welcome.mustache`. It is `FilesystemProvider` in every
@@ -181,6 +182,18 @@ actual Mustache text:
181
182
Locale, A/B, dynamic, and evolutionary prompt variants all live behind the
182
183
provider seam without touching metadata.
183
184
185
+
**Jinja bodies (Python and TypeScript only, ADR-0061).** A body may be a Jinja file —
186
+
`lobby/welcome.jinja` (or `.j2` / `.jinja2`) — instead of `welcome.mustache`; the
187
+
`@textRef` does not change, and the metadata never names an engine. Python renders it with
188
+
jinja2 (the `metaobjects[jinja]` extra), TypeScript with nunjucks. The same `verify` gate
189
+
checks it against the payload, walking the parsed template, and reports what it cannot
190
+
settle statically (`user[key]`, a computed include name) as `ERR_TEMPLATE_NOT_STATIC`. Java,
191
+
Kotlin and C# refuse a Jinja body with `ERR_TEMPLATE_ENGINE_UNSUPPORTED`, so a model that
192
+
must render in those ports keeps Mustache. Prefer Mustache for new templates: it is the
193
+
cross-port engine, and its logic-less shape is what pushes conditionals into the payload
194
+
(next sections). Jinja is for adopting existing Jinja templates without rewriting them; per
195
+
port reference files say how.
196
+
184
197
## `render()` is deterministic + byte-stable
185
198
186
199
Rendering is a pure function: `(payload VO, resolved text) → string`. Same inputs,
@@ -244,7 +257,8 @@ against each value of the dimension and snapshot every variant.
244
257
## `verify` fails the build on prompt-drift
245
258
246
259
For every template, the verify step resolves the text, parses each `{{...}}`
247
-
reference, and checks it exists on the payload VO. If the text references
260
+
reference (Mustache, or a Jinja body in Python and TypeScript), and checks it exists on the
261
+
payload VO. If the text references
248
262
`{{authorName}}` but the payload only has `displayName`, **the build fails.** This
249
263
is the prompt-vs-payload drift gate — run it in CI. It walks both `template.prompt`
250
264
and `template.output` nodes the same way (both RENDER; only the direction of what comes
Copy file name to clipboardExpand all lines: fixtures/agent-context-conformance/java-kotlin-react-tanstack/expected/.claude/skills/metaobjects-prompts/references/java.md
+6Lines changed: 6 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -148,3 +148,9 @@ JUnit test in the Maven `test` phase to fail the build on prompt/payload drift.
148
148
`metaobjects:verify` codegen-drift goal additionally catches a stale committed
149
149
parser. The emitted parser imports Jackson (`com.fasterxml.jackson`), normally
150
150
already on a Spring Boot classpath.
151
+
152
+
**Mustache only (ADR-0061).** Jinja bodies are a Python and TypeScript engine. A ref whose
153
+
only body is a `.jinja` / `.j2` / `.jinja2` file is refused here with
154
+
`ERR_TEMPLATE_ENGINE_UNSUPPORTED` (by the filesystem provider, and as a drift line by
155
+
`verify`), rather than reported as missing. Keep templates the JVM ports render in
Copy file name to clipboardExpand all lines: fixtures/agent-context-conformance/java-kotlin-react-tanstack/expected/.claude/skills/metaobjects-prompts/references/kotlin.md
+6Lines changed: 6 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -166,3 +166,9 @@ resolve against the payload — empty list = no drift. Assert it is empty in a J
166
166
test in the Maven `test` phase to fail the build on prompt/payload drift. The
167
167
`metaobjects:verify` codegen-drift goal additionally catches a stale committed
168
168
parser.
169
+
170
+
**Mustache only (ADR-0061).** Jinja bodies are a Python and TypeScript engine. A ref whose
171
+
only body is a `.jinja` / `.j2` / `.jinja2` file is refused here with
172
+
`ERR_TEMPLATE_ENGINE_UNSUPPORTED` (by the filesystem provider, and as a drift line by
173
+
`verify`), rather than reported as missing. Keep templates the JVM ports render in
Copy file name to clipboardExpand all lines: fixtures/agent-context-conformance/java-react/expected/.claude/skills/metaobjects-prompts/references/java.md
+6Lines changed: 6 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -148,3 +148,9 @@ JUnit test in the Maven `test` phase to fail the build on prompt/payload drift.
148
148
`metaobjects:verify` codegen-drift goal additionally catches a stale committed
149
149
parser. The emitted parser imports Jackson (`com.fasterxml.jackson`), normally
150
150
already on a Spring Boot classpath.
151
+
152
+
**Mustache only (ADR-0061).** Jinja bodies are a Python and TypeScript engine. A ref whose
153
+
only body is a `.jinja` / `.j2` / `.jinja2` file is refused here with
154
+
`ERR_TEMPLATE_ENGINE_UNSUPPORTED` (by the filesystem provider, and as a drift line by
155
+
`verify`), rather than reported as missing. Keep templates the JVM ports render in
Copy file name to clipboardExpand all lines: fixtures/agent-context-conformance/python/expected/.claude/skills/metaobjects-prompts/references/python.md
Copy file name to clipboardExpand all lines: fixtures/agent-context-conformance/ts-react-tanstack/expected/.claude/skills/metaobjects-prompts/references/typescript.md
+12Lines changed: 12 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -219,6 +219,18 @@ error in every port. The emitted parser imports `zod`;
219
219
it's usually already a dependency (Drizzle / `runtime-ts` lean on it), else
220
220
`npm i zod`.
221
221
222
+
**Jinja bodies (ADR-0061).** A body may be `<group>/<source>.jinja` (or `.j2`, `.jinja2`)
223
+
instead of `.mustache`; `@textRef` does not change. `@metaobjectsdev/render` renders it with
224
+
nunjucks (a dependency of the package, nothing to install) and `meta verify` checks it the same
225
+
way, walking the parsed template; it names the `.jinja` file and line on a drift.
226
+
`FilesystemProvider.engineOf(ref)` reports the engine of the file it found; for an
227
+
`InMemoryProvider` pass `new InMemoryProvider(map, { engine: "jinja" })`, or pass
228
+
`engine: "jinja"` to `render` / `verify`. A generated `render<Name>()` helper over a Jinja body
229
+
passes `engine: "jinja"`, so it renders as Jinja through any runtime provider, and the
230
+
runtime check runs on it as on a Mustache body. What the check cannot settle statically is
231
+
`ERR_TEMPLATE_NOT_STATIC`. nunjucks treats an empty list as true (jinja2 does not), so test a
232
+
list with `{% if items | length %}` when the same template must render in Python.
233
+
222
234
## See which fields a template consumes
223
235
224
236
List `docsFile()` in `generators` and run `meta gen` to emit the model surface to the
0 commit comments