Skip to content

Commit 8a56217

Browse files
committed
Update Agent instructions
1 parent 33d252d commit 8a56217

14 files changed

Lines changed: 122 additions & 92 deletions

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
exclude: "/migrations/|Makefile*"
1+
exclude: "^docs/agents/instructions/|/migrations/|Makefile*"
22
default_stages: [ pre-commit ]
33

44
repos:

docs/agents/agent_instructions.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -39,20 +39,20 @@ Your mission is twofold:
3939
To assist with specific domains, specialized instruction files are available in `docs/agents/instructions`.
4040
**Mandate:** You MUST read and apply the relevant project-specific context file when working within these domains. These files outline architectural constraints, preferred tools, and forbidden patterns for this specific repository.
4141

42-
| Domain | Project-Specific Context File |
43-
| :---------------------- | :------------------------------------------------ |
44-
| **Orchestrator** | `docs/agents/instructions/orchestrator.md` |
45-
| **Planning** | `docs/agents/instructions/formal_planning.md` |
46-
| **Plan to tasks** | `docs/agents/instructions/plan_to_tasks.md` |
47-
| **ML / Geospatial** | `docs/agents/instructions/ml.md` |
48-
| **Python / QA** | `docs/agents/instructions/python.md` |
49-
| **System Design** | `docs/agents/instructions/systemdesign.md` |
50-
| **Infrastructure** | `docs/agents/instructions/infrastructure.md` |
51-
| **Root Cause Analysis** | `docs/agents/instructions/root_cause_analysis.md` |
52-
| **Analytics** | `docs/agents/instructions/analytics.md` |
53-
| **Security** | `docs/agents/instructions/security.md` |
54-
| **Spec-Driven Dev** | `docs/agents/instructions/specdrivendev.md` |
55-
| **Knowledge Base** | `docs/agents/instructions/KNOWLEDGE.md` |
42+
| Domain | Project-Specific Context File |
43+
| :---------------------- | :----------------------------------------------------------------------------------------- |
44+
| **Orchestrator** | [**docs/agents/instructions/orchestrator.md**](instructions/orchestrator.md) |
45+
| **Planning** | [**docs/agents/instructions/formal_planning.md**](instructions/formal_planning.md) |
46+
| **Plan to tasks** | [**docs/agents/instructions/plan_to_tasks.md**](instructions/plan_to_tasks.md) |
47+
| **ML / Geospatial** | [**docs/agents/instructions/ml.md**](instructions/ml.md) |
48+
| **Python / QA** | [**docs/agents/instructions/python.md**](instructions/python.md) |
49+
| **System Design** | [**docs/agents/instructions/systemdesign.md**](instructions/systemdesign.md) |
50+
| **Infrastructure** | [**docs/agents/instructions/infrastructure.md**](instructions/infrastructure.md) |
51+
| **Root Cause Analysis** | [**docs/agents/instructions/root_cause_analysis.md**](instructions/root_cause_analysis.md) |
52+
| **Analytics** | [**docs/agents/instructions/analytics.md**](instructions/analytics.md) |
53+
| **Security** | [**docs/agents/instructions/security.md**](instructions/security.md) |
54+
| **Spec-Driven Dev** | [**docs/agents/instructions/specdrivendev.md**](instructions/specdrivendev.md) |
55+
| **Knowledge Base** | [**docs/agents/instructions/KNOWLEDGE.md**](instructions/KNOWLEDGE.md) |
5656

5757
## 4. Agent Behaviors, Memory & Tactics
5858

docs/agents/instructions/KNOWLEDGE.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
---
2+
name: KNOWLEDGE
3+
description: Project Knowledge Base
4+
---
15
# Project Knowledge Base
26

37
## STAC Catalogs

docs/agents/instructions/analytics.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
1+
---
2+
name: analytics
3+
description: Analytics Skill Instructions
4+
---
15
# Analytics Skill Instructions
26

3-
\<primary_directive>
7+
## Primary Directive
48
Your primary objective is to extract truth from experimental data without fooling yourself or others.
59
**MANDATE:** Apply the project-specific rules outlined below for all analytics and EDA tasks.
6-
\</primary_directive>
710

8-
<context>
11+
## Context
912
In a geospatial research setting, data analysis must account for spatial dimensions, non-standard projections, and highly skewed physical measurements (e.g., radar reflectivity, atmospheric depth).
10-
</context>
1113

12-
<standards>
14+
## Standards
1315
You MUST adhere to the following project-specific standards when performing or reviewing data analysis:
1416

1517
### 1. Geospatial Exploratory Data Analysis (EDA)
@@ -33,11 +35,11 @@ You MUST adhere to the following project-specific standards when performing or r
3335

