Token导航 LogoToken导航TokenDH.com
开发需要联网github未标认证来源可访问许可证需确认审计提醒

arcgis-coding-componentsarcgis 编码组件

Agent Skill

arcgis-coding-components 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

321

周安装

13

GitHub Stars

13

下载量

101
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:arcgis-coding-components(arcgis 编码组件)
来源仓库:https://github.com/saschabrunnerch/arcgis-maps-sdk-js-ai-context
仓库路径:skills/arcgis-coding-components
安装命令:
npx skills add https://github.com/saschabrunnerch/arcgis-maps-sdk-js-ai-context --skill arcgis-coding-components
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/saschabrunnerch/arcgis-maps-sdk-js-ai-context --skill arcgis-coding-components

简介

提供 Arcade 表达式编辑器组件,支持代码编写、测试与调试。

  • 适用于在 Web 应用中嵌入可编程的地理处理表达式界面。
  • 通过 CDN 或 ESM 方式加载 arcgis-arcade-editor 组件。
  • 注意该组件为 5.0 版本新增,无 4.x 对应替代方案。
  • arcgis-coding-components 属于开发类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

ArcGIS Coding Components

Use this skill when embedding an Arcade expression editor into a web application. The @arcgis/coding-components package provides the arcgis-arcade-editor web component - a full-featured code editor for writing, testing, and debugging Arcade expressions. This is a new component package in 5.0 with no 4.x equivalent.

Import Patterns

CDN (No Build Tools)

<!-- Load ArcGIS Maps SDK -->
<script src="https://js.arcgis.com/5.0/"></script>
<!-- Load Coding Components -->
<script
  type="module"
  src="https://js.arcgis.com/5.0/coding-components/"
></script>

Direct ESM Imports (Build Tools)

import "@arcgis/coding-components/components/arcgis-arcade-editor";

arcgis-arcade-editor Component

A rich code editor for Arcade expressions with syntax highlighting, diagnostics, code suggestions, and a documentation side panel.

Properties

PropertyAttributeTypeDefaultDescription
scriptscriptstring""The Arcade script content (read/write)
profile-IEditorProfileDefinition-Profile metadata defining the editing context (set via JS)
testData-IEditorTestContext-Test data context for expression validation (set via JS)
snippets-ApiSnippet[]-Collection of code snippets to show in the snippets panel (set via JS)
suggestions-IEditorCodeSuggestion[]-Code suggestions shown to the user (set via JS)
editorOptions-IEditorOptions & IGlobalEditorOptions-Monaco-style editor options (set via JS)
hideSideBarhide-side-barbooleanfalseHide the side action bar for a minimal UI
hideDocumentationActions-booleanfalseHide the documentation action in the side panel
openedSidePanelopened-side-panelstring"none"Name of the currently opened side panel
sideActionBarExpandedside-action-bar-expandedbooleanfalseWhether the side action bar is expanded

Methods

MethodReturnsDescription
setFocus()voidSet focus on the editor
componentOnReady()Promise<void>Resolves when the component is fully loaded

Events

EventDetailDescription
arcgisScriptChangestringFired when the script content changes (debounced)
arcgisDiagnosticsChangeDiagnostic[]Fired when diagnostics (errors/warnings) change

Basic Usage

Minimal Editor

<arcgis-arcade-editor
  script="return $feature.Population * 2;"
  style="width: 600px; height: 400px;"
>
</arcgis-arcade-editor>

Listening for Script Changes

<arcgis-arcade-editor id="editor" style="width: 600px; height: 400px;">
</arcgis-arcade-editor>

<script type="module">
  const editor = document.querySelector("#editor");
  editor.script = "return $feature.Name;";

  editor.addEventListener("arcgisScriptChange", (event) => {
    const newScript = event.detail;
    console.log("Script updated:", newScript);
  });

  editor.addEventListener("arcgisDiagnosticsChange", (event) => {
    const diagnostics = event.detail;
    const errors = diagnostics.filter((d) => d.severity === "error");
    if (errors.length > 0) {
      console.warn("Script has errors:", errors);
    }
  });
</script>

Editor with Profile Context

const editor = document.querySelector("arcgis-arcade-editor");

// Define the editing profile - tells the editor what variables are available
editor.profile = {
  id: "popup",
  title: "Popup Expression",
  description: "Expression for popup content",
  variables: [
    {
      name: "$feature",
      type: "Feature",
      description: "The current feature",
    },
    {
      name: "$layer",
      type: "FeatureSet",
      description: "The feature's parent layer",
    },
  ],
};

Editor with Test Data

const editor = document.querySelector("arcgis-arcade-editor");

// Provide test data for expression validation
editor.testData = {
  spatialReference: { wkid: 4326 },
  features: [
    {
      attributes: {
        Name: "Test Feature",
        Population: 50000,
        Area: 125.5,
      },
      geometry: {
        type: "point",
        x: -118.24,
        y: 34.05,
      },
    },
  ],
  fields: [
    { name: "Name", type: "esriFieldTypeString", alias: "Name" },
    { name: "Population", type: "esriFieldTypeInteger", alias: "Population" },
    { name: "Area", type: "esriFieldTypeDouble", alias: "Area" },
  ],
};

