wix-app: trim Editor React Component reference loads; document Link.href#279
Draft
yanivefraim wants to merge 1 commit into
Draft
wix-app: trim Editor React Component reference loads; document Link.href#279yanivefraim wants to merge 1 commit into
yanivefraim wants to merge 1 commit into
Conversation
Editor React Component init runs are paying a high cache-read tax because the parent reference instructs the agent to read all 9 topic files upfront (ACCESSIBILITY, DIRECTIONALITY, PARTS, PROPS-VS-CSS, COMPONENT-CONFIGURATION, plus the three load-always files). On a recent INIT_CODEGEN run for a simple list-of-cards widget, that pushed the per-turn cache-read floor to ~58k and the run cost to $0.81 / 3:21 (SLO: <$0.50 / <3 min). Two changes here, both contained to the wix-app skill: 1. EDITOR_REACT_COMPONENT.md — split the topic references into "read upfront" (REACT-GUIDELINES, COMPONENT-API, CSS-GUIDELINES) and "load on demand" (everything else), with a per-topic trigger table so the agent only pulls ACCESSIBILITY/DIRECTIONALITY/PARTS when the spec actually warrants them. 2. COMPONENT-API.md — add a "Field-name gotchas" callout in the Component Data Types section documenting that Link's URL field is `href` (not `url`). The agent guessed `.url` in the breaching run, blew a tsc cycle, and went grepping node_modules to find the right name. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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
Editor React Component init runs are paying a high cache-read tax because the parent reference instructs the agent to read all 9 topic files upfront. On a recent
INIT_CODEGENrun for a simple list-of-cards widget, that pushed the per-turn cache-read floor to ~58k and the run cost to $0.81 / 3:21 (SLO: <$0.50 / <3 min). Cache reads alone accounted for ~$0.54 of the bill.Two contained changes to the
wix-appskill:EDITOR_REACT_COMPONENT.md— split the topic references into "read upfront" (REACT-GUIDELINES,COMPONENT-API,CSS-GUIDELINES) and "load on demand" (everything else), with a per-topic trigger table so the agent only pullsACCESSIBILITY/DIRECTIONALITY/PARTS/PROPS-VS-CSS/REACT-PATTERNS/COMPONENT-CONFIGURATIONwhen the spec actually warrants them.COMPONENT-API.md— add a "Field-name gotchas" callout in the Component Data Types section documenting thatLink's URL field ishref(noturl), and thatImageusesurl(absolute) anduri(fileName) together. The agent guessedLink.urlin the breaching run, blew atsccycle, and went greppingnode_modulesto find the right name.Context
ff287973-d6f2-4fd7-9960-c242a732d456(BracketBlaze,INIT_CODEGEN)The full investigation flagged two other fixes that live in different repos and aren't in this PR:
*.module.css+*.tsx?urlambient declarations in the project scaffold (lives inditto/packages/scaffolding).wix generateoutput forEDITOR_REACT_COMPONENTdoesn't match the named-export pattern this skill teaches inEXTENSION_REGISTRATION.md(either the scaffolder or that doc needs to move).Test plan
EDITOR_REACT_COMPONENT.mdto confirm the trigger table reads clearly and the "Read upfront" set is unambiguous.INIT_CODEGENfor a simple Editor React Component (similar shape to BracketBlaze) and confirm the agent no longer readsACCESSIBILITY/DIRECTIONALITY/PARTSupfront — expect cache-read floor to drop ~25–40%.Linkand confirm the agent no longer hallucinates.url.🤖 Generated with Claude Code