/ai-doc-gen:generate-ai-rulesfrom ai-doc-gen
Generates AI assistant configuration files (CLAUDE.md, AGENTS.md, Cursor rules) from codebase analysis. Use when onboarding AI tools or creating/updating these files.
Ships in ai-doc-gen. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Generate configuration files that help AI coding assistants work effectively with a codebase. Three targets, generated from the same analysis so they stay consistent:
<repo>/.ai/docs/ for analysis documents from the analyze-codebase skill. If present, use them as the primary source (spot-check against the code — they may be stale). If absent, offer to run analyze-codebase first, or explore the codebase directly for a quicker pass.Shared principles for all targets:
uv run vs pip).uv run ruff format src/" beats "format your code".The primary file — write it first, and write it best. Target well under 150 lines.
Claude Code reads AGENTS.md natively, so avoid duplicating content between the two files. Pick based on what exists and what the user wants:
See AGENTS.md for project instructions. plus only Claude-specific additions if any (e.g., skill/subagent usage preferences, permission notes). If there is nothing Claude-specific, ask the user whether they want CLAUDE.md at all.Generate 2–3 focused, composable rule files in MDC format (markdown with YAML frontmatter):
---
description: Brief description of what this rule covers
globs:
- "src/**/*.py"
alwaysApply: false
---
# Rule Title
Content...
project-overview.mdc — project context, architecture, conventions (alwaysApply: true, no globs needed)code-patterns.mdc — code style, testing patterns, anti-patterns to avoid (globbed to source files)api-conventions.mdc — only if the project has a significant API surface (globbed to API/handler files)Keep each file to 50–100 lines. Rules should be prescriptive and project-specific, with short code examples from the actual codebase. Reference files with @path syntax where helpful. If a legacy .cursorrules file exists, migrate its still-valid content into the new files and tell the user the legacy file can be removed.
When updating rather than creating:
List the files written, their line counts, and anything you left out or couldn't verify. If the repo's docs and reality diverged notably, mention it — that's a signal the team should know.
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub divar-ir/ai-doc-gen --plugin ai-doc-gen3 skills in this plugin
/analyze-codebaseRun a multi-agent deep analysis of a codebase, producing AI-readable analysis documents in .ai/docs/ covering structure, dependencies, data flow, request flow, and APIs. Use whenever the user asks to analyze a repository, generate codebase analysis, understand an unfamiliar codebase in depth, or before generating documentation (README, CLAUDE.md, AGENTS.md) so the generators have analysis data to work from. Also use when the user mentions ".ai/docs", "ai analysis", or wants a structured architectural map of a project./generate-readmeGenerate or refresh a comprehensive, professional README.md for a repository, with architecture overview, mermaid and optional C4 diagrams, repository structure, dependencies, and API documentation. Use whenever the user asks to create, write, update, improve, or regenerate a README, project documentation, or a project overview page — even if they just say "document this project" or "this repo needs docs".Other plugins' skills for the same job