3436
- **Assumptions:** ALWAYS verify statistical assumptions (e.g., Normality) before applying tests (e.g., T-Test).
3537
- **Reporting:** Report effect sizes (e.g., Cohen's d) alongside p-values. Statistical significance != Practical significance.
36-
</standards>
38+
3739

38-
\<forbidden_patterns>
40+
## Forbidden Patterns
3941

4042
-**Ignoring Nodata:** You MUST NOT silently calculate statistics over arrays containing raw nodata values (e.g., averaging `-9999` with valid data). Use `xarray.where()` or masked arrays.
4143
-**"Magic" Outlier Removal:** You MUST NOT remove spatial data points just because they "look wrong" without explicit domain-specific justification.
4244
-**Pie Charts & Dual Y-Axes:** Avoid these misleading visualization formats entirely.
43-
\</forbidden_patterns>
45+

docs/agents/instructions/formal_planning.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
1+
---
2+
name: formal_planning
3+
description: Formal Planning Protocol
4+
---
15
# Formal Planning Protocol
26

3-
\<primary_directive>
7+
## Primary Directive
48
**MANDATE:** Ensure any generated plan adheres to the structure below.
5-
\</primary_directive>
69

710
When the user explicitly asks for a "plan," "architecture," "design," or "proposal"—or when embarking on a multi-step/multi-domain implementation—you must use the **Formal Design Document** structure below, saving it to `docs/agents/planning/<TASK_DESCRIPTION>_PLAN.md`.
811

docs/agents/instructions/infrastructure.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
1+
---
2+
name: infrastructure
3+
description: Infrastructure Skill Instructions
4+
---
15
# Infrastructure Skill Instructions
26

3-
\<primary_directive>
7+
## Primary Directive
48
Your objective is to ensure that all research environments, compute jobs, and pipelines are reproducible, resilient, and explicitly defined as code.
59
**MANDATE:** Apply the project-specific rules outlined below for all infrastructure and environment tasks.
6-
\</primary_directive>
710

8-
<context>
11+
## Context
912
This project uses modern Python packaging and infrastructure-as-code principles.
10-
</context>
1113

12-
<standards>
14+
## Standards
1315
You MUST enforce the following project-specific infrastructure standards:
1416

1517
### 1. Environment Management
@@ -30,11 +32,11 @@ You MUST enforce the following project-specific infrastructure standards:
3032
### 4. HPC & Automation
3133

3234
- **Explicit Resources:** If interacting with SLURM or cluster job scripts, ALWAYS request specific resources (`cpus-per-task`, memory, etc.).
33-
</standards>
35+
3436

35-
\<forbidden_patterns>
37+
## Forbidden Patterns
3638

3739
-**"ClickOps":** You MUST NOT recommend setting up environments or servers manually via a GUI.
3840
-**Untracked Environments:** Do not add dependencies without ensuring they are reflected in `pyproject.toml` and `uv.lock`.
3941
-**Hardcoded Secrets:** You MUST NEVER include API keys or tokens in scripts, Makefiles, or Dockerfiles.
40-
\</forbidden_patterns>
42+

docs/agents/instructions/ml.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
1+
---
2+
name: ml
3+
description: Machine Learning & Geospatial Processing Instructions
4+
---
15
# Machine Learning & Geospatial Processing Instructions
26

3-
\<primary_directive>
7+
## Primary Directive
48
Your goal is to help build state-of-the-art models and data pipelines that are reproducible, reliable, and well-documented.
59
**MANDATE:** Apply the project-specific rules outlined below for all ML and geospatial processing tasks.
6-
\</primary_directive>
710

8-
<context>
11+
## Context
912
This project deals heavily with geospatial datasets (Sentinel-2, Radar, etc.) which introduce unique memory and projection challenges compared to standard ML pipelines.
10-
</context>
1113

12-
<standards>
14+
## Standards
1315
You MUST enforce the following project-specific standards:
1416

1517
### 1. Geospatial Data Handling
@@ -27,11 +29,11 @@ You MUST enforce the following project-specific standards:
2729

2830
- **Config-Driven:** Hyperparameters and dataset paths MUST be externalized to configuration files and loaded via Pydantic models.
2931

30-
</standards>
32+
3133

32-
\<forbidden_patterns>
34+
## Forbidden Patterns
3335

3436
-**Silent OOMs:** You MUST NOT write data loaders that attempt to load massive raster datasets entirely into RAM.
3537
-**Ignoring CRS:** You MUST NEVER perform spatial joins or distance calculations without first asserting both datasets share the exact same CRS.
3638
-**Fitting on Test Data:** You MUST NEVER allow data transformations to be fitted on the validation or test sets.
37-
\</forbidden_patterns>
39+
Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
1+
---
2+
name: orchestrator
3+
description: Orchestrator Skill Instructions
4+
---
15
# Orchestrator Skill Instructions
26

3-
\<primary_directive>
7+
## Primary Directive
48
Your primary responsibility is the horizontal integration of all research components.
59
**MANDATE:** Apply the project-specific rules outlined below for all orchestration and integration tasks.
6-
\</primary_directive>
710

8-
<context>
11+
## Context
912
In this repository, successful orchestration means tying together raw geospatial data fetching (STAC/Copernicus), pre-processing (Rasterio/Xarray), and output generation (COGs/Zarr).
10-
</context>
1113

12-
<workflow>
14+
## Workflow
1315
For any task requiring more than a minor fix, you MUST enforce the following framework:
1416

1517
### 1. The Written Plan (Mandatory)
@@ -25,11 +27,11 @@ Before writing implementation code, you MUST create or update a `<TASK_DESCRIPTI
2527

2628
- Implement exactly ONE step from the plan at a time.
2729
- After completing a step, you MUST STOP and ask the user to validate the output before moving to the next step.
28-
</workflow>
30+
2931

30-
\<forbidden_patterns>
32+
## Forbidden Patterns
3133

3234
-**Vertical Myopia:** You MUST NOT focus entirely on optimizing one specific file while ignoring how it breaks integration with the rest of the project (e.g., changing a config structure without updating `geospatial_tools_ini.yaml.example`).
3335
-**Implied Contracts:** You MUST NOT build components that pass raw, untyped dictionaries to each other. Always enforce explicit data contracts (e.g., Pydantic Models, Dataclasses).
3436
-**Skipping E2E Testing:** You MUST NOT declare a complex integration "complete" without verifying that the data flows from start to finish via `nox` testing sessions or test notebooks.
35-
\</forbidden_patterns>
37+

docs/agents/instructions/plan_to_tasks.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
1+
---
2+
name: plan_to_tasks
3+
description: Plan To Tasks
4+
---
15
# Plan To Tasks
26

3-
\<primary_directive>
7+
## Primary Directive
48
**MANDATE:** Decompose a plan into modular, atomic tasks, each documented in its own file (or a structured document) with all the context needed for implementation and verification.
5-
\</primary_directive>
69

710
## Core Workflow
811

docs/agents/instructions/python.md

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,21 @@
1+
---
2+
name: python
3+
description: Python & QA Skill Instructions
4+
---
15
# Python & QA Skill Instructions
26

3-
\<primary_directive>
7+
## Primary Directive
48
Your objective is to elevate research scripts into robust, maintainable, and type-safe software.
59
**MANDATE:** Apply the project-specific rules outlined below for all Python development and QA tasks.
6-
\</primary_directive>
710

8-
<context>
11+
## Context
912
This project relies heavily on modern Python tooling and strictly enforced quality assurance.
1013
- **Pre-commit is Central:** All QA tasks (linting, formatting, type checking) are orchestrated via `pre-commit`.
1114
- **Environment & Build:** We use `uv` for package management and `hatchling` as the build backend (defined in `pyproject.toml`).
1215
- **Task Automation:** We use `nox` for isolated test environments and task execution.
1316
- **Makefile:** We use a makefile to automate and orchestrate most things in this project. Use `make targets` to discover the available targets.
14-
</context>
1517

16-
<standards>
18+
## Standards
1719
You MUST strictly adhere to the following project-specific Python standards:
1820

1921
### 1. QA & Tooling
@@ -27,19 +29,20 @@ You MUST strictly adhere to the following project-specific Python standards:
2729
- **Strict Typing:** You MUST use type hints for ALL function arguments and return values (e.g., `def process(data: str | Any) -> pd.DataFrame`).
2830
- **Filesystem Paths:** You MUST NEVER use `os.path`. ALWAYS use `pathlib.Path` for all file and directory manipulations.
2931
- **Logging:** Use `structlog` for application flow. NEVER use `print()` for production code.
32+
- **Function Calls:** Prefer keyword arguments for complex function calls to enhance readability and maintainability.
3033
- **Data Structures:** ALWAYS use `@dataclass` or `pydantic` models for complex structures instead of untyped dictionaries.
3134
- **Type Hints Format:** Always prefer X | Y format over Union[X, Y].
32-
- **Docstrings:** Always add docstrings to your functions and classes. Use the Google standard for docstrings. Don't show types in docstrings.
35+
- **Docstrings:** Always add docstrings to your functions and classes. Use the Google standard for docstrings and follow the Diátaxis framework for documentation structure. Don't show types in docstrings.
3336

3437
### 3. Testing & Performance
3538

3639
- **Vectorization:** ALWAYS prefer vectorized operations (NumPy, Pandas, Polars, Xarray) over native Python `for` loops when processing geospatial data.
37-
</standards>
40+
3841

39-
\<forbidden_patterns>
42+
## Forbidden Patterns
4043

4144
-**Bypassing Pre-commit:** Do not commit code that fails `pre-commit` checks. Fix the underlying linting or typing issue.
4245
-**Global Mutable State:** You MUST NEVER define or mutate global variables to pass state between functions.
4346
-**Magic Numbers/Strings:** You MUST NOT hardcode numeric constants. Extract them to Pydantic settings or config classes.
4447
-**Bare Except Blocks:** You MUST NEVER use `except: pass` or `except Exception: pass`.
45-
\</forbidden_patterns>
48+

0 commit comments

Comments
 (0)