Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .agents/skills
1 change: 1 addition & 0 deletions .claude/skills
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,13 @@ docs/_build/*
coverage.xml
htmlcov/*

# IDEs and editors
.idea/
.vscode/
scripts/download/data/*
.zed/
# ZED spellchecker
codebook.toml

*.egg-info

# Version
Expand Down
42 changes: 42 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# AGENTS.md

Guide for LLM coding agents working with the snowexsql repository.

## When using the package

DO NOT explore the codebase at first.
Use the preferred pattern from the [README.md](README.md).
Only use reverse engineering based on the code as a last resort.

## When writing new code

### Core Technologies

Do not add new dependencies without approval from the team.
Prefer existing core technologies used in this project:

- **SQLAlchemy** + **GeoAlchemy2** - ORM with PostGIS spatial query support
- **PostgreSQL/PostGIS** - Database with spatial extensions. Hosted on Amazon.
- **AWS Lambda** - Serverless public access point. Documented in the [deployment](deployment/README.md) folder.

### API - Design

The central logic for API lives in [api.py](snowexsql/api.py)
All measurement types must inherit from `BaseDataset`.

### Database Schema

Further explained in classes under [snowexsql/tables](snowexsql/tables)

## Testing

Need to pass with every code change.
Command:

```
pytest tests/
```

# Skills
Project specific skills are defined in [skills](skills/)

1 change: 1 addition & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@AGENTS.md
30 changes: 30 additions & 0 deletions skills/db-query/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
name: db-query
description: Guide to answering SnowEx database query questions
whenToUse: When the user asks how to query, access, or filter data from the SnowEx database
---

# SnowEx Query Skill

## No setup required

Use the preferred Lambda client. It works with zero configuration. No env vars, credentials, or AWS account.
Do not tell users to set `SNOWEX_LAMBDA_URL` or any other variable.

## Filtering

Check `ALLOWED_QRY_KWARGS` of the `BaseDataset` class in `snowexsql/api.py` to get supported filtering criteria.
Use `all_*` properties of query classes to inspect possible values to filter on.
Allowed filter kwargs, available campaigns/sites/types change over time.

## Query result

All returned timestamps are in UTC.
All returned coordinates are in WGS84 (EPSG:4326) lat/lon.

### Limits

The Lambda client returns a maximum of 1000 records per query.
Advise users to use filters to narrow results rather than paginating.
Use a count query to check how many records match a filter before running a full query and
advise the user to narrow the filter if the count is too high.