context7
Fetches up-to-date documentation and code examples for libraries, frameworks, SDKs, CLI tools and cloud services, so an AI agent can answer API questions and generate code against current references.
Skills that analyze a codebase and generate documentation for it: AI-readable analysis docs, a README.md with architecture and diagrams, and AI assistant rule files such as CLAUDE.md, AGENTS.md and Cursor rules.
Claude Code
> /plugin marketplace add divar-ir/ai-doc-gen> /plugin install ai-doc-gen@divar
Codex
$ npx skills add divar-ir/ai-doc-gen -a codex
Cursor
$ npx skills add divar-ir/ai-doc-gen -a cursor
Gemini CLI
$ npx skills add divar-ir/ai-doc-gen -a gemini-cli
GitHub Copilot
$ copilot plugin marketplace add divar-ir/ai-doc-gen$ copilot plugin install ai-doc-gen@divar
OpenCode
$ npx skills add divar-ir/ai-doc-gen -a opencode
Windsurf
$ npx skills add divar-ir/ai-doc-gen -a windsurf
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.
Read the full story behind this project:
.ai/docs/CLAUDE.md, AGENTS.md, and .cursor/rules/*.mdc files for AI coding assistantsanalyze-codebase, generate-readme, and generate-ai-rules skills (.claude-plugin/, skills/)ANALYZER_MAX_WORKERS, 0 = auto-detect CPU count).ai/config.yaml, then CLI flagsRetry-After support (handles 429s)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/ documentsgenerate-readme — README generation from analysis or direct explorationgenerate-ai-rules — CLAUDE.md, AGENTS.md, and Cursor rules generationgit clone https://github.com/divar-ir/ai-doc-gen.git
cd ai-doc-gen
curl -LsSf https://astral.sh/uv/install.sh | sh
uv sync
pip install -e .
A Dockerfile and a Helm chart (k8s/helm/) are also provided for containerized and scheduled (Kubernetes CronJob) deployments.
# 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
# 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.
# Analyze codebase (structure, data flow, dependencies, request flow, APIs)
uv run src/main.py analyze --repo-path <path>
# Generate README documentation
uv run src/main.py generate readme --repo-path <path>
# Generate AI assistant configuration files
uv run src/main.py generate ai-rules --repo-path <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.
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
The tool automatically looks for configuration in .ai/config.yaml or .ai/config.yml in your repository. Precedence: Pydantic defaults < YAML file < CLI flags.
analyzer.max_workers caps concurrent analyzer agents (0 = auto-detect CPU count)minimal/standard/comprehensive), set line limitsSee config_example.yaml for all available options and .env.sample for environment variables (per-agent LLM models, timeouts, retry behavior, GitLab credentials, Langfuse keys).
The system uses a multi-agent architecture with specialized AI agents for different types of code analysis and generation:
src/main.py): argparse-based entry point; CLI flags are auto-generated from Pydantic config modelssrc/handlers/): command-specific orchestration implementing an AbstractHandler interface (analyze, generate readme, generate ai-rules, cronjob analyze)src/agents/): pydantic-ai agents with YAML/Jinja2 prompt templates
AnalyzerAgent: coordinates 5 analysis agents through a worker poolDocumenterAgent: generates README.md from analysis documentsAIRulesGeneratorAgent: generates markdown rules (CLAUDE.md + AGENTS.md) and Cursor rules concurrentlysrc/agents/tools/): FileReadTool (ranged file reading) and ListFilesTool (filtered recursive listing) registered with every agentOpenAIChatModel + OpenAIProvider with configurable base URL)This project is licensed under the MIT License - see the LICENSE file for details.
Fetches up-to-date documentation and code examples for libraries, frameworks, SDKs, CLI tools and cloud services, so an AI agent can answer API questions and generate code against current references.
Gives Claude Code skills and agents for writing React documentation on react.dev, covering MDX components, voice and style rules, blog post structure, and interactive Sandpack code examples.
An agent skill that turns complex terminal output into styled HTML pages you actually want to read. Ask your agent to explain a system architecture, review a diff, or compare requirements against a plan.
A WYSIWYG markdown editor so you can edit markdown files like a Google Doc or Notion page, with a desktop app and web UI for navigation, search, and wiki-style linking. It also ships skills for working in codebase wiki, personal CRM, and knowledge base projects.
Install it with the command on its page. It includes analyze-codebase, generate-ai-rules, generate-readme. Its skills do not fire on their own yet. Free and open source.
Is this plugin yours?
Claim it with GitHubSubmit a pluginPromote it