Skip to content
Back to skills

Hive Scheduler

ASecurity

How to create scheduled jobs in Hive framework

  • 57 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added May 31, 2026
developmentjavascriptjavadebuggingapi

Works with

  • api

Security analysis

A100/100

Scanned May 31, 2026

npx -y skills add diegosouzapw/awesome-omni-skill --skill hive-scheduler --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Hive Scheduler?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Hive Scheduler
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/diegosouzapw-hive-scheduler/badge)](https://www.skillsdirectory.com/skills/diegosouzapw-hive-scheduler)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: hive-scheduler
description: How to create scheduled jobs in Hive framework
globs:
  - src/scheduler/handlers/*.js
alwaysApply: false
---

# Scheduler Jobs

Background jobs on cron schedules.

Location: `/src/scheduler/handlers/{jobName}.js`

## Template

```javascript
import db from 'db';

export const handler = async () => {
  // Job logic
};

export const cron = '0 * * * *';  // Every hour
```

## Cron Patterns

```
┌─ minute (0-59)
│ ┌─ hour (0-23)
│ │ ┌─ day of month (1-31)
│ │ │ ┌─ month (1-12)
│ │ │ │ ┌─ day of week (0-6)
* * * * *
```

| Pattern | Schedule |
|---------|----------|
| `* * * * *` | Every minute |
| `*/5 * * * *` | Every 5 minutes |
| `0 * * * *` | Every hour |
| `0 */12 * * *` | Every 12 hours |
| `0 0 * * *` | Daily at midnight |
| `0 9 * * 1` | Mondays at 9am |

## Examples

**Sync external data:**
```javascript
import db from 'db';
import moment from 'moment';
import externalApi from 'services/externalApi';

export const handler = async () => {
  const items = await externalApi.list({
    updatedSince: moment().subtract(5, 'minutes').toDate(),
  });
  
  for (const item of items) {
    await db.services.items.updateOne(
      { externalId: item.id },
      (doc) => ({ ...doc, ...item })
    );
  }
};

export const cron = '*/5 * * * *';
```

**Mark overdue:**
```javascript
import db from 'db';
import moment from 'moment';

export const handler = async () => {
  await db.services.invoices.updateMany(
    {
      isPaid: { $ne: true },
      isDue: { $ne: true },
      dueOn: { $lt: new Date() },
    },
    (doc) => ({ ...doc, isDue: true })
  );
};

export const cron = '0 */12 * * *';
```

## Rules

- Export both `handler` and `cron`
- Keep jobs idempotent (safe to re-run)
- Log progress for debugging

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.