.cortex/skills/routing-customization/SKILL.md
Route customization requests to the correct subskills. Use when: changing location, changing map, changing vehicle, changing routing profile. Do NOT use for: initial ORS deployment (use build-routing-solution), deploying demo apps, or reading ORS config only (use read-ors-configuration subskill directly). Triggers: change location, change map, change vehicle, change routing profile, change routing profiles.
npx skillsauth add snowflake-labs/sfguide-create-a-route-optimisation-and-vehicle-route-plan-simulator routing-customizationInstall 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.
This skill routes customization requests to the correct subskills based on what you want to customize.
| Parameter | Default | Description |
|-----------|---------|-------------|
| ORS_APP_NAME | OPENROUTESERVICE_NATIVE_APP | Name of the installed ORS native app |
| COMPUTE_POOL | OPENROUTESERVICE_NATIVE_APP_COMPUTE_POOL | Compute pool used by ORS services |
| MAP_REGION | (current) | Target geographic region for the map data |
| ROUTING_PROFILES | (current) | Comma-separated list of profiles to enable |
| Privilege | Scope | Reason | |-----------|-------|--------| | USAGE ON APPLICATION OPENROUTESERVICE_NATIVE_APP | Application | Reads and modifies ORS configuration | | WRITE ON STAGE @OPENROUTESERVICE_NATIVE_APP.CORE.ORS_SPCS_STAGE | Stage | Uploads updated config files | | WRITE ON STAGE @OPENROUTESERVICE_NATIVE_APP_PKG.APP_SRC.STAGE | Stage | Uploads service specs and Function Tester | | ALTER COMPUTE POOL | Compute Pool | Suspends/resumes compute pool for config changes | | ALTER SERVICE | Application | Suspends/resumes ORS services and updates specs | | INSERT/DELETE ON OPENROUTESERVICE_NATIVE_APP.CORE.MAP_CONFIG | Table | Updates map configuration for Function Tester | | ALTER APPLICATION | Application | Upgrades native app to apply changes |
Follow the Error Logging convention in AGENTS.md. Log file prefix:
routing-customization.
All file paths in subskills (e.g.,
.cortex/skills/build-routing-solution/native_app/...) are relative to the repository root directory.
Set at the start of every session:
ALTER SESSION SET query_tag = '{"origin":"sf_sit-is-fleet","name":"oss-routing-customization","version":{"major":1,"minor":0},"attributes":{"is_quickstart":1,"source":"sql"}}';
Goal: Detect the initial map region and routing profiles from the ORS configuration and display to the user
Read and follow the instructions in
.cortex/skills/routing-customization/read-ors-configuration/SKILL.md
Output: ORS configuration displayed to the user:
<INITIAL_REGION_NAME><INITIAL_PROFILES>Ask the user (allow multiple selections):
"What would you like to customize? Multiple selection is allowed."
IMPORTANT: Use multi-select so the user can choose one or both options. If both are selected, run the location skill first, then the routing profiles skill, before proceeding to Step 4.
If user wants to change LOCATION or MAP:
This requires changing a map. Read and follow the instructions in
.cortex/skills/routing-customization/location/SKILL.md
If user wants to change ROUTING PROFILES:
This updates which routing profiles are available. Read and follow the instructions in
.cortex/skills/routing-customization/routing-profiles/SKILL.md
Goal: Restart services to update routing graphs with new location
Actions:
Determine if this is a new region or an existing region re-download:
New region (no prior graphs exist): Skip the REMOVE commands and proceed directly to resuming services. The graphs stage paths won't exist yet.
Existing region re-download (map existed and user selected to re-download): Ask the user:
If existing region and user confirms YES, clear existing graphs and elevation cache:
REMOVE @OPENROUTESERVICE_NATIVE_APP.CORE.ORS_ELEVATION_CACHE_SPCS_STAGE/<REGION_NAME>/;
REMOVE @OPENROUTESERVICE_NATIVE_APP.CORE.ORS_GRAPHS_SPCS_STAGE/<REGION_NAME>/;
NOTE: This ensures graphs are rebuilt from scratch with the new map data rather than using potentially stale cached data.
Resume the compute pool (required if it was suspended during location change):
ALTER COMPUTE POOL OPENROUTESERVICE_NATIVE_APP_COMPUTE_POOL RESUME;
Resume all services:
CALL OPENROUTESERVICE_NATIVE_APP.CORE.RESUME_ALL_SERVICES();
Verify ORS is healthy:
SELECT OPENROUTESERVICE_NATIVE_APP.CORE.CHECK_HEALTH();
Monitor ORS_SERVICE logs for graph building progress:
CALL SYSTEM$GET_SERVICE_LOGS('OPENROUTESERVICE_NATIVE_APP.CORE.ORS_SERVICE', 0, 'ors', 100);
"Graph built in X seconds" messages for each enabled profileNote: Graph building can take 30 minutes to several hours depending on map size and number of enabled profiles.
Output: Services rebuilding with new map
Goal: Store map configuration so Function Tester can dynamically load settings
Actions:
Clear any existing configuration:
DELETE FROM OPENROUTESERVICE_NATIVE_APP.CORE.MAP_CONFIG;
Insert the new map configuration:
INSERT INTO OPENROUTESERVICE_NATIVE_APP.CORE.MAP_CONFIG
(city_name, center_lat, center_lon, min_lat, max_lat, min_lon, max_lon, osm_file_name, updated_at)
VALUES ('<CITY_NAME>', <CENTER_LAT>, <CENTER_LON>, <MIN_LAT>, <MAX_LAT>, <MIN_LON>, <MAX_LON>, '<MAP_NAME>', CURRENT_TIMESTAMP());
NOTE: The
updated_atcolumn is required -- the Function Tester usesORDER BY updated_at DESC LIMIT 1to load the latest config.
Example for Paris:
INSERT INTO OPENROUTESERVICE_NATIVE_APP.CORE.MAP_CONFIG
(city_name, center_lat, center_lon, min_lat, max_lat, min_lon, max_lon, osm_file_name, updated_at)
VALUES ('Paris', 48.8566, 2.3522, 48.80, 48.92, 2.22, 2.42, 'Paris.osm.pbf', CURRENT_TIMESTAMP());
Example for Berlin:
INSERT INTO OPENROUTESERVICE_NATIVE_APP.CORE.MAP_CONFIG
(city_name, center_lat, center_lon, min_lat, max_lat, min_lon, max_lon, osm_file_name, updated_at)
VALUES ('Berlin', 52.5200, 13.4050, 52.35, 52.70, 13.08, 13.77, 'Berlin.osm.pbf', CURRENT_TIMESTAMP());
Verify the configuration was saved:
SELECT * FROM OPENROUTESERVICE_NATIVE_APP.CORE.MAP_CONFIG;
Note: The Function Tester will automatically generate test addresses within these bounds when it loads. If no MAP_CONFIG entry exists, it defaults to San Francisco.
Output: MAP_CONFIG table updated with new region bounds
Goal: Upload and redeploy the Function Tester so it picks up the new MAP_CONFIG
Note: The Function Tester automatically reads the MAP_CONFIG table (updated in Step 5) and dynamically generates region-specific sample addresses within those bounds. No manual code edits are needed for addresses — just redeploy.
NOTE: The React-based Function Tester in the ORS Control App dynamically loads installed profiles from ORS_STATUS — no hardcoded profile list to update.
Actions:
Redeploy the ORS Control App to pick up changes:
bash .cortex/skills/build-routing-solution/native_app/services/ors_control_app/deploy.sh <connection>
Upgrade the Native App to apply changes:
ALTER APPLICATION OPENROUTESERVICE_NATIVE_APP UPGRADE USING '@OPENROUTESERVICE_NATIVE_APP_PKG.APP_SRC.STAGE';
Output: Function Tester redeployed, now showing addresses for the new region
User says: "Change the map to Paris" Actions:
User says: "Add walking and cycling-regular profiles" Actions:
User says: "Switch to London with driving-car and foot-walking only" Actions:
This skill modifies ORS configuration but does not create persistent objects. To revert changes:
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.