agentleFS
MicrosoftKnown publishermicrosoft/haste/.github/skills/deterministic-scripts/SKILL.md

deterministic-scripts

Skill110 starsChanged 3 months agoMITView on GitHub

Deterministic script execution skill for HASTE. Execute scripts instead of free-form LLM behavior for consistent, repeatable operations. Use when: 'run preprocessing', 'convert format', 'parse metadata', 'generate tiles', 'build wheel', 'deploy functions'. Prevents hallucinated scripts.

  • Installs packages

The file

Files
SKILL.md

Deterministic Script Execution

Overview

HASTE has established scripts and commands for common operations. Agents must use these exact commands instead of generating free-form alternatives. This prevents hallucinated scripts, ensures consistency, and makes operations repeatable.

Key Concepts

Why Deterministic Scripts Matter

  • LLMs can "helpfully" generate plausible-looking but incorrect commands
  • HASTE has specific build tooling (hatch, conda) that must be used correctly
  • Azure Functions deployment has specific prerequisites and ordering
  • Geospatial processing requires exact GDAL/rasterio invocations

Patterns & Techniques

Build & Package Operations

OperationExact CommandNotes
Build core wheelcd hastelib && hatch build -t wheelAuto-increments version, copies to func apps
Run Python testscd hastelib && hatch run test:pytestUses conda env with GDAL
Build UIcd ui && npm run buildProduction build via Vite
Lint UIcd ui && npm run lintESLint with React rules
Install UI depscd ui && npm installUses package-lock.json
Create conda envconda env create -f env.ymlFull env with GDAL and dependencies
Update conda envconda env update -f env.ymlPreserves existing packages
Install hastelib editablepip install -e hastelib/For local development hot-reload

Local Development

OperationExact CommandNotes
Start API locallycd api/hastefuncapi && func host startRequires .venv or conda env
Start UI locallycd ui && swa start --app-devserver-url http://localhost:5173 --run 'npm run dev'SWA CLI with Vite dev server
Start Azuriteazurite --silent --location ./data --debug ./data/debug.logLocal Azure Storage emulator
Start Docker stackdocker-compose -f docker/docker-compose.yml upFull local stack

Deployment

OperationExact CommandNotes
Deploy Azure Functionfunc azure functionapp publish <NAME> --subscription <SUB> --tenant <TENANT>After hatch build
Deploy SWAcd ui && swa deploy --app-location ./dist --app-name <NAME>After npm run build
Build Docker images./build_and_push_images.shBuilds training + imagery prep images

Imagery Processing

OperationApproachNotes
COG generationUse rasterio with COG driver profileNever use raw GDAL CLI unless wrapping in Python
Tile generationThrough ImageryPreProcessorNot manual gdal2tiles
Reprojectionrasterio.warp.reproject()Always specify src_crs and dst_crs
Format conversionThrough provider-specific adapterNot generic gdal_translate

Decision Framework

SituationDo ThisNOT This
Need to run testshatch run test:pytestpytest (wrong env)
Need to build wheelhatch build -t wheelpython setup.py bdist_wheel
Need to start APIfunc host startpython function_app.py
Need Azure storage locallyazuriteCustom mock storage
Need to process imageryUse ImageryPreProcessorWrite new GDAL script
Need to deployfunc azure functionapp publishManual zip deployment

Common Pitfalls

  • Inventing new build commands — Use the established commands above
  • Running pytest directly — Use hatch run test:pytest to get the correct conda env
  • Starting the UI with npm start — HASTE uses swa start with Vite dev server
  • Using python setup.py — HASTE uses hatch/hatchling, not setuptools
  • Generating GDAL scripts from scratch — Use existing processor methods

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.