AI SummaryHelps Crystal developers quickly scaffold properly-structured JoobQ job classes with correct initialization, queue configuration, and retry settings. Essential for anyone building background job systems with JoobQ.
Install
Copy this and paste it into Claude Code, Cursor, or any AI assistant:
I want to install the "Create Job" skill in my project. Please run this command in my terminal: # Install skill into the correct directory (6 files) mkdir -p .claude/skills/commands && curl --retry 3 --retry-delay 2 --retry-all-errors -o .claude/skills/commands/SKILL.md "https://raw.githubusercontent.com/azutoolkit/joobq/master/.claude/commands/job.md" && curl --retry 3 --retry-delay 2 --retry-all-errors -o .claude/skills/commands/bench.md "https://raw.githubusercontent.com/azutoolkit/joobq/master/.claude/commands/bench.md" && curl --retry 3 --retry-delay 2 --retry-all-errors -o .claude/skills/commands/middleware.md "https://raw.githubusercontent.com/azutoolkit/joobq/master/.claude/commands/middleware.md" && curl --retry 3 --retry-delay 2 --retry-all-errors -o .claude/skills/commands/queue.md "https://raw.githubusercontent.com/azutoolkit/joobq/master/.claude/commands/queue.md" && curl --retry 3 --retry-delay 2 --retry-all-errors -o .claude/skills/commands/spec.md "https://raw.githubusercontent.com/azutoolkit/joobq/master/.claude/commands/spec.md" && curl --retry 3 --retry-delay 2 --retry-all-errors -o .claude/skills/commands/test.md "https://raw.githubusercontent.com/azutoolkit/joobq/master/.claude/commands/test.md" Then restart Claude Code (or reload the window in Cursor) so the skill is picked up.
Description
Create a new JoobQ job class with proper structure and registration
Create Job
Create a new job class for JoobQ.
Information Needed
• Job name (e.g., SendEmailJob, ProcessImageJob) • Queue name (e.g., emails, images, default) • Arguments (e.g., user_id: Int32, email: String) • Retry count (default: 3)
Template
`crystal class {JobName} include JoobQ::Job @queue = "{queue_name}" @retries = {retry_count} @max_retries = {retry_count} getter {arg1} : {Type1} getter {arg2} : {Type2} def initialize(@{arg1} : {Type1}, @{arg2} : {Type2} = default_value) end def perform # TODO: Implement job logic # Available: jid, queue, status, retries, expires end end `
After Creation
• Register the job in spec/spec_helper.cr: `crystal JoobQ::QueueFactory.register_job_type({JobName}) ` • Add queue configuration in config/joobq.*.yml or programmatically: `crystal queue "{queue_name}", 10, {JobName} ` • Create spec file at spec/{job_name_snake}_spec.cr
Discussion
Health Signals
My Fox Den
Community Rating
Sign in to rate this booster