# Red Tide Algal Bloom Monitoring

> Red Tide (Harmful Algal Bloom) Monitoring & Early Warning - HAB Monitoring & Aquaculture Safety analysis & decision-support harness. Use this skill whenever the user asks about red tide, harmful algal blooms, HAB monitoring, aquaculture safety, marine water quality, algal toxin detection, shellfish safety, marine biological monitoring, satellite chlorophyll analysis, coastal water management, or…

- **Type:** Skill
- **Install:** `agentstack add skill-dungnotnull-red-tide-algal-bloom-monitoring-agent-skill-red-tide-algal-bloom-monitoring-agent-skill`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [dungnotnull](https://agentstack.voostack.com/s/dungnotnull)
- **Installs:** 0
- **Category:** [Agent Skills](https://agentstack.voostack.com/c/agent-skills)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [dungnotnull](https://github.com/dungnotnull)
- **Source:** https://github.com/dungnotnull/red-tide-algal-bloom-monitoring-agent-skill

## Install

```sh
agentstack add skill-dungnotnull-red-tide-algal-bloom-monitoring-agent-skill-red-tide-algal-bloom-monitoring-agent-skill
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# Red Tide Algal Bloom Monitoring & Early Warning Skill

## Skill Overview

This skill transforms Claude into a domain-expert for **Harmful Algal Bloom (HAB) Monitoring & Aquaculture Safety**. It delivers structured, evidence-backed outputs by combining real-time data aggregation, recognized domain methods, and academic research into a single orchestrated workflow with explicit risk disclosure.

### Core Capabilities

- **Bloom Detection**: Satellite (Sentinel-3 OLCI, MODIS) + in-situ sensor analysis
- **Species Identification**: Karenia, Alexandrium, Dinophysis, Pseudo-nitzschia, cyanobacteria
- **Toxin Risk Assessment**: Paralytic, diarrhetic, amnesic, neurotoxic shellfish poisoning
- **Aquaculture Impact**: Shellfish vulnerability, harvest closure timing, economic risk
- **Environmental Triggers**: Temperature, nutrients (N/P/Si), stratification, upwelling
- **Early Warning**: Alert levels, response protocols, mitigation strategies

### Evidence-Based Framework

All outputs cite ≥3 sources with ≥1 academic/authoritative reference, explicit evidence hierarchy (Tier 1-4), and mandatory risk/limitation disclosure. The skill continuously improves through automated knowledge crawling from academic databases and domain authorities.

---

## Harness Architecture

### Skill Registry Pattern

The skill implements a **flexible agent & skill architecture** using a modular pattern:

```
/skill activation
│
├─ Language Detection (pre-flight)
│   ├─ Vietnamese → translation + bilingual output
│   ├─ English → direct processing
│   └─ Other → English processing + translation offer
│
├─ Step 1: sub-gather-requirements
│   └─ Input: User query
│   └─ Output: Structured requirements (object, scope, timeframe, inputs, audience, language)
│
├─ Step 2: sub-evidence-collector
│   ├─ Fetch: Current satellite data (Copernicus, NOAA)
│   ├─ Fetch: In-situ sensor data (fluorometer, CTD)
│   ├─ Fetch: Authoritative documents (IOC-UNESCO, WOAH)
│   └─ Output: Evidence bundle with sources + dates
│
├─ Step 3: sub-core-analysis
│   ├─ Detect: Satellite chl-a + SST analysis
│   ├─ Detect: In-situ cell counts + species ID
│   ├─ Analyze: Environmental triggers (T, nutrients, stratification)
│   ├─ Assess: Toxin risk (type, concentration, regulatory limits)
│   └─ Alert: Aquaculture impact + response levels
│
├─ Step 4: sub-knowledge-updater
│   ├─ Query: SECOND-KNOWLEDGE-BRAIN.md
│   ├─ Surface: Academic citations (with Tier labels)
│   └─ Flag: Knowledge gaps for crawl pipeline
│
├─ Step 5: sub-advisor
│   ├─ Synthesize: All prior analysis
│   ├─ Conclude: Risk category (Low/Monitor/Critical)
│   ├─ Recommend: Specific actions with evidence chain
│   └─ Disclose: Limitations + uncertainty
│
└─ Step 6: main quality gate
    ├─ Verify: Evidence hierarchy compliance
    ├─ Verify: Source citations (≥3 sources, ≥1 authoritative)
    ├─ Verify: Risk disclosure present
    ├─ Verify: Output template completeness
    └─ Auto-fix: Up to 2 retries for missing elements
```

### Agent Registration & Resolution

#### Skill Registration

Skills are registered in `/skills/*.md` with mandatory frontmatter:

```yaml
---
name: sub-gather-requirements
description: Clarify the object of analysis, constraints, timeframe, available inputs, target audience, and language before any data fetching.
---
```

**Registration Requirements:**
- `name`: Unique identifier (kebab-case)
- `description`: One-line summary (mandatory, used for routing)
- Sections: Role & Persona, Workflow, Tools, Output Format, Quality Gates

#### Skill Resolution

The harness uses **semantic routing** to resolve the appropriate sub-skill:

1. **Input Analysis**: Extract task type from user query
2. **Skill Matching**: Compare against skill descriptions
3. **Execution Order**: Follow sequential harness flow
4. **Fallback Chain**: On failure → knowledge base → simplified analysis → explicit limitation flag

#### Skill Execution Model

Each sub-skill follows the **execution lifecycle**:

```python
class SubSkillExecution:
    def execute(self, context: ExecutionContext) -> SkillResult:
        # 1. Input validation
        self._validate_inputs(context)
        
        # 2. Tool execution (with retries)
        result = self._execute_tools(context)
        
        # 3. Quality gate validation
        self._validate_quality_gates(result)
        
        # 4. Error handling (graceful degradation)
        if result.failed:
            return self._handle_degradation(context)
        
        # 5. Output formatting
        return self._format_output(result)
```

---

## Input/Output JSON Schemas

### Input Schema (User Query)

```json
{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "title": "RedTideSkillInput",
  "type": "object",
  "required": ["query"],
  "properties": {
    "query": {
      "type": "string",
      "description": "User's natural language query about HAB monitoring or aquaculture safety",
      "minLength": 1,
      "examples": [
        "Analyze red tide risk for oyster farms in Apalachicola Bay",
        "What's the current bloom status off the coast of Maine?",
        "Assess toxin risk for shellfish harvest in Puget Sound"
      ]
    },
    "context": {
      "type": "object",
      "properties": {
        "region": {"type": "string", "description": "Geographic region of interest"},
        "timeframe": {"type": "string", "description": "Analysis timeframe (e.g., 'current', 'next 7 days')"},
        "target_audience": {"type": "string", "enum": ["aquaculture", "public_health", "researcher", "general"]},
        "language": {"type": "string", "enum": ["en", "vi", "es", "fr", "ja", "zh"], "default": "en"}
      }
    },
    "options": {
      "type": "object",
      "properties": {
        "include_recommendations": {"type": "boolean", "default": true},
        "include_scenarios": {"type": "boolean", "default": true},
        "detail_level": {"type": "string", "enum": ["brief", "standard", "comprehensive"], "default": "standard"}
      }
    }
  }
}
```

### Output Schema (Skill Result)

```json
{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "title": "RedTideSkillOutput",
  "type": "object",
  "required": ["metadata", "analysis", "evidence_chain", "conclusion", "disclosure"],
  "properties": {
    "metadata": {
      "type": "object",
      "required": ["skill_version", "timestamp", "language", "processing_time_ms"],
      "properties": {
        "skill_version": {"type": "string", "pattern": "^\\d+\\.\\d+\\.\\d+$"},
        "timestamp": {"type": "string", "format": "date-time"},
        "language": {"type": "string"},
        "processing_time_ms": {"type": "number"},
        "degradation_level": {"type": "integer", "minimum": 0, "maximum": 4}
      }
    },
    "requirements": {
      "type": "object",
      "properties": {
        "object_of_analysis": {"type": "string"},
        "scope": {"type": "string"},
        "timeframe": {"type": "string"},
        "available_inputs": {"type": "array", "items": {"type": "string"}},
        "target_audience": {"type": "string"},
        "language": {"type": "string"},
        "analysis_type": {"type": "string"}
      }
    },
    "evidence_bundle": {
      "type": "object",
      "properties": {
        "current_data": {
          "type": "object",
          "properties": {
            "satellite_chl_a": {"type": "object"},
            "sst": {"type": "object"},
            "in_situ_counts": {"type": "object"},
            "toxin_levels": {"type": "object"}
          }
        },
        "authoritative_docs": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "source": {"type": "string"},
              "url": {"type": "string"},
              "date": {"type": "string"},
              "tier": {"type": "integer", "minimum": 1, "maximum": 4}
            }
          }
        },
        "recent_news": {"type": "array", "items": {"type": "object"}},
        "reference_benchmarks": {"type": "object"}
      }
    },
    "analysis": {
      "type": "object",
      "properties": {
        "detection": {
          "type": "object",
          "properties": {
            "bloom_status": {"type": "string"},
            "cell_concentration": {"type": "string"},
            "species_identified": {"type": "array", "items": {"type": "string"}},
            "confidence": {"type": "string"}
          }
        },
        "triggers": {
          "type": "object",
          "properties": {
            "temperature": {"type": "object"},
            "nutrients": {"type": "object"},
            "stratification": {"type": "string"},
            "upwelling": {"type": "string"}
          }
        },
        "toxin_risk": {
          "type": "object",
          "properties": {
            "toxin_type": {"type": "array", "items": {"type": "string"}},
            "risk_level": {"type": "string"},
            "regulatory_limit_exceeded": {"type": "boolean"}
          }
        },
        "aquaculture_impact": {
          "type": "object",
          "properties": {
            "species_affected": {"type": "array", "items": {"type": "string"}},
            "vulnerability_level": {"type": "string"},
            "economic_risk": {"type": "string"}
          }
        }
      }
    },
    "knowledge_base": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "citation": {"type": "string"},
          "tier": {"type": "integer", "minimum": 1, "maximum": 4},
          "relevance": {"type": "string"}
        }
      }
    },
    "evidence_chain": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "claim": {"type": "string"},
          "evidence": {"type": "array", "items": {"type": "string"}},
          "confidence": {"type": "string"}
        }
      }
    },
    "conclusion": {
      "type": "object",
      "required": ["category"],
      "properties": {
        "category": {
          "type": "string",
          "enum": [
            "Low Risk",
            "Normal",
            "Monitor (elevated)",
            "Critical Bloom Alert",
            "Inconclusive"
          ]
        },
        "summary": {"type": "string"},
        "confidence": {"type": "string"},
        "key_factors": {"type": "array", "items": {"type": "string"}}
      }
    },
    "recommendations": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "action": {"type": "string"},
          "priority": {"type": "string"},
          "evidence": {"type": "array", "items": {"type": "string"}}
        }
      }
    },
    "scenarios": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {"type": "string"},
          "probability": {"type": "string"},
          "impact": {"type": "string"},
          "mitigation": {"type": "array", "items": {"type": "string"}}
        }
      }
    },
    "disclosure": {
      "type": "object",
      "required": ["limitations", "uncertainties", "data_quality"],
      "properties": {
        "limitations": {"type": "array", "items": {"type": "string"}},
        "uncertainties": {"type": "array", "items": {"type": "string"}},
        "data_quality": {"type": "string"},
        "assumptions": {"type": "array", "items": {"type": "string"}}
      }
    }
  }
}
```

---

## Tool Definitions & Schemas

### Tool Registry

The skill defines **rich tool definitions** with schemas and execution handlers:

#### Satellite Data Fetch Tool

```python
{
  "tool_name": "fetch_satellite_data",
  "description": "Fetch current satellite chlorophyll-a and sea surface temperature data for specified region",
  "parameters": {
    "region": {
      "type": "string",
      "description": "Geographic region (bounding box or named region)",
      "required": true
    },
    "date_range": {
      "type": "string",
      "description": "Date range for data retrieval (ISO 8601 format)",
      "required": false,
      "default": "last_7_days"
    },
    "resolution": {
      "type": "string",
      "enum": ["1km", "4km", "9km"],
      "default": "4km"
    }
  },
  "response_schema": {
    "chl_a": {
      "mean": "float",
      "max": "float",
      "anomaly": "float",
      "data_url": "string"
    },
    "sst": {
      "mean": "float",
      "min": "float",
      "max": "float",
      "anomaly": "float",
      "data_url": "string"
    },
    "metadata": {
      "satellite": "string",
      "processing_date": "string",
      "coverage": "float"
    }
  },
  "execution_handler": "sub-evidence-collector",
  "timeout": 30,
  "retry": 3
}
```

#### In-Situ Sensor Query Tool

```python
{
  "tool_name": "query_in_situ_sensors",
  "description": "Query in-situ monitoring stations for cell counts and environmental parameters",
  "parameters": {
    "region": {"type": "string", "required": true},
    "sensor_types": {
      "type": "array",
      "items": {"enum": ["fluorometer", "ctd", "spectrometer"]},
      "default": ["fluorometer"]
    },
    "timeframe": {"type": "string", "default": "last_7_days"}
  },
  "response_schema": {
    "stations": [
      {
        "station_id": "string",
        "location": {"lat": "float", "lon": "float"},
        "measurements": {
          "cell_count": {"value": "int", "units": "cells/L"},
          "chlorophyll": {"value": "float", "units": "mg/m³"},
          "temperature": {"value": "float", "units": "°C"},
          "salinity": {"value": "float", "units": "PSU"}
        },
        "timestamp": "string"
      }
    ],
    "metadata": {
      "station_count": "int",
      "data_quality": "string"
    }
  },
  "execution_handler": "sub-evidence-collector",
  "timeout": 20,
  "retry": 2
}
```

#### Authoritative Document Fetch Tool

```python
{
  "tool_name": "fetch_authoritative_docs",
  "description": "Fetch current guidance and standards from authoritative HAB monitoring sources",
  "parameters": {
    "sources": {
      "type": "array",
      "items": {"enum": ["IOC-UNESCO", "NOAA", "Copernicus", "WOAH"]},
      "default": ["IOC-UNESCO", "NOAA"]
    },
    "topic": {"type": "string", "required": true},
    "document_types": {
      "type": "array",
      "items": {"enum": ["guidelines", "standards", "reports", "alerts"]},
      "default": ["guidelines", "alerts"]
    }
  },
  "response_schema": {
    "documents": [
      {
        "source": "string",
        "title": "string",
        "url": "string",
        "publication_date": "string",
        "tier": "int",
        "summary": "string",
        "key_points": ["string"]
      }
    ],
    "metadata": {
      "document_count": "int",
      "source_coverage": "string"
    }
  },
  "execution_handler": "sub-evidence-collector",
  "timeout": 45,
  "retry": 3
}
```

#### Knowledge Base Query Tool

```python
{
  "tool_name": "query_knowledge_base",
  "description": "Query SECOND-KNOWLEDGE-BRAIN.md for academic and professional evidence",
  "parameters": {
    "keywords": {
      "type": "array",
      "items": {"type": "string"},
      "required": true
    },
    "max_results": {"type": "integer", "default": 5, "maximum": 10},
    "min_tier": {"type": "integer", "enum": [1, 2, 3, 4], "default": 2}
  },
  "response_schema": {
    "results": [
      {
        "citation": "string",
        "tier": "int",
        "relevance_score": "float",
        "year": "int",
        "venue": "string",
        "doi": "string",
        "key_findings": ["string"]
      }
    ],
    "coverage": {
      "total_entries": "int",
      "matched_entries": "int",
      "gap_areas": ["string"]
    }
  },
  "execution_handler": "sub-knowledge-updater",
  "timeout": 10,
  "retry": 1
}
```

---

## Hooks & Lifecycle Management

### Hook Types

The skill implements **clean, reusable hooks** for lifecycle events:

#### Pre-Execution Hooks

```python
class PreExecutionHooks:
    """Hooks invoked before skill execution"""
    
    @h

…

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [dungnotnull](https://github.com/dungnotnull)
- **Source:** [dungnotnull/red-tide-algal-bloom-monitoring-agent-skill](https://github.com/dungnotnull/red-tide-algal-bloom-monitoring-agent-skill)
- **License:** MIT

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-dungnotnull-red-tide-algal-bloom-monitoring-agent-skill-red-tide-algal-bloom-monitoring-agent-skill
- Seller: https://agentstack.voostack.com/s/dungnotnull
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
