agentleFS
MicrosoftKnown publishermicrosoft/haste/.github/copilot-instructions.md

haste

Copilot instructions106 starsChanged 7 months agoMITView on GitHub

Always run tests before marking a task as complete. Always run lint before committing changes. All feature work, refactors, and architecture decisions are driven by specs in spec/.

The file

Show its rules and text

We split this copilot-instructions.md into the rules it gives an agent

19 rules. About 0 are common, 9 are distinctive, and 10 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈9

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 10

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  • could be automatic: a setting could enforce it
  1. Distinctive:

    Always run tests before marking a task as complete.

    line 39
  2. Distinctive:

    Always run lint before committing changes.

    line 40
  3. Very specific:

    Follow existing patterns in hastegeo.core.processors for business logic.

    line 47
  4. Very specific:

    Follow existing patterns in hastegeo.core.data_layer for storage backends.

    line 48
  5. Very specific:

    Never hardcode Azure connection strings or keys.

    line 50
  6. Distinctive:

    Write clear, self-documenting code.

    line 59
  7. Distinctive:

    Prefer small, focused functions over long procedural blocks.

    line 60
  8. Distinctive:

    Never commit secrets, credentials, or API keys.

    line 63
  9. Very specific:

    Use conventional commits: feat:, fix:, docs:, chore:, refactor:, test:

    line 79
  10. Distinctive:

    Keep PRs focused — one logical change per PR.

    line 80
  11. Distinctive:

    Write descriptive PR titles and descriptions.

    line 81
  12. Very specific:

    All feature work, refactors, and architecture decisions are driven by specs in spec/.

    line 85
  13. Very specific:

    Before implementing: Check spec/features/ for the relevant spec.

    line 111
  14. Very specific:

    Never start feature work without a spec (at minimum README.md + design.md).

    line 119
  15. Very specific:

    Every feature spec must map user stories to HASTE agents.

    line 160
  16. Very specific:

    user-stories.md: must include an Agent Assignment Map table: story → implementing agent + validating agent.

    line 162
  17. Very specific:

    plan.md: must use agent names (not people/roles) in the Agent column of task tables.

    line 163
  18. Distinctive:

    When multiple approaches exist, present the best option with a one-line justification.

    line 181
  19. Distinctive:

    If unsure about intent, ask a clarifying question rather than guessing.

    line 182

≈ “Common” is an estimate: at least 1 in 5 of the 1,644 Copilot instructions files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
copilot-instructions.md

HASTE — Repository-Wide Copilot Instructions

These instructions are automatically loaded into EVERY Copilot session

(VS Code, Copilot CLI, Cloud Agent, Code Review).

Keep them concise and universally applicable.

Project Overview

  • Name: HASTE (High-speed Assessment and Satellite Tracking for Emergencies)
  • Description: AI-driven framework for rapid disaster assessment using satellite and remote sensing data
  • Primary Languages: Python 3.11 (backend/core), JavaScript/React (UI)
  • Package Managers: pip/conda (Python), npm (UI)
  • Owner: microsoft/haste

Architecture

React UI (Vite + FluentUI + Azure Maps + MSAL)
  └─ Azure Static Web Apps / SWA CLI
       ├─ hastefuncapi (41 HTTP routes, Azure Functions, Python)
       ├─ titilerfuncapi (TiTiler/FastAPI, COG tile serving)
       └─ hastefuncqueues (7 queue triggers, Azure Functions, Python)
            └─ hastegeo core library (hastelib/)
                 ├─ Config · Models · Processors · Data Layers
                 ├─ Runners (Azure Batch GPU) · Utils · Workflows
                 └─ Storage: Blob, Cosmos DB, Data Lake, PostgreSQL

Build & Test

  • Core library build: cd hastelib && hatch build -t wheel
  • Core library tests: cd hastelib && hatch run test:pytest
  • Core library tests (specific file): cd hastelib && hatch run test:pytest tests/path/to/test_file.py -v
  • UI build: cd ui && npm run build
  • UI lint: cd ui && npm run lint
  • API local run: cd api/hastefuncapi && func host start
  • UI local run: cd ui && swa start --app-devserver-url http://localhost:5173 --run 'npm run dev'

Always run tests before marking a task as complete. Always run lint before committing changes.

Coding Standards

Python (backend, core library)

  • Python 3.11+. Use type hints everywhere.
  • Pydantic models for data validation (already used throughout).
  • Follow existing patterns in hastegeo.core.processors for business logic.
  • Follow existing patterns in hastegeo.core.data_layer for storage backends.
  • GDAL/rasterio for geospatial operations — never use raw file I/O for imagery.
  • Never hardcode Azure connection strings or keys. Use Config class from hastegeo.core.config.

JavaScript/React (UI)

  • React functional components with hooks.
  • FluentUI component library — do not introduce alternative UI frameworks.
  • Azure Maps for all geospatial visualization — no Leaflet/Mapbox.
  • MSAL for authentication — do not bypass or mock in production paths.

