# Hive Overview

> Hive framework structure and conventions. Apply when working with this codebase.

- Skill: `diegosouzapw/hive-overview` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add diegosouzapw/hive-overview`
- Raw SKILL.md: https://api.skillmd.com/api/skills/diegosouzapw/hive-overview/raw
- Safety review: pending (external: skill-scanner PASS, skillspector PASS)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: diegosouzapw (https://skillmd.com/u/diegosouzapw)
- Updated: 2026-09-08
- Page: https://skillmd.com/skills/diegosouzapw/hive-overview

---


# Hive Framework Overview

Hive is a Koa-based Node.js framework with MongoDB, Zod validation, and auto-sync for embedded documents.

## Directory Structure

| Directory | Purpose | Edit? |
|-----------|---------|-------|
| `/.hive/` | Framework core | No - read only |
| `/src/` | Application code | Yes |

## Resources

A resource is a feature module in `/src/resources/{name}/`:

```
src/resources/{name}/
├── {name}.schema.js      # Required: DB schema
├── endpoints/            # API routes
├── handlers/             # Event listeners
└── methods/              # Reusable functions
```

## Built-in (in .hive/)

- `tokens` - Auth token storage
- `users` - Base user schema  
- `db` - Database layer with services

## Key Imports

```javascript
import db from 'db';                    // Database
import config from 'app-config';        // Config
import { z } from 'zod';                // Validation
```

## Services Access

```javascript
const taskService = db.services.tasks;  // Auto-created from schema
```

