Skip to content

Commit eb2e841

Browse files
dmealingclaude
andcommitted
docs(prompts): say which generated file exports which extract function
A cold agent imported extractLenient<Name>WithLoader from <Name>.extractor.ts, which exports extract<Name> and extractLenient<Name> instead; the WithLoader form lives only in <Name>.response.ts. The TypeScript prompts reference now names the extractor generator's two entry points and where each function is exported. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01M1mRRB1K2WdYy82kntMQdx
1 parent 6ffdd74 commit eb2e841

3 files changed

Lines changed: 18 additions & 0 deletions

File tree

  • agent-context/skills/metaobjects-prompts/references
  • fixtures/agent-context-conformance
    • ts-react-tanstack/expected/.claude/skills/metaobjects-prompts/references
    • ts-requirements/expected/.claude/skills/metaobjects-prompts/references

‎agent-context/skills/metaobjects-prompts/references/typescript.md‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,12 @@ and `data` holds what was recovered (every field of the `<Vo>Extracted` mirror i
103103
nullable). It throws only when `root` does not declare the response value object, which is
104104
a setup error.
105105

106+
Wiring the `extractor` generator as well adds `<Name>.extractor.ts` with two more entry
107+
points over the same call: `extract<Name>(root, text)` returns the strict response type and
108+
throws when a `@required` field is lost or malformed, and `extractLenient<Name>(root, text)`
109+
re-exports the tolerant call above. `extractLenient<Name>WithLoader` itself is exported
110+
only from `<Name>.response.ts`.
111+
106112
Field-type → Zod mapping: `field.string` → `z.string()`; `field.int`/`long`/`currency`
107113
→ `z.number().int()`; `field.double`/`float` → `z.number()`; `field.boolean` →
108114
`z.boolean()`; `field.enum` → `z.enum([...])` over its declared `@values`;

‎fixtures/agent-context-conformance/ts-react-tanstack/expected/.claude/skills/metaobjects-prompts/references/typescript.md‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,12 @@ and `data` holds what was recovered (every field of the `<Vo>Extracted` mirror i
103103
nullable). It throws only when `root` does not declare the response value object, which is
104104
a setup error.
105105

106+
Wiring the `extractor` generator as well adds `<Name>.extractor.ts` with two more entry
107+
points over the same call: `extract<Name>(root, text)` returns the strict response type and
108+
throws when a `@required` field is lost or malformed, and `extractLenient<Name>(root, text)`
109+
re-exports the tolerant call above. `extractLenient<Name>WithLoader` itself is exported
110+
only from `<Name>.response.ts`.
111+
106112
Field-type → Zod mapping: `field.string` → `z.string()`; `field.int`/`long`/`currency`
107113
→ `z.number().int()`; `field.double`/`float` → `z.number()`; `field.boolean` →
108114
`z.boolean()`; `field.enum` → `z.enum([...])` over its declared `@values`;

‎fixtures/agent-context-conformance/ts-requirements/expected/.claude/skills/metaobjects-prompts/references/typescript.md‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,12 @@ and `data` holds what was recovered (every field of the `<Vo>Extracted` mirror i
103103
nullable). It throws only when `root` does not declare the response value object, which is
104104
a setup error.
105105

106+
Wiring the `extractor` generator as well adds `<Name>.extractor.ts` with two more entry
107+
points over the same call: `extract<Name>(root, text)` returns the strict response type and
108+
throws when a `@required` field is lost or malformed, and `extractLenient<Name>(root, text)`
109+
re-exports the tolerant call above. `extractLenient<Name>WithLoader` itself is exported
110+
only from `<Name>.response.ts`.
111+
106112
Field-type → Zod mapping: `field.string` → `z.string()`; `field.int`/`long`/`currency`
107113
→ `z.number().int()`; `field.double`/`float` → `z.number()`; `field.boolean` →
108114
`z.boolean()`; `field.enum` → `z.enum([...])` over its declared `@values`;

0 commit comments

Comments
 (0)