General

  • Write clear, self-documenting code. Avoid unnecessary comments.
  • Prefer small, focused functions over long procedural blocks.
  • Handle errors explicitly — do not silently swallow exceptions.
  • Validate inputs at system boundaries; trust internal data.
  • Never commit secrets, credentials, or API keys.

Key Domain Concepts

  • Project: A disaster assessment campaign (e.g., "Maui Wildfires 2023")
  • Image Layer: A set of pre/post-event satellite imagery for a project
  • Source Type: Satellite imagery provider (Planet, Vantor, Airbus, etc.)
  • Label Project: Human labeling of damage on imagery tiles
  • Model: ML model trained on labeled data for damage classification
  • Inference: Running a trained model on new imagery
  • Artifact: Model weights, predictions, and outputs
  • COG: Cloud Optimized GeoTIFF — the standard imagery format

Git Conventions

  • Default branch: main
  • Use conventional commits: feat:, fix:, docs:, chore:, refactor:, test:
  • Keep PRs focused — one logical change per PR.
  • Write descriptive PR titles and descriptions.

Specification System

All feature work, refactors, and architecture decisions are driven by specs in spec/.

Structure

spec/
├── architecture/
│   ├── overview.md              # System architecture (canonical reference)
│   └── decisions/               # ADRs: 0001-template.md, 0002-xyz.md
├── features/                    # One subfolder per feature spec
│   └── <feature-name>/
│       ├── README.md            # Overview, status, components affected
│       ├── plan.md              # Execution plan, phases, milestones
│       ├── impact-analysis.md   # Risk, dependencies, blast radius
│       ├── user-stories.md      # User stories & acceptance criteria
│       ├── design.md            # Technical design & API contracts
│       ├── data-model.md        # Cosmos DB / Blob / Data Lake schema changes
│       ├── test-plan.md         # Test strategy & coverage matrix
│       └── rollout.md           # Rollout strategy, flags, rollback
└── _templates/                  # Copy templates when starting new work
    ├── feature/                 # Full feature spec template
    └── modification/            # Lighter template for refactors/migrations

Spec Workflow

  1. Before implementing: Check spec/features/ for the relevant spec. Read the design.md and user-stories.md first.
  2. During implementation: Validate work against the spec's acceptance criteria. Update plan.md status as tasks complete.
  3. Architecture decisions: Record in spec/architecture/decisions/ using the ADR template.
  4. New features: Copy spec/_templates/feature/ to spec/features/<name>/ and fill in docs before coding.
  5. Status lifecycle: draft → in-review → approved → in-progress → implemented → released

Rules

  • Never start feature work without a spec (at minimum README.md + design.md).
  • Architecture changes require an ADR in spec/architecture/decisions/.
  • Specs are the source of truth — if code diverges from spec, update the spec or fix the code.
  • Cross-reference related specs using relative paths.

Agent Architecture

HASTE uses specialized agents with clear boundaries. Skills are preferred over agents where possible.

Core Agents

AgentScopeTouches Code?
backend-devPython backend, API, processors, data layers, runnersYes
gisSatellite imagery, GDAL/rasterio, provider adapters, damage assessmentYes
uiReact/FluentUI/Azure Maps/MSAL, frontend onlyYes
securityDependabot alerts, CVE analysis, dependency audits. Never auto-merges.No (reports only)

Validation Agents

AgentValidatesMethod
backend-validationBackend code against specs, conventions, testsRuns hatch run test:pytest, reads code
ui-validationFrontend changes against expected behaviorRuns Playwright tests
security-validationSecurity Agent findings (packages real, CVEs accurate)Web research, cross-reference

Support Agent

AgentPurpose
orchestratorRecords what agents did, when, why. Run logs, summaries. Does not own execution.

Agent ↔ Spec Integration

  • Agents read specs before implementing — check spec/features/ for relevant design docs.
  • Validation agents compare implementations against spec acceptance criteria.
  • The orchestrator tracks spec status and updates plan.md after agent work.
  • Architecture changes trigger an ADR in spec/architecture/decisions/.

Agent ↔ Story Mapping (Required)

Every feature spec must map user stories to HASTE agents. This is enforced in the templates:

  • user-stories.md must include an Agent Assignment Map table: story → implementing agent + validating agent.
  • plan.md must use agent names (not people/roles) in the Agent column of task tables.
  • Assignment rules:
    • hastelib/, api/, docker/, .github/workflows/ → backend-dev implements, backend-validation validates.
    • Satellite imagery, GDAL, provider adapters → gis implements or co-implements.
    • ui/ → ui implements, ui-validation validates.
    • New dependencies → security audits, security-validation confirms.
    • orchestrator tracks all work — does not need per-story assignment.

Guardrails

  • No auto-merge of security fixes — humans remain in the approval loop.
  • No monolithic agents — use specialized agents and skills.
  • Skills preferred over agents where possible.
  • Agents must never claim tests ran without observable evidence.

Communication

  • Be concise. Explain tradeoffs briefly, then provide the recommended choice.
  • When multiple approaches exist, present the best option with a one-line justification.
  • If unsure about intent, ask a clarifying question rather than guessing.

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.