Editor with Custom Snippets

const editor = document.querySelector("arcgis-arcade-editor");

editor.snippets = [
  {
    name: "Format Currency",
    description: "Format a number as US currency",
    code: 'Text($feature.Value, "$#,###.00")',
  },
  {
    name: "Concatenate Fields",
    description: "Join two text fields with a separator",
    code: 'Concatenate([$feature.FirstName, $feature.LastName], " ")',
  },
];

Minimal Editor (No Side Bar)

<arcgis-arcade-editor
  hide-side-bar
  script="return Round($feature.Value, 2);"
  style="width: 400px; height: 200px;"
>
</arcgis-arcade-editor>

Full Example with Map Integration

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <title>Arcade Editor</title>
    <script src="https://js.arcgis.com/5.0/"></script>
    <script
      type="module"
      src="https://js.arcgis.com/5.0/coding-components/"
    ></script>
    <script
      type="module"
      src="https://js.arcgis.com/5.0/map-components/"
    ></script>
    <style>
      html,
      body {
        height: 100%;
        margin: 0;
        display: flex;
        flex-direction: column;
      }
      arcgis-map {
        flex: 1;
      }
      #editor-panel {
        height: 300px;
        border-top: 1px solid #ccc;
      }
    </style>
  </head>
  <body>
    <arcgis-map id="map" item-id="YOUR_WEBMAP_ID">
      <arcgis-zoom slot="top-left"></arcgis-zoom>
    </arcgis-map>
    <div id="editor-panel">
      <arcgis-arcade-editor id="editor"></arcgis-arcade-editor>
    </div>

    <script type="module">
      const mapElement = document.querySelector("#map");
      const editor = document.querySelector("#editor");

      await mapElement.viewOnReady();
      const view = mapElement.view;
      const layer = view.map.layers.getItemAt(0);
      await layer.load();

      // Set initial script
      editor.script = 'return $feature.Name + " (" + $feature.Type + ")"';

      // Configure profile from layer fields
      editor.profile = {
        id: "popup",
        title: "Popup Expression",
        variables: [
          { name: "$feature", type: "Feature", description: "Current feature" },
        ],
      };

      // Listen for changes and apply to popup
      editor.addEventListener("arcgisScriptChange", (event) => {
        console.log("Expression:", event.detail);
      });
    </script>
  </body>
</html>

Common Pitfalls

  1. Missing coding-components script: The arcgis-arcade-editor element must be loaded separately from the core SDK. <!-- Anti-pattern: only loading core SDK --> <script src="https://js.arcgis.com/5.0/"></script> <arcgis-arcade-editor></arcgis-arcade-editor> <!-- Correct: load coding-components too --> <script src="https://js.arcgis.com/5.0/"></script> <script type="module" src="https://js.arcgis.com/5.0/coding-components/" ></script> <arcgis-arcade-editor></arcgis-arcade-editor> Impact: The element is unrecognized and renders as empty.
  2. No size on the editor: The editor needs explicit width and height to render. <!-- Anti-pattern: no size --> <arcgis-arcade-editor></arcgis-arcade-editor> <!-- Correct: explicit size --> <arcgis-arcade-editor style="width: 600px; height: 400px;" ></arcgis-arcade-editor> Impact: The editor renders with zero height and is invisible.
  3. Setting profile or testData as HTML attributes: These properties accept complex objects and must be set via JavaScript. Impact: Values are silently ignored; the editor lacks context for autocompletion and validation.
  4. Not debouncing arcgisScriptChange: The event fires on every keystroke (debounced internally but can still be frequent). Avoid expensive operations in the handler. // Anti-pattern: expensive operation on every change editor.addEventListener("arcgisScriptChange", async (event) => {await compileAndExecuteArcade(event.detail); // too frequent}); // Correct: add your own debounce for expensive operations let timeout; editor.addEventListener("arcgisScriptChange", (event) => {clearTimeout(timeout); timeout = setTimeout(() => {compileAndExecuteArcade(event.detail);}, 500);}); Impact: UI freezes or excessive server requests during typing.

Reference Samples

  • Search for Arcade-related samples that demonstrate expression editing workflows.

Related Skills

  • See arcgis-arcade for Arcade expression language syntax and usage patterns.
  • See arcgis-widgets-ui for layout components to host the editor panel.
  • See arcgis-popup-templates for using Arcade expressions in popup content.
  • See arcgis-visualization for Arcade-driven visual variables and renderers.

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

38.27%
按下载量换算39

Claude

27.31%
按下载量换算28

Cursor

18.99%
按下载量换算19

Gemini CLI

8.65%
按下载量换算9

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

可疑

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills