
Processes
- 12 installs
- 610 repo stars
- Updated June 26, 2026
- alsk1992/cloddsbot
processes is a Claude skill that spawns and manages background jobs and long-running processes with logging, auto-restart, and resource limits.
About
This skill is a process manager for spawning and managing background jobs and long-running tasks. Developers use /job commands or a TypeScript API to spawn processes, list and check status, stream output, view logs, and stop or restart jobs. It supports auto-restart, resource limits, timeouts, and SQLite-backed job storage. It is used to run things like backtests and ML training in the background.
- Spawns and manages background jobs and long-running processes
- Streams output, follows logs, and auto-restarts failed jobs
- Enforces memory limits, timeouts, and tracks CPU/memory per job
Processes by the numbers
- 12 all-time installs (skills.sh)
- Ranked #1,453 of 2,715 Automation & Workflows skills by installs in the Skillselion catalog
- Data as of Aug 5, 2026 (Skillselion catalog sync)
processes capabilities & compatibility
- Capabilities
- process management · job scheduling · log streaming
- Use cases
- orchestration · devops
What processes says it does
Spawn and manage background processes, long-running jobs, and scheduled tasks.
restart: true, maxRestarts: 3, restartDelayMs: 5000,
npx skills add https://github.com/alsk1992/cloddsbot --skill processesAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 12 |
|---|---|
| repo stars | ★ 610 |
| Last updated | June 26, 2026 |
| Repository | alsk1992/cloddsbot ↗ |
What it does
Spawn, monitor, and manage background jobs and long-running processes from an agent.
Who is it for?
Running and monitoring background jobs like backtests or ML training from an agent.
When should I use this skill?
A user needs to spawn a background job, follow its output, or restart a long-running process.
By the numbers
- 5 job statuses (running, stopped, completed, failed, restarting)
Files
Processes - Complete API Reference
Spawn and manage background processes, long-running jobs, and scheduled tasks.
---
Chat Commands
Spawn Jobs
/job spawn "npm run backtest" Start background job
/job spawn "python train.py" --name ml Named job
/job spawn "node bot.js" --restart Auto-restart on exitManage Jobs
/jobs List all jobs
/job status <id> Check job status
/job output <id> View job output
/job output <id> --follow Stream output
/job stop <id> Stop job
/job restart <id> Restart jobLogs
/job logs <id> View logs
/job logs <id> --tail 100 Last 100 lines
/job logs <id> --since 1h Last hour---
TypeScript API Reference
Create Process Manager
import { createProcessManager } from 'clodds/processes';
const processes = createProcessManager({
// Working directory
cwd: process.cwd(),
// Environment
env: process.env,
// Limits
maxProcesses: 10,
maxMemoryMB: 1024,
// Logging
logDir: './logs/jobs',
maxLogSizeMB: 100,
// Storage
storage: 'sqlite',
dbPath: './jobs.db',
});Spawn Process
// Simple spawn
const job = await processes.spawn({
command: 'npm',
args: ['run', 'backtest'],
name: 'backtest-btc',
});
console.log(`Job ID: ${job.id}`);
console.log(`PID: ${job.pid}`);
// With options
const job = await processes.spawn({
command: 'python',
args: ['train.py', '--epochs', '100'],
name: 'ml-training',
// Environment
env: {
...process.env,
CUDA_VISIBLE_DEVICES: '0',
},
// Working directory
cwd: '/path/to/ml-project',
// Auto-restart
restart: true,
maxRestarts: 3,
restartDelayMs: 5000,
// Resource limits
maxMemoryMB: 4096,
timeoutMs: 3600000, // 1 hour
});List Jobs
const jobs = await processes.list();
for (const job of jobs) {
console.log(`${job.id}: ${job.name}`);
console.log(` Status: ${job.status}`); // 'running' | 'stopped' | 'failed' | 'completed'
console.log(` PID: ${job.pid}`);
console.log(` Started: ${job.startedAt}`);
console.log(` Memory: ${job.memoryMB}MB`);
console.log(` CPU: ${job.cpuPercent}%`);
}Get Status
const status = await processes.getStatus(jobId);
console.log(`Status: ${status.status}`);
console.log(`Exit code: ${status.exitCode}`);
console.log(`Runtime: ${status.runtimeMs}ms`);
console.log(`Restarts: ${status.restarts}`);
console.log(`Memory: ${status.memoryMB}MB`);
console.log(`CPU: ${status.cpuPercent}%`);Get Output
// Get all output
const output = await processes.getOutput(jobId);
console.log(output.stdout);
console.log(output.stderr);
// Get last N lines
const output = await processes.getOutput(jobId, { tail: 100 });
// Stream output
const stream = processes.streamOutput(jobId);
stream.on('stdout', (data) => console.log(data));
stream.on('stderr', (data) => console.error(data));
stream.on('exit', (code) => console.log(`Exit: ${code}`));Stop Job
// Graceful stop (SIGTERM)
await processes.stop(jobId);
// Force kill (SIGKILL)
await processes.stop(jobId, { force: true });
// Stop all
await processes.stopAll();Restart Job
await processes.restart(jobId);Event Handlers
processes.on('started', (job) => {
console.log(`Job started: ${job.name}`);
});
processes.on('stopped', (job) => {
console.log(`Job stopped: ${job.name} (code: ${job.exitCode})`);
});
processes.on('failed', (job, error) => {
console.error(`Job failed: ${job.name}`, error);
});
processes.on('output', (job, type, data) => {
console.log(`[${job.name}] ${type}: ${data}`);
});---
Job Status
| Status | Description |
|---|---|
running | Currently executing |
stopped | Stopped by user |
completed | Finished successfully |
failed | Exited with error |
restarting | Auto-restarting |
---
Use Cases
Run Backtest
const job = await processes.spawn({
command: 'npm',
args: ['run', 'backtest', '--', '--strategy', 'momentum'],
name: 'backtest-momentum',
});
// Wait for completion
const result = await processes.wait(job.id);
console.log(`Backtest complete: ${result.exitCode === 0 ? 'success' : 'failed'}`);Train ML Model
const job = await processes.spawn({
command: 'python',
args: ['train.py'],
name: 'ml-training',
cwd: './ml',
maxMemoryMB: 8192,
timeoutMs: 86400000, // 24 hours
});
// Monitor progress
processes.streamOutput(job.id).on('stdout', (line) => {
if (line.includes('Epoch')) {
console.log(line);
}
});---
Best Practices
1. Name your jobs — Easier to identify 2. Set timeouts — Prevent runaway processes 3. Monitor memory — Prevent OOM kills 4. Use restart sparingly — Debug failures first 5. Check logs — Always review output
/**
* Processes CLI Skill
*
* Commands:
* /processes - List running processes
* /processes run <cmd> - Run a command
* /processes info - Current process info
* /processes kill <pid> - Kill a process tree
*/
async function execute(args: string): Promise<string> {
const parts = args.trim().split(/\s+/);
const cmd = parts[0]?.toLowerCase() || 'info';
try {
const proc = await import('../../../process/index');
switch (cmd) {
case 'info': {
const info = proc.getProcessInfo();
let output = '**Process Info**\n\n';
output += `PID: ${info.pid}\n`;
output += `PPID: ${info.ppid}\n`;
output += `CWD: ${info.cwd}\n`;
output += `Uptime: ${info.uptime.toFixed(0)}s\n`;
output += `Memory: ${(info.memory.heapUsed / 1024 / 1024).toFixed(1)}MB heap\n`;
return output;
}
case 'run':
case 'exec': {
const command = parts.slice(1).join(' ');
if (!command) return 'Usage: /processes run <command>';
const result = await proc.execute(command, { timeout: 30000 });
let output = `**Exit: ${result.exitCode}** (${result.duration}ms)\n`;
if (result.stdout) output += `\n\`\`\`\n${result.stdout.slice(0, 2000)}\n\`\`\``;
if (result.stderr) output += `\nStderr:\n\`\`\`\n${result.stderr.slice(0, 500)}\n\`\`\``;
return output;
}
case 'kill': {
const pid = parseInt(parts[1], 10);
if (isNaN(pid)) return 'Usage: /processes kill <pid>';
proc.killTree(pid);
return `Sent SIGTERM to process tree rooted at PID ${pid}.`;
}
case 'check': {
const bin = parts[1];
if (!bin) return 'Usage: /processes check <binary-name>';
const exists = proc.commandExists(bin);
return exists ? `\`${bin}\` is available on PATH.` : `\`${bin}\` not found on PATH.`;
}
case 'pool': {
const pool = proc.createProcessPool();
const stats = pool.getStats();
let output = '**Process Pool Status**\n\n';
output += `Active: ${stats.active}\n`;
output += `Idle: ${stats.idle}\n`;
output += `Total: ${stats.total}`;
await pool.shutdown();
return output;
}
default:
return helpText();
}
} catch (error) {
return `Process error: ${error instanceof Error ? error.message : String(error)}`;
}
}
function helpText(): string {
return `**Processes Commands**
/processes - Current process info
/processes run <command> - Execute a command
/processes kill <pid> - Kill process tree
/processes check <binary> - Check if binary exists
/processes pool - Process pool status`;
}
export default {
name: 'processes',
description: 'Process management - spawn, monitor, and control child processes',
commands: ['/processes', '/proc'],
handle: execute,
};
Related skills
FAQ
Can jobs restart automatically on failure?
Yes, spawn with restart:true and maxRestarts to auto-restart on exit.
How is job state stored?
It uses SQLite storage by default, configured via storage and dbPath.