Atlas helps OCaml developers in 2026 produce accurate, current documentation for modules by directly reading source code, dune build rules, and .mli interface files. It leverages tools like lsp for API enumeration, read for implementation details, and ocamlformat for style-clean diffs, ensuring your README reflects the code's actual behavior today, not its historical intent.
How Atlas Documents OCaml Modules with READMEs
In 2026, Atlas streamlines OCaml module documentation by directly analyzing your codebase to produce accurate READMEs. It starts by enumerating the public API using the lsp tool's documentSymbol operation, ensuring no export is missed. This process guarantees a comprehensive 1:1 mapping from code to documentation.
Atlas approaches OCaml module documentation by treating your source code as the single source of truth. Instead of relying on outdated comments or developer memory, Atlas uses its lsp tool to perform a documentSymbol operation, which precisely enumerates the public API of your OCaml module. This ensures that every exported function, type, or value defined in your .mli interface files is captured and documented, preventing omissions or invented features. Once the public surface is identified, Atlas employs its read tool to delve into the implementation of each export. This step gathers the actual behavior and logic of your OCaml code. To further enrich the documentation, Atlas uses codebase_search to find real-world examples of how these exports are used within your repository. This provides concrete usage patterns and context, making the generated README highly practical for other OCaml developers. By deriving all information directly from the codebase, Atlas ensures that the documentation is traceable and reflects what the code actually does today, not what it was intended to do a year ago.
Integrating OCaml Toolchain for Accurate Documentation
Atlas deeply integrates with the OCaml toolchain to ensure documentation accuracy and consistency. It reads dune build rules, .mli interface files, and opam switch packages to understand your project's structure and dependencies. This allows Atlas to generate READMEs that reflect the current state of your code in 2026.
To produce truly OCaml-native documentation, Atlas is designed to understand and interact with the core components of the OCaml ecosystem. It operates within a workspace containing a dune-project at its root, allowing it to read each dune stanza and comprehend your project's build configuration. This understanding is crucial for accurately identifying modules and their dependencies. Atlas also parses your .mli interface files, which are fundamental in OCaml for defining module signatures and public APIs. By reading these files, Atlas gains a precise understanding of what your module exposes. Furthermore, it inspects the packages pinned in your opam switch, providing context about your project's external dependencies. This comprehensive understanding of the OCaml toolchain enables Atlas to generate READMEs that are not only accurate but also contextually relevant to your specific OCaml project. Before writing the documentation, Atlas uses its grep tool to search for an existing README.md file in your repository, allowing it to match the established heading structure and tone rather than inventing a new format. Finally, the write tool emits the README, quoting real OCaml signatures and file paths, and every code sample is verified by running it with bash, ensuring it is a liability-free, executable example.
Reviewing and Approving OCaml Documentation Changes with Atlas
Atlas prioritizes safety and accuracy when generating OCaml documentation, employing a multi-stage approval process. Every Atlas tool call, including write operations for READMEs, is permission-gated against allow, ask, and deny rules. This ensures you maintain full control over 100% of the changes made to your project.
The integrity of your OCaml codebase is paramount, and Atlas is built with robust safety mechanisms. Before any action is taken, Atlas drafts a plan in a read-only plan agent, which you can review. Only after your explicit approval does it switch to a build agent to execute the plan. Every Atlas tool call, whether it's lsp, read, codebase_search, grep, write, or bash, is permission-gated. This means you can configure Atlas to ask for permission before running certain tools, or even deny them outright, giving you granular control over its operations. When Atlas proposes changes to your README.md or any other file, it computes a unified diff for every edit. This diff is surfaced for your approval, allowing you to see precisely what modifications will be made before they are written to disk. Atlas also integrates with git, reading branches, status, and diffs, and can stage and create commits on your behalf, always with your approval. To ensure the final output is pristine, Atlas finishes by running ocamlformat on the modified files. This guarantees that the diff is style-clean and adheres to your project's OCaml formatting standards before you approve the commit, making the review process straightforward and efficient.
Step by step
- 01Run Atlas in your OCaml workspace, ensuring a dune-project file is at the root.
- 02Let Atlas read each dune stanza, your .mli signatures, and the packages pinned in your opam switch.
- 03Ask Atlas to enumerate the module's public API using the lsp tool's documentSymbol operation.
- 04Instruct Atlas to read the implementation of each OCaml export and use codebase_search to find how callers actually use it.
- 05Have Atlas grep the repository for an existing README.md to match its heading structure and tone.
- 06Approve Atlas to write the new README.md, quoting real OCaml signatures and file paths.
- 07Verify every OCaml code sample in the generated README.md by running it with the bash tool.
- 08Let Atlas finish with ocamlformat so the diff is style-clean before you approve the final commit.
Frequently asked questions
- How does Atlas ensure OCaml documentation is up-to-date?
- Atlas reads your OCaml source code, dune configurations, and .mli interface files directly, ensuring documentation reflects the current state of the codebase, not outdated assumptions.
- Can Atlas document OCaml modules with complex dune rules?
- Yes, Atlas is designed to read and understand dune stanzas and build rules, allowing it to accurately document modules within complex OCaml project structures.
- What OCaml tools does Atlas use for documentation?
- Atlas leverages the lsp tool for API enumeration, read for implementation details, codebase_search for usage patterns, and bash to verify OCaml code samples. It also respects ocamlformat for style.
- How does Atlas handle existing OCaml README files?
- Atlas uses the grep tool to find existing README.md files in your OCaml repository, matching their heading structure and tone rather than inventing a new format.
- Is it safe to let Atlas modify my OCaml project's README?
- Yes, Atlas operates with permission-gated tool calls and presents a unified diff for every file edit, including README.md changes. You must approve all modifications before they are written.
- Does Atlas support OCaml projects managed with opam?
- Absolutely. Atlas reads the packages pinned in your opam switch, providing it with a complete understanding of your OCaml project's dependencies and environment.
- How does Atlas verify OCaml code examples in documentation?
- Atlas uses the bash tool to execute every OCaml code sample it includes in the documentation. This ensures that all examples are functional and accurate, preventing the inclusion of broken code.
Try Atlas in your terminal
The terminal-native AI coding agent. Free core, single binary.
Install AtlasRelated guides
Document a Module with a README Using Atlas (2026 Workflow)
How to document a module with a README using Atlas in 2026: the lsp tool's documentSymbol enumerates the real exports, read supplies the behavior, write emits the README.
Atlas for OCaml: A Terminal-Native AI Coding Agent for dune and opam Projects in 2026
Atlas is a terminal-native AI coding agent for OCaml in 2026. It reads dune stanzas and .mli signatures, runs dune runtest behind a prompt, and finishes with ocamlformat.
Debug a single failing test in OCaml with Atlas in 2026
Pinpoint and fix failing OCaml tests with Atlas, the terminal-native AI coding agent. Leverage dune runtest, opam, and ocamlformat for efficient debugging in 2026.
Rename a symbol across the repo in OCaml with Atlas in 2026
Learn how Atlas renames OCaml functions, classes, and constants across your repository in 2026. Leverage lsp, grep, edit, and dune for precise, verified refactoring.
Audit an OCaml Repository with Parallel Subagents in Atlas, 2026
Sweep an OCaml repository for specific problems using Atlas's parallel subagents. Leverage `dune`, `opam`, and `ocamlformat` for efficient, context-window-friendly audits.
Refactor a legacy module in OCaml with Atlas in 2026
Restructure an old OCaml module without breaking callers using Atlas. Map public surfaces, pin behavior with dune runtest, apply changes with apply_patch, and ensure style with ocamlformat.
Review a pull request in OCaml with Atlas in 2026
In 2026, Atlas helps OCaml developers review pull requests by fetching diffs, reading full files, checking .mli signatures, running dune runtest, and applying ocamlformat.
Automate GitHub Issue and Pull Request Triage in OCaml with Atlas in 2026
Automate GitHub issue and pull request triage for OCaml projects in 2026 using Atlas. Ensure safe, permission-gated responses from trusted users, integrating with `dune` and `opam`.