add-cron-job

Automates adding cron jobs to microservice worker binaries with logging and error handling.

Updated Feb 10, 2026
One-click install
npx skills add https://github.com/vesviet/microservices-agent-skills --skill add-cron-job-vesviet
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: add-cron-job
Source: https://github.com/vesviet/microservices-agent-skills/tree/main/skills/add-cron-job
Command: npx skills add https://github.com/vesviet/microservices-agent-skills --skill add-cron-job-vesviet

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill automates the process of adding new scheduled background jobs (cron jobs) to a microservice's worker process, ensuring they follow established patterns for reliability and observability.

Core Features & Use Cases

  • Worker Integration: Seamlessly integrates new cron jobs into the existing worker binary architecture.
  • Scheduling Options: Supports both simple time-based intervals using time.Ticker and complex cron expressions via robfig/cron.
  • Observability: Enforces logging of job start, end, duration, and error metrics for monitoring.
  • Use Case: You need to add a daily job to clean up expired user sessions from the database. This skill will guide you through creating the job, integrating it into the worker, and ensuring it's properly scheduled and logged.

Quick Start

Use the add-cron-job skill to create a new cleanup job named 'my-cleanup-job' that runs every 15 minutes.

Frequently Asked Questions about add-cron-job

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

FAQPage Schema
How do I schedule background tasks in microservice workers?

Scheduling background tasks in microservice workers involves embedding new cron jobs into the worker binary, using either time.Ticker for simple intervals or robfig/cron for complex expressions, while enforcing logging and graceful shutdown handling.

What is the best way to add a periodic cleanup routine to a worker binary?

Adding a periodic cleanup routine requires integrating a scheduled cron job into the worker binary architecture, ensuring the job respects graceful shutdown signals and includes essential logging for observability and error handling.

Does this approach support both simple intervals and complex cron expressions?

Yes, this approach supports both simple time-based intervals using time.Ticker and complex cron expressions via robfig/cron, allowing flexible scheduling for periodic tasks like cleanup routines, reconciliation processes, and report generation.

How do I ensure observability for scheduled jobs in a microservice?

Ensuring observability for scheduled jobs requires enforcing logging of job start, end, duration, and error metrics during worker integration, providing the necessary monitoring capabilities for periodic background tasks.

Can I use this method to schedule reconciliation processes and report generation?

Yes, you can use this method to schedule reconciliation processes and report generation, as it facilitates embedding periodic tasks into the worker binary with appropriate scheduling mechanisms and essential error handling.

What happens to running cron jobs during a graceful shutdown?

During a graceful shutdown, the scheduled cron jobs are designed to respect shutdown signals, ensuring periodic tasks running within the microservice worker binary terminate safely without interrupting ongoing cleanup routines or reconciliation processes.