← 开源
divar-ir

ai-doc-gen

AI-powered multi-agent system that automatically analyzes codebases and generates comprehensive documentation. Features GitLab integration, concurrent processing, and multiple LLM support for better code understanding and developer onboarding.

ApplicationsCodingPython
在 GitHub 打开
增长势头
+024 小时新增 Star0.0%
767
Star
80
Fork
+0
本周
3
贡献者
创建于 2025-07-19 · 更新于 2026-10-08 · 今日第 14038 名
主要开发者
miladosossoroushfathiMeshkati

divar-ir/ai-doc-gen 排名第 14,038,有 767 个星标。

同类别比较

divar-ir/ai-doc-gen 排名第 14,038,此处有 8 个同类条目;ZeroTang05/VideoAdGuard 排名第 14,052。

同类别比较
名称排名指标
robswc/tradingview-webhooks-bot13,998
语言:
Python
星标数:
771
分叉数:
207
简介:
a framework 🏗 for trading with tradingview webhooks!
ai-ppt-template/free-ppt-template14,004
星标数:
770
分叉数:
177
opslane/opslane_old14,008
语言:
TypeScript
星标数:
770
分叉数:
41
简介:
Run multiple Claude Code sessions in parallel
yeephycho/tensorflow-face-detection14,023
语言:
Python
星标数:
769
分叉数:
258
简介:
A mobilenet SSD based face detector, powered by tensorflow object detection api, trained by WIDERFACE dataset.
ZeroTang05/VideoAdGuard14,052
语言:
TypeScript
星标数:
766
分叉数:
37
简介:
哔哩哔哩浏览器插件:基于大语言模型,对B站视频中的植入广告进行检测。一键跳过视频中的植入/口播广告。
mandiant/stringsifter14,056
语言:
Python
星标数:
766
分叉数:
125
简介:
A machine learning tool that ranks strings based on their relevance for malware analysis.
metabase/dataset-generator14,057
语言:
TypeScript
星标数:
766
分叉数:
48
简介:
AI Dataset Generator – Create realistic datasets for demos, learning, and dashboards
L1AD/claude-task-viewer14,062
语言:
HTML
星标数:
765
分叉数:
90
简介:
A web-based Kanban board for viewing Claude Code tasks
关键参数与规格
关键参数与规格
参数值
语言Python
类别Applications
子类别Coding
关键词Documentation
星标数767
分叉数80
贡献者3
创建日期2025-07-19
更新日期2026-10-08
1 天星标数0
7 天星标数0
排名14,038
上次排名13,914
排名变化-124
7 天星标排名14,253
上次 7 天星标排名14,274
7 天星标排名变化21
总星标排名13,814
上次总星标排名13,794
总星标排名变化-20
国家Iran
README 摘录

AI Documentation Generator An AI-powered code documentation generator that automatically analyzes repositories and creates comprehensive documentation using large language models. The system employs a multi-agent architecture: five specialized analysis agents run concurrently to map a codebase's structure, dependencies, data flow, request flow, and APIs, and generation agents turn those analyses into a polished and AI assistant configuration files ( , , ). A GitLab cronjob mode discovers active projects and opens merge requests with fresh analysis automatically. 13 Git API access to

an OpenAI-compatible LLM provider 1. Or install with pip: A and a Helm chart ( ) are also provided for containerized and scheduled (Kubernetes CronJob) deployments. Set up your environment and configuration: 2. Run analysis and generate documentation: Analysis documents are saved to , and generated documentation and AI configuration files are placed in your repository root. Usage Available Commands The package also installs an console script exposing the same CLI. Advanced Options **Analysis Options:** **README Generation Options:** **AI Rules Generation Options

:** **Cronjob Options:** Configuration The tool automatically looks for configuration in or in your repository. Precedence: Pydantic defaults < YAML file < CLI flags. Configuration Options **Exclude specific analyses**: Skip code structure, data flow, dependencies, request flow, or API analysis **Tune concurrency**: caps concurrent analyzer agents (0 = auto-detect CPU count) **Customize README sections**: Control which sections appear in generated documentation **AI rules behavior**: Skip existing files, choose detail level ( / / ), set line limits **Configure cronjob settings**: Working path and commit recency filter See

for all available options and for environment variables (per-agent LLM models, timeouts, retry behavior, GitLab credentials, Langfuse keys). Architecture The system uses a **multi-agent architecture** with specialized AI agents for different types of code analysis and generation: **CLI Layer** ( ): argparse-based entry point; CLI flags are auto-generated from Pydantic config models **Handler Layer** ( ): command-specific orchestration implementing an interface (analyze, generate readme, generate ai-rules, cronjob analyze) **Agent Layer** ( ): pydantic-ai agents with YAML/Jinja2 prompt templates

