← GeoAI SkillsCONTENT HISTORYWHAT CHANGED · RULE-BASED ANALYSIS
Update to GeoAI Skills
Snapshot Sep 30, 2026 · 23:13 UTC · version 0.4.0
Collection source: not recorded for this historical snapshot.
First saved snapshot
No earlier snapshot is available to establish a change.
Compare saved observations
Download comparison JSONFull technical diff · 0 changed fields
Full snapshot data
{
"name": "swe-devops-standards",
"description": "Always invoke to review, repair, or deliver geospatial or GeoAI code, including contract compliance, security, error handling, transactions, tests, scripts, functions, notebooks, packages, CI/CD, and repository changes, even when deployment is not requested. Pair with the domain skill for ETL and other production code. Covers CRS/data invariants, dependencies, cross-platform reproducibility, automation, and shipping. Do not trigger for unrelated software or analysis requesting no code or repository artifact.",
"included_files": [
{
"relative_path": "agents/openai.yaml",
"size_in_bytes": 215
},
{
"relative_path": "references/authoritative-sources.md",
"size_in_bytes": 844
}
],
"skill_md_contents": "---\nname: swe-devops-standards\ndescription: >-\n Always invoke to review, repair, or deliver geospatial or GeoAI code,\n including contract compliance, security, error handling, transactions,\n tests, scripts, functions, notebooks, packages, CI/CD, and repository\n changes, even when deployment is not requested. Pair with the domain skill\n for ETL and other production code. Covers CRS/data invariants, dependencies,\n cross-platform reproducibility, automation, and shipping. Do not trigger for\n unrelated software or analysis requesting no code or repository artifact.\nlicense: MIT\nmetadata:\n author: Muhammed Enes Duran\n---\n\n# Geospatial SWE & DevOps Standards\n\nPurpose: code produced as part of geospatial work should run in the user's\nreal environment and meet peer-level engineering quality. Apply these rules\nonly when code or repository artifacts are in scope.\n\n## 1. Environment realities (the top error source)\n\n- **Script-first by default**: no `%matplotlib inline`, `!pip install`, or\n `display()` unless the user is explicitly in a notebook. Every file runs\n from a terminal via `python script.py` behind an\n `if __name__ == \"__main__\":` block. (Cell markers like `# %%` are fine\n as an addition — the script must also work without them.)\n- **Cross-platform paths**: always `pathlib.Path`; never string-concatenate\n or hardcode `/` or `\\\\`. Ask or detect the user's OS before giving shell\n commands; give CMD/PowerShell syntax on Windows, POSIX elsewhere —\n don't mix (`export` vs `set`, `venv/bin/activate` vs\n `venv\\Scripts\\activate`).\n- **Encodings**: explicit `encoding=\"utf-8\"` on every text file open —\n Windows still defaults to legacy code pages, and non-ASCII content\n corrupts silently.\n- **Modern Python (3.11+)**: `X | None` unions, `type` aliases, structural\n pattern matching where they clarify; state the minimum version if a\n feature requires it.\n\n## 2. Code quality defaults\n\nApplied to every generated function/module, even when not asked:\n\n```python\ndef compute_share(values: list[float], total: float) -> list[float]:\n \"\"\"Return each value's share of the total.\n\n Args:\n values: Values to compute shares for.\n total: Denominator; must be non-zero.\n\n Returns:\n Shares in the same order as values.\n\n Raises:\n ValueError: If total is zero.\n \"\"\"\n if total == 0:\n raise ValueError(\"total must be non-zero — share is undefined.\")\n return [v / total for v in values]\n```\n\n- Type hints on every signature; `dataclass`/`TypeAlias` for complex types.\n- Google-style docstrings; one-liners suffice for trivial functions.\n- **Never bare `except:`**; catch specific exceptions, handle or re-raise\n with `raise ... from e`. A silent `pass` costs a week of debugging.\n- `logging` over `print` (leveled, formatted), except user-facing CLI\n output.\n- Note algorithmic complexity where it matters (\"this is O(n log n), safe\n at n>10⁶\") — especially around nested loops and pandas `apply`.\n- Magic numbers → named module-level constants.\n\n## 3. Testing and verification\n\n- Offer at least a skeleton pytest for every function carrying real logic:\n\n```python\n# test_compute.py — run: python -m pytest -q\nimport pytest\nfrom compute import compute_share\n\ndef test_basic() -> None:\n assert compute_share([1, 1], 2) == [0.5, 0.5]\n\ndef test_zero_total_raises() -> None:\n with pytest.raises(ValueError):\n compute_share([1.0], 0)\n```\n\n- Numerical code: test edge cases — empty input, NaN, negatives, single\n element.\n- Run generated code yourself when an execution environment exists;\n otherwise mark it explicitly \"not executed\" — no silent assumptions.\n\n## 4. Dependencies and reproducibility\n\n- New project → virtual environment + pinned `requirements.txt`\n (`package==version`); never \"install the latest\".\n- Seed randomness and put the seed in config (details in\n `ml-experiment-standards`).\n- Note environment-difference risks where relevant (BLAS, CUDA, locale).\n\n## 5. Git practices\n\n- Conventional Commits: `feat(scope): ...`, `fix: ...`, `refactor: ...`;\n the body explains *why* — the diff already shows *what*.\n- Commit in meaningful units; warn against 500-line single commits.\n- Default `.gitignore`: `venv/`, `__pycache__/`, `*.pyc`, large data files\n (suggest DVC/LFS), IDE folders.\n\n## 6. Automation / DevOps\n\n- **CI**: minimal GitHub Actions for test + lint (ruff); note OS-runner\n differences if jobs must run on Windows too.\n- **Docker**: start from `python:3.12-slim`, simple single-stage until\n size/caching demands more; note image size and build-cache implications.\n- **Monitoring**: any long-lived service/pipeline ships three signals\n minimum: structured logs, failure alerting, basic metrics (duration,\n volume). ML services add drift checks (see `ml-experiment-standards`).\n- **Scheduled jobs**: match the user's platform — cron on POSIX,\n Task Scheduler (`schtasks`) on Windows.\n\n## 7. Code review mode\n\nReview in this order and report findings by severity: correctness (edge\ncases, silent failures) → security (injection, secrets, path traversal) →\nperformance (N+1, needless copies, O(n²)) → readability. Every finding\nships with the suggested fix as code — never \"this is bad\" and nothing\nelse.\n\n## Execution contract\n\n- **Workflow:** clarify the geospatial code's contract; reproduce the environment; inspect correctness and data invariants; implement the smallest safe change; test; package; document operations and rollback.\n- **Decision rules:** apply this skill to geospatial software and pipeline delivery, not generic non-spatial coding; scale CI, containers, and observability to the actual deployment risk.\n- **Verification protocol:** run focused and regression tests, lint and type checks where configured, exercise CRS/nodata/geometry edge cases, verify clean installation, and review CI artifacts.\n- **Failure modes:** block release for silent data loss, nondeterminism, mutable hidden state, unpinned critical dependencies, secrets, platform assumptions, missing rollback, or unhandled spatial edge cases.\n- **Deliverables:** reviewed code, tests, reproducible environment and lock data, CI configuration, operational notes, risk-ranked findings, observability plan, and rollback instructions.\n- **Source freshness:** consult [the authoritative source registry](references/authoritative-sources.md) before applying packaging, CI, testing, or supply-chain guidance.\n"
}SHA-256: 04e57ff114b5f12c505c2366aa36bbf8500d1f85823926f2b4c57f4aebe09a8b