跳到正文
cccskills
免费在 GitHub 公开

arcpy-migration

Migrates ArcPy and ArcGIS Pro workflows to explicit, testable open-source Python geospatial workflows. Use when removing ArcPy dependencies, porting geoprocessing scripts, or documenting ArcGIS behavior that will not be migrated.

中文简介正在准备中。当前显示原文说明。

查看安装方法

包含的文件(9)

  • SKILL.md7.6 KB
  • examples/explicit-workflow.md868 B
  • references/limitations-and-evidence.md975 B
  • references/source-inventory.md1.0 KB
  • references/spatial-semantics.md944 B
  • templates/migration-manifest.yaml597 B
  • templates/operation-contract.yaml594 B
  • templates/qa-and-test-matrix.md969 B
  • templates/workflow-boundary.py1.1 KB

SKILL.md(原文)

安装前可以查看交给 AI 代理的指令内容。

ArcPy Migration

Migrate the workflow, not ArcGIS UI state. Create an inventory, explicit contracts, separate adapters, a pure core, parity evidence, and documented limits.

Phase gates

Gate 0: Discover the source contract

Before changing code, inventory:

  • Entrypoints, ArcPy tools, parameters, environment settings, and implicit defaults.
  • Inputs, outputs, intermediate artifacts, file formats, naming rules, overwrite behavior, and side effects.
  • CURRENT project access, active maps/layers, scratch workspaces, selections, symbology, progress reporting, and global state.
  • Horizontal and vertical CRS, units, datum assumptions, resampling, tolerances, NoData, invalid-geometry, and empty-result behavior.
  • Dependencies, licenses, ArcGIS version, and any ArcGIS-only behavior.

Write the inventory to a migration manifest. Stop if the behavior cannot be reproduced from explicit inputs or hidden state remains undocumented.

Gate 1: Approve shared contracts

Define a contract for every operation and output. Each contract names:

  • Typed inputs and outputs.
  • Source and target CRS, horizontal and vertical units, reprojection point, and raster resampling.
  • Geometry validity policy, distance/area semantics, NoData policy, tolerances, ordering, naming, and overwrite rules.
  • Side effects, deterministic expectations, semantic parity criteria, unsupported behavior, and tests.

Use explicit status values such as covered, partially_covered, unmapped, and no_data. Do not collapse NoData, empty coverage, service failure, and numeric zero into one value. Preserve denominators for weighted calculations.

Stop if an output lacks a type, CRS, naming rule, or semantic parity criterion.

Gate 2: Separate adapter and core

The core must:

  • Accept explicit paths, values, models, CRS, units, tolerances, NoData policy, and output configuration.
  • Avoid importing arcpy, reading arcpy.env or CURRENT, mutating map layers, or relying on scratch-workspace state.
  • Keep data loading, transformation, and output writing behind narrow seams.
  • Return a structured result containing artifacts, diagnostics, status, provenance, and limitations.

The adapter may read ArcGIS projects, extract parameters, report progress, and create ArcGIS-facing outputs. Convert every arcpy.env value, scratch location, current-map reference, and implicit relative path into a named workflow-context field.

Gate 3: Implement and test the pure core

Prefer these defaults where they fit the contract:

ArcPy concernDefault replacement
Geometry and attribute transformsShapely, GeoPandas, pandas, NumPy
Raster read/write, windows, masksRasterio
Projection and coordinate transformsPyProj
Feature-class and table I/OFiona or GeoPandas
arcpy.env settingsExplicit workflow-context fields
Scratch geodatabaseExplicit temporary or output directory
Map/layer mutationOmit unless explicitly required; otherwise use an optional presentation adapter
Symbology/layout/exportDocument as a scope reduction or isolate in a presentation adapter

Extract reusable helpers for I/O, projection, clipping, zoning, raster conditioning, geometry repair, logging, and deterministic artifact writing. Do not duplicate spatial logic across migrated scripts.

Make these decisions visible in code and tests:

  • Reject unknown CRS; never infer silently.
  • Reproject mixed CRS explicitly before overlay, clipping, distance, or area.
  • Do not calculate planar measurements directly in geographic coordinates.
  • Require vertical units for elevation or terrain calculations.
  • State whether invalid geometries are rejected or repaired, and report repairs.
  • Preserve input immutability unless mutation is part of the contract.
  • Normalize external identifiers at boundaries and log failures at the feature, tile, or operation level.

Gate 4: Show behavior matches

Compare the migrated workflow with a retained ArcPy reference fixture where available:

  • Geometry after normalization.
  • Raster dimensions, transform, CRS, NoData, and values within declared tolerance.
  • Attribute schema and values.
  • File naming and artifact set.
  • Stable ordering and repeated-run determinism.

Use checksums only when byte-level equality is meaningful. Preserve exact inputs and configuration needed for replay. Keep ArcGIS-runtime, network, and live-service tests opt-in; deterministic unit and fixture tests belong in the default suite.

