Skip to content

wix-app: trim Editor React Component reference loads; document Link.href#279

Draft
yanivefraim wants to merge 1 commit into
mainfrom
wix-app-editor-react-trim-refs
Draft

wix-app: trim Editor React Component reference loads; document Link.href#279
yanivefraim wants to merge 1 commit into
mainfrom
wix-app-editor-react-trim-refs

Conversation

@yanivefraim

Copy link
Copy Markdown
Member

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_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). Cache reads alone accounted for ~$0.54 of the bill.

Two contained changes to the wix-app skill:

  • 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 / PROPS-VS-CSS / REACT-PATTERNS / COMPONENT-CONFIGURATION when the spec actually warrants them.
  • 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), and that Image uses url (absolute) and uri (fileName) together. The agent guessed Link.url in the breaching run, blew a tsc cycle, and went grepping node_modules to find the right name.

Context

  • Breaching job: ff287973-d6f2-4fd7-9960-c242a732d456 (BracketBlaze, INIT_CODEGEN)
  • 36 steps · 1.86M total tokens · 1.81M cache-read · $0.8141 · 3:21 wall

The full investigation flagged two other fixes that live in different repos and aren't in this PR:

  • Missing *.module.css + *.tsx?url ambient declarations in the project scaffold (lives in ditto/packages/scaffolding).
  • wix generate output for EDITOR_REACT_COMPONENT doesn't match the named-export pattern this skill teaches in EXTENSION_REGISTRATION.md (either the scaffolder or that doc needs to move).

Test plan

  • Skim rendered EDITOR_REACT_COMPONENT.md to confirm the trigger table reads clearly and the "Read upfront" set is unambiguous.
  • Re-run an INIT_CODEGEN for a simple Editor React Component (similar shape to BracketBlaze) and confirm the agent no longer reads ACCESSIBILITY / DIRECTIONALITY / PARTS upfront — expect cache-read floor to drop ~25–40%.
  • Re-run an init that uses Link and confirm the agent no longer hallucinates .url.

🤖 Generated with Claude Code

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>
@yanivefraim yanivefraim marked this pull request as draft May 25, 2026 11:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant