feat(slides): attach the slide design persona to the slides tool set#543
Draft
Denis Fadeev (fadeev) wants to merge 20 commits into
Draft
feat(slides): attach the slide design persona to the slides tool set#543Denis Fadeev (fadeev) wants to merge 20 commits into
Denis Fadeev (fadeev) wants to merge 20 commits into
Conversation
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Make the slide persona ride in with semantic tool selection the same way the App Builder prompt does. When the slides tool set activates (e.g. an implicit "make a deck about X"), its design guidance — layout catalog, palettes, font presets — is now appended to the conversation, not just the slide tools. This closes the asymmetry where app-generation attached APP_BUILDER_PROMPT but slides attached nothing. The slide persona builder lived in slides/index.ts, which reaches @babel/parser via ./jsx, so the lib tool-set layer couldn't import it without bundling the heavy slide runtime. Mirror the appBuilderPrompt.ts extraction instead of snapshotting (zero drift, fully sync, no public API break): - Move FontPreset + FONT_PRESETS into the dependency-free fonts.ts. - Extract buildSlideSystemPrompt into a new dependency-free slides/slidePrompt.ts and export SLIDE_BUILDER_PROMPT — the default-options instance, computed at load from the live design-system/palette/font catalogs, so editing those flows through automatically with no generated artifact. - serverTools.ts imports SLIDE_BUILDER_PROMPT via the babel-free path and sets it as the slides tool set's systemPrompt — same field/collection/injection as app-generation. - index.ts re-exports both for back-compat; trim its now-unused builder imports. Same mechanism end to end; collected by toolSetSystemPrompts. No consumer change required — the implicit slide path picks up the persona automatically. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…th background asset
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com> Co-authored-by: Cursor Agent <cursoragent@cursor.com>
…#537) Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
… shape (#555) Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
… loops (#528) Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-authored-by: Claude Opus 4.8 (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
Makes the slide design persona ride in with semantic tool selection the same way the App Builder prompt does. When the slides tool set activates (e.g. an implicit "make a deck about X"), its design guidance — layout catalog, palettes, font presets — is now appended to the conversation, not just the slide tools. Closes the asymmetry where app-generation attached
APP_BUILDER_PROMPTbut the slides set attached nothing.The slide persona builder lived in
slides/index.ts, which reaches@babel/parservia./jsx, so the lib tool-set layer couldn't import it without bundling the heavy slide runtime. Rather than snapshot the prompt (drift risk, two sources of truth), this mirrors the existingappBuilderPrompt.tsextraction:FontPreset+FONT_PRESETSmoved into the dependency-freefonts.ts.buildSlideSystemPromptextracted into a new dependency-freeslides/slidePrompt.ts, which exportsSLIDE_BUILDER_PROMPT— the default-options instance, computed at load from the live design-system / palette / font catalogs (dynamic; no generated artifact, no drift).serverTools.tsimportsSLIDE_BUILDER_PROMPTvia the babel-free path and sets it as the slides tool set'ssystemPrompt— same field, sametoolSetSystemPromptscollection, same additiverole:systeminjection as app-generation.index.tsre-exports both for back-compat; its now-unused builder imports were trimmed.The load-bearing guarantee holds structurally:
slidePrompt.tsonly reachesfonts/designSystem/palettes, all zero-import, so no@babeledge enters the lib bundle.Built on the
feat/app-gen-tool-improvementstool-setsystemPromptmachinery (ToolSet.systemPrompt,toolSetSystemPrompts,computeToolGuidance, thetoolGuidanceinjection) — which isn't onmainyet. This PR therefore targetsfeat/app-gen-tool-improvements, notmain; retarget/rebase ontomainonce that lands.Gates:
pnpm test(1280 passed),pnpm check(0 errors),pnpm buildall green. The slides tool-set test was inverted to assert["plan_deck"]now yieldsSLIDE_BUILDER_PROMPT.Integration
None required. The implicit slide path picks up the persona automatically through the existing
toolSetSystemPromptsmachinery.SLIDE_BUILDER_PROMPTis newly exported from@anuma/sdk/toolsif a host wants the default-options string directly. Optional later cleanup on the consumer: drop thedetectSlideDeckIntentregex heuristic now that the semantic path carries the persona.Breaking Changes
None. Additive
systemPromptfield on the slides tool set plus a newSLIDE_BUILDER_PROMPTexport;buildSlideSystemPrompt,FONT_PRESETS,FontPreset, andcreateSlideToolskeep their exports and signatures.