diff --git a/.agents/skills b/.agents/skills new file mode 120000 index 0000000..42c5394 --- /dev/null +++ b/.agents/skills @@ -0,0 +1 @@ +../skills \ No newline at end of file diff --git a/.claude/skills b/.claude/skills new file mode 120000 index 0000000..42c5394 --- /dev/null +++ b/.claude/skills @@ -0,0 +1 @@ +../skills \ No newline at end of file diff --git a/.gitignore b/.gitignore index df92e95..54d6f64 100644 --- a/.gitignore +++ b/.gitignore @@ -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 diff --git a/AGENTS.md b/AGENTS.md new file mode 100644 index 0000000..03c2a94 --- /dev/null +++ b/AGENTS.md @@ -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/) + diff --git a/CLAUDE.md b/CLAUDE.md new file mode 100644 index 0000000..43c994c --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1 @@ +@AGENTS.md diff --git a/skills/db-query/SKILL.md b/skills/db-query/SKILL.md new file mode 100644 index 0000000..e4aa157 --- /dev/null +++ b/skills/db-query/SKILL.md @@ -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.