Skill: PM2 Config Rendering
Goal
Render pm2-clj ecosystem files to JSON for validation and debugging without starting processes.
Use This Skill When
- The user wants to validate a pm2-clj ecosystem configuration
- You need to see what JSON pm2-clj will generate
- Debugging ecosystem DSL issues
- Verifying config parity after migrations
Do Not Use This Skill When
- The user wants to actually start/stop/restart PM2 processes (use
pm2-process-managementskill) - The request is about creating or editing ecosystem files
- You need to interact with running PM2 daemon
Inputs
- Path to
ecosystem.pm2.cljfile - Optional: output path for rendered JSON
Steps
- Locate the target
ecosystem.pm2.cljfile - Run
clobber render <path>/ecosystem.clj - Capture and validate the JSON output
- Check for PM2 app structure validity
Common Patterns
Render single config:
# Render to stdout
clobber render system/daemons/services/heartbeat/ecosystem.clj
# Render to file
clobber render system/daemons/services/heartbeat/ecosystem.clj > /tmp/heartbeat.json
Validate structure:
## Render and pipe to jq for validation
clobber render ecosystem.clj | jq '.apps | length'
clobber render ecosystem.clj | jq '.apps[].name'
Verify environment variables:
clobber render ecosystem.clj | jq '.apps[].env'
clobber render ecosystem.clj | jq '.apps[].env_production'
Strong Hints
- clobber outputs JSON to stdout by default
- Use
jqfor filtering and validation - Check that
appsarray is present and non-empty - Verify process names, scripts, and environment variables are correct
- Generated JSON should be valid PM2 configuration format
Output
- Rendered JSON configuration
- Validation result (valid/invalid)
- Any errors or warnings from pm2-clj rendering
Related Skills
- Use
pm2-process-managementskill to start/stop processes - Use
workspace-navigationskill to locate ecosystem files - Use
create-pm2-clj-configskill to create new ecosystem files
Example Workflows
Validate before starting:
# 1. Render and validate
clobber render system/daemons/services/heartbeat/ecosystem.clj | jq '.'
# 2. If valid, start process
clobber start system/daemons/services/heartbeat/ecosystem.clj
Compare configs:
# Render both configs for comparison
clobber render ecosystem.clj > /tmp/current.json
clobber render ecosystem.clj.new > /tmp/new.json
diff /tmp/current.json /tmp/new.json
