Repository navigation
Add field-level comments to RxJsonSchema types for coding agents - #8832
Merged
Merged
Conversation
âĶg agents Add JSDoc comments to the fields of JsonSchema, TopLevelProperty and RxJsonSchema in src/types/rx-schema.d.ts. Coding agents read type definitions, so the comments explain RxDB-specific rules directly at the fields: ref (population), final (immutable after insert), default (top-level only), maxLength for indexed strings, minimum/maximum/ multipleOf for indexed numbers, version/migration and more. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01T2s4XZfAyrF3osvzNKdvCn
âĶLLMs Plugins like webmcp embed the collection's JSON schema into MCP tool descriptions, so title and description reach AI agents, not only humans. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01T2s4XZfAyrF3osvzNKdvCn
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01T2s4XZfAyrF3osvzNKdvCn
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR contains:
Describe the problem you have without this PR
Coding agents read type definitions to learn how to build a valid
RxJsonSchema, but most fields insrc/types/rx-schema.d.tshad no comments. Agents therefore miss RxDB-specific rules that plain JSON Schema does not have and generate invalid schemas (missingmaxLengthon indexed strings,nulltypes,defaulton nested fields).This PR adds JSDoc comments to the fields of
JsonSchema,TopLevelPropertyandRxJsonSchema, so the rules are visible directly at the field:ref: reference to another collection for the population pluginfinal: value can never be changed after insert, automatically requireddefault: only allowed on top-level fieldsmaxLength: required for string fields used as primary key or in an indexminimum/maximum/multipleOf: required for number and integer fields used in an indexversion: starts at 0, increasing it requires migration strategiestype,format,pattern,properties,required,items: RxDB-specific guidance (single fixed type, no underscore-prefixed field names, validation plugin needed forformat/pattern, index fields must be required)Todos
Tests(comment-only change, no behavior change)ðĪ Generated with Claude Code
https://claude.ai/code/session_01T2s4XZfAyrF3osvzNKdvCn
Generated by Claude Code