docs(develop-app): workflow-first analysis pattern + clearer layer z-order#46
Merged
Merged
Conversation
…order
Two improvements to carto-develop-app.
1. Complex analysis → Workflow, called from the app.
- Lead workflows-and-sql.md with a decision rule: non-trivial analysis
(revenue prediction, composite scores, segmentation, multi-step joins)
belongs in a workflow built with carto-create-workflow, not inlined as
app SQL. App reads the output table or CALLs the compiled procedure via
the Workflows API.
- Add the agent path: publish the workflow as an MCP tool when an embedded
agent drives the analysis.
- Fix procedure-naming guidance (hash-based FQN from `mcp describe`, not a
guessed wf_<title>); note token must grant the procedure + its tables.
- Surface the pattern as an always-on bullet in SKILL.md.
2. Clearer layer z-order, anchored on the layers themselves.
- Rewrite layers.md "Layer order": z-order is the `layers` array (last =
top), CSS z-index does nothing to stacking, rebuild the array don't
mutate, plus polygonOffset / depthCompare:'always' (v9 spelling) and the
3D depth-test caveat.
- Replace the basemap-and-view.md "out of scope" punt with the validated
overlaid-vs-interleaved fix: *_NOLABELS basemap or MapboxOverlay +
beforeId:'watername_ocean' (verified against the live CARTO styles;
needs maplibre-gl@>3).
- Add an always-on z-order bullet to SKILL.md.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
ernesmb
approved these changes
Jun 9, 2026
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.
Two improvements to the
carto-develop-appskill.1. Complex analysis → Workflow, called from the app
Previously
workflows-and-sql.mdframed a workflow as just "one of two ways to run SQL" and led with ad-hocquery(). The skill is now explicit that non-trivial analysis belongs in a workflow, not inlined as app SQL:workflows-and-sql.md(with a why: one source of truth, public-token apps leak SQL to the browser, perf) plus a situation → action table.CALLthe compiled procedure via the Workflows API (on-demand/parameterized).wf_<workflow_id>; it's a hash-based FQN in the connection's workspace dataset. Doc now says get it fromcarto workflows mcp describe, and notes the token must grant the procedure and the tables it reads.SKILL.mdso it's reached at decision time.2. Clearer layer z-order — anchored on the layers themselves
The real confusion is the deck.gl
layersarray, not the basemap:layers.md: z-order is the array (last = top); CSSz-indexdoes nothing to layer stacking; rebuild the array, don't mutate it; "won't restack" is usually a stale array reference. PluspolygonOffset/depthCompare: 'always'(v9 spelling — olddepthTest: falseis gone) and the 3D depth-test caveat.basemap-and-view.md"out of scope for v1" punt with the validated overlaid-vs-interleaved fix: a*_NOLABELSbasemap, orMapboxOverlay+interleaved: true+beforeId: 'watername_ocean'.SKILL.md.Validation of the z-order facts (done against primary sources, not asserted)
watername_ocean(index 67) is the first label layer, so it's the rightbeforeIdto slip fills under all labels;waterway_label(index 13) is a trap that sits below roads. Same IDs across Positron / Dark Matter / Voyager.beforeId: 'watername_ocean'is the exact value their own example uses, and that interleaved requiresmaplibre-gl@>3(WebGL2).Notes
catalog.jsonchange →make syncnot required.make validatepasses (validate_skills: OK (23 skills),validate_snippets: OK (520 snippets)).🤖 Generated with Claude Code