/install ai-readme-generator
AI README Generator
Use this skill to scan an existing code project and generate maintainable documentation for both AI agents and developers.
The generated docs should help future AI coding sessions quickly understand:
- what the project does
- how the code is organized
- how to run, test, and build it
- what the key technical flows are
- what business knowledge still needs human input
Default output
Generate or update these files in the target project:
AGENTS.md
.cursor/rules/ai-readme/RULE.mdc
.cursor/rules/ai-readme/generated/project-structure.mdc
.cursor/rules/ai-readme/generated/technical-architecture.mdc
.cursor/rules/ai-readme/generated/development-guide.mdc
.cursor/rules/ai-readme/generated/core-flows.mdc
.cursor/rules/ai-readme/manual/business-knowledge.mdc
.cursor/rules/ai-readme/manual/lessons-learned.mdc
Use English file names for better cross-platform compatibility. Chinese section text is allowed when the project language is Chinese.
Safety rules
- Do not invent APIs, commands, paths, services, or business rules. If uncertain, write
\x3C!-- TODO: verify ... -->. - Do not overwrite existing files under
.cursor/rules/ai-readme/manual/. - If
AGENTS.mdalready exists, read it first. Preserve useful human-written constraints and update only project facts that can be verified from code. - Generated files under
.cursor/rules/ai-readme/generated/may be refreshed from code evidence. - Avoid secrets. Do not copy
.env, credentials, tokens, private keys, or local machine-specific paths into generated docs. - Prefer concise, factual documentation over long explanations.
- Every
.mdcfile must include frontmatter withdescriptionandalwaysApply: false. - Each generated technical
.mdcfile should include at least one Mermaid or ASCII diagram when useful.
Workflow
1. Identify the target project
If the user provides a path, use it. Otherwise inspect the current workspace and ask only if the project root is ambiguous.
Confirm the project root by checking common files:
- JavaScript/TypeScript:
package.json,pnpm-lock.yaml,yarn.lock - Java:
pom.xml,build.gradle,settings.gradle - Python:
pyproject.toml,requirements.txt,setup.py - Go:
go.mod - Rust:
Cargo.toml - .NET:
*.csproj,*.sln
2. Scan code evidence
Read only enough files to understand the project:
- dependency/build files
- README or existing docs
- top-level directory tree
- main entry points
- 3-8 representative source files
- tests, config, and scripts when available
Record facts with source paths in your notes before writing docs.
3. Plan generated files
For non-trivial projects, keep a short task plan:
- create/update
RULE.mdcskeleton - write
project-structure.mdc - write
technical-architecture.mdc - write
development-guide.mdc - write
core-flows.mdc - create missing manual templates only
- create/update
AGENTS.md - verify generated paths and summarize TODOs
4. Write files
Create directories as needed. Use the templates below, adapting content to verified project facts.
Templates
RULE.mdc
---
description: "AI README entrypoint - project rules navigation. Read this before working on the project."
alwaysApply: false
---
# AI README - Project Rules Entry
## Project overview
\x3C!-- One short paragraph describing the verified project purpose. -->
```mermaid
flowchart LR
Entry[Entry Points] --> Core[Core Modules]
Core --> Data[Data / External Services]
Generated information
- Generated at: \x3C!-- YYYY-MM-DD HH:mm -->
- Project root: \x3C!-- path or repository name -->
- Evidence scope: \x3C!-- key files/directories scanned -->
Navigation
Generated technical docs
- Project Structure - directories, modules, and responsibilities
- Technical Architecture - layers, dependencies, and technology stack
- Development Guide - setup, run, build, test, and config
- Core Flows - important runtime or business call chains
Human-maintained docs
- Business Knowledge - domain terms, business rules, product context
- Lessons Learned - pitfalls, decisions, and team experience
### generated/project-structure.mdc
```md
---
description: "Project structure - directories, modules, and responsibilities. Use when understanding code organization."
alwaysApply: false
---
# Project Structure
## Directory tree
```text
project-root/
├── ...
Module responsibilities
| Path | Responsibility | Key files |
|---|
Dependencies between modules
flowchart LR
A[Module A] --> B[Module B]
Evidence
path/to/file
### generated/technical-architecture.mdc
```md
---
description: "Technical architecture - layers, dependencies, and technology stack. Use when understanding technical design."
alwaysApply: false
---
# Technical Architecture
## Architecture overview
```mermaid
flowchart TD
UI[Interface / API Layer] --> App[Application / Service Layer]
App --> Domain[Domain / Core Logic]
Domain --> Infra[Infrastructure / Data Layer]
Layers
| Layer | Responsibility | Main files/classes |
|---|
Technology stack
| Category | Technology | Version/source | Purpose |
|---|---|---|---|
| Language/runtime | |||
| Framework | |||
| Build tool | |||
| Test framework |
Evidence
path/to/file
### generated/development-guide.mdc
```md
---
description: "Development guide - setup, run, build, test, and configuration. Use when preparing a development environment."
alwaysApply: false
---
# Development Guide
## Requirements
| Tool | Version | Evidence |
| --- | --- | --- |
## Common commands
| Task | Command | Evidence |
| --- | --- | --- |
| Install dependencies | \x3C!-- TODO: verify --> | |
| Run locally | \x3C!-- TODO: verify --> | |
| Build | \x3C!-- TODO: verify --> | |
| Test | \x3C!-- TODO: verify --> | |
## Configuration
| File / variable | Purpose | Required? |
| --- | --- | --- |
## Validation checklist
- [ ] dependencies install successfully
- [ ] app starts locally
- [ ] tests pass
- [ ] build succeeds
generated/core-flows.mdc
---
description: "Core flows - important runtime or business call chains. Use when understanding how the system works."
alwaysApply: false
---
# Core Flows
> These flows are inferred from code evidence. Ask the user to confirm if they match the team's product understanding.
## Flow list
| Priority | Flow | Entry point | Evidence |
| --- | --- | --- | --- |
| P0 | | | |
| P1 | | | |
## Flow: \x3C!-- name -->
```mermaid
sequenceDiagram
participant Client
participant Entry
participant Service
participant Store
Client->>Entry: request
Entry->>Service: delegate
Service->>Store: read/write
Service-->>Entry: result
Entry-->>Client: response
Call chain
file:Class.methodfile:Class.method
Key branches
- \x3C!-- error handling / cache / fallback / async branch -->
### manual/business-knowledge.mdc
Create this file only if it does not already exist.
```md
---
description: "Business knowledge - product context, domain terms, and business rules. Use when business context is needed."
alwaysApply: false
---
# Business Knowledge
## Project context
\x3C!-- TODO: human to fill: who uses this project, what problem it solves, and important product boundaries. -->
## Domain terms
| Term | Code name | Meaning |
| --- | --- | --- |
## Business rules
\x3C!-- TODO: human to fill: state transitions, limits, calculations, approvals, exceptions. -->
manual/lessons-learned.mdc
Create this file only if it does not already exist.
---
description: "Lessons learned - pitfalls, decisions, and team experience. Read before changing risky code."
alwaysApply: false
---
# Lessons Learned
## Pitfalls
| Problem | Cause | Solution |
| --- | --- | --- |
## Decisions
| Decision | Reason | Date / owner |
| --- | --- | --- |
AGENTS.md
# AGENTS.md
## Project Overview
\x3C!-- One verified paragraph describing the project purpose and core capability. -->
## Development Commands
- Install dependencies: \x3C!-- TODO: verify -->
- Run locally: \x3C!-- TODO: verify -->
- Build: \x3C!-- TODO: verify -->
- Test: \x3C!-- TODO: verify -->
## Key Directories
- `src/` - \x3C!-- responsibility -->
- `tests/` - \x3C!-- responsibility, if present -->
## Boundaries and Constraints
\x3C!-- Verified project conventions, safety rules, generated-code boundaries, or things not to modify. -->
## AI Context
Detailed project rules live in `.cursor/rules/ai-readme/RULE.mdc`:
- architecture: `.cursor/rules/ai-readme/generated/technical-architecture.mdc`
- flows: `.cursor/rules/ai-readme/generated/core-flows.mdc`
- business context: `.cursor/rules/ai-readme/manual/business-knowledge.mdc`
- lessons learned: `.cursor/rules/ai-readme/manual/lessons-learned.mdc`
Verification
After writing files:
- Re-read every generated path to confirm it exists.
- Check
.mdcfrontmatter is valid. - Confirm manual files were not overwritten.
- List unresolved
TODOitems. - Report generated files with paths and sizes.
Final response
Return a concise summary:
- generated/updated files
- skipped files, especially existing manual files
- key uncertainties marked as TODO
- recommended next human edits
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install ai-readme-generator - 安装完成后,直接呼叫该 Skill 的名称或使用
/ai-readme-generator触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
AI README Generator 是什么?
Generate AI-readable project documentation for OpenClaw/Cursor-style coding workflows. Use when the user asks to create, initialize, update, or refresh AGENT... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 49 次。
如何安装 AI README Generator?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install ai-readme-generator」即可一键安装,无需额外配置。
AI README Generator 是免费的吗?
是的,AI README Generator 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。
AI README Generator 支持哪些平台?
AI README Generator 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 AI README Generator?
由 zhaojun(@zjuncher)开发并维护,当前版本 v1.0.0。