skills/work-management/SKILL.md
Query, monitor, and analyze jobs on IBM i using SQL table functions via the ibmi CLI. Use when user asks about: (1) finding jobs by status, user, subsystem, or type, (2) monitoring active job performance (CPU, I/O, memory), (3) detecting long-running SQL statements, (4) analyzing lock contention, (5) checking job queues, (6) scheduled jobs, (7) job logs, (8) replacing WRKACTJOB, WRKUSRJOB, WRKSBSJOB, WRKSBMJOB commands, or (9) any IBM i work management task.
npx skillsauth add ajshedivy/ibmi-agent-skills work-managementInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Query, monitor, and analyze jobs on IBM i using SQL table functions QSYS2.JOB_INFO and QSYS2.ACTIVE_JOB_INFO.
The ibmi CLI is the primary tool for executing work management queries. Set SKILL_DIR to this skill's installed location (the directory containing this SKILL.md file):
# SKILL_DIR = directory containing this SKILL.md
# Examples: ./skills/work-management, ~/.claude/skills/work-management
# List all work management tools
ibmi tools --tools "$SKILL_DIR/tools/" --toolset work_management_default
# Run a specific tool
ibmi tool list_active_jobs --tools "$SKILL_DIR/tools/"
# Ad-hoc SQL for custom queries
ibmi sql "SELECT * FROM TABLE(QSYS2.ACTIVE_JOB_INFO(JOB_NAME_FILTER => '*')) X"
Use ibmi describe <schema>.<object> to verify columns and parameters before writing custom SQL.
Purpose: Find jobs across all states (active, queued, completed)
Use for:
*JOBQ)*OUTQ)Purpose: Monitor active jobs with performance metrics
Use for:
Get detailed information about your current connection's job
Set baseline and measure performance deltas over time intervals
Filter by interactive, batch, prestart, or system jobs
Identify jobs experiencing database and non-database lock waits
Always use UDTF filter parameters (not WHERE clause) for optimal performance:
JOB_STATUS_FILTER - *ALL, *ACTIVE, *JOBQ, *OUTQJOB_TYPE_FILTER - *ALL, *BATCH, *INTERACTJOB_SUBSYSTEM_FILTER - Subsystem name or *ALLJOB_USER_FILTER - User name, *ALL, *USER, or USER special registerJOB_SUBMITTER_FILTER - *ALL, *JOB, *USER, *WRKSTNJOB_NAME_FILTER - Job name or *ALLRESET_STATISTICS - YES/NO (establish measurement baseline)SUBSYSTEM_LIST_FILTER - Comma-separated subsystems (max 25)JOB_NAME_FILTER - *, *ALL, *CURRENT, *SBS, *SYS, or job nameCURRENT_USER_LIST_FILTER - Comma-separated users (max 10)DETAILED_INFO - NONE, WORK, QTEMP, FULL, ALL| Level | Returns | Authorization | Use Case |
|-------|---------|---------------|----------|
| NONE | Basic job info | None | Quick overview |
| WORK | + Work management | None | Job config, queues |
| QTEMP | + QTEMP_SIZE | *JOBCTL | Storage analysis |
| FULL | All except QTEMP/HOST | Special auth for SQL cols | Complete performance data |
| ALL | Complete | Special auth for SQL cols | Full SQL activity detail |
SQL Column Auth: QIBM_DB_SQLADM or QIBM_DB_SYSMON function usage identifiers
Job identity, status, type, subsystem, queue info, timing, completion status, configuration, regional settings, logging, output queues
Job identity, status, function, CPU usage, memory, I/O counts, elapsed statistics, SQL statement details, cursor metrics, lock waits, client connection info, QTEMP size
| CL Command | SQL Service | |------------|-------------| | WRKACTJOB | ACTIVE_JOB_INFO() | | WRKUSRJOB | JOB_INFO() + filter system jobs | | WRKSBSJOB | JOB_INFO(JOB_SUBSYSTEM_FILTER) | | WRKSBMJOB | JOB_INFO(JOB_SUBMITTER_FILTER) |
SELECT * FROM TABLE(QSYS2.ACTIVE_JOB_INFO(JOB_NAME_FILTER => '*')) X;
SELECT JOB_NAME, AUTHORIZATION_NAME, CPU_TIME
FROM TABLE(QSYS2.ACTIVE_JOB_INFO(SUBSYSTEM_LIST_FILTER => 'QUSRWRK,QBATCH'))
ORDER BY CPU_TIME DESC LIMIT 10;
SELECT * FROM TABLE(QSYS2.JOB_INFO(JOB_STATUS_FILTER => '*JOBQ')) X;
SELECT JOB_NAME, AUTHORIZATION_NAME,
TIMESTAMPDIFF(2, CAST(CURRENT_TIMESTAMP - SQL_STATEMENT_START_TIMESTAMP AS CHAR(22))) AS SECONDS,
SQL_STATEMENT_TEXT
FROM TABLE(QSYS2.ACTIVE_JOB_INFO(DETAILED_INFO => 'ALL'))
WHERE SQL_STATEMENT_STATUS = 'ACTIVE'
ORDER BY SECONDS DESC;
SELECT * FROM TABLE(QSYS2.JOB_INFO(JOB_USER_FILTER => 'USERNAME')) X;
The tools/work-management.yaml file provides 12 ready-to-use tools:
| Tool | Description |
|------|-------------|
| list_active_jobs | Active jobs with CPU, status, and subsystem filter |
| get_job_info | Detailed info for a specific qualified job name |
| list_scheduled_jobs | Scheduled jobs with dates, times, and frequency |
| list_subsystems | Active subsystems with aggregated job metrics |
| list_job_queues | Job queues with status and job count breakdowns |
| get_job_log_entries | Job log messages for a specific job |
| find_long_running_sql | Active SQL statements sorted by elapsed time |
| find_jobs_by_user | All jobs for a user across all statuses |
| list_subsystem_info | Subsystem configuration with max/current active jobs and monitor job |
| list_ended_jobs | Recently ended jobs with CPU time, end code, and completion detail |
| list_job_descriptions | Job descriptions with user, job queue, routing, and logging settings |
| list_autostart_jobs | Autostart job entries configured in subsystem descriptions |
An additional work_management_locks toolset provides get_object_lock_info, get_record_lock_info, and get_job_lock_info for contention analysis.
ibmi tool <tool_name> --tools "$SKILL_DIR/tools/" # Execute
ibmi tool <tool_name> --tools "$SKILL_DIR/tools/" --dry-run # Preview SQL
ibmi tools show <tool_name> --tools "$SKILL_DIR/tools/" # View details
testing
Monitor IBM i system health including CPU, memory, disk, ASPs, system limits, and network status via SQL services. Use when user asks about: (1) CPU utilization or system status, (2) memory pool sizes or page faults, (3) disk capacity or ASP usage, (4) system limits approaching thresholds, (5) TCP/IP connections and network status, (6) system activity overview, (7) replacing WRKSYSSTS, WRKDSKSTS, WRKTCPSTS commands, or (8) any system health monitoring task.
development
Monitor and analyze IBM i storage resources including ASPs, disk units, temporary storage, user storage consumption, and NVMe devices via SQL services. Use when user asks about: (1) ASP capacity, usage, or health, (2) disk unit status or I/O performance, (3) temporary storage consumption by jobs, (4) storage used per user profile, (5) NVMe device health, (6) IASP vary operations, or (7) replacing WRKDSKSTS, WRKSYSSTS storage info, or WRKSTG commands.
testing
Manage and analyze spooled files, output queues, and printer configurations on IBM i via SQL services. Use when user asks about: (1) listing or searching output queues, (2) viewing spooled file entries by queue, user, or status, (3) reading spool file content, (4) identifying top spool consumers or old spool files, (5) printer file definitions, (6) spool storage analysis, (7) replacing WRKSPLF, WRKOUTQ, WRKOBJLCK commands, or (8) any spool file management task.
development
Assess IBM i security posture including user privileges, object authorities, vulnerability detection, and function usage via SQL services. Use when user asks about: (1) user profiles with special authorities or limited capabilities, (2) object privileges and *PUBLIC authority exposure, (3) files vulnerable to trigger, rename, or library list attacks, (4) user impersonation vulnerabilities, (5) group profile membership, (6) function usage and access control, (7) security audit and compliance, or (8) replacing WRKOBJAUT, DSPUSRPRF, DSPAUTL commands.