arcgis-arcade
Skill1 starsChanged 6 months agoMITView on GitHub
Write and run Arcade expressions with the ArcGIS Maps SDK for JavaScript 5.1: createArcadeProfile and createArcadeExecutor for popups, labels and renderers, execute vs executeAsync, fieldsUsed/geometryUsed (missing ones return 0 silently), and geodetic vs planar measures. Use this skill whenever the user writes an Arcade expression for a popup, label, renderer, or computes a value from feature attributes/geometry.
1 other project uses a version of this.
Adopted by
Most recently taken up by
- GeoDaoyu/arcgis-maps-sdk-js-ai-contexttheir own version, first seen Nov 8, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- GeoDaoyu/arcgis-maps-sdk-js-ai-context★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository73 other files it gives its agents.
- skills/arcgis-3d-layers/AGENTS.mdAGENTS.md
- skills/arcgis-advanced-layers/AGENTS.mdAGENTS.md
- skills/arcgis-ai-components/AGENTS.mdAGENTS.md
- skills/arcgis-arcade/AGENTS.mdAGENTS.md
- skills/arcgis-authentication/AGENTS.mdAGENTS.md
- skills/arcgis-charts/AGENTS.mdAGENTS.md
- skills/arcgis-cim-symbols/AGENTS.mdAGENTS.md
- skills/arcgis-coding-components/AGENTS.mdAGENTS.md
- skills/arcgis-coordinates-projection/AGENTS.mdAGENTS.md
- skills/arcgis-core-maps/AGENTS.mdAGENTS.md
- skills/arcgis-core-utilities/AGENTS.mdAGENTS.md
- skills/arcgis-custom-rendering/AGENTS.mdAGENTS.md
- skills/arcgis-editing/AGENTS.mdAGENTS.md
- skills/arcgis-embeddable-maps/AGENTS.mdAGENTS.md
- skills/arcgis-feature-effects/AGENTS.mdAGENTS.md
- skills/arcgis-geometry-operations/AGENTS.mdAGENTS.md
- skills/arcgis-imagery/AGENTS.mdAGENTS.md
- skills/arcgis-interaction/AGENTS.mdAGENTS.md
- skills/arcgis-knowledge-graphs/AGENTS.mdAGENTS.md
- skills/arcgis-layers/AGENTS.mdAGENTS.md
- skills/arcgis-map-tools/AGENTS.mdAGENTS.md
- skills/arcgis-parquet/AGENTS.mdAGENTS.md
- skills/arcgis-performance/AGENTS.mdAGENTS.md
- skills/arcgis-popup-templates/AGENTS.mdAGENTS.md
- skills/arcgis-portal-content/AGENTS.mdAGENTS.md
- skills/arcgis-rest-services/AGENTS.mdAGENTS.md
- skills/arcgis-scene-environment/AGENTS.mdAGENTS.md
- skills/arcgis-smart-mapping/AGENTS.mdAGENTS.md
- skills/arcgis-spatial-analysis/AGENTS.mdAGENTS.md
- skills/arcgis-starter-app/AGENTS.mdAGENTS.md
- skills/arcgis-tables-forms/AGENTS.mdAGENTS.md
- skills/arcgis-time-animation/AGENTS.mdAGENTS.md
- skills/arcgis-utility-networks/AGENTS.mdAGENTS.md
- skills/arcgis-visualization/AGENTS.mdAGENTS.md
- skills/arcgis-widgets-advanced/AGENTS.mdAGENTS.md
- skills/arcgis-widgets-ui/AGENTS.mdAGENTS.md
- skills/hello-world/AGENTS.mdAGENTS.md
- arcgis-3d-layersSkill
- arcgis-advanced-layersSkill
- arcgis-ai-componentsSkill
- arcgis-authenticationSkill
- arcgis-chartsSkill
- arcgis-cim-symbolsSkill
- arcgis-coding-componentsSkill
- arcgis-coordinates-projectionSkill
- arcgis-core-mapsSkill
- arcgis-core-utilitiesSkill
- arcgis-custom-renderingSkill
- arcgis-editingSkill
- arcgis-embeddable-mapsSkill
- arcgis-feature-effectsSkill
- arcgis-geometry-operationsSkill
- arcgis-imagerySkill
- arcgis-interactionSkill
- arcgis-knowledge-graphsSkill
- arcgis-layersSkill
- arcgis-map-toolsSkill
- arcgis-parquetSkill
- arcgis-performanceSkill
- arcgis-popup-templatesSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
2 rules. About 0 are common, 1 is distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 96
Use the profile that matches the context so the right globals exist.
- Very specific: line 206
Every claim run in tests/runtime/casos/arcgis-arcade.ts.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Arcade
When to use: Activate this skill whenever the user writes an Arcade expression for popups, labels, or renderers, or computes values from attributes/geometry.
Overview
Arcade is Esri's expression language; the SDK compiles a script into an executor scoped to a profile.
- Problem it solves: dynamic, data-driven text and values without round-trips.
- Who it serves: developers customizing popups, labels, and symbology.
- Pattern it teaches: pick the profile for the context; compile once with
createArcadeExecutor. - What it does NOT cover: renderers themselves (see
arcgis-visualization) or popups (arcgis-popup-templates).
Quick Start
import { createArcadeExecutor } from "@arcgis/core/arcade.js";
const executor = await createArcadeExecutor("$feature.POP * 2", {
variables: [{ name: "$feature", type: "feature" }],
});
const value = executor.execute({ $feature: graphic }); // the graphic must carry POPDecision Tree
- Where does the expression run?
- Popup → use a popup profile (often via PopupTemplate
expressionInfos). - Label → label profile.
- Renderer / visual variable → renderer profile (
valueExpression).
- Popup → use a popup profile (often via PopupTemplate
- Compiling manually?
- Yes →
createArcadeExecutor(script, createArcadeProfile("popup")). The profile names are"popup","labeling","visualization"(renderers),"field-calculation","form-calculation","form-constraint","aggregate-field", among others; the helper declares every variable the context has ($feature,$layer,$map,$view, …).
- Yes →
Default: declare the expression on the consuming object (popup/label/renderer) and let the SDK compile it.
Import Patterns
Direct ESM (recommended for npm/Vite/Webpack)
import { createArcadeExecutor } from "@arcgis/core/arcade.js";Dynamic Imports (CDN)
const arcade = await $arcgis.import("@arcgis/core/arcade.js");Map Components (recommended for new projects)
// Expressions live in popupTemplate/labelingInfo/renderer on layers in the component map.
import "@arcgis/map-components/components/arcgis-map";Key Concepts
Concept 1: Profiles
A profile declares the variables available to the script (e.g. $feature, $layer, $map).
Use the profile that matches the context so the right globals exist.
Concept 2: createArcadeExecutor
createArcadeExecutor(script, profile, options?) returns an ArcadeExecutor you call with the
runtime context (the feature). Compile once, execute many times.
What the executor tells you, and what goes wrong if you ignore it (measured with SDK 5.1.27):
isAsync:truewhen the script uses a FeatureSet function. Then onlyexecuteAsync()works;execute()throws "Cannot execute the script in synchronous mode". For many features,executeAsyncBatch().fieldsUsed: request these fields (layer.outFields = executor.fieldsUsed, or the query'soutFields). A field that was not requested arrives asnull, andnull / 1000gives 0: a plausible wrong number, no error.geometryUsed: request geometry (returnGeometry: true). Without it,Area($feature)returns 0, no error.options.cache(5.0) replaces the deprecatedlruCache;options.timeZoneshould be the view's time zone when dates are shown.
Field names are case-insensitive: $feature.pop reads a field named POP.
Concept 2b: Area and length are planar unless you say otherwise
Area() and Length() measure in the geometry's own projection. In Web Mercator that is wrong away
from the equator: a 0.01° cell at 50° S measures 1.928 km² with Area and 0.798 km² with
AreaGeodetic (factor 2.42). Use AreaGeodetic() / LengthGeodetic() for real-world sizes.
Concept 3: Where expressions live
Most of the time you don't call the executor yourself — you set expressionInfos on a popup,
valueExpression on a renderer, or an Arcade label expression, and the SDK runs it.
Common Pitfalls (Top 3)
Pitfall 1: Wrong profile for the context
// ❌ Anti-pattern
createArcadeExecutor(script, { variables: [] }); // $feature not declared// ✅ Correct
createArcadeExecutor(script, { variables: [{ name: "$feature", type: "feature" }] });Impact: the script errors because $feature is undefined.
Pitfall 2: Compiling on every render
// ❌ Anti-pattern
features.forEach(async (f) => { const e = await createArcadeExecutor(script, profile); });// ✅ Correct
const executor = await createArcadeExecutor(script, profile); // once, reuse per featureImpact: recompiling per feature is slow.
Pitfall 3: A field or the geometry was never requested
// ❌ Anti-pattern
const e = await createArcadeExecutor("$feature.pop2000 / 1000", profile);
const { features } = await layer.queryFeatures({ where: "1=1", outFields: ["objectid"] });
e.execute({ $feature: features[0] }); // 0, silently// ✅ Correct
const { features } = await layer.queryFeatures({
where: "1=1",
outFields: e.fieldsUsed,
returnGeometry: e.geometryUsed,
});
e.execute({ $feature: features[0] }); // 1211.537Impact: measured on the USA sample service: the missing field arrives as null and the
expression returns 0, a believable wrong value with no error. Area() without geometry also
returns 0.
When to Read references/
| If you need... | Read |
| Executor / profile signatures | references/api-detail.md |
| Popup / label / renderer expression examples | references/examples.md |
| More pitfalls (5+ extended) | references/pitfalls.md |
Related Skills
arcgis-popup-templates— expressionInfos in popupsarcgis-visualization— valueExpression in renderersarcgis-layers— the data the expressions read
Reference Samples
Changelog
- 0.2.0 (2026-10-27): SDK 5.1. Removed the false "field name case" pitfall (Arcade field names
are case-insensitive, measured); missing fields or geometry return 0 silently;
isAsync/executeAsync;createArcadeProfile;cachereplaceslruCache(5.0); planar vs geodetic area. Every claim run intests/runtime/casos/arcgis-arcade.ts. - 0.1.0 (2026-05-31): Initial release.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

