AI Doc Gen (Divar)
Five concurrent AI agents analyze your codebase and generate README, CLAUDE.md, AGENTS.md and more — keeping documentation fresh and developer onboarding fast.
- Source repo
- divar-ir/ai-doc-gen
- Stars
- ★ 771
- Last updated
- 3mo ago
- License
- MIT
- Primary language
- Python
- FA score
- 53/100 · Major gaps
At a glance
- How it runs
- Works with
- Universal · cross-platformClaude Code · OpenAI API
- Cost
- Free software; you pay for model usage
- Setup effort
- Medium · a few setup steps
- You'll need
- Typical use
- An engineering team inheriting a large unfamiliar codebase needs onboarding docs covering architecture, dependencies, and data flow quickly.
- Not a fit if
- Environments stuck on Python 3.12 or older, unable to move to 3.13
- GitHub-centric teams wanting automated merge-request workflows
- Maintenance
- Commits in the last 6 monthslast commit 2026-07-21
- Source review
- 53/100 · Major gaps
What does this agent do, and when should you use it?
ai-doc-gen is an open-source multi-agent documentation generator from Divar. Five specialized analysis agents run concurrently to map a repository's code structure, dependencies, data flow, request flow, and APIs, writing reusable analysis documents to .ai/docs/. A DocumenterAgent then produces a README.md, while an AIRulesGeneratorAgent concurrently emits CLAUDE.md, AGENTS.md, and Cursor rules files. The repository also ships as an installable Claude Code plugin exposing three skills: analyze-codebase, generate-readme, and generate-ai-rules. It works with any OpenAI-compatible API with per-agent model/endpoint settings, and a GitLab cronjob mode discovers active projects and opens merge requests automatically. Observability is covered by logfire/OpenTelemetry with optional Langfuse integration.
Running uv run src/main.py analyze --repo-path . has AnalyzerAgent coordinate five analysis agents (code structure, data flow, dependencies, request flow, APIs) through a configurable worker pool (ANALYZER_MAX_WORKERS, 0 = auto-detect CPU count); each agent reads files via FileReadTool and ListFilesTool, and analysis documents are written to .ai/docs/. The generate readme command invokes DocumenterAgent to build a README.md from those analyses; generate ai-rules invokes AIRulesGeneratorAgent to concurrently produce CLAUDE.md, AGENTS.md, and .cursor/rules/*.mdc. The cronjob analyze command uses python-gitlab to discover recently active GitLab projects, run analysis, and open merge requests. Configuration layers Pydantic defaults, .ai/config.yaml, and CLI flags, with per-agent model and endpoint settings.
- An engineering team inheriting a large unfamiliar codebase needs onboarding docs covering architecture, dependencies, and data flow quickly.
- Developers using Claude Code or Cursor want one-shot generation of CLAUDE.md, AGENTS.md, and .cursor/rules/ so AI coding assistants understand project conventions.
- A platform team maintaining many GitLab projects schedules a Kubernetes CronJob to re-analyze active repos and deliver updated docs as merge requests.
- Legacy projects with stale READMEs regenerate documentation via --use-existing-readme, using the old file as context.
- Teams preferring self-hosted or OpenRouter models configure per-agent endpoints instead of committing to OpenAI.
Key setup facts
Pulled from the install and usage notes below. The project README has the current values.
- Config files
.env.sample.envconfig_example.yaml.ai/config.yaml- Runtime
- Python 3.13
- Install notes cover
- Docker
How do you install or deploy this agent?
Option 1 (Claude Code plugin, no API keys or Python needed): inside Claude Code run /plugin marketplace add divar-ir/ai-doc-gen and /plugin install ai-doc-gen@divar. Option 2 (local CLI): requires Python 3.13, Git, and API access to an OpenAI-compatible LLM provider. Clone with git clone https://github.com/divar-ir/ai-doc-gen.git && cd ai-doc-gen, then install with uv sync (recommended) or pip install -e . For containers, a Dockerfile and Helm chart (k8s/helm/) support Docker and scheduled Kubernetes CronJob deployments.
How do you use this agent?
- Configure: cp .env.sample .env and fill in LLM API keys and base URLs; mkdir -p .ai && cp config_example.yaml .ai/config.yaml. 2. Analyze:
uv run src/main.py analyze --repo-path. — results land in .ai/docs/. 3. Generate README:uv run src/main.py generate readme --repo-path. 4. Generate AI assistant files:uv run src/main.py generate ai-rules --repo-path. 5. GitLab batch mode:uv run src/main.py cronjob analyze, optionally with --max-days-since-last-commit 14. Skip specific analyses with flags like --exclude-code-structure, cap concurrency with --max-workers 2; an ai-doc-gen console script exposes the same CLI after install.
What are this agent's strengths and limitations?
- Five specialized agents analyze in parallel (structure, data flow, dependencies, request flow, APIs), producing richer coverage than a single one-shot LLM prompt.
- Doubles as a Claude Code plugin usable via three skills with no API keys or Python setup, while also functioning as a standalone CLI.
- Model-agnostic: works with any OpenAI-compatible API (OpenRouter, local models) with per-agent model/endpoint configuration, avoiding vendor lock-in.
- Production-minded details: HTTP retries with exponential backoff and Retry-After (429 handling), agent-level retries, and logfire/OpenTelemetry plus Langfuse observability.
- GitLab cronjob mode automatically discovers active projects and delivers docs as merge requests, fitting continuous maintenance.
- Requires the relatively new Python 3.13 runtime, forcing upgrades in older environments.
- It is analysis-driven generation that calls LLM APIs, so ongoing usage incurs API costs.
- GitLab automation depends on python-gitlab credentials and cronjob deployment (Docker/Helm/K8s); there is no equivalent automated path for GitHub workflows.
- Output quality depends on the underlying model; the README provides no quality benchmarks or evaluation evidence.
- Outputs target specific AI assistant formats (CLAUDE.md, AGENTS.md, Cursor rules); teams on other tools must assess fitness themselves.
How does this agent compare with similar options?
Key facts side by side with the most closely related agents.
| Agent | Source review | Form / cost | Stars | Updated | Language | Full support on |
|---|---|---|---|---|---|---|
| AI Doc Gen (Divar) This agent | 53 · Major gaps | CLIFree + model costs | ★ 771 | 3mo ago | Python | Claude Code · OpenAI API |
| Code Puppy | 56 · Major gaps | CLIFree + model costs | ★ 880 | 7d ago | Python | Codex · OpenAI API · Claude API |
| RepoBrain – Repo Intelligence Engine | 54 · Major gaps | Agent plugin / skillFree + model costs | ★ 1.4k | 5d ago | Python | Codex · Claude Code |
| Cortex | 49 · Major gaps | — | ★ 13 | 7mo ago | — | Claude Code |
How does FollowAgents rate this agent?
Why each dimension lost points
The code, README, and configuration notes describe repository reads, LLM calls, optional Langfuse/httpx telemetry, and GitLab batch mode creating branches and opening merge requests, so data flows and external effects are partly visible and score 2. Environment variables include API keys and GitLab credentials, but the packet does not explain secret protection, telemetry filtering, or permission scope; least privilege and sensitive-data handling score 1. The generation skill says to ask before updating existing targets, and the CLI offers skip-existing options, but this does not establish confirmation on every execution path, so user confirmation scores 1. Writes and GitLab changes lack clear rollback guidance, scoring 1. Plugin metadata and the license identify project/author attribution, but the publisher is not registry-verified; source attribution scores 2.
README, AGENTS.md, and project metadata mostly agree on Python requirements, commands, and components. However, README says plugin installation requires no API keys while AGENTS.md says CLI imports require several LLM environment variables, leaving entry-point requirements in tension; self-consistency scores 1. pyproject.toml pins or constrains many dependencies and README gives uv and pip installation paths, but the packet provides no broader supply-chain review evidence; dependency availability scores 2. The materials describe retries, partial success, logging, and common error handling, but do not show complete user-facing messages for each failure; failure messages score 2.
Documentation covers repository analysis, README/AI-rule generation, and GitLab batch processing, with configurable analysis scope, concurrency, and generation detail, so audience and scenarios score 2. Capability and configuration boundaries are described, but limits for large repositories, language coverage, and analysis accuracy are not well established, scoring 2. The three skill descriptions give trigger scenarios, though broad wording such as requests for project documentation may over-trigger; trigger precision scores 1. CLI, Claude Code plugin, container, and Kubernetes deployment paths are documented, so environment fit scores 2.
README, AGENTS.md, CLAUDE.md, skills, and sample configuration form a clear information structure, with installation and command examples; examples and FAQ coverage remains incomplete, so these criteria mostly score 2. Naming is broadly stable across CLI, skills, and plugin, but the plugin says 1.0.0 while pyproject.toml says 1.2.0; naming stability scores 2. Limitations are thin, scoring 1. The LICENSE file states complete MIT terms, scoring 3. A version exists but no changelog is included; maintenance responsibility has author/organization metadata but no clear maintenance or update path, both scoring 1.
The tool produces analysis documents, READMEs, and AI rules, and supports configuration, concurrent analysis, and reuse of analysis outputs, so output usability and marginal value score 2. Multiple LLM calls, optional telemetry, and GitLab automation can carry cost and operational overhead, but the materials give no cost estimates, budget controls, or tradeoff guidance; cost-benefit scores 1.
README claims can be partly checked against skills, plugin metadata, CLI, and dependency configuration. Sources corroborate some features, but the packet lacks enough implementation files to verify every runtime behavior, so claim traceability and cross-source corroboration score 2. Skills instruct users to ground content in code, spot-check analysis snapshots, and report what could not be verified, supporting fact/inference separation at 2. Static materials cannot establish execution results, and this review does not infer runtime correctness.
- Before running, confirm the target repository path, LLM provider and costs, credentials in environment variables, and whether telemetry is enabled; GitLab batch mode creates branches and opens merge requests.
- Generation writes analysis documents, a README, and AI assistant rules. Review existing files and generated output, and note the mismatch between plugin installation claims and the Python CLI's stated credential requirements.
FAQ
Do I have to pay for OpenAI?
Is there a simpler path than installing Python?
How are concurrency and rate limits handled?
Can documentation update itself on a schedule?
What files does it produce and where?
Is AI Doc Gen (Divar) open source?
Is AI Doc Gen (Divar) safe to use?
Is AI Doc Gen (Divar) still maintained?
Who makes AI Doc Gen (Divar)?
Thanks — we use this to improve the page.