Описание
Ниже — оригинальный текст автора.
@dsh-gis/dsh-opengis-skill
English summary — A DeepSeek Harness bundle that packages the
gis/skills of opengis-skills as installable, toggleable skills. The session catalog lists names and descriptions only; skill bodies and theirreference/*.mdfiles are loaded on demand. Vendored bodies stay byte-identical to upstream, and a separateadaptations/layer is appended when a skill is loaded — one DeepSeek Harness guidance block per skill plus a shared one (tool mapping, Windows rewrites, background jobs, artifact verification, consent gates, sandbox semantics, optional-plugin fallbacks). A per-skill block must name at least two core harness tools and give a concrete probe command and a concrete verification command, so the layer stays about this harness instead of repeating tool-agnostic advice the upstream bodies already carry; optional-plugin tools (Agent Teams, desktop control, scheduled tasks) may be cited only together with their fallback. Upstream routing metadata (metadata.categoryandmetadata.tagsfrom the Agent Skills six-field frontmatter) is exposed on the provider candidate. Zero runtime dependencies: every asset ships inside the npm package.Compatibility: DeepSeek Harness
>=0.2.0-rc.2 <0.3.0-0(verified end to end against0.2.2-rc.5, the current desktop/nightly build); Node.js>=22for development only. MIT licensed.
DeepSeek Harness 的 OpenGIS 技能包插件:把 opengis-skills 中 gis/ 分类的 GIS 技能打包成可安装、可启停的 DSH bundle。会话技能目录只列出名称与描述,技能正文与参考资料按需加载。
特性
- 覆盖 GIS 全链路(45 个技能):GDAL、GDAL API、QGIS(qgis_process / PyQGIS / QGIS Server)、GeoServer(含 REST API 与 Cloud)、GeoNode、MapServer、PostGIS、DuckDB Spatial、SpatiaLite、PROJ、ProjNet4GeoAPI、PDAL、GRASS GIS、WhiteboxTools、JTS、NetTopologySuite、Esri Geometry API(Java/.NET)、GEOS、Shapely、GeoPandas、GeoPipeAgent、OpenGisDAF、CesiumJS、OpenLayers、Leaflet、BruTile、Mapbox GL JS、MapLibre GL JS、MapLibre Native、deck.gl、Kepler.gl、GeoLibre、OpenDroneMap、STAC/COG/TiTiler、SharpMap、Mapsui、GeoTools、OpenGIS Utils(Java/.NET),以及
opengis-all全流程索引。 - 按需加载:注册的是 skill provider(
ctx.skills.registerProvider),发现阶段只读 frontmatter;正文每次加载时读取,参考资料(reference/*.md)通过技能目录(resource base)相对解析。 - 零运行时依赖:只用 Node 内置模块,不 import DSH 内部包;全部资产与适配文件随 npm 包分发,整个包解包后约 1.24 MB(其中技能资产 910 kB、适配层约 150 kB),npm tarball 约 470 kB(141 个文件)。
- 可同步上游:
npm run sync从 opengis-skills 检出复制资产,记录上游 commit 与每个文件的 SHA-256 到upstream.json,并重新生成本文下方技能清单。 - 可启停:单包同时是 bundle 与插件(
dsh.bundle.patch插入自身行),在 Plugins 里启用/停用即可。 - 分层适配 DSH:
assets/保持上游逐字节快照(SHA-256 清单可校验),DSH 专属建议单独放在adaptations/:common.md是通用执行约定(技能加载与索引型入口、引用分段读取、长任务与后台作业、Windows 改写、随包运行时没有 GIS 绑定、先探测再执行、多步编排、可选插件能力、GUI 验证边界、产物验证、present交付、ask_user_question确认、沙箱与审批、外部资料、失败定位)。命令执行分工与输出截断说明直接指向宿主工具描述,不在这里重述。<skill>.md是该技能的执行建议(按需读哪个 reference、命令跑在哪、先探测什么版本、产物怎么验证、哪些操作要先确认)。加载技能时由 provider 把两段拼到正文之后,技能正文保持原样。 - 适配层强制体现 harness:每个
<skill>.md必须 900–4000 字符、含 5 个固定要点(加载与引用 / 执行环境 / 先探测版本 / 验证产物 / 风险与权限),至少点名 2 个核心工具(skill、bash、read、job_output、read_image、ask_user_question等官方分发自带工具),并且「先探测版本」「验证产物」两条必须各带一条反引号命令——只写「检查一下」会被npm run validate拒绝。工具白名单按来源拆成CORE_TOOLS(DSH 官方分发自带的工具)与OPTIONAL_TOOLS(第三方插件如ops_bash、PTC 专属的run_code、桌面控制、定时任务、MCP 资源等),可选工具不计入最低数,且必须与「没有就退回」的备份方案一起写。 - 可用性靠结构而不是篇幅:每个
<skill>.md至少 4 个要点必须拆成两格缩进的子条目、全文至少 8 条子条目(MIN_NESTED_LABELS/MIN_NESTED_BULLETS)。一条 600 字的段落在模型眼里是一整块,拆成「先查什么 → 怎么判 → 失败怎么办」的子条目才用得起来。common.md里点名的每个可选工具,所在行必须同时给出没有该插件时的退路。 - 上游路由元数据透出:provider 解析上游六字段 frontmatter 里的
metadata.category与metadata.tags,连同本地 groups 与 keywords 一起作为 candidate 的metadata交给宿主(SkillCandidate.metadata)。DSH 的注册表把它当作 provider 私有数据原样保存、不渲染进模型目录,因此模型可见的路由依据始终只有名称与description;解析器同时保留字段顺序,供校验确认没有引入规范外字段。 - 中文触发词与分组:本地
lib/taxonomy.js为每个技能维护 3–6 个请求原话(「格式转换」「洼地填充」「移动端地图」),作为metadata.keywords交给宿主;metadata.groups同时给出技能分组并驱动插件配置过滤(groups)。这两个键是本包添加的,宿主不认也只是忽略;模型侧命中的仍是英文description,因此路由测试衡量的是「描述 + 触发词」这层判据是否还分得开,而不是网关真的按关键词排序。 - 可裁剪目录:插件配置支持
scenario/groups/skills/exclude四个字段,写错的场景名、组名或技能名会直接报错而不是静默返回错误的目录。浏览器地图会话写scenario: web即可,不必为 GeoServer 与 PostGIS 的描述付上下文;当前配置下的目录开销由diagnose()的catalogTokens给出。 - 可诊断:
npm run diagnose(或node -e一行 import 包根调用diagnose())只读地报告技能数、可见数、缺失技能、降级技能、悬空引用、upstream.json的 SHA-256 不符项、目录 token 估算与本机 DSH 版本;healthy为 false 时退出码为 1,可以直接当门禁用。适配文件缺失不再让整个技能加载失败,而是降级为「上游正文 + 通用约定」并出现在诊断里。 - 交叉引用校验:
npm run check:citations检查适配层指向的技能确实存在(加载x`` 与skill({ name: "x" })两种写法)、以及引用的三段式版本号能在该技能正文里找到——上游重同步后最容易出现的就是这两类悬空引用。
兼容性
- DeepSeek Harness:
>=0.2.0-rc.2 <0.3.0-0(package.json的engines.dsh)。本包通过 Host 提供的ctx.skills注册 provider,遵循@deepseek-ai/dsh-skill的 registry API 与 candidate/definition 契约。已实测版本:0.2.2-rc.5(当前桌面/nightly 发行版)——其中registerProvider((control) => provider)、list()的完整数组简写、get()的SkillDefinition | undefined返回值、BUNDLED_SKILL_RANK = 600与本包实现一致;更早的0.2.x版本只在engines.dsh声明的范围内被假定兼容,未逐一验证。这层证据是机器可读的:package.json的dsh.compatibility列出实测版本与对应测试文件(verified[].evidence),npm run compat:report重新执行这些测试并生成 docs/compatibility.md(含生成时间、命令、退出码与通过/失败数;执行不了的套件写not-run与原因,不会伪造 pass)。 - candidate
metadata:宿主契约里的SkillCandidate与SkillDefinition都声明了可选的metadata。本包有意只放在 candidate 上:registry 的toSummary()会把它从list()摘要中丢弃,skill工具渲染也只读名称、描述与正文,所以 definition 不携带它是设计选择而非契约限制;多带一个字段只会增加无谓的载荷。 - Node.js:
>=22(engines.node)。仅开发脚本与测试需要,插件本身运行在 DSH 内。 - 运行时依赖:无。
dependencies为空,只使用 Node 内置模块,不 import DSH 内部包。
技能清单
共 45 个技能,描述取自上游 frontmatter。
| Skill | Description (upstream frontmatter) |
|---|---|
brutile | Use when fetching or enumerating map tiles in .NET with BruTile 6.0.0 — HttpTileSource over HttpClient, KnownTileSources.Create, ITileSchema.GetTileInfos for a viewport and resolution, MbTilesTileSource for offline MBTiles, or wiring tiles into Mapsui/SharpMap. Also for missing 'BruTile.Desktop' packages, CS0246 on KnownTileSources, MBTiles SQLite native load failures, and 404s from inverted TMS/OSM y-axis. |
cesiumjs | Use when building browser-based 3D globes, 3D Tiles, CZML/time-dynamic data, or glTF models with npm cesium 1.147.0 — Viewer, Cesium3DTileset, Ion token (Cesium.Ion.defaultAccessToken), CESIUM_BASE_URL for Workers/Assets/Widgets, GCJ-02 tile offset, or debugging a black screen after a Vite/Webpack build. |
deck-gl | Use when visualizing large geospatial datasets in the browser with deck.gl 9.4.1 — ScatterplotLayer/GeoJsonLayer, HexagonLayer/ScreenGridLayer aggregation, MVTLayer/TileLayer, @deck.gl/mapbox MapboxOverlay over MapLibre, or debugging blank canvases, stale data props and mismatched @deck.gl/* subpackage versions. |
duckdb-spatial | Use when doing spatial analysis inside a DuckDB database or SQL pipeline — INSTALL spatial / LOAD spatial, ST_Read over Shapefile/GeoPackage/GeoJSON, ST_Point/ST_GeomFromText, ST_Intersects/ST_Contains/ST_Buffer joins, ST_Area_Spheroid, ST_AsMVT tiles, DuckDB-WASM; also for 'Extension spatial is not installed' or spatial function does not exist, GEOMETRY vs WKB_BLOB friction, CRS type modifiers, and exporting query results to GeoParquet. GEOMETRY became a built-in type in DuckDB 1.5. |
gdal | Use when processing geospatial raster/vector data via GDAL/OGR CLI — ogr2ogr format conversion (Shapefile/GeoPackage/GeoJSON), gdalwarp reprojection, gdal_translate, gdal_calc.py NDVI, COG, mosaicking, DEM contours, gdalinfo -json checks — or diagnosing "not recognized as a supported file format"; also covers the 3.11+ unified gdal raster / gdal vector CLI. |
gdal-api | Use when programming against GDAL/OGR in C, C++, Python, Java, or .NET — raster/vector I/O, gdal.UseExceptions, OGRSpatialReference transforms, gdal.Translate / gdal.Warp, VRT/COG, or fixing "no driver registered" and UnsatisfiedLinkError; C++ gdal-config, Maven org.gdal:gdal 3.13.0, NuGet MaxRev.Gdal.Core. |
geolibre | Use when scripting or self-hosting the GeoLibre GIS app — geolibre Python anywidget (Map/add_geojson/add_cog/save_project), geolibre-mcp stdio server for AI agents, ghcr.io/opengeos/geolibre Docker image, DuckDB-WASM SQL workspace, ?data= and ?url= deep links; also for a blank window on Linux WebKitGTK, sidecar path not allowed from GEOLIBRE_CONVERSION_ROOTS, and Jupyter relay not connected. GeoLibre 3.7.0. |
geometry-api-java | Use when working with Esri geometry types (Point, Polyline, Polygon, Envelope) in Java — GeometryEngine, com.esri.geometry:esri-geometry-api:2.2.4, WKT/WKB/GeoJSON/Esri JSON I/O, geodesic distance; also when GeometryEngine has no intersects or WKB method and you need OperatorFactoryLocal, or when 2.3.1 coordinates fail to resolve on Maven Central. Esri Geometry API for Java. |
geometry-api-net | Use when working with Esri geometry types (Point, Polyline, Polygon, Envelope) in .NET/C# — GeometryEngine, NuGet OpenGIS.Esri.Geometry.Core 1.0.9, WKT/EWKT, WKB, GeoJSON and Esri JSON I/O, System.Text.Json converters, geodesic distance; also for unclosed polygon rings, Geometry base-class casts after overlay, or the retired Esri/geometry-api-net repo. Esri Geometry API for .NET. |
geonode | Use when deploying or automating GeoNode 5.1.1 — docker compose with create-envfile.py, geonode/geonode:5.1.1 image, django4geonode logs, /api/v2/resources and /api/v2/uploads/upload (action=upload|replace|upsert|create), OGC WMS/WFS links from resource.links[], geonode-project customization; also for 502 after compose up, 'GeoNode has no attribute' after upgrade, and upload 401/403 with Basic vs Bearer auth. |
geopandas | Use when doing vector spatial analysis in Python — gpd.read_file/to_file via pyogrio (GPKG, Shapefile, GeoParquet 2.0), sjoin/sjoin_nearest, overlay, clip, dissolve, make_grid, to_crs vs set_crs, gdf.plot choropleth; also for CRSError from a missing PROJ data dir, area/distance computed in degrees, or GeoDataFrame geometry-column conflicts. GeoPandas 1.2.0 extends pandas DataFrames with geometry columns. |
geopipe-agent | Use when building YAML GIS pipelines with GeoPipeAgent — geopipe-agent validate/run, io.read_vector to vector.buffer to io.write_vector chains, 36 built-in steps (33 analysis + 3 passthrough), qc.geometry_validity/attribute_completeness/topology, native_python|qgis_process|gdal_cli backends, $step.output refs; also for validate not-registered errors, silent when-condition skips, and resolve/knowledge gaps. 0.1.0, source install only (not on PyPI). |
geos | Use when working with the GEOS C/C++ geometry engine that powers PostGIS, QGIS, Shapely and GDAL — GEOSGeomFromWKT/GEOSIntersection/GEOSBuffer/GEOSMakeValid C API, geos::geom C++ API, OverlayNG robustness, GEOSPrepare and GEOSSTRtree, or debugging TopologyException and self-intersection. |
geoserver | Use when deploying GeoServer 3.0.x to publish WMS/WFS/WMTS/WCS/MVT, or configuring SLD/CSS styles, RBAC security, and GeoWebCache seeding. Covers geoserver-3.0.2-bin.zip, docker.osgeo.org/geoserver:3.0.2 on Java 17/21, /rest/about/version.json, blank GetMap from wrong native bounds, and Shapefile charset mojibake. |
geoserver-cloud | Use when deploying GeoServer Cloud 3.0.2.1 on Docker Compose or Kubernetes — gateway serving WMS/WFS/WCS/WPS/GWC microservices under /geoserver/cloud, PgConfig vs datadir backends, RabbitMQ config-bus sync, Helm chart geoservercloud 3.0.3, and diagnosing 502s via actuator/health and Consul registration. |
geoserver-rest-api | Use when automating GeoServer 3.0.2 over REST — POST /rest/workspaces, datastores, featuretypes, PUT Shapefile ZIP to file.shp, GeoTIFF to coveragestores, upload SLD as application/vnd.ogc.sld+xml, ?recurse=true deletes. curl -u admin:geoserver, single-key JSON like {"workspace":{...}}, 401 on POST but 200 on GET, GWC cache masking style changes. |
geotools | Use when building Java GIS apps on GeoTools 35.2 (JDK 17) — org.geotools:gt-main / gt-shapefile / gt-geopkg / gt-epsg-hsql from repo.osgeo.org (not Maven Central), CQL/ECQL filters, CRS.decode plus JTS.transform reprojection, StreamingRenderer PNG output, and disposing DataStore/SimpleFeatureIterator. |
grass-gis | Use when doing GIS geoprocessing with GRASS GIS headlessly — grass --exec and --tmp-project for servers and CI, g.region computational region management, r.* raster, v.* vector, r3.* 3D raster and t.* temporal modules, r.import/v.import data import, or Python scripting with grass.script, grass.script.array and grass.tools. |
jts | Use when doing precise 2D computational geometry in Java with org.locationtech.jts:jts-core 1.20.0 — GeometryFactory construction, contains/intersects predicates, overlay via OverlayNGRobust, buffer, STRtree and PreparedGeometry speedups, WKT/WKB/GeoJSON I/O, and fixing TopologyException or unclosed rings. |
kepler-gl | Use when building React/Redux web apps or Jupyter notebooks for large-scale geospatial visual exploration with Kepler.gl 3.3.0-alpha.20 — @kepler.gl/components KeplerGl, @kepler.gl/actions addDataToMap, @kepler.gl/processors processGeojson/processCsvData, and the Python keplergl widget. Also for fixing blank maps from a missing reducer or wrong getState (react-redux 'Could not find ... in the context of Connect(...)'), Mapbox token basemap errors, and oversized addDataToMap payloads. |
leaflet | Use when adding lightweight 2D tile maps to web pages with leaflet 1.9.4 — L.map/L.tileLayer, markers, popups, GeoJSON overlays, layer control, [lat, lng] ordering, or debugging blank maps, broken default marker icons after bundling, and sizing fixed by invalidateSize(). |
mapbox-gl-js | Use when building vector web maps with mapbox-gl 3.34.2 — WebGL rendering, Style Spec layers, data-driven expressions, setTerrain raster-dem, fill-extrusion, or debugging 401 'A valid Mapbox access token is required', 'Style is not done loading', and pk./sk. token handling. Note: v2+ is proprietary under Mapbox TOS and requires a token; MapLibre GL JS is the open-source fork. |
maplibre-gl-js | Use when building open-source vector web maps with maplibre-gl 6.17.0 — Map/addSource/addLayer, Style Spec v25 layers, data-driven expressions, raster-dem terrain with setTerrain, setSky, setMissingStyleImageResolver, addProtocol for PMTiles, or debugging v6 ESM-only import errors, 'WebGL2 is required', blank maps after setStyle and style-spec expression warnings. MapLibre GL JS is the BSD-3-Clause fork of Mapbox GL JS and needs no access token. |
maplibre-native | Use when embedding GPU-accelerated vector maps natively in Android, iOS, macOS, Linux, Windows or Node.js with MapLibre Native (C++ core, BSD-2-Clause) — org.maplibre.gl:android-sdk MapView/MapLibre.getInstance/getMapAsync, CocoaPods MapLibre MLNMapView, @maplibre/maplibre-gl-native mbgl.Map render, offline caching, Bazel/CMake builds, or debugging green map screens, missing submodules and NDK build failures. |
mapserver | Use when publishing WMS/WFS/WCS/OGC API Features from a MapServer 8.6.6 .map mapfile — MAP/LAYER/CLASS/STYLE objects, STATUS/PROJECTION/EXTENT errors, WEB.METADATA wms_enable_request and wfs_enable_request, SLD binding, FastCGI plus MS_MAP_PATTERN hardening, and blank GetMap / "No query information to decode" symptoms. |
mapsui | Use when embedding interactive 2D maps in .NET desktop (WPF/WinUI/WinForms) or mobile (MAUI/Avalonia/Blazor) apps with Mapsui 5.1.0 (net8.0/net9.0) — Mapsui.Wpf/Mapsui.Maui packages, Map and Layers, OpenStreetMap.CreateTileLayer, Shapefile/GeoJSON via Mapsui.Nts, SphericalMercator.FromLonLat, or fixing a blank MapControl. |
nettopologysuite | Use when doing 2D computational geometry in .NET with NuGet NetTopologySuite 2.6.0 — GeometryFactory with SRID, Contains/Intersects predicates, Intersection/Union/Buffer overlays, STRtree, GeometryFixer, WKT/WKB/GeoJSON I/O, Shapefile via IO.Esri, and EF Core spatial queries on SQL Server/Npgsql. |
opendronemap | Use when turning drone/aerial imagery into orthophotos, DSM/DTM, point clouds or 3D Tiles with OpenDroneMap — odm CLI via docker run --project-path, --dsm --dtm --orthophoto-resolution --pc-quality --3d-tiles, WebODM 4.0.0 compose, /api/token-auth/ and /api/projects/{id}/tasks, pyodm Node('localhost',3000); also for 'odm_orthophoto.tif' outputs and out-of-memory failures. |
opengis-all | Use when navigating end-to-end GIS workflows — GDAL CLI/API (ogr2ogr, gdalwarp, gdal_calc.py), qgis_process and PyQGIS analysis, GeoServer REST publishing, and OpenLayers/CesiumJS visualization. One-stop index covering the complete open-source GIS data pipeline. |
opengis-daf | Use when building JSON-plan GIS analysis or QC pipelines with OpenGisDAF (.NET 10 / C# 14) — daf validate/run, operators buffer/clip/intersect_check/containment_check/coordinate_transform, DAG upstream bindings, GeoJSON/Shapefile/PostGIS sinks, qcMode QC reports, AssemblyLoadContext plugins; also for "zero tests ran" exit code 5, missing --recurse-submodules GDAL build errors, or PostGIS Layer already exists. Plan-driven ETL. |
opengis-utils-for-java | Use when needing common GIS utilities in Java — OguLayerUtil layer read/write, GeometryUtil 60+ ops, CrsUtil CGCS2000 (EPSG:4490, 4502-4554), Shapefile/GeoJSON/FileGDB/PostGIS/land TXT I/O, topology validation; also for GDAL UnsatisfiedLinkError on gdal_jni, missing osgeo repo on GeoTools, or resolving com.znlgis.ogu4j:ogu4j:1.0.0 that is not on Maven Central. OGU4J. |
opengis-utils-for-net | Use when needing common GIS utilities in .NET/C# — OguLayerUtil ReadLayer/WriteLayer/ConvertFormat, GeometryUtil 50+ ops, CrsUtil CGCS2000 transforms, Shapefile/GeoJSON/FileGDB/GeoPackage/KML/PostGIS I/O; also for Unable to load DLL gdal / DllNotFoundException, GBK shapefile mojibake, or ArgumentException from Geojson2Wkt on a whole FeatureCollection. OpenGIS.Utils 1.1.2. |
openlayers | Use when adding interactive 2D maps to web apps with npm ol 10.11.0 — Map/View, fromLonLat to EPSG:3857, WMS/WMTS/XYZ sources, MVT with featureClass, Draw/Modify/Snap interactions, or debugging blank layers (missing setStyle), offset centers and ol/... module-not-found errors. |
pdal | Use when processing point cloud data (LAS/LAZ/BPF/EPT/COPC) via CLI or Python — pipeline JSON workflows, format conversion, reprojection, cropping, outlier removal, ground classification (SMRF), and DEM generation from LiDAR. PDAL (Point Data Abstraction Library) is the point cloud equivalent of GDAL: pdal info/translate/pipeline commands plus pdal.Pipeline Python bindings. |
postgis | Use when extending PostgreSQL with PostGIS 3.7.0 — geometry/geography/raster types, GiST and KNN distance-operator indexes, ST_Intersects/ST_Buffer/ST_Transform/ST_AsMVT, shp2pgsql -I and raster2pgsql import, and fixing "Operation on mixed SRID", slow spatial joins, and invalid polygons with ST_MakeValid. |
proj | Use when transforming coordinates or inspecting CRS definitions from the command line — cs2cs, projinfo -s/-t, proj projection math, cct, EPSG lookup, datum shift with grid files, WKT/PROJJSON export, or debugging "Cannot find proj.db" and latitude-first axis order. PROJ 9.9.0: the OSGeo engine behind GDAL/QGIS, with the proj.db SQLite database. |
projnet4geoapi | Use when transforming coordinates or reading CRS definitions in .NET with ProjNet 2.1.0 (NuGet ProjNet, repo ProjNet4GeoAPI) — CoordinateSystemFactory.CreateFromWkt, CoordinateTransformationFactory.CreateFromCoordinateSystems, MathTransform.Transform, CoordinateSystemServices SRID registration. Also for 'no suitable transformation' / null from GetCoordinateSystem, EPSG codes beyond 4326 and 3857 returning null, and SharpMap projects needing the legacy ProjNet4GeoAPI 1.4.1 GeoAPI build. |
pyqgis | Use when scripting QGIS with Python — QgsApplication standalone init, QgsVectorLayer / QgsRasterLayer loading, processing.run after Processing.initialize(), QgsGeometry / QgsExpression, QgsMapSettings rendering and QgsLayoutExporter PDF/PNG export, qgis._3d, or debugging "import qgis.core" failures. PyQGIS for QGIS 4.2.3 and LTR 3.44.15 (use the interpreter bundled with QGIS, not system Python). |
qgis-process | Use when running QGIS geoprocessing headless via qgis_process — native:buffer / native:reprojectlayer / native:clip, qgis_process list / help --json / run --json, .model3 models and .py scripts, batch CI pipelines, or debugging "Algorithm ... not found!"; includes QT_QPA_PLATFORM=offscreen and the qgis/qgis images (stable 4.2, ltr 3.44). |
qgis-server | Use when publishing QGIS projects (.qgs/.qgz) as OGC web services — WMS GetMap/GetPrint, WFS and WFS-T, WMTS, OGC API Features via qgis_mapserv.fcgi with Apache mod_fcgid, Nginx, or Docker, plus QGIS_SERVER_* tuning (MAX_THREADS, PARALLEL_RENDERING, LOG_STDERR); covers "Service unknown or unsupported" and MAP/GetCapabilities checks. QGIS 4.2.3 and LTR 3.44.15. |
shapely | Use when doing computational geometry in Python — shapely.intersection/union/buffer/convex_hull/simplify, STRtree queries, from_wkt/to_wkt/to_geojson, make_valid, GEOS-gated ops (coverage_clean, split); also for TopologyException on self-intersecting polygons or OOP vs function buffer quad_segs mismatch. Shapely 2.2.0 binds GEOS. |
sharpmap | Use when rendering 2D maps in legacy .NET Framework 4.7.2 WinForms or ASP.NET WebForms apps with SharpMap 1.2.0 — Map.GetMap() to PNG, ShapeFile/PostGIS providers, VectorLayer with CustomTheme, TileAsyncLayer via BruTile, ProjNet4GeoAPI transforms, or debugging blank output and GDI+ handle leaks. New projects should use Mapsui. |
spatialite | Use when adding spatial SQL to a single-file SQLite database with SpatiaLite — mod_spatialite loading, InitSpatialMetaData, AddGeometryColumn, CreateSpatialIndex/MbrWithin, ST_Transform and GEOS predicates, spatialite_tool or ogr2ogr import of Shapefile, and GPKG fallback; also for 'no such module: mod_spatialite', 'no such function: InitSpatialMetaData', and 'the SPATIALITE_SECURITY environment variable' errors. libspatialite 5.1.0. |
stac-cog-titiler | Use when building cloud-native imagery pipelines with STAC 1.1.0, Cloud Optimized GeoTIFF and TiTiler 2.4.0 — rio cogeo create/validate, pystac-client search, stac-fastapi 7.1.1 with stac-fastapi-pgstac 7.2.1, uvicorn stac_fastapi.pgstac.app:app, titiler.application /cog and /stac tilejson endpoints, MosaicJSON mosaics, or debugging HTTP 416 range errors, blank tiles from band index mismatch and 403 on private object storage. |
whitebox-tools | Use when doing advanced raster, terrain or LiDAR geoprocessing with WhiteboxTools v2.4.0 — whitebox_tools --run=Slope/FillDepressions/BreachDepressions/FlowAccumulationFullWorkflow/Watershed/ExtractStreams, lidar_* tools for LAS point clouds, or the whitebox (whitebox-python 2.3.6) WhiteboxTools wrapper in Python. Also for 'whitebox_tools: command not found', mismatched Python frontend versions, and missing DEM/flow-accumulation intermediate outputs. |
安装
方式一:Plugins 界面(本地目录,适合开发)
- 在 DSH 中打开 Plugins / 插件 页面,选择安装 bundle(本地目录方式)。
- 目标填包根目录的绝对路径,也就是包含
package.json的目录,例如D:\path\to\dsh-opengis-skill。 - 安装后在列表中找到 OpenGIS 技能包 并启用;记录写入当前所选 profile 的插件配置。
- 本地目录方式直接引用源码目录,改动会随重载生效,适合开发与试用;正式使用建议走下面的 npm 方式,便于升级与版本校验。
方式二:npm
sole plugin --profile <profile> add @dsh-gis/dsh-opengis-skill
安装后在 Plugins 页面启用该 bundle。卸载:
sole plugin --profile <profile> remove @dsh-gis/dsh-opengis-skill
- desktop profile 由 Electron 应用独占,推荐直接使用 Plugins 界面操作。
- 安装、升级或启停之后,需要重载/重启 dsh,并新开会话,技能目录才会反映最新状态(bundle 与技能目录在会话启动时装配)。
- 升级到新版本后同样需要重载 + 新会话;本地目录方式改动
package.json或assets/后也一样。
使用
- 技能目录只列出每个技能的名称与描述;模型用
skill("gdal")之类的调用加载,用户也可以在输入框直接输入/gdal。 - 常用入口:
opengis-all— 端到端 GIS 流程索引(GDAL → 处理 → GeoServer → 可视化);gdal/gdal-api— 命令行与编程式栅格/矢量处理;qgis-process/pyqgis— QGIS 批处理与二次开发;geoserver+geoserver-rest-api— 发布与管理 OGC 服务;postgis/duckdb-spatial/spatialite— 空间数据库;proj— 坐标转换;whitebox-tools/grass-gis/pdal— 地形水文、点云批处理;geonode/geoserver/mapserver/qgis-server— 发布 OGC 服务;openlayers/leaflet/maplibre-gl-js/mapbox-gl-js/cesiumjs/deck-gl/kepler-gl/geolibre— Web 2D/3D 可视化;maplibre-native— Android/iOS/桌面/Node 原生渲染;geos— GEOS C/C++ 几何内核(PostGIS/QGIS/Shapely 的底层);opendronemap— 无人机影像摄影测量(正射/DSM/点云/3D Tiles);stac-cog-titiler— 影像云原生链路(STAC + COG + TiTiler)。
- 加载结果会给出该技能的 Base directory;正文中的
reference/*.md与../<其他技能>/SKILL.md相对链接都据此解析。因为全部技能资产随同一个包一起分发,跨技能链接不需要额外安装或配置。
配置(裁剪目录)
技能目录里的 45 条描述每轮对话都在上下文里。按当前可见技能的 description 字符数估算,全量约 4.1k token(口径:ceil(Σ description 字符数 / 4),与 validate-skills.mjs 的目录预算同一算法;技能名与分隔符不计入)。这个数字是 diagnose() 的 catalogTokens,配置裁剪前后的差值可以直接用它对比:全量 4108、scenario: web 约 929。插件配置可以把它裁剪成当前项目真正需要的子集,配置在 bundle 的插件行上。
这四个字段由 provider 自己在 apply() 里校验(不导出 schemastery Config,也不会向宿主注册配置 schema):宿主因此只负责传递配置,写错的场景名、组名、技能名或「筛完为空」会在插件激活时报错并出现在启动诊断里,而不是静默返回半份目录:
- insert:
- id: opengis-skill
name: '@dsh-gis/dsh-opengis-skill'
config:
scenario: web # 预设:浏览器地图
groups: ['data'] # 再并入数据处理分组
exclude: ['kepler-gl'] # 最后去掉某个技能
四个字段的语义与优先级:
| 字段 | 类型 | 行为 |
|---|---|---|
scenario | string | 场景预设,展开成一组 groups;未知值报错 |
groups | string[] | 与 scenario 展开的分组取并集;留空表示全部 |
skills | string[] | 显式白名单,优先于 scenario 与 groups |
exclude | string[] | 最后应用,从结果里移除 |
优先级一句话:scenario 展开的分组与 groups 取并集 → 非空 skills 覆盖前面的分组筛选 → exclude 最后删。
可选场景预设:
| 预设 | 分组 | 可见技能数 | 估算 token |
|---|---|---|---|
web | web | 10 | 约 929 |
server | server | 7 | 约 623 |
data | data | 11 | 约 1059 |
all | 全部分组 | 45 | 约 4108 |
可选分组:desktop(QGIS 桌面)、server(发布与 OGC 服务)、data(数据读写与空间数据库)、geometry(几何算法库)、web(Web/3D 可视化)、dotnet、java、pipeline(流程编排与无人机重建)、meta(索引)。一个技能可以属于多个分组,例如 brutile 同时是 web 与 dotnet。
四个已知行为点:
- 未知名字报错:
groups里写了不存在的组、skills/exclude里写了不存在的技能,插件加载直接抛错并列出合法取值。拼错一个过滤词不应该悄悄返回一半目录。 - 筛完为空报错:
exclude把所选技能全删掉时抛错,而不是注册一个空目录。 - 顺序不变:过滤后仍按技能名字典序排列,与上游目录一致。
- 只影响发现:裁剪只改变候选列表;被裁掉的技能无法通过
skill加载(provider 会报未知技能),文件仍在包内,改配置即可恢复。
DeepSeek Harness 适配
上游已把仓库与特定 Agent 解耦,技能正文保持通用写法。本包不去改上游快照,而是加一层只在 DSH 里生效的执行指南:
- 分层存放:
assets/<skill>/SKILL.md是上游逐字节快照;adaptations/common.md是每个技能都会读到的通用约定(技能加载与兄弟技能、reference 分段读取、ops_bash/pwsh/run_code分工、Windows 改写、后台作业、present交付、ask_user_question确认、沙箱与审批、外部资料);adaptations/<skill>.md是该技能独有的执行建议(先读哪个 reference、命令跑在哪、探测什么版本、怎么验证、哪些操作要先确认)。 - 加载时拼接:provider 的
get把「上游正文 +## DeepSeek Harness 使用建议+## DeepSeek Harness 通用约定」拼成一次加载结果,正文与reference/*.md的相对链接仍以技能目录为基准解析,不需要额外配置。 - 硬约束保证「确实是 DSH」:
<skill>.md必须 900–4000 字符、含 5 个固定要点、至少点名 2 个核心工具,「先探测版本」「验证产物」两条必须各带一条反引号命令,并且至少 4 个要点要拆成子条目、全文至少 8 条子条目;common.md至少 14 条要点、覆盖 8 个以上核心工具。工具名从固定白名单里数,所以「读一下文件」这种泛泛叙述不算数。 - 能力按来源分级:
lib/adaptations.js把工具白名单拆成CORE_TOOLS(DSH 官方分发自带的工具:bash/pwsh、文件与检索、job_*、subagent家族、skill、present、todo_write、Web、working_directory、ask_user_question、目标与 Agent Teams 等,已对照0.2.2-rc.5的dsh-base与 web 预设核实)与OPTIONAL_TOOLS(第三方插件与可选预设:ops_bash、run_code、load_workspace_dependencies、桌面控制、定时任务、MCP 资源、配置管理等);最低引用数只算核心工具,可选工具必须写成「会话提供时……否则退回……」的形态,避免在没有该插件的会话里给出无法执行的指引。 - 不随上游漂移:同步只覆盖
assets/与upstream.json,不会碰adaptations/;上游新增技能时npm run validate会点名缺少适配文件的技能,补齐后再发布,避免悄悄发布一个没有 DSH 指南的技能。 - 只写这个 harness 里才成立的事实:通用约定按 DSH 的真实行为写,而不是泛泛的「用终端跑」——前台命令超时会被提升成后台作业并返回
jobId(不要重跑)、随包 Python 有 numpy/pandas/Pillow 但没有 GDAL/Shapely/GeoPandas 绑定(load_workspace_dependencies只用来取解释器与 Node 路径)、Agent Teams/桌面控制/定时任务属于可选插件(会话里没有就退回todo_write+ 后台作业 +subagent)、ops_bash与官方bash是同一个 shell 消费者的两种暴露方式(没有插件时把正文里的ops_bash换成bash)。 - 自检:
npm run check:adaptations只校验适配层(可传入技能名);npm run validate会同时校验适配层的结构、长度、工具覆盖、子条目、相对链接,以及适配文件里用反引号提到的reference/*.md是否真的存在于该技能目录。npm run check:citations再往前一步:校验适配层指向的技能确实存在、引用的三段式版本号能在该技能正文里找到。 - 命令统一走 DSH 的 shell 工具:官方发行版叫
bash,装了 Ops 类插件的部署把它包装成ops_bash,两者参数与行为一致(本包正文默认写ops_bash,没有该插件时换成bash);Windows 的 Bash 是 MSYS,Windows 原生命令用pwsh;只暴露run_code的 PTC 会话在 TypeScript 程序里按生成的 SDK 调用同名工具。 - 文件与日志优先用
read(分段)/grep/glob;大输出先落盘,长任务放后台作业并用job_output收日志。技能目录与运行时是只读资源,脚本与产物写到会话工作区。 - 技能正文标注的是上游核验时点的版本(例如 GeoServer 3.0.2、GeoTools 35.2、QGIS 4.2.3 / LTR 3.44.15、GDAL 3.13.3)。实际环境版本不同时,先探测版本,再按“低版本降级”或“高版本新增 API”说明差异,不要照搬不存在的命令。
- 技能只是领域知识与执行约定,不会替你安装工具、绕过沙箱或读取凭据;安装依赖、启动服务、覆盖数据、执行破坏性 SQL 前先向用户确认,命令与回答中不要回显密码与 token。
上游同步
本节只适用于本仓库的源码开发。
scripts/与test/不在 npm 发布包内(package.json的files未包含它们),安装用户无需执行这些命令。
# 默认从 ../opengis-skills 读取,也可用 --from 或 OPENGIS_SKILLS_DIR 指定
npm run sync -- --from ../opengis-skills
# 只检查是否与上游一致(CI 可用)
npm run sync:check -- --from ../opengis-skills
同步脚本会:逐文件复制 gis/<skill>/(文本统一为 LF,保证与上游 git blob 跨平台字节一致)、校验 frontmatter(name 必须为 kebab-case 且与目录同名)、清理上游已删除的技能目录、更新 upstream.json,并重新生成 README 中的技能数量与技能表(生成区域由 <!-- skills:count:* --> 与 <!-- skills:* --> 标记界定)。
当前快照对应上游提交 upstream.json 中记录的 commit(本版为 55b87f4,45 个技能、71 个文件,摘要以清单为准):在上次同步的 e47ff34 基础上新增 GEOS、MapLibre GL JS、MapLibre Native、OpenDroneMap、STAC/COG/TiTiler 五个技能,并刷新了 GDAL 统一 CLI 写法、GeoPandas 1.2 的 make_grid/read_file_info/GeoParquet 2.0、Shapely 2.2 的新函数、PDAL 2.10 的新 stage、GRASS 8.5 的 JSON 输出与 grass.tools、MapServer 的 map2img 更名、DuckDB 的 GEOMETRY 内置类型等 20 余处正文。上游仍使用 Agent Skills 规范的六字段(name / description / license / metadata{category,tags},另有可选的 compatibility 与 allowed-tools);本包的解析器认识这层嵌套结构,校验脚本会拒绝规范外字段,因此上游若再改 frontmatter 形状,npm run validate 会在发布前报错而不是悄悄丢字段。sync:check 做双向比较:既检查已同步文件是否漂移,也检查上游新增/删除的技能是否遗漏。adaptations/ 不参与同步:它属于本仓库的 DSH 适配层,同步只覆盖资产快照;上游新增技能后需要手工补一个 adaptations/<skill>.md,否则校验失败。
为避免伪造来源,npm run sync 要求 --from 指向 opengis-skills 的 git 检出根目录:脚本用 git rev-parse --show-toplevel 校验该目录就是仓库根,避免把外层仓库的 HEAD 误记成上游 commit;无法证明 commit 时同步直接失败。上游 gis/ 下若出现没有 SKILL.md 的目录,同步会报错而不是静默跳过(否则上游改名会静默丢技能);gis/ 根目录的普通文件(上游分类索引 gis/SKILL.md 等)不参与同步,也不会被当作技能打包。
upstream.json 同时是一份完整性清单:schemaVersion 为 1,hashAlgorithm 为 "sha256",files 以相对 assets/ 的 POSIX 路径为键、对应文件的 SHA-256 摘要为值。npm run validate 会重新计算并比对全部摘要,因此不依赖上游 checkout 也能发现资产被手改、缺失或未列入清单的情况;CI 的 sync 任务再用固定 commit 的上游检出做一次 sync:check,确保快照与上游一致。
开发
需要 Node.js 22+。
npm run check # validate + check:adaptations + check:citations + test,发布前必跑(也是 prepublishOnly)
npm run check:adaptations [skill...] # 只校验 DSH 适配层,可指定技能
npm run check:citations # 校验适配层指向的技能与版本号是否仍然存在
npm run validate # 资产、六字段 frontmatter、内容质量、bundle 接线、完整性清单、分类法与 DSH 适配层
npm run diagnose # 只读诊断:技能数/可见数/缺失/降级/悬空引用/哈希/目录 token/DSH 版本,healthy 为假时退出 1
npm run compat:report # 重新执行契约测试并生成 docs/compatibility.md(真实退出码与通过/失败数)
npm test # Node 内置测试运行器(本机装了 DSH 时额外跑真实注册表集成用例)
npm pack --dry-run # 查看实际发布内容
编辑器默认值见 .editorconfig(UTF-8、LF、最终换行;JS/MJS 用 Tab,JSON/YAML/Markdown 用 2 空格;Markdown 保留行尾空格)。版本变更记录见 CHANGELOG.md。
目录结构
dsh-opengis-skill/
├── package.json # dsh.bundle.patch、engines、files、图标/本地化导出
├── cordis.patch.yml # bundle 层:把 opengis-skill provider 行插入 Host
├── lib/
│ ├── index.js # provider 插件(注册 ctx.skills、list/get),并再导出 diagnose()
│ ├── diagnose.js # 同步、只读诊断;DSH 版本探测
│ ├── adaptations.js # DSH 适配层读取、拼接、降级记录与结构校验(插件/脚本/测试共用)
│ ├── citations.js # 适配层交叉引用判定(技能名与版本号),脚本与诊断共用
│ ├── taxonomy.js # 技能分组、场景预设与中文触发词,提供配置过滤与路由打分
│ ├── catalog.js # 扫描 assets/ 构建技能目录、生成 README 区域
│ ├── markdown-links.js # Markdown 相对链接解析与断链校验
│ ├── skill-file.js # SKILL.md frontmatter 解析(插件/脚本/测试共用)
│ └── *.d.ts # 手写类型声明
├── assets/<skill>/ # 上游技能快照(SKILL.md + reference/*.md,逐字节同步,勿手改)
├── adaptations/ # DSH 适配层(不参与上游同步)
│ ├── common.md # 每个技能都会读到的通用执行约定
│ └── <skill>.md # 该技能专属的执行建议
├── locale/{en,zh}.json # Plugins 里显示的标题与描述
├── icon.svg # bundle 图标
├── docs/
│ ├── DETAIL.md # Plugins 详情页正文(locale 的 meta.detail 指向它)
│ └── compatibility.md # compat:report 生成的真实测试证据(生成,勿手改)
├── scripts/
│ ├── sync-opengis-skills.mjs # 上游同步(assets/、upstream.json、README 生成区域)
│ ├── check-adaptations.mjs # 单独的 DSH 适配层校验(可指定技能)
│ ├── check-citations.mjs # 适配层交叉引用校验(技能名与三段式版本号)
│ ├── diagnose.mjs # npm run diagnose 的一行诊断入口
│ ├── compat-report.mjs # npm run compat:report:跑契约测试并生成兼容性报告
│ └── validate-skills.mjs # 发布前校验(自包含,无需上游 checkout)
├── test/
│ ├── plugin.test.mjs # provider 目录/加载/链接/适配层拼接
│ ├── adaptations.test.mjs # 适配层拼接、覆盖与结构规则
│ ├── skill-file.test.mjs # frontmatter 解析
│ ├── catalog.test.mjs # 目录构建与 README 生成区域
│ ├── markdown-links.test.mjs # 相对链接解析与断链检测
│ ├── taxonomy.test.mjs # 分类法覆盖、场景预设与插件配置过滤
│ ├── diagnose.test.mjs # diagnose() 与「缺适配文件降级」夹具
│ ├── routing.test.mjs # 中文请求的路由判据命中率回归
│ ├── dsh-contract.test.mjs # 按 DSH 注册表的校验规则回归 candidate/definition
│ ├── dsh-integration.test.mjs # 在本机已安装的 DSH 注册表里跑一遍 provider(找不到安装则跳过)
│ └── scripts.test.mjs # 同步/校验脚本(临时目录夹具)
├── .editorconfig # 编辑器默认值
├── CHANGELOG.md # 版本变更记录
├── README.md
└── upstream.json # 上游仓库、commit、同步时间、技能清单与 SHA-256 清单
设计说明
- 规范注册:
apply时调用ctx.skills.registerProvider(() => provider);返回的 disposer 由调用方 fiber 拥有,卸载时自动清理,因此不需要再套一层ctx.effect(...)。 - provider 名为
opengis,source为opengis,候选 rank 为 600(即BUNDLED_SKILL_RANK,与官方内置技能包一致),invocation为模型与用户均可调用。 list只返回元数据(名称、描述、rank、source、locator/path、resourceBase、来自上游 frontmatter 的metadata),每次调用返回一个新数组、元素冻结,调用方排序或截断不会改到 provider 的目录;get每次重新读盘并解析正文与adaptations/<skill>.md,因此编辑资产或适配文件后重新加载插件即可生效。adaptations/common.md在一个 provider 实例内缓存一次成功读取的结果(失败的读取不缓存,调用方取消也不会污染共享缓存),避免每加载一个技能重复读同一文件;改动它需要重载插件(或重启 DSH),而不是只重读技能正文。插件不注册工具、不注入提示段、不写会话状态。- 元数据只放 candidate:
metadata.category/metadata.tags/metadata.groups/metadata.keywords只出现在list结果上,get结果保持干净。宿主的两份契约都允许 definition 携带metadata,但 registry 的toSummary()与skill工具都不会读它,返回它只是增加载荷;description 始终用上游原文,不因元数据改动而偏移。groups 与 keywords 来自本地lib/taxonomy.js,与上游无关。 - 目录可裁剪:
apply(ctx, config)读scenario/groups/skills/exclude四个字段并交给selectSkills;scenario展开成预设分组再与groups取并集,非空skills覆盖分组,exclude最后应用。未知场景名、未知组名、未知技能名、筛完为空都直接抛错,因为一次拼错的过滤会静默返回一半目录,比启动失败更难发现。 - 路由判据有回归:
test/routing.test.mjs给每个技能准备两条中文请求,用关键词命中(×3)与描述里的拉丁词命中(×1)打分,要求 90% 以上命中第一名、全部命中前三名。拉丁词按整词匹配(geos不再命中geoserver),因此这是对「英文描述 + 中文触发词」这层判据的可执行断言:改动关键词或重新同步上游后会立刻报出退步。注意 DSH 的模型侧目录只渲染名称与描述,所以该测试衡量的是判据是否分得开,不是网关真的按关键词排序。 - 不设
whenToUse:宿主虽然接受这个可选路由字段,但它只在网关的 user-invocable 技能列表(/命令面板)里透出,模型可见的技能目录只渲染description;上游 description 已经按「Use when … / Also for …」写好,再补一份 whenToUse 只会产生第二套会漂移的文案,因此本包不引入。 - 兼容性有三层回归:
test/dsh-contract.test.mjs按 0.2.2-rc.5 的validateCandidate/validateDefinition规则校验 45 个候选与正文;test/dsh-integration.test.mjs自动探测本机安装的 DeepSeek Harness,用ELECTRON_RUN_AS_NODE把 provider 装进真实的SkillRegistry跑一遍(列表、加载、未知技能、取消、重名 provider),找不到安装或设置DSH_SKIP_INTEGRATION=1时跳过;npm run compat:report真实执行这两个测试并把退出码、通过/失败数与生成时间写进 docs/compatibility.md,package.json的dsh.compatibility用verified[].evidence指回测试文件,声明与证据不会各说一套。 - 校验分层:
npm run validate把「会破坏下游契约或让内容不可发现」的问题设为错误(规范外 frontmatter 字段、license 不是 MIT、metadata.category不是gis、tags 数量或语法不对、description 超 500 字符/不以Use when开头/含尖括号或中文/重复、SKILL.md 超 500 行、reference/有孤儿文件、分类法与技能目录不一致、适配层不达标),把「上游编辑口味」设为警告(缺「截至 YYYY-MM」时效标记、FAQ 少于 5 行、reference 超 100 行没有目录、代码围栏没语言、正文含 emoji),警告不会阻塞发布。 - 适配层拼接:
get返回的content是「上游正文 + 分隔线 +adaptations/<skill>.md+adaptations/common.md」。正文首部保持上游原样,所以reference/*.md与../<skill>/SKILL.md的相对链接仍按技能目录解析;共用约定放在最后,保证读到的最后一段是安全与平台约束。适配文件缺失与内容不合规是两类失败:缺失(ENOENT/ENOTDIR/EISDIR)时该技能降级为「上游正文 + 通用约定」继续加载,降级原因记在 provider 内部的降级表里并由diagnose()的degraded报告——一次不完整的安装不应让整个技能不可用;内容不合规(不以## DeepSeek Harness 使用建议开头)仍然直接报错并指出期望路径,因为那是打包错误,静默返回一个没有 DSH 指南的技能比失败更难发现。 - 运行时加固:frontmatter 解析严格且容忍 UTF-8 BOM(
name必须为 kebab-case、description必填,块标量与未闭合引号会报可读错误);上游部分description存在未转义的内层双引号(非法 YAML 但语义明确),解析器按“首尾引号之间全部内容”宽容读取,未知转义保持字面,从而继续与上游字节一致而不必改写快照;assets/缺失时报错会指明期望的资产根目录;resourceBase在 Windows 上也统一输出为正斜杠,跨平台链接一致。 - 相对链接不做改写:包内是全量技能目录,
reference/*.md与../<skill>/SKILL.md都能解析;npm run validate会扫描全部 Markdown 相对链接,断链或越出assets/都会失败。
故障排查
- 技能目录没有出现:确认 bundle 已在 Plugins 中启用;安装、升级或启停后需要重载/重启 dsh 并新开会话。若用本地目录方式,确认填的是包含
package.json的包根目录。 - 加载技能失败:错误信息会带出具体资产路径(例如
.../assets/gdal/SKILL.md的 frontmatter 问题);按提示修复,或从上游重新同步,不要手工编辑assets/。 - 本地验证:
npm run validate检查资产、元数据、bundle 接线、完整性清单、兼容性声明与链接;npm test跑单元测试;发布前统一用npm run check。 - 目录/诊断排查:
npm run diagnose打印契约字段(技能数、可见数、缺失、降级、悬空引用、哈希不符、目录 token、DSH 版本)并以退出码表达healthy;--human给人读摘要。装好的包里没有scripts/时用一行等价命令:node -e "import('@dsh-gis/dsh-opengis-skill').then(m => console.log(JSON.stringify(m.diagnose(), null, 2)))"。degraded出现adaptation-missing表示该技能缺adaptations/<skill>.md,技能仍可用但只有上游正文与通用约定;missing/哈希不符表示快照缺文件或被改动(npm run sync修复)。 - 同名技能冲突:技能注册表按 rank、再按注册顺序决定同名技能的解析优先级;本包 rank 为 600。若其他 provider 也提供了同名技能,检查是否有另一份 OpenGIS 技能包或自定义技能被同时启用。
- 不要手改
assets/:它是上游快照,手工修改会导致 SHA-256 完整性校验与同步检查失败;需要改内容时先改上游,再npm run sync重新生成。 - 适配层报错:
npm run validate报adaptations/<skill>.md: missing表示上游新增了技能但还没写 DSH 指南(运行时这一项会降级并在diagnose()里报告,发布前仍必须补齐);报... must start with "## DeepSeek Harness 使用建议"、missing the "…" bullet、too short/exceeds the …-character budget、cites N core DeepSeek Harness tool(s)分别表示标题、固定要点、长度或核心工具覆盖不达标;"先探测版本" must cite a concrete command or tool in backticks表示该条目只有泛泛叙述、没有可执行命令;cites reference/x.md, which is not a file表示引用了不存在的参考资料。按提示修好后再发布。 - 分类法报错:
lib/taxonomy.js: "x" has no group/has fewer than 3 keywords表示新增技能还没登记分组或触发词;names "x", which is not a bundled skill表示上游删了技能而本地还留着记录;group "x" has no members表示分组表里没有成员却仍在GROUP_IDS里。四类都在npm run validate的checkTaxonomy里,上游同步后必跑。 - 适配层子条目报错:
N label(s) decompose into sub-bullets, needs at least 4与carries N sub-bullet(s), needs at least 8表示条目又退回了整段长文;保证至少 4 个固定要点下各有两格缩进的-子项。 - 交叉引用报错:
npm run check:citations报points at skill "x", which is not bundled是改名或删除后的悬空指引;报cites version 1.2.3, which x does not document是适配层与上游正文对同一版本号说法不一致,按上游正文或迁移说明改正。两段式版本号只报警告,用来提示「这里引的是旧版本,确认是不是迁移注记」。 - 插件配置报错:启动时报
unknown scenario "x"/unknown group "x"/unknown skill "x"是配置里拼错了名字,合法取值见本文「配置」一节;the plugin config selects no skill表示exclude把结果清空了。 - 上游 frontmatter 报错:报
illegal frontmatter field、"license" must be MIT、"metadata.category" must be "gis"、"metadata.tags" must list、description must start with "Use when"表示上游改了 frontmatter 形状。assets/是只读快照,先看上游是否已迁移到新规范,再决定是升级解析器/校验规则还是重新同步。
与 @dsh-gis 其他插件的关系
@dsh-gis/dsh-gis:GIS 工具与地图界面(inspect/query/CRS/OGC/UI)。@dsh-gis/dsh-prompt-gis:一段 GIS system-prompt 与两个内联技能(gis-inspect-first、gis-query-patterns)。- 本包:纯知识型技能包,不提供工具,可与上述插件同时安装。
许可
MIT,见 LICENSE。技能正文与参考资料来自 opengis-skills(MIT © 2024-2026 znlgis),详见 THIRD_PARTY_NOTICES.md。
История версий
- 0.5.229 нояб. 2026 г. · 521 KB