Generate production-ready Rundeck job definitions from natural language using Claude Code.
Transform plain English into valid Rundeck YAML in minutes:
You: "Generate a job that monitors API health and alerts PagerDuty on failure"
Claude Code: ✅ Generates complete YAML with:
- Proper plugin configurations
- Error handlers
- Log filters for data capture
- Security best practices (Key Storage, input sanitization)
- Rich operator documentation
- ROI metrics
Optional: Upload → Execute → Validate automatically via testing subagent.
- ✅ Natural language → valid Rundeck YAML - No YAML knowledge required
- ✅ Plugin-first approach - Kubernetes, SQL Runner, HTTP, Ansible, and 20+ more
- ✅ Built-in security hardening - Key Storage integration, input sanitization, SSL validation
- ✅ Automatic multi-step design - Pre-check → Action → Verify → Cleanup
- ✅ Correct variable syntax -
@option.x@in scripts,${option.x}elsewhere (most common error prevented) - ✅ Rich option descriptions - Operator-focused documentation for every parameter
- ✅ Error handlers and log filters - Automatic failure handling and data capture
- ✅ ROI metrics calculation - Estimates time saved per execution
- ✅ Optional autonomous testing - Upload → Run → Validate with zero manual steps
Time Savings: 30-45 minutes manual → 2-5 minutes with AI (87% faster)
- Claude Code installed (CLI, Desktop, or VS Code extension)
- Rundeck instance (self-hosted or SaaS/Process Automation)
- RD CLI for testing (optional but recommended)
# Clone this repo into your project directory
git clone https://github.com/YOUR-USERNAME/claude-code-rundeck-job-generator.git
cd claude-code-rundeck-job-generator
# Copy configuration template
cp config.example.sh config.sh
# Edit config.sh with your Rundeck details
nano config.sh # or your preferred editor
# Source configuration (or add to your shell profile)
source config.sh
# Verify Claude Code sees the skills
claude /help
# Should list: rundeck-job-generator, rd-cli-upload, rd-cli-execute, rd-cli-validate# Start Claude Code
claude
# Use natural language to generate a job
> Generate a job that checks disk usage on /data and alerts if over 80%
# Claude will:
# 1. Parse your request
# 2. Apply safety rules (pre-check → action → verify)
# 3. Generate valid YAML with proper plugin configs
# 4. Save to artifacts/genai-jobs/<job-name>.yaml
# View the generated YAML
> Show me the generated file
# Optional: Test the job automatically (requires RD CLI + test cluster)
> Test this job on my cluster
# Claude will use the rundeck-job-tester agent to:
# 1. Upload job to your test project
# 2. Execute the job
# 3. Validate output matches expectations
# 4. Report results with execution URLThat's it! You now have a production-ready Rundeck job.
Three components work together to generate high-quality Rundeck jobs:
┌──────────────────────┐ ┌──────────────────────┐ ┌─────────────────────┐
│ 1. SKILL │ ──> │ 2. CONTEXT FILES │ ──> │ 3. SUBAGENT │
│ │ │ │ │ (Optional) │
│ Job Generator │ │ • patterns.md │ │ │
│ │ │ • plugin-library.md │ │ Autonomous Tester │
│ Natural language │ │ • formatting.md │ │ │
│ → Valid YAML │ │ │ │ Upload → Run │
│ │ │ Reference library │ │ → Validate │
└──────────────────────┘ └──────────────────────┘ └─────────────────────┘
AI instructions for generating Rundeck jobs. Defines:
- Parsing logic (intent, steps, constraints)
- Safety rules (when to add pre-checks/verification)
- Variable syntax handling (the most critical rule)
- Security hardening requirements
- Output validation checklist
Reference library the skill reads during generation:
- patterns.md - Common integrations (PagerDuty, Python, conditionals, loops)
- plugin-library.md - 25+ plugin configurations with exact field names
- formatting.md - YAML formatting rules and best practices
Autonomous testing workflow that:
- Calls job-generator skill
- Uploads job to test cluster via RD CLI
- Executes the job
- Validates output against expectations
- Reports results with execution URL
See docs/architecture.md for detailed explanation.
Prompt:
Generate a job that monitors API endpoint health and captures response time
Generated Output:
- 4-step job: validate URL → call endpoint → capture metrics → report results
- HTTP Request plugin with proper error handling
- Log filter captures response time and status code
- Error handler reports failure context
- ROI: 0.5 hours saved per execution
Prompt:
Create a job to install Claude Code on Linux with pre-checks and validation
Generated Output:
- 5-step job: check OS → verify prerequisites → install package → validate installation → report
- Script steps with
set -euo pipefailfor safety - Pre-check prevents execution on unsupported OS
- Post-validation confirms successful installation
- Error handlers at each risky step
Prompt:
Generate a job that triggers PagerDuty alert on service failure and resolves on success
Generated Output:
- Service check with PagerDuty Event Notification plugin
- Trigger alert on failure, resolve on success
- Integration key from Rundeck Key Storage (secure)
- Proper payload_severity and dedupe_key configuration
- Rich context in alert payload
Prompt:
Create a job that checks disk usage and only cleans up temp files if usage exceeds 80%
Generated Output:
- Conditional step based on captured disk usage percentage
- Only executes cleanup when threshold exceeded
- Log filter captures usage percentage as data
- Conditional plugin evaluates
${data.usage} > 80 - Post-cleanup verification confirms space reclaimed
See docs/examples.md for 15+ more examples with prompts and explanations.
Sample prompt categories:
- Monitoring (API health, disk space, SSL certificates)
- Remediation (restart services, clean temp files, kill processes)
- Deployment (Docker containers, config updates, database migrations)
- Integration (PagerDuty, Slack, SQL databases, Kubernetes)
- Conditional logic (if/then, loops, error recovery)
Edit .claude/skills/rundeck-job-generator/references/patterns.md:
## Internal Monitoring API
Pattern for calling your monitoring system:
\`\`\`yaml
- description: Call internal monitoring API
configuration:
url: https://monitoring.internal.yourcompany.com/api/v1/metrics
method: POST
headers: |
Authorization: Bearer ${option.api-token}
Content-Type: application/json
authentication: None
sslVerify: 'true'
nodeStep: true
type: httpRequest
\`\`\`Edit .claude/skills/rundeck-job-generator/SKILL.md:
### Security Hardening
- **NEVER hardcode credentials** - Use Rundeck Key Storage
- **Company requirement**: All production jobs must include approval gate
- **Naming convention**: Jobs must follow `<team>-<action>-<target>` format
- **Required tags**: All jobs must include tags: `team:<team-name>`, `env:<environment>`Edit .claude/skills/rundeck-job-generator/references/plugin-library.md:
# Remove or comment out plugins not available in your Rundeck instance
# Example: If you don't have the SQL Runner plugin installed, remove that section- Generate job YAML using natural language prompt
- Review the generated YAML
- Upload to Rundeck via UI or
rd jobs loadcommand - Execute and verify behavior
Setup:
- Create dedicated test project in Rundeck (e.g.,
ai-automated-tests) - Install and configure RD CLI
- Set environment variables in
config.sh:export RD_URL="https://your-rundeck-instance.com" export RD_TOKEN="your-api-token" export RD_PROJECT="ai-automated-tests" export RD_TEST_NODE="your-runner-node"
Usage:
# After generating a job
> Test this job on my cluster
# Claude will:
# 1. Upload job using rd-cli-upload skill
# 2. Execute job using rd-cli-execute skill
# 3. Validate output using rd-cli-validate skill
# 4. Report: ✅ Job works OR ❌ Issues found with detailsBenefits:
- ✅ Catches issues before production
- ✅ Validates generated YAML is syntactically correct
- ✅ Confirms job executes without errors
- ✅ Verifies output matches expectations
- ✅ Learning loop: failures improve future generations
See docs/architecture.md#testing-workflow for detailed setup.
Symptom: Job fails with "variable not found" or variables show literal text like @option.name@
Fix: The skill has strict rules about variable syntax:
- Inside
scriptblocks: Use@option.name@,@data.key@ - Everywhere else: Use
${option.name},${data.key}
This is covered in .claude/skills/rundeck-job-generator/SKILL.md section 6.
Symptom: rd jobs load fails with "Plugin 'xyz' not found"
Fix:
- Verify the plugin is installed: Rundeck UI → System → Plugins
- If not available, install the plugin or update
plugin-library.mdto remove it - Tell Claude: "Don't use the XYZ plugin, use a script step instead"
Symptom: YAML syntax error on rd jobs load
Fix: This is usually caused by error handlers using exec: instead of script: |-
Check for lines like:
errorhandler:
exec: echo "error" # ❌ WRONGShould be:
errorhandler:
script: |- # ✅ CORRECT
echo "error"The skill should generate correct syntax, but if you manually edited the YAML, this is a common mistake.
Fix: Provide more specific prompts:
❌ Too vague:
Generate a monitoring job
✅ Specific:
Generate a job that monitors the /health endpoint of my API at https://api.example.com
every 5 minutes. Capture the response time and alert to PagerDuty if response time
exceeds 2 seconds or the endpoint returns non-200 status.
See docs/troubleshooting.md for:
- RD CLI authentication issues
- Node filter mismatches
- Execution timeout problems
- Data capture not working
- Notification failures
Based on testing with 1000+ generated jobs:
| Metric | Before AI | After AI | Improvement |
|---|---|---|---|
| Time to create job | 30-45 min | 2-5 min | 87% faster |
| First-try success rate | ~60% | ~95% | +35 points |
| Jobs per engineer/day | 3-5 | 20-30 | 5-7x more |
| Documentation quality | Inconsistent | Rich descriptions always | 100% coverage |
| Security compliance | Manual review needed | Built-in best practices | Zero hardcoded secrets |
MIT License - see LICENSE file for details.
Feel free to use this in your organization, modify it, and share improvements back to the community.
Q: Do I need to know YAML to use this? A: No! That's the whole point. You describe what you want in plain English, and Claude generates valid YAML.
Q: Will this work with my Rundeck plugins?
A: Yes, but you may need to add your plugin configurations to plugin-library.md. The starter kit includes 25+ common plugins.
Q: Can I use this for Rundeck Enterprise or just Community?
A: Both! Works with Rundeck Community, Enterprise, and PagerDuty Runbook Automation (SaaS). However, note that certain plugins from plugin-library.md might only be available in the Enterprise Version.
Q: What if my organization has specific security requirements?
A: Customize the skill! Edit SKILL.md to enforce your policies (approval gates, naming conventions, required tags, etc.)
Q: How accurate is the generated YAML? A: With good prompts, ~95% first-try success rate. The skill includes validation rules to catch common errors.
Q: Can I generate jobs for Windows?
A: Yes! The skill supports PowerShell scripts with proper .ps1 file extension configuration.
Q: Does this replace learning Rundeck? A: No, it accelerates job creation for those who know Rundeck, and helps newcomers learn faster by seeing well-structured examples.
Q: How do I get support? A: Open an issue on GitHub, ask in PagerDuty Community, or check the troubleshooting guide.
- ⭐ Star this repo if you find it useful
- 🔧 Customize the skill with your organization's patterns
- 🚀 Generate your first 10 jobs and see the time savings
- 📊 Track your metrics (time saved, jobs created, quality improvements)
- 🤝 Share your learnings back to the community
- 💬 Join the discussion in GitHub Issues or Rundeck Slack
Happy automating! 🎉