.cortex/skills/route-optimization/SKILL.md
Deploy the Route Optimization demo including Marketplace data and notebook. Use when: setting up the route optimization demo after native app deployment. Do NOT use for: fleet intelligence demos (use fleet-intelligence-taxis), route deviation analysis (use route-deviation), or retail catchment analysis. Triggers: deploy route optimization demo, setup route optimization demo, run route optimization demo.
npx skillsauth add snowflake-labs/sfguide-create-a-route-optimisation-and-vehicle-route-plan-simulator route-optimizationInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Deploys the complete Route Optimization demo including Snowflake Marketplace data and the exploration notebook. The interactive VRP simulator is served via the shared React Demo Dashboard app.
| Privilege | Scope | Reason | |-----------|-------|--------| | CREATE DATABASE | Account | Creates FLEET_INTELLIGENCE database | | CREATE WAREHOUSE | Account | Creates ROUTING_ANALYTICS warehouse | | IMPORT SHARE | Account | Acquires OVERTURE_MAPS__PLACES from Marketplace | | USAGE ON DATABASE FLEET_INTELLIGENCE | Database | Uses the setup database | | CREATE SCHEMA | Database (FLEET_INTELLIGENCE) | Creates ROUTE_OPTIMIZATION schema | | CREATE TABLE | Schema (FLEET_INTELLIGENCE.ROUTE_OPTIMIZATION) | Creates CONFIG, PLACES, LOOKUP, JOB_TEMPLATE | | USAGE ON DATABASE OVERTURE_MAPS__PLACES | Database | Reads Marketplace POI data | | USAGE ON DATABASE OPENROUTESERVICE_NATIVE_APP | Database | Calls ORS routing functions | | EXECUTE MANAGED TASK | Account | Enables ALTER ACCOUNT SET CORTEX_ENABLED_CROSS_REGION (optional) |
Note: ACCOUNTADMIN is NOT required. Create a custom role with the above privileges, or use any role that has them.
All
snow stage copycommands use--connection <ACTIVE_CONNECTION>. Replace<ACTIVE_CONNECTION>with the name of your currently active Snowflake connection.
| Parameter | Default | Description |
|-----------|---------|-------------|
| DATABASE | FLEET_INTELLIGENCE | Database for demo objects |
| SCHEMA | ROUTE_OPTIMIZATION | Schema for VRP tables and notebooks |
| WAREHOUSE | ROUTING_ANALYTICS | Warehouse for queries |
| MARKETPLACE_CARTO | CARTO Academy | CARTO Academy Marketplace listing name |
Follow the Error Logging convention in AGENTS.md. Log file prefix:
route-optimization.
sed or replace_all on .ipynb files — notebooks are JSON with structured cell arrays. Use targeted replacements on specific cells identified by name..ipynb files before uploading.Pre-check: If data already exists, skip to Step 6. Run:
SELECT COUNT(*) AS cnt FROM FLEET_INTELLIGENCE.ROUTE_OPTIMIZATION.PLACES;
If cnt > 0, the data pipeline has already run. Skip to Step 6 (Claude model check) or Step 7 (AISQL notebook) as needed.
Goal: Set session query tag for attribution tracking.
See
references/sql-setup.mdfor the SQL command.
Goal: Confirm all 4 ORS services are active (OPENROUTESERVICE, ROUTING_REVERSE_PROXY, VROOM, DOWNLOADER).
See
references/sql-setup.mdfor SHOW SERVICES, RESUME_ALL_SERVICES, and CHECK_HEALTH SQL.
STOP if ORS Native App is not installed.
Goal: Detect current map region and routing profiles, gather customization preferences from the user.
.cortex/skills/routing-customization/read-ors-configuration/SKILL.mdreferences/industry-customization.md<REGION_NAME>, <NOTEBOOK_CITY>, <ENABLED_PROFILES>, <CUSTOM_INDUSTRIES>Output: Map Region, Demo City, Vehicle Profiles, Custom Industries (YES/NO) confirmed with user.
Goal: Acquire Overture Maps Places dataset for POI data.
See
references/sql-setup.mdfor the Marketplace SQL.
Output: OVERTURE_MAPS__PLACES database available.
Goal: Create database, schema, warehouse, CONFIG, PLACES, JOB_TEMPLATE, and LOOKUP tables from Overture Maps.
SET variables at the top of references/seed-data.sql:
$REGION_GEOHASH: see geohash table in references/notebook-deployment.md$REGION_NAME: the city/region name (e.g., 'NewYork', 'London')references/seed-data.sql per references/industry-customization.md.snow sql -f .cortex/skills/route-optimization/references/seed-data.sql -c <connection>
SELECT 'PLACES' AS TBL, COUNT(*) AS CNT FROM FLEET_INTELLIGENCE.ROUTE_OPTIMIZATION.PLACES
UNION ALL SELECT 'LOOKUP', COUNT(*) FROM FLEET_INTELLIGENCE.ROUTE_OPTIMIZATION.LOOKUP
UNION ALL SELECT 'JOB_TEMPLATE', COUNT(*) FROM FLEET_INTELLIGENCE.ROUTE_OPTIMIZATION.JOB_TEMPLATE;
Expected: PLACES 50K-500K, LOOKUP 4, JOB_TEMPLATE 29. STOP if any table has 0 rows.Output: Standing data populated for <REGION_NAME>.
Goal: Verify latest Claude Sonnet model is available in Snowflake Cortex.
See
references/notebook-deployment.md(Step 7) for the test SQL and update instructions.
Goal: Deploy the AISQL exploration notebook, customized for <NOTEBOOK_CITY>.
See
references/notebook-deployment.md(Step 8) for cell-by-cell update tables, text replacement rules, post-replacement validation, and upload/create commands.
If city references already match <NOTEBOOK_CITY>, skip modification and upload directly.
Output: AISQL notebook deployed with AI prompts customized for <NOTEBOOK_CITY>.
The React Demo Dashboard page queries these exact tables and columns. If the pipeline changes column names, the React page must be updated to match.
| Column | Type | Used By | |--------|------|---------| | VEHICLE_TYPE | VARCHAR | Global vehicle type selector | | REGION | VARCHAR | Global region selector (updated by server on region switch) |
| Column | Type | Used By | |--------|------|---------| | REGION | VARCHAR | RouteOptimization (region filter) | | NAME | VARCHAR | RouteOptimization (place display) | | CATEGORY | VARCHAR | RouteOptimization (filtering) | | GEOMETRY | GEOGRAPHY | RouteOptimization (ST_X/ST_Y, ST_DWITHIN radius filter) |
| Column | Type | Used By | |--------|------|---------| | REGION | VARCHAR | RouteOptimization (region filter) | | ID | NUMBER | RouteOptimization (job assignment) | | SLOT_START | NUMBER | RouteOptimization (VRP time windows) | | SLOT_END | NUMBER | RouteOptimization (VRP time windows) | | SKILLS | NUMBER | RouteOptimization (VRP skills constraint) | | PRODUCT | VARCHAR | RouteOptimization | | STATUS | VARCHAR | RouteOptimization (active filter) |
| Column | Type | Used By | |--------|------|---------| | REGION | VARCHAR | RouteOptimization (region filter) | | INDUSTRY | VARCHAR | RouteOptimization (industry selector) | | PA | VARCHAR | RouteOptimization (POI category filter) | | PB | VARCHAR | RouteOptimization | | PC | VARCHAR | RouteOptimization |
| Function | Used By | |----------|---------| | OPENROUTESERVICE_NATIVE_APP.CORE.ISOCHRONES | Catchment preview (TABLE function) | | OPENROUTESERVICE_NATIVE_APP.CORE.OPTIMIZATION | VRP solver | | OPENROUTESERVICE_NATIVE_APP.CORE.DIRECTIONS | Per-vehicle route geometry (TABLE function) | | SNOWFLAKE.CORTEX.COMPLETE | AI geocoding |
Goal: Confirm tables exist and Demo Dashboard shows the page.
| Issue | Symptom | Solution |
|-------|---------|----------|
| Stale config file | Wrong region detected | Run rm -rf /tmp/ors* /tmp/*ors* before downloading config |
| Marketplace access denied | CALL SYSTEM$ACCEPT_LEGAL_TERMS fails | Requires IMPORT SHARE privilege (see Required Privileges section) |
| Notebook execution fails | EXECUTE NOTEBOOK errors | Check logs in Snowsight; verify OVERTURE_MAPS__PLACES accessible and warehouse active |
| Cortex model unavailable | "model not found" error | Try fallback model or set CORTEX_ENABLED_CROSS_REGION = 'ANY_REGION' |
| Services not starting | SUSPENDED or FAILED status | CALL OPENROUTESERVICE_NATIVE_APP.CORE.RESUME_ALL_SERVICES(); check compute pool capacity |
| Dashboard shows no data | Verify PLACES, LOOKUP, JOB_TEMPLATE tables are populated |
| Stage upload fails | Permission error | Verify WRITE privilege on stage and correct --connection |
| Wrong POI region | PLACES has wrong city data | Fix geohash in Step 5, re-run notebook |
| Custom industries missing | Dropdown shows old industries | Verify LOOKUP table; re-run from Step 5 |
Re-running is safe: all statements use IF NOT EXISTS or OR REPLACE, and snow stage copy uses --overwrite. No manual cleanup needed.
Complete Route Optimization demo with:
To remove all objects created by this skill:
DROP NOTEBOOK IF EXISTS FLEET_INTELLIGENCE.ROUTE_OPTIMIZATION.ROUTING_FUNCTIONS_AISQL;
DROP TABLE IF EXISTS FLEET_INTELLIGENCE.ROUTE_OPTIMIZATION.CONFIG;
DROP TABLE IF EXISTS FLEET_INTELLIGENCE.ROUTE_OPTIMIZATION.LOOKUP;
DROP STAGE IF EXISTS FLEET_INTELLIGENCE.ROUTE_OPTIMIZATION.NOTEBOOK;
DROP SCHEMA IF EXISTS FLEET_INTELLIGENCE.ROUTE_OPTIMIZATION;
Tip: Use the
cleanupskill to auto-discover all tagged objects via COMMENT tracking.
tools
Optimize, audit, create, and improve Cortex Code skills following official best practices from the Anthropic skill-building guide. Use when: creating a new skill, reviewing an existing skill, optimizing skill description or triggers, improving SKILL.md structure, auditing skill quality, fixing undertriggering or overtriggering, restructuring skill for progressive disclosure. Do NOT use for: general code review, non-skill markdown editing, MCP server development. Triggers: optimize skill, audit skill, review skill, create skill, improve skill, fix skill triggers, skill best practices, skill quality check.
testing
Discover and remove all Snowflake objects created by skills in this repo. Uses the COMMENT tracking tag (sf_sit-is-fleet) to find objects, generates DROP statements, and optionally executes them. Use when: cleaning up after a demo, removing all skill-created objects, tearing down an environment, uninstalling a specific skill's objects. Do NOT use for: dropping objects not created by these skills, production environment cleanup without review. Triggers: routing-solution-cleanup, cleanup, teardown, remove, uninstall, drop all, clean up demo, remove skill objects, reset environment.
tools
Check and install build prerequisites for the Routing Solution project. Use when: verifying environment setup before building, checking if Docker/Podman/snow CLI are installed, confirming readiness to build. Do NOT use for: building the routing solution itself (use build-routing-solution), deploying demos, or changing ORS configuration. Triggers: check prerequisites, check build prerequisites, am I ready to build, what do I need installed, verify environment setup, Docker installed, Podman installed, snow CLI installed.
tools
Enable or disable ORS routing profiles (driving-car, driving-hgv, cycling, walking, wheelchair). Subskill of routing-customization — must be invoked from the router, not independently. Use when: changing vehicle types as part of customization workflow. Do NOT use for: standalone execution, changing map region, or deploying demo apps. Triggers: change routing profile, change vehicle type, enable profile, disable profile.