Skip to content

feat: add @deck.gl-community/ai-skills — AI agent helpers for deck.gl#551

Closed
charlieforward9 wants to merge 4 commits intomasterfrom
feat/ai-skills
Closed

feat: add @deck.gl-community/ai-skills — AI agent helpers for deck.gl#551
charlieforward9 wants to merge 4 commits intomasterfrom
feat/ai-skills

Conversation

@charlieforward9
Copy link
Collaborator

Summary

This PR adds a new @deck.gl-community/ai-skills module, picking up the thread from #534 and the discussion with @ibgreen and @akre54.

The module takes the position that both approaches are correct — for different jobs — and ships them together with a single llms.txt that makes the distinction clear:

  • Pattern A — native TypeScript (for LLM code generation): typed factory functions (scatterplotLayer, arcLayer, etc.) returning correct props with sensible defaults, backed by a comprehensive llms.txt reference. This directly addresses @akre54's point that "agentic coding tools work best when they can read clean documentation and write native code directly."

  • Pattern B — JSON descriptors (for serializable configs and low-code UIs): fully JSON-serializable layer descriptors with dot-path accessor strings, validateDescriptor, and hydrateDescriptor. This preserves the noodle/IR approach from feat: add @deck.gl-community/visgl-skills — AI agent skills for deck.gl #534 for the cases where it genuinely shines — low-code builders, saved dashboards, server-side LLM output that can't execute code.

What's included

File Purpose
src/layer-factories.ts Typed factory functions for Scatterplot, Path, Polygon, Text, Arc, Heatmap
src/layer-descriptors.ts createDescriptor / validateDescriptor / hydrateDescriptor with dot-path resolution
src/deck-builder.ts Fluent DeckBuilder composing layers + view state into a serializable DeckConfig
src/viewport-skills.ts fitViewport, getBoundingBox, createViewState
llms.txt The agent reference doc — worked examples, full layer reference, decision guide for both patterns

llms.txt is included in the npm files list so it ships with the package and is accessible at node_modules/@deck.gl-community/ai-skills/llms.txt.

On the Zod direction

The validateDescriptor function is a natural slot for Zod schemas — if @ibgreen shares more on the Zod layer schema direction, it would slot in cleanly here without breaking the existing API.

Test plan

  • 14 unit tests covering factories, descriptor validation, hydration, DeckBuilder, and viewport helpers
  • All 57 test files in the repo pass (yarn test)
  • Prettier + ESLint hooks pass

Closes #534 (supersedes the Copilot-generated PR with a more considered design)

🤖 Generated with Claude Code

Copilot AI and others added 4 commits February 28, 2026 15:41
…-geographic editing

Co-authored-by: charlieforward9 <62311337+charlieforward9@users.noreply.github.com>
…ORDINATE_SYSTEM constants

Co-authored-by: charlieforward9 <62311337+charlieforward9@users.noreply.github.com>
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>
@charlieforward9
Copy link
Collaborator Author

Closing in favour of #552 — this branch was accidentally based on a Copilot branch and included unrelated editable-layers changes.

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.

2 participants