feat: add @deck.gl-community/ai-skills — AI agent helpers for deck.gl#552
Closed
charlieforward9 wants to merge 1 commit intomasterfrom
Closed
feat: add @deck.gl-community/ai-skills — AI agent helpers for deck.gl#552charlieforward9 wants to merge 1 commit intomasterfrom
charlieforward9 wants to merge 1 commit intomasterfrom
Conversation
Adds a new module that handles both approaches discussed in #534: - Pattern A (native TypeScript): typed factory functions for all common layer types with sensible defaults, backed by llms.txt reference docs for LLM code generation (addresses akre54's docs-first feedback) - Pattern B (JSON descriptors): fully serializable layer configs with dot-path accessors, validateDescriptor, and hydrateDescriptor for low-code UIs and server-side LLM output (the noodle approach) Also includes DeckBuilder fluent compositor, viewport helpers (fitViewport, getBoundingBox), and a comprehensive llms.txt that serves as the single agent-facing reference for both patterns. 14/14 tests passing. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Collaborator
Author
|
Closing — shelving this for now. |
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
Picks up the thread from #534 and the discussion with @ibgreen and @akre54.
The module takes the position that both approaches are valid — for different jobs — and ships them together with a single
llms.txtthat makes the distinction explicit.Note on scope: I checked what GeoDA AI / OpenAssistant and
@kepler.gl/ai-assistantare doing before building this. GeoDA's OpenAssistant is visualization-agnostic (Kepler.gl and Leaflet are the current targets; deck.gl is listed aswip). Kepler's@kepler.gl/ai-assistantprovides function-calling tools (addLayer,mapBoundary, etc.) scoped to the Kepler UI rather than raw deck.gl. Neither covers the "help an LLM write deck.gl code directly" use case — so this fills a real gap rather than duplicating existing work.Pattern A — native TypeScript (for LLM code generation)
Typed factory functions (
scatterplotLayer,arcLayer, etc.) returning correct props with sensible defaults. This directly addresses @akre54's point that agents work best writing native code backed by clean docs. Thellms.txtis that doc.Pattern B — JSON descriptors (for serializable configs / low-code UIs)
Fully JSON-serializable layer descriptors with dot-path accessor strings,
validateDescriptor, andhydrateDescriptor. Preserves the noodle/IR approach from #534 for the cases where it genuinely belongs: low-code builders, saved dashboards, server-side LLM output that can't execute code.Files
src/layer-factories.tssrc/layer-descriptors.tscreateDescriptor/validateDescriptor/hydrateDescriptorwith dot-path resolutionsrc/deck-builder.tsDeckBuildercomposing layers + view state into a serializableDeckConfigsrc/viewport-skills.tsfitViewport,getBoundingBox,createViewStatellms.txtllms.txtis included in the npmfileslist and ships with the package.On the Zod direction
validateDescriptoris a natural slot for Zod schemas. @ibgreen — if you share more on the Zod layer schema direction, it would integrate cleanly here without a breaking API change.Test plan
modules/ai-skills/,tsconfig.json,.eslintignore,.prettierignore,yarn.lockSupersedes #551 (wrong base branch) and #534 (Copilot-generated).
🤖 Generated with Claude Code