Ibmi review

From Crapule421/tiger-team · View interactive version

Ibmi review is an AI agent skill from the GitHub repository Crapule421/tiger-team. Analyze an IBM i artifact (RPG, CL or COBOL program, job, or interface over Db2, data queue, MQ, REST, FTP/CFT) - what it does, then findings on error handling, locking, CCSID, security and restartability. Use before modifying legacy code.

How to use this skill

Skill file

IBM i review - program, job or interface

Input: $ARGUMENTS

You do not see the prior conversation: work only from the input above and the files it points to.

0. Intake

1. Confidentiality gate (mandatory, before any analysis)

Stop and ask the user for an anonymized version - without producing the review - if the input contains:

Reply only with the category detected (never quote the value), its location (file:line), and a request for a sanitized version (fictitious library/system names like APPCPT, SRV-IBMI-01, <PASSWORD> placeholders). Source code with business identifiers removed is fine.

2. Load knowledge

Read ${CLAUDE_PLUGIN_ROOT}/skills/ibmi-reference/SKILL.md, focusing on the sections matching the artifact: RPG (2), CL (3), COBOL (4), DB2 for i (5), work management (6), spool (7), IFS (8), security (9), integration (10), HA (11), scheduling (12), CCSID (13), messages (14) and always the review checklist (15).

If the artifact is a job inside a scheduler chain (VTOM, Dollar Universe, Control-M), also Read ${CLAUDE_PLUGIN_ROOT}/skills/scheduling-reference/SKILL.md (sections 3 and 5: restartability, exit-code contract, incident method).

3. Identify the artifact

4. Analysis

4.1 Explain first

Plain-language description: purpose, inputs (files/tables, parameters, data queues), outputs (updates, files, spooled files, messages), main logic steps, side effects, external calls. Include a short call/data flow (Mermaid flowchart LR) when there are more than three objects.

4.2 Review axes (cite file:line for each finding)

| Axis | Programs (RPG/CL/COBOL) | Jobs | Interfaces |

|---|---|---|---|

| Error handling | SQLSTATE checks, MONITOR, FILE STATUS, unhandled exceptions (MSGW risk), CL escape propagation, swallowed MONMSG CPF0000 | ENDSEV, INQMSGRPY, reply list, escape vs normal end seen by the scheduler | Error responses, retries, dead-letter, partial failures |

| Data integrity and restart | Commitment control and journaling, commit frequency, restart key, idempotent rerun, cleanup | Restart procedure, rerun effect, checkpoint | Exactly-once vs at-least-once, duplicates detection, acknowledgments |

| Locking and performance | Update-capable reads, lock duration, row-by-row SQL, missing indexes, SELECT *, full scans | Job queue/subsystem concurrency (MAXACT), run priority, collisions with saves | Host server load, connection pooling, batch size |

| Data and CCSID | Packed/zoned handling, date formats and 2-digit years, overflow/truncation, CCSID 65535, variant characters | Job CCSID | Encoding conversions, EBCDIC/ASCII, sign nibbles, collation, record layout |

| Libraries and environment | Hard-coded libraries, *LIBL assumptions, overrides scope, naming *SYS vs *SQL | JOBD INLLIBL, USER, JOBQ, LOG | Library list of host-server jobs (JDBC/ODBC properties) |

| Security | Hard-coded credentials, adopted authority (USRPRF(*OWNER)), QCMDEXC/dynamic SQL with external input, object ownership/*PUBLIC | Run-as profile privileges (special authorities), PASSWORD(*NONE) | Exit programs, TLS, plaintext FTP, authentication of callers |

| Operability | Meaningful messages, job log level, counts logged | Run book, monitoring of MSGW/long runs, QSYSOPR | Monitoring, alerting, traceability |

| Maintainability | Indicators, GOTO/TAG, cycle logic, copybook prototypes, service program design, dead code | Scheduling via WRKJOBSCDE vs enterprise scheduler | Versioning, contract documentation |

Severity: Critical (data corruption or loss, security bypass, live secret, silent failure reported as success in a critical chain), High (no commitment control on multi-update logic, MSGW risk in batch, non-idempotent rerun without procedure, CCSID corruption of amounts), Medium (performance, missing monitoring, hard-coded libraries), Low (style, readability, modernization comfort).

5. Output (Markdown)

Summary

Artifact, assumed release, what it does in 2-3 sentences, verdict (Safe to run/integrate / Fix before change / Not acceptable), counts per severity, top 3 actions.

What it does

Plain-language walkthrough (section 4.1) and the flow diagram if useful.

Findings

| ID | Severity | Axis | Evidence (file:line) | Issue | Fix |

|---|---|---|---|---|---|

Sort by severity; one row per root cause with all line references.

Fixes

For each Critical/High finding: corrected code snippet (same language and style level as the source, or **FREE if converting is proposed) and how to test it (test case, data, expected result). Anything depending on release/TR or PTF level is marked "verify against your release".

Restart and operations

How to rerun safely, what to clean up first, what the scheduler sees on failure, recommended JOBD/job log settings.

Modernization options

Only those that reduce risk or cost (e.g. free-form conversion, SQL instead of RLA in batch, service program extraction, exposing via SQL views/procedures or IWS), each with effort (S/M/L) and prerequisite.

Risks

| Risk | Criticality | Mitigation |

|---|---|---|

| ... | Critical/High/Medium/Low | ... |

Handoffs

Only when there is a real point, one typed line per handoff: → <agent-name> | <claim: what you assert or need, one sentence> | <evidence: source, file:line, or "assumption"> | <needs: confirm / adjust / provide <what>>. Names: project-manager, enterprise-architect, devsecops-expert, security-expert, dba-expert, scheduling-expert, integration-expert, erp-expert, infra-expert, ibmi-expert. Example: → infra-expert | the CFT acknowledgment flow SRV-SAP-01 → SRV-BATCH-01 is missing from the flow matrix | interface contract §4 | provide the firewall rule and port. A settled point is not a handoff.

Open questions

Numbered, each stating why it matters (e.g. missing DDS of a file, caller unknown, commit mode at compile time).

Assumptions

Numbered list of every assumption (release, compile options, file definitions, library list, profile, scheduler).

Answer in the language used in the input.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.