feat: add generate_screen_from_json virtual tool#151
Open
Eyaldavid7 wants to merge 1 commit intodavideast:mainfrom
Open
feat: add generate_screen_from_json virtual tool#151Eyaldavid7 wants to merge 1 commit intodavideast:mainfrom
Eyaldavid7 wants to merge 1 commit intodavideast:mainfrom
Conversation
Adds a new virtual tool that combines a design prompt with live JSON data, so generated screens render real content instead of placeholders. Wraps the upstream generate_screen_from_text tool with an enhanced prompt that includes data binding instructions and the serialized JSON. Includes input validation, 100KB size limit, circular reference detection, prompt injection mitigation via JSON round-tripping, and 19 unit tests covering happy paths, edge cases, and error propagation. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Wow it's owsome bro |
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.
Summary
Adds a new virtual tool
generate_screen_from_jsonthat combines a design prompt with live JSON data, so generated screens render real content instead of placeholder text.generate_screen_from_textwith an enhanced prompt containing data binding instructions + serialized JSONprojectId,prompt,jsonData)generateResult,dataBound,originalPrompt, anddataKeysmetadataUse case
When building data-driven UIs (dashboards, admin panels, game screens),
generate_screen_from_textproduces beautiful layouts with placeholder content. This tool lets you pass your actual API/app JSON data alongside the design prompt, so the generated HTML renders real values — zero manual data binding needed.Files changed
src/commands/tool/virtual-tools/generate-screen-from-json.tssrc/commands/tool/virtual-tools/index.tstests/commands/tool/virtual-tools/generate-screen-from-json.test.tsdocs/tool-catalog.mdTest plan
🤖 Generated with Claude Code