pear-jobs

Enforce safe implementation patterns for Pear's Java Quartz scheduled jobs.

Updated May 15, 2026
One-click install
npx skills add https://github.com/Pear-Commerce/pear-ai-skills --skill pear-jobs
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: pear-jobs
Source: https://github.com/Pear-Commerce/pear-ai-skills/tree/main/skills/pear-jobs
Command: npx skills add https://github.com/Pear-Commerce/pear-ai-skills --skill pear-jobs

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill eliminates common production failures in Pear's Java scheduled jobs caused by race conditions, indefinite thread hangs, unmanaged thread pools, and hardcoded configuration values, reducing downtime and debugging effort for engineering teams.

Core Features & Use Cases

  • Concurrency Safety: Enforces AtomicBoolean guards to prevent overlapping job executions that cause data corruption.
  • Timeout Enforcement: Requires Parallel.getAll() for parallel task execution to avoid hanging threads that consume resources indefinitely.
  • Dynamic Configuration & Anti-Pattern Detection: Mandates AppConfig toggles for runtime configuration and flags common mistakes like plain boolean running flags, unshutdown thread pools, and hardcoded values.
  • Use Case: When building a new retailer data sync scheduled job, use this Skill to implement safe parallel processing, configurable timeouts, and progress tracking without introducing race conditions or resource leaks.

Quick Start

Use the pear-jobs skill to review your new scheduled job implementation for missing AtomicBoolean guards, timeout handling, and AppConfig usage.

Frequently Asked Questions about pear-jobs

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

FAQPage Schema
How do I prevent race conditions in Java scheduled jobs?

To prevent race conditions in Java scheduled jobs, implement AtomicBoolean concurrency guards to block overlapping job executions. This safety pattern stops parallel runs from corrupting data when a scheduled job takes longer than its fixed interval.

How do I handle hanging threads in Quartz scheduled jobs?

Handle hanging threads in Quartz scheduled jobs by using Parallel.getAll() for parallel task execution. This enforces strict timeout handling to prevent indefinite resource consumption and ensures threads are released properly.

Why should I use AppConfig toggles instead of hardcoded values in scheduled jobs?

Use AppConfig toggles instead of hardcoded values in scheduled jobs to enable dynamic runtime configuration without redeploying. Hardcoded values are flagged as anti-patterns because they prevent flexible timeout adjustments and job disabling during incidents.

What are common anti-patterns when refactoring Java batch processing tasks?

Common anti-patterns when refactoring Java batch processing tasks include using plain boolean running flags instead of AtomicBoolean guards, leaving thread pools unshutdown, and ignoring timeout handling for parallel execution, all of which cause production failures.

Can I use this approach for both cron jobs and fixed-interval jobs?

Yes, these enforced guardrails apply to Quartz-based cron jobs, fixed-interval jobs, and parallel batch processing tasks. The safety patterns ensure proper thread pool shutdown and concurrency control across all scheduled job types.

What is the best way to manage thread pool shutdown in Java scheduled jobs?

The best way to manage thread pool shutdown in Java scheduled jobs is to enforce proper resource cleanup patterns. Unshutdown thread pools are flagged as anti-patterns, requiring explicit teardown logic to prevent memory leaks and indefinite thread hangs.