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.
Evidence shows agents register only read-only tools (FileReadTool, ListFilesTool with ranged reads), supporting least_privilege at 2; however cronjob mode automatically opens merge requests on GitLab projects with no user confirmation or rollback/cleanup mechanism, so user_confirmation and external_effects get 1 and rollback gets 0; sensitive data handling relies only on .env.sample with no key-handling guidance; attribution is limited to the LICENSE, with no statement on whether generated docs are marked as AI-produced.
pyproject pins dependency versions exactly and the README describes retries with exponential backoff and Retry-After, giving dependency_availability 2; README claims are consistent with pyproject and CLI naming, giving self_consistency 2; but actual error messages and failure behavior are not visible in provided sources, so failure_messages stays at 1.
Target audience (developer onboarding, docs maintenance) is clear, and multiple environments (Claude plugin, pip, uv, Docker, Helm) are documented, giving audience_and_scenarios and environment_fit 2; layered config and precise CLI flags support trigger_precision 2; capability boundaries (unsuitable codebases, LLM hallucination risk in generated docs) are essentially undiscussed, so capability_boundaries gets 1.
Full MIT LICENSE matching the README earns 3; installation notes are thorough with prerequisites and multiple methods, earning 2; structure and naming are stable; but there is no CHANGELOG (only version 1.2.0 in pyproject), so versioning_changelog gets 1; no FAQ or sample outputs, giving examples_and_faq and known_limitations 1; maintenance responsibility rests only on an author email and blog posts with no CONTRIBUTING or governance, so maintenance_responsibility gets 1.
Outputs (README, CLAUDE.md, AGENTS.md, Cursor rules) are clearly targeted with usability options like skip-existing and line limits, giving output_usability 2; clear marginal value over manual documentation gives marginal_value 2; but token/compute cost of five concurrent agents is never estimated or budgetable, so cost_benefit gets 1.
README claims partially corroborate against pyproject and workflow files (pydantic-ai, GitLab integration, Claude actions), giving cross_source_corroboration 2; but central claims (analysis quality, quality of generated docs) lack tests or sample outputs, so claim_traceability and fact_inference_separation stay at 1; promotional blog links are not separated from factual description. Note: this is a static, low-confidence review without execution.
- Cronjob mode automatically opens merge requests on GitLab projects; verify target project scope and credential permissions before deploying to avoid unintended writes.
- Generated README/CLAUDE.md/AGENTS.md files are LLM-produced and may contain inaccuracies; require human review before merging.
- No rollback mechanism is documented; if auto-generated docs overwrite human-maintained content, recovery depends on Git history.
- LLM token cost of five concurrent agents is not quantified; estimate before large-scale use.
- Only README-level evidence was available for this static review; core source and tests were not provided, so actual behavior needs independent verification.
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.
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 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.