This guide demonstrates how to use the Ona agent to autonomously generate documentation for complex, legacy, or difficult-to-understand codebases. Ona can traverse entire codebases, analyze assembly code, extract meaningful insights, and create complete documentation sites without human intervention.

Caption: Video showing Ona understanding a complex, legacy codebase and documenting it. Using the Lunar 11 landing module as the example.

Prerequisites (optional)

Giving Ona the ability to run any applications will produce better results. Configure your environment with Dev Container before launching an Ona conversation to create your documentation.

  • Give access to the codebase to be documented (example using Apollo 11)
  • Install any necessary build tools and dependencies

Example using Hugo and Jekyll

{
  "features": {
    "ghcr.io/devcontainers/features/hugo:1": {
      "version": "latest"
    },
    "ghcr.io/devcontainers/features/ruby:1": {
      "version": "3.1"
    },
    "ghcr.io/devcontainers/features/node:1": {
      "version": "18"
    }
  },
  "postCreateCommand": "gem install jekyll bundler"
}

Example Prompts

Basic documentation

Please analyze this codebase and create comprehensive documentation. Focus on:
- System overview and architecture
- Key components and their interactions
- Setup and installation instructions
- Developer getting-started guide

Generate a documentation site that can be served locally for review.

Advanced documentation

This codebase contains complex assembly language and legacy code. Please:
1. Traverse the entire codebase and identify all major components
2. Analyze the system architecture and data flow
3. Create detailed documentation including:
   - System requirements and constraints
   - Architectural overview with diagrams
   - Module-by-module breakdown
   - Developer guides for extending the code
4. Generate a complete documentation site using a static site generator
5. Create a pull request with the documentation changes