: coordinates 5 analysis agents through a worker pool : generates README. md from analysis documents : generates markdown rules (CLAUDE. md) and Cursor rules concurrently **Tool Layer** ( ): (ranged file reading) and (filtered recursive listing) registered with every agent Technology Stack **Python 3. 13** with pydantic-ai for AI agent orchestration **OpenAI-compatible APIs** for LLM access ( + with configurable base URL) **GitPython & python-gitlab** for repository operations and GitLab automation **logfire / OpenTelemetry & Langfuse** for observability **YAML + Jinja2 + Pydantic** for prompts and configuration management

License This project is licensed under the MIT License - see the LICENSE file for details. Acknowledgments Built with pydantic-ai for AI agent orchestration Supports multiple LLM providers through OpenAI-compatible APIs (including OpenRouter) Uses Langfuse for LLM observability

常见问题

记录了多少星标和分叉?

divar-ir/ai-doc-gen 有 767 个星标和 80 个分叉。

仓库排名是多少?

divar-ir/ai-doc-gen 排名第 14,038。

记录的语言和类别是什么?

divar-ir/ai-doc-gen 有 767 个星标,语言为 Python,类别为 Applications。

哪个仓库排名最接近?

divar-ir/ai-doc-gen 与 ZeroTang05/VideoAdGuard 比较,后者排名第 14,052,有 766 个星标。

README

AI Documentation Generator

An AI-powered code documentation generator that automatically analyzes repositories and creates comprehensive documentation using large language models. The system employs a multi-agent architecture: five specialized analysis agents run concurrently to map a codebase's structure, dependencies, data flow, request flow, and APIs, and generation agents turn those analyses into a polished README.md and AI assistant configuration files (CLAUDE.md, AGENTS.md, .cursor/rules/). A GitLab cronjob mode discovers active projects and opens merge requests with fresh analysis automatically.

📝 Blog Posts

Read the full story behind this project:

Table of Contents

