# Home Spirulina Farming System

> Home Spirulina Farming System Design & Operation — Home-Scale Microalgae (Spirulina) Cultivation evidence-backed analysis harness. Use this skill whenever the user asks about spirulina farming, home algae cultivation, microalgae systems, Arthrospira growth, Zarrouk medium preparation, algae harvesting, or any aspect of home-scale spirulina production including food safety, contamination control,…

- **Type:** Skill
- **Install:** `agentstack add skill-dungnotnull-home-spirulina-farming-system-agent-skill-home-spirulina-farming-system-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/home-spirulina-farming-system-agent-skill

## Install

```sh
agentstack add skill-dungnotnull-home-spirulina-farming-system-agent-skill-home-spirulina-farming-system-agent-skill
```

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

## About

# Home Spirulina Farming System — Skill Registry

## Overview

This document serves as the comprehensive skill registry for the `home-spirulina-farming-system` Claude Code skill. It provides complete documentation for skill registration, resolution, execution, and validation, including input/output JSON schemas for all components.

## Skill Identity

- **Name:** `home-spirulina-farming-system`
- **Version:** 1.0.0
- **Category:** Domain-Specific Analysis / Agriculture / Biotechnology
- **Phase:** Production Ready
- **Last Updated:** 2026-07-15

## Skill Architecture

### Modular Directory Structure

```
279-home-spirulina-farming-system/
├── config/                    # Configuration management
│   ├── __init__.py
│   ├── schemas.py             # Type-safe configuration schemas
│   └── config_manager.py      # Environment variable management
├── lib/                       # Core library modules
│   ├── __init__.py
│   ├── logging_system.py      # Structured logging
│   ├── error_handler.py       # Error handling & recovery
│   ├── token_tracker.py       # Token consumption tracking
│   └── context_manager.py     # Context window optimization
├── hooks/                     # Lifecycle management
│   ├── __init__.py
│   ├── lifecycle_hooks.py     # Step execution hooks
│   ├── state_sync.py          # State synchronization
│   └── event_emitter.py       # Event management
├── tools/                     # Tool definitions
│   ├── __init__.py
│   ├── tool_registry.py       # Tool registration & execution
│   ├── tools_factory.py       # Predefined tools
│   ├── knowledge_updater.py   # Knowledge crawl pipeline
│   └── test_knowledge_updater.py
├── skills/                    # Sub-skill definitions
│   ├── main.md                # Main harness orchestrator
│   ├── sub-gather-requirements.md
│   ├── sub-evidence-collector.md
│   ├── sub-core-analysis.md
│   ├── sub-knowledge-updater.md
│   └── sub-advisor.md
├── references/                # Domain knowledge templates
│   ├── domain_concepts.md
│   ├── evidence_hierarchy.md
│   └── output_templates.md
├── assets/                    # Static resources
│   ├── diagrams/
│   └── schemas/
├── scripts/                   # Automation scripts
│   ├── setup.sh
│   └── validate.sh
├── tests/                     # Test scenarios
│   ├── test-scenarios.md
│   └── TEST_RESULTS.md
├── SECOND-KNOWLEDGE-BRAIN.md  # Living knowledge base
├── CLAUDE.md                  # Project instructions
├── PROJECT-detail.md          # Technical specification
├── PROJECT-DEVELOPMENT-PHASE-TRACKING.md
├── README.md
├── requirements.txt
├── .gitignore
└── SKILL.md                   # This file
```

## Skill Registration

### Main Skill Registration

The main skill is registered in `skills/main.md` with the following frontmatter:

```yaml
---
name: home-spirulina-farming-system
description: Home Spirulina Farming System Design & Operation
---
```

### Sub-Skill Registration

Each sub-skill is registered with its own frontmatter:

| Sub-Skill | Purpose | Trigger Condition |
|-----------|---------|-------------------|
| `sub-gather-requirements` | Clarify analysis scope | Step 1 of harness |
| `sub-evidence-collector` | Fetch authoritative data | Step 2 of harness |
| `sub-core-analysis` | Domain analysis | Step 3 of harness |
| `sub-knowledge-updater` | Query knowledge base | Step 4 of harness |
| `sub-advisor` | Synthesize recommendations | Step 5 of harness |

## Skill Resolution

### Resolution Order

1. **Direct invocation:** `/home-spirulina-farming-system [query]`
2. **Pattern matching:** User message contains spirulina/farming keywords
3. **Context detection:** User discusses algae cultivation
4. **Manual trigger:** User explicitly requests analysis

### Resolution Parameters

```json
{
  "skill_name": "home-spirulina-farming-system",
  "resolution": {
    "method": "pattern_match",
    "confidence": 0.95,
    "matched_keywords": ["spirulina", "farming", "cultivation"],
    "context": "home_scale_agriculture"
  }
}
```

## Skill Execution

### Execution Protocol

The skill follows a 6-step execution protocol:

1. **Pre-Flight:** Language detection
2. **Step 1:** `sub-gather-requirements` → Structured requirements
3. **Step 2:** `sub-evidence-collector` → Evidence bundle
4. **Step 3:** `sub-core-analysis` → Domain analysis
5. **Step 4:** `sub-knowledge-updater` → Academic evidence
6. **Step 5:** `sub-advisor` → Final recommendations
7. **Quality Gate:** Verify all gates passed

### Input/Output Schemas

#### Main Skill Input Schema

```json
{
  "type": "object",
  "properties": {
    "query": {
      "type": "string",
      "description": "User's analysis request"
    },
    "language": {
      "type": "string",
      "enum": ["en", "vi"],
      "default": "en"
    },
    "context": {
      "type": "object",
      "description": "Additional context or inputs"
    }
  },
  "required": ["query"]
}
```

#### Main Skill Output Schema

```json
{
  "type": "object",
  "properties": {
    "report": {
      "type": "string",
      "description": "Formatted analysis report"
    },
    "verdict": {
      "type": "string",
      "enum": ["optimal", "conditional", "toxin_risk", "inconclusive"],
      "description": "Analysis verdict category"
    },
    "confidence": {
      "type": "number",
      "minimum": 0,
      "maximum": 1,
      "description": "Confidence score"
    },
    "evidence_count": {
      "type": "integer",
      "description": "Number of sources cited"
    },
    "gates_passed": {
      "type": "array",
      "items": {"type": "string"},
      "description": "Quality gates that passed"
    },
    "warnings": {
      "type": "array",
      "items": {"type": "string"},
      "description": "Warnings or limitations"
    }
  },
  "required": ["report", "verdict"]
}
```

#### Sub-Skill Input/Output Schemas

##### sub-gather-requirements

**Input:**
```json
{
  "type": "object",
  "properties": {
    "user_message": {"type": "string"},
    "provided_inputs": {"type": "object"}
  }
}
```

**Output:**
```json
{
  "type": "object",
  "properties": {
    "object": {"type": "string"},
    "scope": {"type": "string"},
    "timeframe": {"type": "string"},
    "available_inputs": {"type": "object"},
    "target_audience": {"type": "string"},
    "language": {"type": "string"},
    "analysis_type": {"type": "string"}
  },
  "required": ["object"]
}
```

##### sub-evidence-collector

**Input:**
```json
{
  "type": "object",
  "properties": {
    "requirements": {"$ref": "#/definitions/sub-gather-requirements-output"}
  }
}
```

**Output:**
```json
{
  "type": "object",
  "properties": {
    "current_data": {"type": "object"},
    "authoritative_docs": {"type": "array"},
    "recent_news": {"type": "array"},
    "reference_benchmarks": {"type": "array"}
  }
}
```

##### sub-core-analysis

**Input:**
```json
{
  "type": "object",
  "properties": {
    "setup": {"type": "string"},
    "strain": {"type": "string"},
    "space": {"type": "string"},
    "light": {"type": "string"},
    "language": {"type": "string"}
  }
}
```

**Output:**
```json
{
  "type": "object",
  "properties": {
    "medium": {"type": "object"},
    "light_T_agitation": {"type": "object"},
    "growth": {"type": "object"},
    "harvest_drying": {"type": "object"},
    "contamination": {"type": "object"},
    "scenarios": {"type": "object"}
  }
}
```

##### sub-knowledge-updater

**Input:**
```json
{
  "type": "object",
  "properties": {
    "keywords": {"type": "array", "items": {"type": "string"}}
  }
}
```

**Output:**
```json
{
  "type": "object",
  "properties": {
    "citations": {"type": "array"},
    "tier_labels": {"type": "object"},
    "coverage_rating": {"type": "string"},
    "flagged_gaps": {"type": "array"}
  }
}
```

##### sub-advisor

**Input:**
```json
{
  "type": "object",
  "properties": {
    "core_analysis": {"type": "object"},
    "evidence_bundle": {"type": "object"},
    "knowledge_evidence": {"type": "object"}
  }
}
```

**Output:**
```json
{
  "type": "object",
  "properties": {
    "conclusion": {"type": "string"},
    "scenarios": {"type": "object"},
    "key_risks": {"type": "array"},
    "evidence_chain": {"type": "array"},
    "remediation": {"type": "array"},
    "disclosure": {"type": "string"}
  }
}
```

## Quality Gates

### Universal Gates (U1-U6)

| Gate | Check | Auto-Fix | Enforcement |
|------|-------|----------|------------|
| U1 | ≥3 sources, ≥1 academic | Fetch from KB | Append before delivery |
| U2 | Disclosure before recommendation | Prepend disclosure | Block until present |
| U3 | Evidence hierarchy per source | Tag sources | Mark each source |
| U4 | Language matches preference | Translate output | Run detection |
| U5 | Output template complete | Reformat | Check sections |
| U6 | Claims traceable | Flag unsupported | Mark claims |

### Domain Gates (G1-G4)

| Gate | Check | Auto-Fix | Enforcement |
|------|-------|----------|------------|
| G1 | Medium (Zarrouk/pH) set | Set medium | Configure medium |
| G2 | Light/T/agitation configured | Configure light/T | Set parameters |
| G3 | Contamination/toxin control | Add control | Implement checks |
| G4 | Harvest/food safety | Add safety | Add procedures |

## Validation

### Skill Validation

The skill is validated using the 8-File Contract:

1. ✅ CLAUDE.md — Skill identity card
2. ✅ PROJECT-detail.md — Technical specification
3. ✅ PROJECT-DEVELOPMENT-PHASE-TRACKING.md — Build roadmap
4. ✅ README.md — Public documentation
5. ✅ skills/main.md — Main harness
6. ✅ skills/sub-*.md — Sub-skills
7. ✅ SECOND-KNOWLEDGE-BRAIN.md — Knowledge base
8. ✅ tools/knowledge_updater.py — Crawl pipeline

### Execution Validation

- [ ] All steps complete in order
- [ ] Quality gates pass
- [ ] Output template complete
- [ ] Evidence hierarchy respected
- [ ] Language detection working
- [ ] Graceful degradation functional

## Tool Integration

### Available Tools

- **WebSearch** — Live domain data
- **WebFetch** — Scrape authoritative sources
- **Read/Write** — File operations
- **Bash** — Command execution
- **Skill** — Sub-skill invocation

### Tool Registry

Tools are registered in `tools/tool_registry.py` with schema validation and execution tracking.

## Configuration

### Environment Variables

```bash
ENVIRONMENT=production
MODEL_PROVIDER=anthropic
MODEL_NAME=claude-sonnet-4-20250514
MODEL_TEMPERATURE=0.7
LOG_LEVEL=INFO
FEATURE_ENABLE_CRAWL=true
FEATURE_ENABLE_CACHE=true
```

### Configuration Schema

See `config/schemas.py` for complete configuration schema definition.

## Hooks & Events

### Lifecycle Hooks

- **before_step** — Before step execution
- **after_step** — After step completion
- **on_error** — On error occurrence
- **on_completion** — On harness completion
- **on_validation** — On quality gate validation

### Event Types

- `step_start` — Step execution started
- `step_complete` — Step execution completed
- `step_error` — Step execution failed
- `data_fetched` — Data fetched successfully
- `analysis_complete` — Analysis completed
- `report_generated` — Report generated
- `error_occurred` — Error occurred
- `warning_issued` — Warning issued

## Knowledge Pipeline

### Crawl Schedule

- **Weekly Academic:** Mondays 08:00
- **Daily News:** Daily 07:00

### Knowledge Config

Located in `tools/knowledge_updater.py`:

```python
KNOWLEDGE_CONFIG = {
    "domain": "Home-Scale Microalgae (Spirulina) Cultivation",
    "keywords": [...],
    "arxiv_categories": [],
    "rss_feeds": [],
    "authoritative_docs": [...],
}
```

## Error Handling

### Error Categories

- Network
- Data Source
- Validation
- Processing
- Authentication
- Rate Limit
- Dependency
- Internal

### Recovery Strategies

Each error category has a recovery strategy with retry logic, exponential backoff, and fallback handlers.

## Performance Monitoring

### Token Tracking

- Input tokens per operation
- Output tokens per operation
- Total consumption tracking
- Cost estimation
- Optimization suggestions

### Context Management

- Current usage percentage
- Compression threshold
- Truncate strategy
- Section preservation

### Logging

- Structured JSON logging
- Correlation ID tracking
- Log level configuration
- File rotation
- Performance metrics

## Integration Points

### MCP Servers

- **CodeGraph** — Code intelligence
- **Context7** — Documentation queries
- **Supabase** — Database operations

### External APIs

- ArXiv API
- Semantic Scholar API
- RSS feeds

## Testing

### Test Scenarios

Located in `tests/test-scenarios.md`:

1. Standard analysis
2. Minimal input
3. Comparison case
4. Risk/conflict case
5. Degraded mode

### Test Execution

```bash
python tools/test_knowledge_updater.py
python tools/run_test_scenarios.py --all
```

## Maintenance

### Knowledge Updates

```bash
python tools/knowledge_updater.py
python tools/knowledge_updater.py --dry-run
python tools/knowledge_updater.py --news-only
```

### Configuration Updates

```bash
# Edit .env file
vim .env

# Reload configuration
python -c "from config import reload_config; reload_config()"
```

## License

MIT License — see LICENSE file.

## Citation

```bibtex
@software{home-spirulina-farming-system,
  title = {home-spirulina-farming-system: Home Spirulina Farming System Design & Operation},
  author = {Claude Code},
  year = {2026},
  version = {1.0.0},
  url = {https://github.com/972026/279-home-spirulina-farming-system}
}
```

## 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/home-spirulina-farming-system-agent-skill](https://github.com/dungnotnull/home-spirulina-farming-system-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:** yes
- **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-home-spirulina-farming-system-agent-skill-home-spirulina-farming-system-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%.
