Slash commands
Use IBM i-specific slash commands to re-use pre-defined prompts that automate repetitive tasks.
IBM Bob Premium Package for i extends Bob's built-in slash commands with a set of IBM i-specific slash commands. For a general introduction to how slash commands work and what the built-in ones are, see Slash Commands.
Type / in the chat to see all available commands, including the IBM i-specific ones described here.
/init
The /init command analyzes your active IBM i workspace and generates an AGENTS.md file tailored to your codebase. It documents non-obvious architecture, source structures, database conventions, and project standards so Bob automatically follows them across all future chat sessions.
| Property | Value |
|---|---|
| Command | /init |
| Argument | None |
| Available in | IBM i Developer, IBM i Database |
| Requires | Active IBM i connection (QSYS Current Library or IFS Working Directory configured) |
What it does
Bob follows these steps:
Pre-flight check:
- In a QSYS (Library List) workspace, verifies that a current library is set. If the current library is an IBM-supplied system library (such as
QGPLorQTEMP), Bob alerts you and suggests switching to an application library before proceeding. - In an IFS Working Directory workspace, verifies that a working directory is configured (rather than the entire root
/).
Workspace analysis:
- Inspects source physical files, member types, and directory layouts. For large libraries or folders, Bob summarizes counts and patterns rather than listing every file, keeping the summary compact.
- Discovers ILE architecture patterns (service programs, binding directories, activation groups), IWS web service definitions, database objects (physical files, logical files, journaling), and project naming conventions.
Generate or update AGENTS.md:
- Writes the generated guidelines to
{currentLibrary}/QBOBSRC/AGENTS.MDfor QSYS workspaces, or{ifsWorkingDirectory}/.bob/AGENTS.mdfor IFS workspaces. - If
AGENTS.mdalready exists, Bob updates it with the latest findings while preserving any custom guidelines or manual edits you previously added.
Real-time sync:
- The generated rules are immediately loaded into memory and automatically injected into every conversation in IBM i Developer and IBM i Database modes without requiring a reconnect.
Adding custom rules and standards
You can add your own team-specific coding standards, architectural rules, naming conventions, and preferred practices directly into AGENTS.md.
You can either:
- Edit the file manually: Open
{currentLibrary}/QBOBSRC/AGENTS.MDor{ifsWorkingDirectory}/.bob/AGENTS.mdin the editor and add your custom guidelines. - Instruct Bob during
/init: When running/init, you can prompt Bob to include specific rules or standards. For example:"/init and make sure to enforce free-format RPG and our standard error-handling subprocedures""/init and document our naming conventions: all service programs must start with SRV_"
Example usage
/init
/init and add our team rules: prefer SQL over RLA and use *NEW activation groups for main programs/erd
The /erd command instructs Bob to generate a Mermaid style Entity Relationship Diagram (ERD) for a set of database tables on the connected IBM i.
| Property | Value |
|---|---|
| Command | /erd |
| Argument | [schema.table or library/file] |
| Available in | IBM i Developer, IBM i Database |
| Requires | Active IBM i connection |
What it does
Bob follows these steps:
Determine scope from the argument you provided or ask which schema/library to analyze if no argument is given.
Query QSYS2.SYSTABLES, QSYS2.SYSCOLUMNS, QSYS2.SYSCST, and QSYS2.SYSREFCST to gather table structure and relationships.
Build and render a Mermaid style Entity Relationship Diagram (ERD) with accurate Db2 for i data types, column markers (PK, FK, UQ), and cardinality notations.
Example usage
/erd
/erd MYLIB
/erd MYAPP.ORDERS
/erd MYPROJ/CUSTOMER/review_SQL
The /review_SQL command instructs Bob to perform a comprehensive review of an SQL statement, using a collection of best practices. It can accept a stand-alone SQL statement or refer to source code that contains one or more SQL statements.
| Property | Value |
|---|---|
| Command | /review_SQL |
| Argument | [SQL statement or source code path] |
| Available in | IBM i Database |
| Requires | Active IBM i connection |
What it does
Bob follows these steps:
Parse the SQL statement from the provided argument or ask for one if no argument is given.
Evaluate the statement against a comprehensive review checklist:
- Correctness and simplification: Correctness concerns, redundant predicates, fragile constructs, nested subqueries, repeated expressions, and unnecessary joins
- Readability and supportability: Formatting, aliases, and comments on complex logic
- Qualification and naming: Table correlation and meaningful names
- Best practices: Usage of built-in functions, CTEs, and statement reuse
- Security: Least privilege, deny by default, protection against SQL injection, and more
- Performance: Data type alignment, unnecessary scalar functions in predicates, non-probable predicates, avoidable casts, and other SQL Query Engine best practices
- Statement-type-specific guidance: Specifics for Data Definition Language (DDL), Data Manipulation Language (DML), embedded SQL, and dynamic SQL
- Diagnostic and verification guidance: Visual Explain, plan cache, and index advice pointers
- Reusable logic: UDFs and stored procedures
- Transaction isolation: Explicit
WITHclauses and isolation level consistency
Return the findings structured as:
- Summary: Brief overall assessment
- Confirmed Findings: Numbered list of issues each with a category, explanation, and suggested improvement
- Conditional Recommendations: Numbered list of suggestions that depend on metadata, workload, or runtime evidence
- Revised SQL: A revised SQL statement only when semantics can be preserved confidently; otherwise an illustrative rewrite with an explanation of what remains conditional
- Explanation of Changes: Concise description of each suggested change
Example usage
/review_SQL
/review_SQL SELECT * FROM ORDERS WHERE CUSTID = '12345'
/review_SQL mylib/mysrc(mycode)
/review_SQL /home/scottf/RPGsrc/toystore.rpglesrc/review_rpg
The /review_rpg command instructs Bob to perform a dedicated code review on an RPG source member or stream file, evaluating syntax, language best practices, coding standards, error handling, security, and modernization opportunities across both fixed-form and free-form RPG.
| Property | Value |
|---|---|
| Command | /review_rpg |
| Argument | [source member or stream file path] |
| Available in | IBM i Developer |
| Requires | Active IBM i connection |
What it does
Bob follows these steps:
Validate that the target file is a valid RPG source (e.g. .RPGLE, .SQLRPGLE, .RPG, .RPG36, or .RPG38). Non-RPG sources such as CL, COBOL, DDS, or pure SQL are rejected before review rules are loaded.
Determine the RPG source format (fixed-form, free-form, or mixed) and load the appropriate review skills.
Evaluate the RPG code against language best practices:
- Syntax and format rules: Specification column placement, comment formatting, and subprocedure placement
- Coding standards: Naming conventions, indentation, and structure
- Error handling and reliability: Monitor blocks, status checking, and file error handling
- Security: Adopted authority and injection risks in dynamic operations
- Performance and database operations: Record-level access vs. embedded SQL, blocking, and cursor management
- Modernization opportunities: Converting legacy fixed-form constructs, eliminating indicators, and refactoring subroutines to subprocedures
Return the findings structured as:
- Detected Format: Source variant and format classification
- Summary: High-level review assessment
- Critical Issues: Severe syntax, security, or runtime defects
- Major Issues: Structural flaws, performance bottlenecks, or unhandled errors
- Minor Issues: Style inconsistencies and minor cleanup
- Modernization Roadmap: Actionable steps to modernize legacy RPG code
Example usage
/review_rpg
/review_rpg MYLIB/QRPGLESRC/MYPGM.RPGLE
/review_rpg /home/user/src/order_processing.rpgle
/review_rpg /user/ibmi_local/FLIGHT400/QRPGLESRC/FRS400.rpgle