When you begin working with IBM Bob on a new or existing RPGLE, CLLE, or SQLRPGLE project, one of the smartest things you can do is properly initialize Bob with your codebase. This is where the /init command and the AGENTS.md files come in.
Bob is powerful, but like all large language models it is stateless: Every new chat starts with no memory of your project.
The /init command fixes this by scanning your project and creating persistent documentation that Bob automatically reads in every conversation and every mode.
This is especially valuable on IBM i where we have specific conventions: library structures, naming standards for programs and service programs, free-format RPGLE preferences, error handling patterns, and more.
Let's dive into teaching BOB about our codebase!
Make sure you have the following ready before you start:
- Your IBM i source code open in the Bob IDE. This is usually your local workspace folder that contains your source members (either mirrored from QSYS.LIB, stored in IFS or downloaded to your local PC from a repository like github.
- Recommended: Start with a clean project folder that includes your typical IBM i source physical files such as QRPGLESRC, QCLLESRC, QDDSSRC, or your IFS-based source tree. Rename folders into the structure you like before initializing BOB. This way BOB will learn how you like things to look.
How to Initialize Your Project with /init
Follow these steps to give Bob deep knowledge of your IBM i application:
Bob scans your project, reviewing RPGLE programs, CL scripts, database files, and the overall structure. From there, it generates two key items: a main AGENTS.md file at the root of your project, and a .bob folder containing mode-specific AGENTS.md files.
Understanding the AGENTS.md Files
The AGENTS.md files act as permanent project documentation specifically written for Bob. They tell him about:
- Your overall application purpose
- Directory and library structure
- Coding standards and naming conventions (very important for consistent RPGLE code)
- Technology stack (RPG IV free-format, SQLRPGLE, CLLE, etc.)
- Common architectural patterns you use
You will see several files created:
File Path | Purpose |
|---|---|
AGENTS.md | Main project context |
.bob/rules-code/AGENTS-code.md | Context specifically for Code mode |
.bob/rules-plan/AGENTS-plan.md | Context for planning new features |
.bob/rules-ask/AGENTS-ask.md | Context for Ask mode |
.bob/rules-advanced/AGENTS-advanced.md | Context for Advanced mode |
Bob automatically loads the correct AGENTS.md files depending on which mode you are using. This makes his suggestions much more relevant to your IBM i environment.
Maintaining Your Project Context
You should re-run the /init command whenever you make significant changes to your project, such as:
- Adding new service programs or major RPGLE modules
- Changing your naming standards or file organization
- Introducing new technologies (for example, moving more code to SQLRPGLE)
- Restructuring libraries or IFS folders
You can also manually edit the AGENTS.md files to add important details that Bob might not automatically detect, such as:
- Your shop's specific error handling standards
- Security and authority checking rules
- Deployment and promotion procedures
- Business logic that is important for new development
Why This Matters for IBM i Developers
Taking a few minutes to run /init at the start of a project (or when onboarding Bob to an existing legacy application) will save you hours later. Bob will understand your coding style better, suggest more accurate RPGLE code, and respect your CL and SQL standards from the very beginning.
This is one of the highest-return steps you can take when working with Bob on the IBM i platform.
Ready to take the next step? In the following lessons we will look at generating code predictions and building new features with Bob.
