install
source · Clone the upstream repo
git clone https://github.com/diegosouzapw/awesome-omni-skill
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/diegosouzapw/awesome-omni-skill "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/development/hive-handler" ~/.claude/skills/diegosouzapw-awesome-omni-skill-hive-handler && rm -rf "$T"
manifest:
skills/development/hive-handler/SKILL.mdsource content
Creating Event Handlers
Handlers react to database events automatically.
Location:
/src/resources/{name}/handlers/{handlerName}.js
Template
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 |
|---|---|---|
| | After |
| | After |
| | After |
Common Patterns
Create related record:
taskService.on('created', async ({ doc }) => { await eventService.create({ type: 'task.created', data: { task: doc }, project: doc.project, }); });
Update parent on child change:
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:
import ifUpdated from 'helpers/db/ifUpdated'; taskService.on('updated', ifUpdated(['status'], async ({ doc, prevDoc }) => { // Only runs when status changed }));
Cleanup on delete:
docService.on('removed', async ({ doc }) => { await eventService.remove({ 'data.doc._id': doc._id }); });
Rules
- Keep handlers fast (don't block response)
- Use
for silent bulk updates (no events)atomic.update - Use
helper to filter field changesifUpdated