terraproof 0.0.0-stage → 0.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (182) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +356 -2
  3. package/bin/terraproof.js +4 -0
  4. package/dist/router/apply.js +147 -0
  5. package/dist/router/classify.js +111 -0
  6. package/dist/router/explain.js +9 -0
  7. package/dist/router/index.js +272 -0
  8. package/dist/router/resolve.js +239 -0
  9. package/dist/router/score.js +60 -0
  10. package/dist/router/types.js +1 -0
  11. package/dist/router/validate.js +81 -0
  12. package/instructions/engineering.md +14 -0
  13. package/instructions/security.md +14 -0
  14. package/instructions/simplicity.md +13 -0
  15. package/package.json +65 -4
  16. package/routing/DOMAIN_ROUTING.md +161 -0
  17. package/routing/ROUTER_DESIGN.md +173 -0
  18. package/routing/SKILL_MANIFEST.md +86 -0
  19. package/routing/checks.json +121 -0
  20. package/routing/collections.json +47 -0
  21. package/routing/registry.json +2211 -0
  22. package/routing/rules.json +64 -0
  23. package/skills/accuracy-assessment/SKILL.md +213 -0
  24. package/skills/accuracy-assessment/UPSTREAM.md +7 -0
  25. package/skills/accuracy-assessment/references/stratified-estimator.md +127 -0
  26. package/skills/accuracy-assessment/skill.json +103 -0
  27. package/skills/brainstorming/SKILL.md +250 -0
  28. package/skills/brainstorming/UPSTREAM.md +29 -0
  29. package/skills/brainstorming/scripts/frame-template.html +213 -0
  30. package/skills/brainstorming/scripts/helper.js +167 -0
  31. package/skills/brainstorming/scripts/server.cjs +723 -0
  32. package/skills/brainstorming/scripts/start-server.sh +209 -0
  33. package/skills/brainstorming/scripts/stop-server.sh +120 -0
  34. package/skills/brainstorming/skill.json +73 -0
  35. package/skills/brainstorming/spec-document-reviewer-prompt.md +49 -0
  36. package/skills/brainstorming/visual-companion.md +299 -0
  37. package/skills/crs-and-units/SKILL.md +200 -0
  38. package/skills/crs-and-units/UPSTREAM.md +7 -0
  39. package/skills/crs-and-units/skill.json +74 -0
  40. package/skills/design-postgis-tables/SKILL.md +494 -0
  41. package/skills/design-postgis-tables/UPSTREAM.md +21 -0
  42. package/skills/design-postgis-tables/skill.json +90 -0
  43. package/skills/gdal/SKILL.md +125 -0
  44. package/skills/gdal/UPSTREAM.md +22 -0
  45. package/skills/gdal/references/gdal-recipes.md +103 -0
  46. package/skills/gdal/skill.json +66 -0
  47. package/skills/geomaster/README.md +105 -0
  48. package/skills/geomaster/SKILL.md +366 -0
  49. package/skills/geomaster/UPSTREAM.md +21 -0
  50. package/skills/geomaster/references/advanced-gis.md +376 -0
  51. package/skills/geomaster/references/big-data.md +363 -0
  52. package/skills/geomaster/references/code-examples.md +531 -0
  53. package/skills/geomaster/references/coordinate-systems.md +364 -0
  54. package/skills/geomaster/references/core-libraries.md +273 -0
  55. package/skills/geomaster/references/data-sources.md +330 -0
  56. package/skills/geomaster/references/gis-software.md +369 -0
  57. package/skills/geomaster/references/industry-applications.md +420 -0
  58. package/skills/geomaster/references/machine-learning.md +462 -0
  59. package/skills/geomaster/references/programming-languages.md +456 -0
  60. package/skills/geomaster/references/remote-sensing.md +370 -0
  61. package/skills/geomaster/references/scientific-domains.md +416 -0
  62. package/skills/geomaster/references/specialized-topics.md +428 -0
  63. package/skills/geomaster/references/troubleshooting.md +439 -0
  64. package/skills/geomaster/skill.json +157 -0
  65. package/skills/geopandas/SKILL.md +250 -0
  66. package/skills/geopandas/UPSTREAM.md +22 -0
  67. package/skills/geopandas/references/crs-management.md +231 -0
  68. package/skills/geopandas/references/data-io.md +323 -0
  69. package/skills/geopandas/references/data-structures.md +207 -0
  70. package/skills/geopandas/references/geometric-operations.md +262 -0
  71. package/skills/geopandas/references/spatial-analysis.md +294 -0
  72. package/skills/geopandas/references/visualization.md +230 -0
  73. package/skills/geopandas/scripts/_common.py +605 -0
  74. package/skills/geopandas/scripts/crs_reprojection_plan.py +210 -0
  75. package/skills/geopandas/scripts/export_plan.py +305 -0
  76. package/skills/geopandas/scripts/geometry_validity_report.py +227 -0
  77. package/skills/geopandas/scripts/sensitive_coordinates_checklist.py +230 -0
  78. package/skills/geopandas/scripts/spatial_join_audit.py +368 -0
  79. package/skills/geopandas/scripts/vector_inventory.py +140 -0
  80. package/skills/geopandas/skill.json +116 -0
  81. package/skills/geoparquet-validation/SKILL.md +125 -0
  82. package/skills/geoparquet-validation/UPSTREAM.md +24 -0
  83. package/skills/geoparquet-validation/references/distribution-best-practices.md +118 -0
  84. package/skills/geoparquet-validation/references/gpio-commands.md +264 -0
  85. package/skills/geoparquet-validation/references/tool-comparison.md +155 -0
  86. package/skills/geoparquet-validation/skill.json +71 -0
  87. package/skills/geospatial-data-discovery/SKILL.md +49 -0
  88. package/skills/geospatial-data-discovery/UPSTREAM.md +15 -0
  89. package/skills/geospatial-data-discovery/skill.json +51 -0
  90. package/skills/geospatial-frontend/SKILL.md +86 -0
  91. package/skills/geospatial-frontend/UPSTREAM.md +23 -0
  92. package/skills/geospatial-frontend/references/design-system.md +283 -0
  93. package/skills/geospatial-frontend/references/user-preferences.md +96 -0
  94. package/skills/geospatial-frontend/skill.json +87 -0
  95. package/skills/geozarr/SKILL.md +244 -0
  96. package/skills/geozarr/UPSTREAM.md +21 -0
  97. package/skills/geozarr/skill.json +97 -0
  98. package/skills/networkx/SKILL.md +440 -0
  99. package/skills/networkx/UPSTREAM.md +22 -0
  100. package/skills/networkx/references/algorithms.md +384 -0
  101. package/skills/networkx/references/generators.md +385 -0
  102. package/skills/networkx/references/graph-basics.md +284 -0
  103. package/skills/networkx/references/io.md +457 -0
  104. package/skills/networkx/references/visualization.md +531 -0
  105. package/skills/networkx/skill.json +93 -0
  106. package/skills/raster-processing/SKILL.md +222 -0
  107. package/skills/raster-processing/UPSTREAM.md +7 -0
  108. package/skills/raster-processing/skill.json +81 -0
  109. package/skills/sar-basics/SKILL.md +202 -0
  110. package/skills/sar-basics/UPSTREAM.md +7 -0
  111. package/skills/sar-basics/references/calibration-lut.md +98 -0
  112. package/skills/sar-basics/skill.json +97 -0
  113. package/skills/satellite-preprocessing/SKILL.md +241 -0
  114. package/skills/satellite-preprocessing/UPSTREAM.md +7 -0
  115. package/skills/satellite-preprocessing/skill.json +84 -0
  116. package/skills/scientific-visualization/SKILL.md +285 -0
  117. package/skills/scientific-visualization/UPSTREAM.md +25 -0
  118. package/skills/scientific-visualization/assets/color_palettes.py +263 -0
  119. package/skills/scientific-visualization/assets/nature.mplstyle +68 -0
  120. package/skills/scientific-visualization/assets/presentation.mplstyle +68 -0
  121. package/skills/scientific-visualization/assets/publication.mplstyle +77 -0
  122. package/skills/scientific-visualization/assets/publisher_profiles.json +269 -0
  123. package/skills/scientific-visualization/references/color_palettes.md +227 -0
  124. package/skills/scientific-visualization/references/journal_requirements.md +169 -0
  125. package/skills/scientific-visualization/references/matplotlib_examples.md +336 -0
  126. package/skills/scientific-visualization/references/publication_guidelines.md +196 -0
  127. package/skills/scientific-visualization/references/sources.md +76 -0
  128. package/skills/scientific-visualization/scripts/_common.py +136 -0
  129. package/skills/scientific-visualization/scripts/export_plan.py +493 -0
  130. package/skills/scientific-visualization/scripts/figure_export.py +642 -0
  131. package/skills/scientific-visualization/scripts/image_metadata.py +731 -0
  132. package/skills/scientific-visualization/scripts/palette_audit.py +327 -0
  133. package/skills/scientific-visualization/scripts/style_presets.py +501 -0
  134. package/skills/scientific-visualization/scripts/style_preview.py +232 -0
  135. package/skills/scientific-visualization/skill.json +95 -0
  136. package/skills/spectral-indices/SKILL.md +235 -0
  137. package/skills/spectral-indices/UPSTREAM.md +7 -0
  138. package/skills/spectral-indices/skill.json +88 -0
  139. package/skills/stac-and-cloud-access/SKILL.md +209 -0
  140. package/skills/stac-and-cloud-access/UPSTREAM.md +7 -0
  141. package/skills/stac-and-cloud-access/references/run-manifest.md +94 -0
  142. package/skills/stac-and-cloud-access/skill.json +98 -0
  143. package/skills/statistical-analysis/SKILL.md +446 -0
  144. package/skills/statistical-analysis/UPSTREAM.md +24 -0
  145. package/skills/statistical-analysis/references/assumptions_and_diagnostics.md +379 -0
  146. package/skills/statistical-analysis/references/bayesian_statistics.md +686 -0
  147. package/skills/statistical-analysis/references/effect_sizes_and_power.md +649 -0
  148. package/skills/statistical-analysis/references/reporting_standards.md +482 -0
  149. package/skills/statistical-analysis/references/test_selection_guide.md +129 -0
  150. package/skills/statistical-analysis/scripts/assumption_checks.py +652 -0
  151. package/skills/statistical-analysis/skill.json +127 -0
  152. package/skills/systematic-debugging/SKILL.md +283 -0
  153. package/skills/systematic-debugging/UPSTREAM.md +28 -0
  154. package/skills/systematic-debugging/condition-based-waiting-example.ts +158 -0
  155. package/skills/systematic-debugging/condition-based-waiting.md +115 -0
  156. package/skills/systematic-debugging/defense-in-depth.md +122 -0
  157. package/skills/systematic-debugging/find-polluter.sh +72 -0
  158. package/skills/systematic-debugging/root-cause-tracing.md +169 -0
  159. package/skills/systematic-debugging/skill.json +88 -0
  160. package/skills/time-series-and-change/SKILL.md +217 -0
  161. package/skills/time-series-and-change/UPSTREAM.md +7 -0
  162. package/skills/time-series-and-change/references/change-methods.md +42 -0
  163. package/skills/time-series-and-change/skill.json +116 -0
  164. package/skills/vector-quality/SKILL.md +204 -0
  165. package/skills/vector-quality/UPSTREAM.md +7 -0
  166. package/skills/vector-quality/skill.json +82 -0
  167. package/skills/verification/SKILL.md +120 -0
  168. package/skills/verification/UPSTREAM.md +31 -0
  169. package/skills/verification/skill.json +67 -0
  170. package/skills/writing-plans/SKILL.md +171 -0
  171. package/skills/writing-plans/UPSTREAM.md +23 -0
  172. package/skills/writing-plans/plan-document-reviewer-prompt.md +49 -0
  173. package/skills/writing-plans/skill.json +80 -0
  174. package/sources/SOURCES.md +374 -0
  175. package/third_party/isaaccorley-geospatial-skills/LICENSE +176 -0
  176. package/third_party/isaaccorley-geospatial-skills/NOTICE.md +17 -0
  177. package/third_party/kdense-scientific-agent-skills/LICENSE +21 -0
  178. package/third_party/kdense-scientific-agent-skills/NOTICE.md +19 -0
  179. package/third_party/superpowers/LICENSE +21 -0
  180. package/third_party/superpowers/NOTICE.md +17 -0
  181. package/third_party/timescale-pg-aiguide/LICENSE +176 -0
  182. package/third_party/timescale-pg-aiguide/NOTICE.md +14 -0