Features

  • Multi-Agent Analysis: Five specialized AI agents for code structure, data flow, dependency, request flow, and API analysis, writing reusable analysis documents to .ai/docs/
  • Automated Documentation: Generates comprehensive README files with configurable sections
  • AI Assistant Configuration: Generates CLAUDE.md, AGENTS.md, and .cursor/rules/*.mdc files for AI coding assistants
  • Claude Code Plugin & Skills: Ships as an installable Claude Code plugin with analyze-codebase, generate-readme, and generate-ai-rules skills (.claude-plugin/, skills/)
  • GitLab Integration: Cronjob mode discovers recently active GitLab projects, runs analysis, and opens merge requests
  • Concurrent Processing: Parallel agent execution with a configurable worker pool (ANALYZER_MAX_WORKERS, 0 = auto-detect CPU count)
  • Flexible Configuration: Layered configuration — Pydantic defaults, .ai/config.yaml, then CLI flags
  • Multiple LLM Support: Works with any OpenAI-compatible API (OpenAI, Anthropic-compatible gateways, OpenRouter, local models, etc.), with per-agent model/endpoint settings
  • Resilience: Agent-level retries plus an HTTP retry client with exponential backoff and Retry-After support (handles 429s)
  • Observability: OpenTelemetry tracing via logfire with optional Langfuse integration

Installation

Using Skills (Claude Code)

This repository doubles as a Claude Code plugin — the easiest way to use it, no API keys or Python setup required. Install it from within Claude Code:

/plugin marketplace add divar-ir/ai-doc-gen
/plugin install ai-doc-gen@divar

This adds three skills that Claude Code invokes directly:

  • analyze-codebase — multi-agent analysis producing .ai/docs/ documents
  • generate-readme — README generation from analysis or direct exploration
  • generate-ai-rules — CLAUDE.md, AGENTS.md, and Cursor rules generation

Prerequisites

  • Python 3.13
  • Git
  • API access to an OpenAI-compatible LLM provider
  1. Clone the repository:
git clone https://github.com/divar-ir/ai-doc-gen.git
cd ai-doc-gen
  1. Install using uv (recommended):
curl -LsSf https://astral.sh/uv/install.sh | sh
uv sync
  1. Or install with pip:
pip install -e .

A Dockerfile and a Helm chart (k8s/helm/) are also provided for containerized and scheduled (Kubernetes CronJob) deployments.

Quick Start

  1. Set up your environment and configuration:
# Copy and edit environment variables (LLM API keys, base URLs, etc.)
cp .env.sample .env

# Copy and edit configuration
mkdir -p .ai
cp config_example.yaml .ai/config.yaml
  1. Run analysis and generate documentation:
# Analyze your repository
uv run src/main.py analyze --repo-path .

# Generate README documentation
uv run src/main.py generate readme --repo-path .

# Generate AI assistant configuration files (CLAUDE.md, AGENTS.md, .cursor/rules/)
uv run src/main.py generate ai-rules --repo-path .

Analysis documents are saved to .ai/docs/, and generated documentation and AI configuration files are placed in your repository root.

Usage

Available Commands

# Analyze codebase (structure, data flow, dependencies, request flow, APIs)
uv run src/main.py analyze --repo-path 

# Generate README documentation
uv run src/main.py generate readme --repo-path 

# Generate AI assistant configuration files
uv run src/main.py generate ai-rules --repo-path 

# Run cronjob (GitLab batch analysis)
uv run src/main.py cronjob analyze

The package also installs an ai-doc-gen console script exposing the same CLI.

Advanced Options

Analysis Options:

# Analyze with specific exclusions
uv run src/main.py analyze --repo-path . --exclude-code-structure --exclude-data-flow

# Limit concurrent analyzer agents
uv run src/main.py analyze --repo-path . --max-workers 2

# Use custom configuration file
uv run src/main.py analyze --repo-path . --config /path/to/config.yaml

README Generation Options:

# Generate with specific section exclusions
uv run src/main.py generate readme --repo-path . --exclude-architecture --exclude-c4-model

# Use existing README as context
uv run src/main.py generate readme --repo-path . --use-existing-readme

AI Rules Generation Options:

# Skip overwriting existing files
uv run src/main.py generate ai-rules --repo-path . \
    --skip-existing-claude-md \
    --skip-existing-agents-md \
    --skip-existing-cursor-rules

# Customize detail level and line limits
uv run src/main.py generate ai-rules --repo-path . \
    --detail-level comprehensive \
    --max-claude-lines 600 \
    --max-agents-lines 150

Cronjob Options:

# Only process projects with commits in the last N days
uv run src/main.py cronjob analyze --max-days-since-last-commit 14

Configuration

The tool automatically looks for configuration in .ai/config.yaml or .ai/config.yml in your repository. Precedence: Pydantic defaults < YAML file < CLI flags.

Configuration Options

  • Exclude specific analyses: Skip code structure, data flow, dependencies, request flow, or API analysis
  • Tune concurrency: analyzer.max_workers caps concurrent analyzer agents (0 = auto-detect CPU count)
  • Customize README sections: Control which sections appear in generated documentation
  • AI rules behavior: Skip existing files, choose detail level (minimal/standard/comprehensive), set line limits
  • Configure cronjob settings: Working path and commit recency filter

See config_example.yaml for all available options and .env.sample for environment variables (per-agent LLM models, timeouts, retry behavior, GitLab credentials, Langfuse keys).

Architecture

The system uses a multi-agent architecture with specialized AI agents for different types of code analysis and generation:

  • CLI Layer (src/main.py): argparse-based entry point; CLI flags are auto-generated from Pydantic config models
  • Handler Layer (src/handlers/): command-specific orchestration implementing an AbstractHandler interface (analyze, generate readme, generate ai-rules, cronjob analyze)
  • Agent Layer (src/agents/): pydantic-ai agents with YAML/Jinja2 prompt templates
    • AnalyzerAgent: coordinates 5 analysis agents through a worker pool
    • DocumenterAgent: generates README.md from analysis documents
    • AIRulesGeneratorAgent: generates markdown rules (CLAUDE.md + AGENTS.md) and Cursor rules concurrently
  • Tool Layer (src/agents/tools/): FileReadTool (ranged file reading) and ListFilesTool (filtered recursive listing) registered with every agent

Technology Stack

  • Python 3.13 with pydantic-ai for AI agent orchestration
  • OpenAI-compatible APIs for LLM access (OpenAIChatModel + OpenAIProvider with configurable base URL)
  • GitPython & python-gitlab for repository operations and GitLab automation
  • logfire / OpenTelemetry & Langfuse for observability
  • YAML + Jinja2 + Pydantic for prompts and configuration management

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

  • Built with pydantic-ai for AI agent orchestration
  • Supports multiple LLM providers through OpenAI-compatible APIs (including OpenRouter)
  • Uses Langfuse for LLM observability
排名相邻
同类项目