Skip to content

docs(cartography): trim both cartography references, lift family principle, restore safety nets#35

Merged
anamanvil merged 5 commits into
masterfrom
docs/cartography-trim
May 29, 2026
Merged

docs(cartography): trim both cartography references, lift family principle, restore safety nets#35
anamanvil merged 5 commits into
masterfrom
docs/cartography-trim

Conversation

@anamanvil

Copy link
Copy Markdown
Contributor

Summary

Trims and reorganises both cartography.md references (one per skill) to address two concrete behaviours we were seeing in agent-generated maps:

  1. Sunset reflex — agents reaching for Sunset / SunsetDark on data that wasn't thermal/severity, because the docs recommended them by name in multiple tables.
  2. Sequential / diverging palettes on string columns — agents picking a sequential ramp for unordered categories because the family-matching principle was buried under prescriptive tables.

The fix leans on established cartographic doctrine (Brewer / ColorBrewer / MacEachren — match palette family to measure character) rather than naming specific palettes by reflex.

Three commits on this branch

5cdcf85carto-render-inline-map/cartography.md trim (426 → 441 lines)

  • Hoisted the cartographic principle into §0 (sequential ↔ magnitude, diverging ↔ signed, qualitative ↔ unordered).
  • Stripped named palettes from recipes; recipes use placeholders pointing back at §6.
  • Expanded §6 with the full CARTO palette registry per family + colorblind-safe subset.
  • Added §3.1 "Opacity as a design lever" (three jobs, fit-by-role).
  • Reframed drawing-order rule (§2) as coverage/occlusion, not size.

d94a69ccarto-create-builder-maps/cartography.md trim (1049 → 678 lines)

  • Lifted the same principle into §4.
  • Dropped troubleshooting prose (§4.5a NULL-ratio post-mortem, rooftop-PV failure narrative, ENERGY STAR worked example, why agents over-use quantile meta).
  • Demoted Sunset / SunsetDark from the §4.4 dark-basemap default list and §4.2a thermal branches; kept in the §4.1 registry.
  • Reframed §1.8 drawing-order rule as coverage/occlusion with a per-row "Why this position" column.
  • Collapsed anti-patterns §7.10–7.13 to index pointers; worked recipes (§8) reduced to three archetypes.

Net: ~-35% line, ~-50% word reduction. Lost no Tier-1 capability content.

f874f2c — restore safety nets

Honest review after the first two commits found regression risk for the median-reasoning agent (placeholders without a working example, opacity range without an anchor, string-column rule too nuanced). This commit restores three guardrails without reintroducing the original Sunset reflex:

  1. Default-per-family table in §4.2 / §6 — Teal (sequential), Temps/Geyser (diverging), Bold/Safe (qualitative), Prism/Pastel (7–12 cats). Framed explicitly as fallback when reasoning gives no preference, not a reflex.
  2. Opacity anchored at 0.7 — the no-context default. The 0.4–0.8 design-lever range remains for agents that have a reason.
  3. String-column rule simplified"string → qualitative palette, period". The rare ordered-strings exception lives in §3.5 as an escape hatch, not surfaced in the anti-pattern.
  4. Checklists in both files reference the §4.2 / §6 defaults for the final-gate pass.

Companion PR

CartoDB/cloud-native#24630 updates the view-map MCP prompt to align with the new skill structure — concrete palette examples (Teal / BluYl / Bold) with inline family-matching rationale, names varied across recipes to avoid a new reflex.

Validation

  • make validate clean (23 skills, 236 snippets, 31 untagged skipped) after each commit.
  • No SKILL.md changes; no frontmatter changes; no plugin manifest changes — pure prose refactor of two reference files.

Review focus

  • Is the default-per-family fallback table (§4.2 / §6) framed clearly enough that strong agents don't reach for it as a reflex, while weak agents do reach for it when reasoning runs out?
  • Did the recipe trim in §8 (create-builder-maps) and §10 (render-inline-map) cut anything load-bearing?
  • Drawing-order reframing in §1.8 / §2 from "size" to "coverage / occlusion" — does it survive contact with the layer matrix?

anamanvil and others added 4 commits May 12, 2026 08:01
… principle, remove palette reflex

- Hoist the cartographic-doctrine principle (match palette family to measure character) into §0 — sequential/diverging/qualitative tied to data shape, sourced from Brewer/MacEachren.
- Strip named palettes (Sunset, Teal, etc.) from recipes and workflows; recipes now use placeholders that point back at §6 so the agent picks by character, not by reflex.
- Expand §6 with the full CARTO palette registry per family and a colorblind-safe subset. Note that custom RGBA arrays are equally valid.
- Add §3.1 "Opacity as a design lever" — three jobs (basemap breathing, hierarchy, density reveal), typical range 0.4–0.8, fit to layer role.
- Soften "string columns sequential" rule: default qualitative, deviate when strings carry inherent order.
- Reframe drawing-order rule (§2) as coverage/occlusion, not size.
- Refresh anti-patterns (§9) with palette-reflex and contrasting-stroke-on-dense-choropleths.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…ng principle, remove palette reflex

