hive-handler
How to create event handlers in Hive framework
Best use case
hive-handler is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
How to create event handlers in Hive framework
Teams using hive-handler should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/hive-handler/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How hive-handler Compares
| Feature / Agent | hive-handler | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
How to create event handlers in Hive framework
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
# Creating Event Handlers
Handlers react to database events automatically.
Location: `/src/resources/{name}/handlers/{handlerName}.js`
## Template
```javascript
import db from 'db';
const myService = db.services.myResource;
myService.on('created', async ({ doc }) => {
// Handle creation
});
myService.on('updated', async ({ doc, prevDoc }) => {
// Handle update
});
myService.on('removed', async ({ doc }) => {
// Handle removal
});
```
## Events
| Event | Payload | Trigger |
|-------|---------|---------|
| `created` | `{ doc }` | After `service.create()` |
| `updated` | `{ doc, prevDoc }` | After `service.updateOne/Many()` |
| `removed` | `{ doc }` | After `service.remove()` |
## Common Patterns
**Create related record:**
```javascript
taskService.on('created', async ({ doc }) => {
await eventService.create({
type: 'task.created',
data: { task: doc },
project: doc.project,
});
});
```
**Update parent on child change:**
```javascript
docService.on('created', async ({ doc }) => {
if (doc.role === 'case-study') {
await projectService.updateOne(
{ _id: doc.project._id },
(p) => ({ ...p, caseStudy: doc })
);
}
});
```
**React to specific field change:**
```javascript
import ifUpdated from 'helpers/db/ifUpdated';
taskService.on('updated', ifUpdated(['status'], async ({ doc, prevDoc }) => {
// Only runs when status changed
}));
```
**Cleanup on delete:**
```javascript
docService.on('removed', async ({ doc }) => {
await eventService.remove({ 'data.doc._id': doc._id });
});
```
## Rules
- Keep handlers fast (don't block response)
- Use `atomic.update` for silent bulk updates (no events)
- Use `ifUpdated` helper to filter field changesRelated Skills
hive-scheduler
How to create scheduled jobs in Hive framework
hive-overview
Hive framework structure and conventions. Apply when working with this codebase.
hive-mapping
Schema mappings for auto-syncing embedded documents
hive-endpoint
How to create API endpoints in Hive framework
hive-credentials
Set up and install credentials for an agent. Detects missing credentials from agent config, collects them from the user, and stores them securely in the local encrypted store at ~/.hive/credentials.
file-archiver
创建和解压ZIP、TAR和GZIP压缩包,支持密码保护。
chatgpt-archive-topic-background-report
Build a topic-focused research collection from ChatGPT archive viewer conversations (latest archive or all archives), run a background Responses API consolidation job with web search, and save markdown plus raw response artifacts. Use when the user asks to find archive threads by topic, reconcile repetition/contradictions, and generate a saved report with minimal polling noise.
hive-mind-advanced
Advanced Hive Mind collective intelligence system for queen-led multi-agent coordination with consensus mechanisms and persistent memory
globalexceptionhandler-class
Structure of GlobalExceptionHandler class.
create-event-handlers
Sets up RabbitMQ event publishers and consumers following ModuleImplementationGuide.md Section 9. RabbitMQ only (no Azure Service Bus). Creates publishers with DomainEvent (tenantId preferred), consumers with handlers, naming {domain}.{entity}.{action}, required fields (id, type, version, timestamp, tenantId, source, data). Use when adding event-driven communication, async workflows, or integrating via events.
github-archive
Investigate GitHub security incidents using tamper-proof GitHub Archive data via BigQuery. Use when verifying repository activity claims, recovering deleted PRs/branches/tags/repos, attributing actions to actors, or reconstructing attack timelines. Provides immutable forensic evidence of all public GitHub events since 2011.
archive
Archive completed task/spec work to ./.gtd/archive/