# AI Documentation Generator

A multi-agent system that analyzes a codebase's structure, dependencies and APIs in parallel and generates a README plus AI-assistant configuration files, with a GitLab mode that opens merge requests automatically.

AI Documentation Generator automatically analyzes a code repository and produces documentation using large language models. Five specialized analysis agents run concurrently to map a codebase's structure, dependencies, data flow, request flow and APIs, writing their findings as reusable analysis documents; generation agents then turn those analyses into a polished README and into configuration files for AI coding assistants, such as CLAUDE.md, AGENTS.md and Cursor rule files.

It can run as a GitLab cronjob that discovers recently active projects, runs the analysis, and opens merge requests with fresh documentation on its own, or interactively as an installable Claude Code plugin with skills for analyzing a codebase, generating a README, and generating assistant rule files. It works with any OpenAI-compatible API, including Anthropic-compatible gateways, OpenRouter or local models, with per-agent model settings, retries with exponential backoff, and OpenTelemetry tracing.

It is written in Python with Pydantic AI, and runs agent analysis concurrently with a configurable worker pool.

Website: https://github.com/divar-ir/ai-doc-gen