- Hoist the cartographic principle (match palette family to measure character) into §4 — sequential/diverging/qualitative tied to data shape, sourced from Brewer/MacEachren. Crossing families misrepresents the data.
- Strip troubleshooting prose: drop §4.5a NULL-ratio post-mortem, rooftop-PV failure narrative, ENERGY STAR worked example, and the "why agents over-use quantile" meta. Keep the rules, drop the war stories.
- Demote Sunset/SunsetDark: remove from §4.4 "good on dark" default list and §4.2a thermal branches; keep in §4.1 registry. Restrict to literal thermal data via the palette-reflex anti-pattern (§7.10).
- Soften "string columns sequential/diverging": default qualitative; sequential is correct when strings carry inherent order (sentiment, grades).
- Reframe drawing-order rule (§1.8) as coverage/occlusion, not "bigger features go to the bottom". Add a "Why this position" column per row.
- Add opacity-as-design-lever framing: three jobs (basemap breathing, hierarchy, density reveal), typical range 0.4–0.8, fit to layer role. Soften the per-layer specifics in §1.1/§1.3/§1.6.
- Collapse anti-patterns §7.10–7.13 to short indices pointing back to main sections. Worked recipes (§8) reduced to three archetypal patterns.

Net: 1049 → 678 lines (-35%), 12.8k → ~6.4k words (-50%). Validation: make validate OK.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
… 0.7 opacity anchor, simplify string-column rule

The first trim commit removed too many guardrails — fine for strong-reasoning agents but a regression for the median case. This commit restores three safety nets without reintroducing the original Sunset-reflex problem they were meant to prevent.

Both cartography files (carto-create-builder-maps + carto-render-inline-map):

1. **Default-per-family palette table.** §4.2 / §6 now end with a small "default if uncertain" table:
   - Sequential → Teal
   - Diverging → Temps / Geyser
   - Qualitative 2–6 cats → Bold (Safe for colorblind)
   - Qualitative 7–12 cats → Prism / Pastel

   These are colorblind-safe, basemap-neutral defaults — explicitly framed as a *fallback when reasoning gives no preference*, not a reflex. The principle still leads: pick by character first; the defaults catch the no-context case so the agent never picks Sunset because the doc named it.

2. **Opacity anchored at 0.7.** §1.4 / §3.1 keep the three-job design-lever framing but lead with "Default to 0.7 when you have no specific reason to deviate". The 0.4–0.8 range remains for agents that have a reason. Per-layer numbers stay as starting points; 0.7 is the no-context fallback.

3. **String-column rule simplified.** §7.8 / §9 collapse from "default qualitative; exception when strings carry order; lock via colorDomain" to "string columns → qualitative palette". The rare ordered-strings case (sentiment, grades) lives in §3.5 of the create-builder-maps doc as an escape hatch; not surfaced in the anti-pattern.

4. **Checklist entries refreshed.** "If uncertain on palette: Teal/Temps/Geyser/Bold/Safe — see §4.2 defaults" added to both checklists so the safety net is reachable from the final-gate step.

Net for the median agent: working map even without strong cartographic reasoning. Net for the strong agent: principle still leads, defaults framed as fallback. No Sunset / SunsetDark reintroduction.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…ol (cloud-native#24623)

PR cloud-native#24623 replaces get_column_stats + list_resources with a unified `describe` tool — one entry-point, two-step flow (schema first, then stats per column). This commit updates the render-inline-map cartography reference to match the new tool surface so the skill and prompt stay in lockstep when #24623 merges.

Changes:
- §0 "Before you pick anything" — replace the two-row table with the describe two-step flow. Add schema response shape ({ source, schema, geomField?, geometryType?, rowCount? }), note geomField as the column NOT to style by, and document the discriminated stats response (type: 'Number' | 'String' | 'Boolean' | 'Timestamp' | 'Geometry').
- Add explicit fallback note: schema mode fails for analytical queries / spatial-index tables / tilesets / rasters → list_resources. Stats mode works on h3/quadbin via spatial_data_type.
- Document the synthetic `_carto_point_density` column on Point sources — server-side per-tile point count, valid as `attr` for colorBins / colorContinuous, NOT queryable via SQL.
- §5 colorBins workflow and helper note — describe replaces get_column_stats.
- §9 anti-pattern — describe replaces get_column_stats.
- §10.1 / §10.2 recipes — describe replaces get_column_stats, response examples include the discriminated `type` field.
- Checklist — describe + list_resources fallback documented.

No cartographic doctrine changed; this is purely a tool-name and response-shape alignment.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@anamanvil
anamanvil marked this pull request as ready for review May 29, 2026 17:31
# Conflicts:
#	skills/carto-create-builder-maps/references/cartography.md
#	skills/carto-render-inline-map/references/cartography.md
@anamanvil
anamanvil merged commit bb898ac into master May 29, 2026
2 checks passed
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