add-cron-job

Create a Node.js cron-job scaffold with in-process guards and env-driven scheduling.

3|3|Updated Nov 5, 2025
One-click install
npx skills add https://github.com/nomos-guild/cgov-api --skill add-cron-job
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: add-cron-job
Source: https://github.com/nomos-guild/cgov-api/tree/main/.claude/skills/add-cron-job
Command: npx skills add https://github.com/nomos-guild/cgov-api --skill add-cron-job

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Scaffolding a new cron job is repetitive and error-prone. This Skill provides a repeatable, safe scaffold that enforces in-process guarding, env-configurable schedules, and a ready-made job registry, reducing boilerplate and misconfigurations.

Core Features & Use Cases

  • In-process guard to prevent overlapping executions.
  • Env-configurable cron schedule with optional ENABLE_CRON_JOBS toggle.
  • Optional SyncStatus distributed locking for multi-instance deployments.
  • Automatic registration in the job registry and starter. Use cases include adding periodic maintenance tasks, data-sync jobs, and analytics routines across Node.js projects.

Quick Start

Run the generator with a job name, schedule, and description to scaffold a new cron job.

Frequently Asked Questions about add-cron-job

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I prevent overlapping cron job executions in Node.js?

To prevent overlapping cron job executions in Node.js, you need an in-process guard. This scaffold includes built-in locking mechanisms that stop concurrent runs of the same scheduled task.

What's the best way to configure cron schedules across different environments?

The best way to configure cron schedules across environments is using environment variables. This scaffold supports env-driven scheduling with an optional ENABLE_CRON_JOBS toggle to control startup.

How do I manage distributed locking for multi-instance Node.js deployments?

For distributed locking in multi-instance Node.js deployments, you can enable optional SyncStatus locking. This prevents separate application instances from running the same job simultaneously.

How do I register a new scheduled task in a Node.js application?

To register a new scheduled task in a Node.js application, you add it to a central job registry. This scaffold automates registration and provides a starter workflow for bootstrapping jobs.

Do I need a job registry to run scheduled maintenance tasks?

You need a job registry to safely run scheduled maintenance tasks because it centralizes startup and management. This scaffold provides a ready-made registry to reduce boilerplate and misconfigurations.

Can I manually trigger a cron job without waiting for its schedule?

You can manually trigger a cron job without waiting for its schedule by using a provided manual trigger. This scaffold's workflow includes adding a manual trigger option during job creation.