@@ -0,0 +1,71 @@
1
+ {
2
+ "name": "geoparquet-validation",
3
+ "layer": "domain",
4
+ "domains": [
5
+ "geospatial",
6
+ "data"
7
+ ],
8
+ "capabilities": [
9
+ "geoparquet",
10
+ "parquet-validation",
11
+ "cloud-native-vector"
12
+ ],
13
+ "triggers": [
14
+ "geoparquet",
15
+ "parquet spatial",
16
+ "cloud native vector",
17
+ "validate geoparquet"
18
+ ],
19
+ "recommended": [
20
+ "verification"
21
+ ],
22
+ "requires": [],
23
+ "conflicts": [],
24
+ "explanation": "Validates GeoParquet metadata and cloud-native vector distribution formatting.",
25
+ "sections": [
26
+ {
27
+ "id": "what-this-skill-is-for",
28
+ "title": "What this skill is for",
29
+ "source": "SKILL.md#what-this-skill-is-for"
30
+ },
31
+ {
32
+ "id": "tools",
33
+ "title": "Tools",
34
+ "source": "SKILL.md#tools"
35
+ },
36
+ {
37
+ "id": "workflow",
38
+ "title": "Workflow",
39
+ "source": "SKILL.md#workflow"
40
+ },
41
+ {
42
+ "id": "quick-reference",
43
+ "title": "Quick Reference",
44
+ "source": "SKILL.md#quick-reference"
45
+ },
46
+ {
47
+ "id": "references",
48
+ "title": "References",
49
+ "source": "SKILL.md#references"
50
+ },
51
+ {
52
+ "id": "distribution-best-practices",
53
+ "title": "GeoParquet Distribution Best Practices",
54
+ "source": "references/distribution-best-practices.md"
55
+ },
56
+ {
57
+ "id": "gpio-commands",
58
+ "title": "gpio Command Reference",
59
+ "source": "references/gpio-commands.md"
60
+ },
61
+ {
62
+ "id": "tool-comparison",
63
+ "title": "GeoParquet Tool Comparison",
64
+ "source": "references/tool-comparison.md"
65
+ }
66
+ ],
67
+ "checks": [
68
+ "crs.defined",
69
+ "geometry.type_consistent"
70
+ ]
71
+ }
@@ -0,0 +1,49 @@
1
+ ---
2
+ name: geospatial-data-discovery
3
+ description: "Discover, evaluate, and acquire open and authoritative geospatial data (vector boundaries, raster imagery, satellite/Earth observation, DEM elevation, land cover, buildings, street networks, and climate grids). Use when searching for GIS datasets, satellite imagery (Sentinel, Landsat), OpenStreetMap/Overture layers, STAC catalogs, national open-data portals, or Cloud-Optimized GeoTIFFs (COG) and GeoParquet distributions."
4
+ license: MIT
5
+ ---
6
+
7
+ # Geospatial Data Discovery & Verification
8
+
9
+ Domain-specific methodology for identifying, evaluating, and obtaining geospatial and Earth observation datasets with spatial precision, format compatibility, and attribution integrity.
10
+
11
+ ---
12
+
13
+ ## When to Use
14
+
15
+ Use this skill when:
16
+ - Sourcing geographic boundaries, admin polygons, roads, or building footprints
17
+ - Locating satellite imagery (Copernicus Sentinel-2, USGS Landsat, MODIS, NAIP)
18
+ - Finding elevation/DEM rasters (SRTM, Copernicus DEM, 3DEP)
19
+ - Querying SpatioTemporal Asset Catalogs (STAC) or cloud-native buckets
20
+ - Checking data licenses (ODbL, CC-BY, Public Domain) before ingestion
21
+
22
+ ---
23
+
24
+ ## 10-Point Geospatial Evaluation Checklist
25
+
26
+ Before downloading or integrating any spatial dataset, verify:
27
+
28
+ 1. **Area of Interest (AOI):** Does the bounding box or polygon strictly cover the study area?
29
+ 2. **Temporal Window:** What are the acquisition date ranges, baseline years, or repeat cycle frequencies?
30
+ 3. **Spatial Resolution / Scale:** Ground Sample Distance (e.g. 10m Sentinel vs 30m Landsat vs sub-meter aerial) or vector scale ratio (1:10k vs 1:110m).
31
+ 4. **Coordinate Reference System (CRS):** Is the native CRS geographic (WGS84 / EPSG:4326) or a local projected system (e.g., UTM zone, State Plane)?
32
+ 5. **Data Geometry / Type:** Vector (Point/Line/Polygon), Raster (single/multi-band), Point Cloud (LiDAR), or Mesh.
33
+ 6. **Cloud Cover & Quality Mask:** For optical Earth observation, check cloud percentage threshold and QA band availability.
34
+ 7. **Distribution Format:** Cloud-native (COG, GeoParquet, PMTiles, GeoZarr) vs legacy archive (Shapefile, raw HDF, zipped GeoTIFF).
35
+ 8. **Catalog & API Access:** STAC API endpoint, S3/GCS bucket requester-pays status, WFS/WMS endpoint, or direct bulk download.
36
+ 9. **License & Attribution:** Verify specific attribution requirements (e.g., "Contains modified Copernicus Sentinel data [year]", "© OpenStreetMap contributors").
37
+ 10. **Data Freshness & Provenance:** Verify update cadence, release version, and authoritative producing agency.
38
+
39
+ ---
40
+
41
+ ## Recommended Authoritative Data Sources
42
+
43
+ - **OpenStreetMap (OSM) / Geofabrik:** Global crowd-sourced vector data (roads, POIs, land use). License: ODbL.
44
+ - **Overture Maps Foundation:** Cloud-native GeoParquet releases of buildings, places, transportation, and base layers. License: CDLA-Permissive-2.0 / ODbL.
45
+ - **USGS EarthExplorer / Landsat:** 30m multispectral global archive (Landsat 8/9). Public Domain.
46
+ - **Copernicus Open Access / Sentinel Hub:** 10m multispectral (Sentinel-2), SAR (Sentinel-1). Open access with attribution.
47
+ - **NASA Earthdata / Planetary Computer / AWS Open Data:** Curated STAC catalogs offering direct COG/Zarr streaming.
48
+ - **Natural Earth:** Public domain global vector and raster map dataset at 1:10m, 1:50m, and 1:110m scales.
49
+ - **Copernicus DEM (GLO-30) / SRTM:** 30m global digital elevation models.
@@ -0,0 +1,15 @@
1
+ # Upstream Attribution
2
+
3
+ This skill is an **AgentLayer-native** skill authored to provide a standardized, rigorous evaluation and acquisition workflow for Earth observation, remote sensing, and open GIS data.
4
+
5
+ - **Author:** AgentLayer Team
6
+ - **License:** MIT
7
+ - **Created Date:** 2026-08-25
8
+ - **Local Path:** `skills/geospatial-data-discovery/`
9
+
10
+ ## Referenced Standards & Sources
11
+
12
+ - OGC (Open Geospatial Consortium) Standards: STAC, GeoTIFF/COG, GeoPackage, WFS/WMS/OGC API Features.
13
+ - OpenStreetMap Attribution Guidelines (ODbL).
14
+ - Overture Maps Foundation Data Distribution Specifications.
15
+ - Copernicus Open Access / USGS Public Data Distribution Policies.
@@ -0,0 +1,51 @@
1
+ {
2
+ "name": "geospatial-data-discovery",
3
+ "layer": "domain",
4
+ "domains": [
5
+ "geospatial",
6
+ "data"
7
+ ],
8
+ "capabilities": [
9
+ "gis-data-sourcing",
10
+ "stac-catalog",
11
+ "osm-data",
12
+ "overture-data",
13
+ "satellite-sourcing"
14
+ ],
15
+ "triggers": [
16
+ "find gis data",
17
+ "source satellite data",
18
+ "stac",
19
+ "openstreetmap data",
20
+ "overture maps",
21
+ "download dem",
22
+ "find shapefile",
23
+ "acquire spatial data"
24
+ ],
25
+ "recommended": [
26
+ "verification"
27
+ ],
28
+ "requires": [],
29
+ "conflicts": [],
30
+ "explanation": "Sources open geospatial data (STAC, OSM, Sentinel, Landsat, DEMs).",
31
+ "sections": [
32
+ {
33
+ "id": "when-to-use",
34
+ "title": "When to Use",
35
+ "source": "SKILL.md#when-to-use"
36
+ },
37
+ {
38
+ "id": "10-point-geospatial-evaluation-checklist",
39
+ "title": "10-Point Geospatial Evaluation Checklist",
40
+ "source": "SKILL.md#10-point-geospatial-evaluation-checklist"
41
+ },
42
+ {
43
+ "id": "recommended-authoritative-data-sources",
44
+ "title": "Recommended Authoritative Data Sources",
45
+ "source": "SKILL.md#recommended-authoritative-data-sources"
46
+ }
47
+ ],
48
+ "checks": [
49
+ "stac.provenance"
50
+ ]
51
+ }
@@ -0,0 +1,86 @@
1
+ ---
2
+ name: geospatial-frontend
3
+ description: Build visually stunning geospatial demo webapps with MapLibre globe, DuckDB-WASM, and a warm dark HUD aesthetic. Use when building satellite imagery retrieval demos, embedding visualization tools, geospatial search UIs, or any map-centric data exploration frontend. Triggers on requests to scaffold a new geo demo, build a map-based UI, or create a retrieval/search visualization over satellite data.
4
+ ---
5
+
6
+ # Geospatial Frontend Demo Builder
7
+
8
+ Build premium map-centric demo webapps. Derived from a production geospatial retrieval demo with battle-tested design patterns.
9
+
10
+ ## Architecture
11
+
12
+ - **Stack**: Vite + vanilla TypeScript + MapLibre GL JS (globe) + DuckDB-WASM + pure CSS
13
+ - **No frameworks**: No React, Vue, Tailwind, CSS-in-JS. Pure semantic HTML + CSS custom properties + vanilla TS.
14
+ - **Map-first**: The globe IS the app. Everything else floats on top as a transparent HUD.
15
+ - **Single source of truth**: Global `state` object; `updateView()` re-renders; fingerprint diffing prevents redundant DOM rebuilds.
16
+
17
+ ## Design System
18
+
19
+ See [references/design-system.md](references/design-system.md) for full token spec (colors, fonts, shadows, spacing, radii, animations, components).
20
+
21
+ **Core identity**: Warm espresso + ivory + rust. Dark mode only. Glassmorphed floating panels. Inspired by Anthropic Salon aesthetic.
22
+
23
+ ## UI Rules
24
+
25
+ See [references/user-preferences.md](references/user-preferences.md) for battle-tested patterns, confirmed features, and design rules.
26
+
27
+ ## Layout
28
+
29
+ ```
30
+ viewport (100vw x 100vh, fixed)
31
+ ::before starfield
32
+ ::after vignette
33
+ #map MapLibre globe canvas
34
+ brand top-left (spinning rings + logotype)
35
+ search top-center (glassmorphed geocoder)
36
+ status top-center-below (pulsing LED + message)
37
+ panel-L left (query: draw controls, exemplars, results)
38
+ panel-R right (explore/discoveries, optional)
39
+ tutorial overlay + spotlight + card (z:1000+)
40
+ ```
41
+
42
+ Panels are `position: fixed`, glassmorphed, with generous padding. Map fills entire viewport underneath.
43
+
44
+ ## Map Integration
45
+
46
+ - **MapLibre GL JS** with `projection: "globe"` (3D globe, not flat)
47
+ - **Sentinel-2 cloudless tiles** (or similar satellite basemap)
48
+ - **Layer stack**: AOI fill/stroke -> draft layers -> result fill/stroke -> point circles with halos -> hover preview
49
+ - **Drawing**: rectangle (shift+drag with DOM overlay) + polygon (click-to-add, double-click-to-close)
50
+ - **Fly-to animations**: `globe.flyTo()` with curve 1.4, speed 1.2
51
+ - **GeoJSON sources**: all data as GeoJSON, expression-based paint properties for dynamic styling
52
+
53
+ ## Data Pipeline Pattern
54
+
55
+ - DuckDB-WASM loads Parquet manifest + shards
56
+ - Spatial filtering via `ST_Intersects` or bbox containment
57
+ - Web Worker for heavy compute (embedding distances, scoring)
58
+ - Concurrency-limited parallel shard fetches
59
+ - Two-phase data loading: metadata first, embeddings on demand
60
+
61
+ ## Tutorial System
62
+
63
+ Interactive 5-7 step spotlight walkthrough that SIMULATES real actions:
64
+ - Box-shadow spotlight (`0 0 0 9999px rgba(...)`) cuts a hole over target element
65
+ - Card auto-positioned via `getBoundingClientRect()`, glass-panel styled
66
+ - Simulated clicks with animated ripple effect
67
+ - Enter key advances; auto-place exemplars if user skips ahead
68
+ - Store completion in localStorage
69
+ - Must be a LIVE demo -- simulate zoom, draw, exemplar placement, view modes
70
+
71
+ ## Responsive
72
+
73
+ Two breakpoints only:
74
+ - **1100px**: shrink panels, hide secondary nav
75
+ - **900px**: panels collapse to bottom-center stack, max-height 40-45vh
76
+
77
+ ## File Organization
78
+
79
+ Keep files under ~500 LOC. Split by concern:
80
+ - `main.ts` -- app state, DOM, event handlers, tutorial
81
+ - `map.ts` -- MapLibre setup, layers, drawing, camera
82
+ - `types.ts` -- interfaces
83
+ - `util.ts` -- geometry, color interpolation, formatting
84
+ - `scoring-worker.ts` -- Web Worker for compute
85
+ - `styles.css` -- all CSS (pure, no preprocessor)
86
+ - `index.html` -- entry with font preloads + meta tags
@@ -0,0 +1,23 @@
1
+ # Upstream Attribution
2
+
3
+ This skill is derived from the `geospatial-frontend` skill in `isaaccorley/geospatial-skills`.
4
+
5
+ - **Upstream repository:** https://github.com/isaaccorley/geospatial-skills
6
+ - **Upstream path:** `skills/geospatial-frontend/`
7
+ - **License:** Apache-2.0 (see [third_party/isaaccorley-geospatial-skills/LICENSE](../../third_party/isaaccorley-geospatial-skills/LICENSE))
8
+ - **Imported commit:** `a203446cb997cd1dbf054918b1021a6040b69824`
9
+ - **Import date:** 2026-08-25
10
+ - **Local path:** `skills/geospatial-frontend/`
11
+
12
+ ## Imported Files
13
+
14
+ - `SKILL.md`
15
+ - `references/design-system.md`
16
+ - `references/user-preferences.md`
17
+
18
+ ## Local modifications
19
+
20
+ Initial import:
21
+ - Local behavioral modifications: none (faithful vendoring, byte-for-byte identical to upstream).
22
+
23
+ Any future AgentLayer modifications must be documented here.
@@ -0,0 +1,283 @@
1
+ # Design System Tokens
2
+
3
+ Full CSS custom property spec for the warm espresso + ivory + rust palette.
4
+
5
+ ## Colors
6
+
7
+ ```css
8
+ :root {
9
+ /* Backgrounds */
10
+ --bg: #1a1612; /* espresso ink */
11
+ --bg-soft: #221c16; /* slightly lifted */
12
+ --panel: rgba(32, 26, 21, 0.78); /* glassmorphism base */
13
+ --panel-strong: rgba(20, 16, 13, 0.9); /* opaque overlay */
14
+ --ink: #0e0b08; /* deepest black */
15
+
16
+ /* Text */
17
+ --text: #f3ecd8; /* warm ivory/bone */
18
+ --muted: #9a8f7a; /* brownish-gray */
19
+ --muted-strong: #d4c9ae; /* brighter muted */
20
+
21
+ /* Accent */
22
+ --accent: #d0542c; /* rust-red, primary */
23
+ --accent-strong:#e37148; /* hover rust */
24
+ --accent-dark: #a33d1a; /* depth/pressed */
25
+ --aoi: #e5a853; /* ochre, regions */
26
+ --positive: #c74633; /* deep coral, exemplars */
27
+ --negative: #3b82f6; /* blue, contrast */
28
+ --amber: #f59e0b; /* toggles, warnings */
29
+
30
+ /* Elevation */
31
+ --shadow-lg: 0 28px 80px rgba(0,0,0,0.55), 0 2px 0 rgba(255,255,255,0.04) inset;
32
+ --shadow-md: 0 18px 42px rgba(0,0,0,0.45);
33
+
34
+ /* Radii */
35
+ --radius: 14px; /* cards, panels */
36
+ --radius-sm: 8px; /* buttons, inputs */
37
+ }
38
+ ```
39
+
40
+ ## Typography
41
+
42
+ ### Font loading (index.html)
43
+
44
+ ```html
45
+ <link rel="preconnect" href="https://fonts.googleapis.com" />
46
+ <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
47
+ <link href="https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,500;9..144,600&family=Inter+Tight:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap" rel="stylesheet" />
48
+ ```
49
+
50
+ ### Font assignments
51
+
52
+ ```css
53
+ body {
54
+ font-family: "Inter Tight", sans-serif;
55
+ font-feature-settings: "ss01", "cv11";
56
+ -webkit-font-smoothing: antialiased;
57
+ text-rendering: optimizeLegibility;
58
+ }
59
+
60
+ h1, h2, h3, .brand-text h1 {
61
+ font-family: "Fraunces", serif;
62
+ }
63
+
64
+ h1 {
65
+ font-size: 1.6rem;
66
+ font-weight: 500;
67
+ font-variation-settings: "opsz" 144;
68
+ letter-spacing: -0.04em;
69
+ }
70
+
71
+ h2 {
72
+ font-size: 1.3rem;
73
+ font-weight: 500;
74
+ font-variation-settings: "opsz" 36;
75
+ }
76
+
77
+ .mono, .score, .coord, .chip-label {
78
+ font-family: "JetBrains Mono", monospace;
79
+ font-variant-numeric: tabular-nums;
80
+ }
81
+ ```
82
+
83
+ ### Letterspacing scale
84
+
85
+ - Display (h1, brand): `-0.04em`
86
+ - Body: `-0.005em`
87
+ - Labels/kickers: `0.22em` (uppercase, open)
88
+
89
+ ## Glassmorphism
90
+
91
+ ```css
92
+ .glass-panel {
93
+ background: var(--panel);
94
+ backdrop-filter: blur(18px) saturate(140%);
95
+ -webkit-backdrop-filter: blur(18px) saturate(140%);
96
+ border: 1px solid rgba(255, 255, 255, 0.06);
97
+ border-radius: var(--radius);
98
+ box-shadow: var(--shadow-lg);
99
+ }
100
+ ```
101
+
102
+ ## Buttons
103
+
104
+ ```css
105
+ .btn-primary {
106
+ background: linear-gradient(180deg, var(--accent) 0%, var(--accent-dark) 100%);
107
+ color: var(--ink);
108
+ border: none;
109
+ border-radius: var(--radius-sm);
110
+ font-family: "JetBrains Mono", monospace;
111
+ font-size: 0.72rem;
112
+ font-weight: 600;
113
+ letter-spacing: 0.06em;
114
+ text-transform: uppercase;
115
+ padding: 7px 18px;
116
+ cursor: pointer;
117
+ transition: transform 140ms, box-shadow 140ms;
118
+ }
119
+
120
+ .btn-primary:hover {
121
+ transform: translateY(-1px);
122
+ box-shadow: 0 6px 20px rgba(208, 84, 44, 0.3);
123
+ }
124
+ ```
125
+
126
+ ## Segmented control (view mode tabs)
127
+
128
+ ```css
129
+ .view-tabs {
130
+ display: grid;
131
+ grid-template-columns: repeat(N, 1fr);
132
+ gap: 2px;
133
+ background: rgba(255, 255, 255, 0.04);
134
+ border-radius: var(--radius-sm);
135
+ padding: 2px;
136
+ }
137
+
138
+ .view-tab {
139
+ font-family: "JetBrains Mono", monospace;
140
+ font-size: 0.68rem;
141
+ text-transform: uppercase;
142
+ letter-spacing: 0.08em;
143
+ padding: 5px 0;
144
+ border-radius: 6px;
145
+ color: var(--muted);
146
+ transition: all 140ms;
147
+ }
148
+
149
+ .view-tab.is-active {
150
+ background: linear-gradient(180deg, var(--accent) 0%, var(--accent-dark) 100%);
151
+ color: var(--ink);
152
+ box-shadow: 0 4px 14px rgba(208, 84, 44, 0.28),
153
+ 0 0 0 1px rgba(208, 84, 44, 0.32) inset;
154
+ }
155
+ ```
156
+
157
+ ## Animations
158
+
159
+ ```css
160
+ /* Staggered list reveal */
161
+ @keyframes fadeSlideUp {
162
+ from { opacity: 0; transform: translateY(6px); }
163
+ to { opacity: 1; transform: none; }
164
+ }
165
+ .list-item {
166
+ animation: fadeSlideUp 320ms ease-out both;
167
+ animation-delay: calc(var(--i, 0) * 28ms);
168
+ }
169
+
170
+ /* Status LED pulse */
171
+ @keyframes pulse-idle { 0%,100% { opacity: 0.5; } 50% { opacity: 1; } }
172
+ @keyframes pulse-busy { 0%,100% { opacity: 0.6; transform: scale(1); } 50% { opacity: 1; transform: scale(1.15); } }
173
+ .status-dot { animation: pulse-idle 2.8s ease-in-out infinite; }
174
+ .status-dot.busy { animation: pulse-busy 1.2s ease-in-out infinite; }
175
+
176
+ /* Brand orbital rings */
177
+ @keyframes spin { to { transform: rotate(360deg); } }
178
+ .brand-ring { animation: spin 14s linear infinite; }
179
+ .brand-ring-2 { animation: spin 22s linear infinite reverse; }
180
+
181
+ /* Tutorial ripple */
182
+ @keyframes tut-ripple {
183
+ 0% { box-shadow: 0 0 0 0 rgba(208,84,44,0.5); }
184
+ 50% { box-shadow: 0 0 0 14px rgba(208,84,44,0.2); }
185
+ 100% { box-shadow: 0 0 0 28px rgba(208,84,44,0); }
186
+ }
187
+
188
+ /* Panel/element entrance */
189
+ @keyframes fadeSlide {
190
+ from { opacity: 0; transform: translateY(12px); }
191
+ to { opacity: 1; transform: none; }
192
+ }
193
+ ```
194
+
195
+ ## Scroll fade mask
196
+
197
+ ```css
198
+ .scrollable-list {
199
+ overflow-y: auto;
200
+ -webkit-mask-image: linear-gradient(to bottom, #000 80%, transparent 100%);
201
+ mask-image: linear-gradient(to bottom, #000 80%, transparent 100%);
202
+ }
203
+ ```
204
+
205
+ ## Custom range slider
206
+
207
+ ```css
208
+ input[type="range"] {
209
+ -webkit-appearance: none;
210
+ height: 5px;
211
+ border-radius: 3px;
212
+ background: linear-gradient(90deg,
213
+ var(--accent) 0%,
214
+ var(--accent) var(--v, 20%),
215
+ rgba(255,255,255,0.12) var(--v, 20%),
216
+ rgba(255,255,255,0.12) 100%
217
+ );
218
+ }
219
+
220
+ input[type="range"]::-webkit-slider-thumb {
221
+ -webkit-appearance: none;
222
+ width: 16px; height: 16px;
223
+ border-radius: 50%;
224
+ background: var(--bg);
225
+ border: 2px solid var(--accent);
226
+ box-shadow: 0 0 0 4px rgba(208, 84, 44, 0.18);
227
+ cursor: pointer;
228
+ }
229
+ ```
230
+
231
+ ## Starfield + Vignette
232
+
233
+ ```css
234
+ .viewport::before {
235
+ content: "";
236
+ position: absolute; inset: 0;
237
+ background-image:
238
+ radial-gradient(1px 1px at 17% 32%, rgba(255,255,255,0.85), transparent 60%),
239
+ radial-gradient(1px 1px at 72% 18%, rgba(255,255,255,0.7), transparent 60%),
240
+ radial-gradient(1px 1px at 41% 71%, rgba(255,255,255,0.6), transparent 60%),
241
+ radial-gradient(1px 1px at 89% 55%, rgba(255,255,255,0.75), transparent 60%),
242
+ radial-gradient(1px 1px at 28% 88%, rgba(255,255,255,0.5), transparent 60%),
243
+ radial-gradient(1px 1px at 63% 42%, rgba(255,255,255,0.65), transparent 60%),
244
+ radial-gradient(1px 1px at 5% 12%, rgba(255,255,255,0.55), transparent 60%),
245
+ radial-gradient(1px 1px at 95% 82%, rgba(255,255,255,0.45), transparent 60%);
246
+ opacity: 0.55;
247
+ z-index: 0;
248
+ pointer-events: none;
249
+ }
250
+
251
+ .viewport::after {
252
+ content: "";
253
+ position: absolute; inset: 0;
254
+ background: radial-gradient(ellipse at center, transparent 40%, rgba(14, 11, 8, 0.6) 100%);
255
+ z-index: 1;
256
+ pointer-events: none;
257
+ }
258
+ ```
259
+
260
+ ## Plasma Colormap (5-stop)
261
+
262
+ ```typescript
263
+ function interpolatePlasma(t: number): string {
264
+ // 0.0 yellow -> 0.25 orange -> 0.5 magenta -> 0.75 violet -> 1.0 indigo
265
+ const stops = [
266
+ [0.0, [240, 249, 33]], // #f0f921
267
+ [0.25, [248, 149, 64]], // #f89540
268
+ [0.5, [204, 71, 120]], // #cc4778
269
+ [0.75, [126, 3, 167]], // #7e03a7
270
+ [1.0, [13, 8, 135]], // #0d0887
271
+ ];
272
+ // Linear interpolation between adjacent stops
273
+ }
274
+ ```
275
+
276
+ ## Number formatting
277
+
278
+ ```typescript
279
+ function compact(n: number): string {
280
+ if (n >= 1000) return (n / 1000).toFixed(1) + "k";
281
+ return String(n);
282
+ }
283
+ ```
@@ -0,0 +1,96 @@
1
+ # UI Preferences & Design Rules
2
+
3
+ Battle-tested patterns from building a production geospatial retrieval demo.
4
+
5
+ ## Layout & Sizing
6
+
7
+ - **Panels must be compact.** Default to smaller controls. Common correction: "make the side panel smaller", "draw button is way too large".
8
+ - **Map is king.** Globe should be large on load. Panels never crowd it.
9
+ - **Exemplar panel shorter, retrieval panel taller.** Results > inputs in visual hierarchy.
10
+ - **Brand subtitle letterspacing must match title width.**
11
+
12
+ ## Remove Clutter
13
+
14
+ Aggressively strip unnecessary text. All explicitly removed in testing:
15
+
16
+ - "Region of Interest" label, "Draw an AOI to fetch candidate tiles", "Ranked candidates" heading, "Awaiting Region" placeholder
17
+ - Chip IDs (just show coords), section numbering (01/02/03), "Clear points" text when icon suffices
18
+ - Stats panels (shards/roi/patches count), "Cutoff" label (just show "1/300"), "data-driven" badges
19
+
20
+ **Rule**: If the UI element doesn't directly help the user DO something, remove it.
21
+
22
+ ## Button & Control Design
23
+
24
+ - Draw mode: literal "Draw Box" and "Draw Poly" buttons. No separate trigger.
25
+ - Button stays "Draw Region" after drawing -- NOT "Redraw Region".
26
+ - "Export GeoParquet" -> just "Export". Same row as other actions.
27
+ - Slider fill syncs with thumb position (CSS `--v` var).
28
+ - Buttons styled with accent gradient (orange/rust), not outline.
29
+
30
+ ## Click Behavior
31
+
32
+ - **Click list item = zoom to it.** NOT remove it.
33
+ - **X button = remove.** Always explicit delete affordance.
34
+ - Exemplar points appear INSTANTLY on click (draw dot immediately, load embedding async).
35
+ - Clicking before drawing a region is allowed -- queue points.
36
+ - Negative exemplars work ANYWHERE on map, not just inside region.
37
+ - Deduplicate: same patch clicked twice must NOT add duplicate.
38
+ - Drawing a region must NOT zoom out to fit. Keep current viewport.
39
+ - Result click should zoom in slightly MORE than default fly-to.
40
+
41
+ ## Hover & Tooltips
42
+
43
+ - Tooltip delay: FAST (cut default in half).
44
+ - Every icon button needs tooltip: name + 1-line description.
45
+ - Help popovers (?) must not clip at viewport edges.
46
+ - Popover z-index above everything (9999+).
47
+
48
+ ## Scrollability
49
+
50
+ - Scrollable lists MUST have bottom fade-out mask.
51
+ - Both exemplar and result lists need this treatment.
52
+
53
+ ## Tutorial
54
+
55
+ - Must simulate real actions, not just point at panels.
56
+ - Simulate: zoom in -> draw region -> click exemplar (inside AND outside region) -> show top-k vs heatmap.
57
+ - Auto-place exemplars if user skips ahead. Enter key advances.
58
+ - ~1.1s per view mode cycle during demo.
59
+ - Card styling matches glass-panel theme.
60
+ - Show on first load (localStorage gate).
61
+ - Demonstrate multi-region and external exemplars.
62
+
63
+ ## Confirmed Good Features
64
+
65
+ - Heatmap view ("the nicest feature")
66
+ - External exemplars (click OUTSIDE region)
67
+ - Multi-AOI support
68
+ - Polygon draw with DuckDB ST_Intersects
69
+ - Outlier detection ("most unique" patches)
70
+ - Threshold histogram with slider
71
+ - Embedding arithmetic (mean/AND/OR/XOR)
72
+ - Invert toggle (bit flip for "opposite" search)
73
+ - Similarity gradient field
74
+ - Pre-computed scores cached for instant view switching
75
+
76
+ ## Features Removed After Testing
77
+
78
+ - Contour view mode, find similar regions / region fingerprint, basemap attribution
79
+
80
+ ## Data & Performance
81
+
82
+ - Two-phase fetch: metadata first, full embedding on demand.
83
+ - Default top-k: 50, max slider: 100
84
+ - Numbers > 1000: compact format (1.8k)
85
+ - Shard loading must NOT block exemplar placement
86
+ - Stale loading messages must always clear
87
+
88
+ ## Branding
89
+
90
+ - Attribution: "Created by [Name]" (hyperlinked, underlined)
91
+ - Brand panel: translucent backdrop, not opaque. Needs margin to avoid overlapping query panel.
92
+
93
+ ## Build & Deploy
94
+
95
+ - Static build can break MapLibre overlays that work in dev. Need MapLibre dev bundle + z-index fix on map canvas for production.
96
+ - Always test static build, not just dev server.