Gate 5: Release check

Before release, require:

  • A fixture-backed end-to-end command.
  • Validated manifest and operation contracts.
  • Reproducible output locations and cleanup behavior.
  • Explicit partial-output and failure behavior.
  • QA report with contract parity, tests, intentional differences, limitations, blockers, provenance, authority, and artifact locations.
  • A documented list of unsupported ArcGIS behavior and scope reductions.

Do not claim universal tool coverage, zero failures, runtime improvement, or official determinations without direct run evidence and source citations.

Migration rules

  1. Preserve original workflow behavior, file naming, and deterministic outputs before restructuring.
  2. Replace ArcGIS global state with explicit paths, configuration, and result objects.
  3. Prefer allowlisted domain operations over unrestricted expression or geoprocessing passthrough.
  4. Keep I/O, transforms, and writing separate so each can be tested independently.
  5. Treat provenance and authority as separate concerns: authoritative source data does not make a derived result official.
  6. Keep timeout detection, per-unit diagnostics, failure snapshots, and replay evidence distinct from success claims.

Required artifacts

At minimum, create:

  • A migration manifest.
  • An operation contract for each migrated operation.
  • A workflow context and structured result model.
  • An adapter/core boundary.
  • A test matrix covering CRS, units, NoData, geometry, boundaries, determinism, and parity.
  • A QA report and assumptions/limitations register.

Use the templates and references in this skill when needed.

Key supporting files:

  • Templates: templates/migration-manifest.yaml, templates/operation-contract.yaml, templates/workflow-boundary.py, and templates/qa-and-test-matrix.md.
  • References: references/source-inventory.md, references/spatial-semantics.md, and references/limitations-and-evidence.md.
  • Worked example: examples/explicit-workflow.md.

Anti-patterns

Anti-patternWhy it failsFix
Keep ArcPy globalsHides dependencies and breaks testabilityPass explicit paths, configuration, and CRS values
Recreate ArcGIS UI behaviorAdds unsupported scopePreserve workflow intent, not the UI
Mix file I/O into core mathMakes migration hard to verifySeparate loading, transforms, and writes
Use one-off library choices per scriptCreates inconsistent behaviorCentralize geospatial helpers
Infer unknown CRS or unitsProduces plausible but invalid resultsBlock and require explicit metadata
Silently repair or discard dataMakes parity and audit impossibleReport repairs, exclusions, and status

评价

还没有评价。欢迎分享你的使用感受。

评论

无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。

还没有评论。来写第一条吧。

提交后会立即公开。请勿填写邮箱、电话等个人信息。URL 最多 2 个。

0 / 1000 字

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

同一仓库的技能

Distills enduring architectural decisions and design rationale from wave orchestration plans or historical git changes into structured, tracked Architecture Decision Records (ADRs). Use pre-wave to resolve active architectural constraints or post-wave to record enduring decisions in docs/decisions/.

中文简介正在准备中。当前显示原文说明。

AndrewBrown-USDA/aigb-skills-usda72026年10月22日 更新

Create and maintain AGENTS.md files for project onboarding and grounding. Use when initialized in a new project, when project structure changes significantly, or when creating subfolder-level AGENTS.md files for complex monorepos.

中文简介正在准备中。当前显示原文说明。

AndrewBrown-USDA/aigb-skills-usda72026年10月22日 更新

Audit and update an arbitrary codebase to follow the Code.mil federal open-source licensing model (MIT with 17 U.S.C. Section 105 disclaimers and INTENT.md), including CRAN/R package DESCRIPTION setup.

中文简介正在准备中。当前显示原文说明。

AndrewBrown-USDA/aigb-skills-usda72026年10月22日 更新

caveman

免费

Ultra-compressed communication mode that cuts output tokens while keeping technical accuracy. Levels: lite, full, ultra and the wenyan variants. Use for /caveman, "caveman mode", "talk like caveman", "be brief" or "less tokens".

中文简介正在准备中。当前显示原文说明。

AndrewBrown-USDA/aigb-skills-usda72026年10月22日 更新

Review the changes since a fixed point (commit, branch, tag, or merge-base) along two axes - Standards (does the code follow this repo's documented coding standards?) and Spec (does the code match what the originating issue/spec asked for?). Runs both reviews in parallel sub-agents and reports them side by side. Use when the user wants to review a branch, a PR, work-in-progress changes, or asks to "review since X".

中文简介正在准备中。当前显示原文说明。

AndrewBrown-USDA/aigb-skills-usda72026年10月22日 更新

Create, classify, validate, and explain commit messages using Conventional Commits v1.0.0, with repository-aware type, scope, footer, and breaking-change guidance. Use when drafting or reviewing a commit message.

中文简介正在准备中。当前显示原文说明。

AndrewBrown-USDA/aigb-skills-usda72026年10月22日 更新

查看 AndrewBrown-USDA 的全部技能

报告此技能的问题