← 返回
未分类 中文

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...
为OpenClaw/Cursor风格的编码工作流生成AI可读的项目文档。当用户要求创建、初始化、更新或刷新AGENT时使用。
zjuncher
未分类 clawhub v1.0.0 1 版本 99572.6 Key: 无需
★ 0
Stars
📥 233
下载
💾 0
安装
1
版本
#ai-readme#cursor#documentation#latest#openclaw

概述

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 .
  • Do not overwrite existing files under .cursor/rules/ai-readme/manual/.
  • If AGENTS.md already 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 .mdc file must include frontmatter with description and alwaysApply: false.
  • Each generated technical .mdc file 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:

  1. dependency/build files
  2. README or existing docs
  3. top-level directory tree
  4. main entry points
  5. 3-8 representative source files
  6. 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:

  1. create/update RULE.mdc skeleton
  2. write project-structure.mdc
  3. write technical-architecture.mdc
  4. write development-guide.mdc
  5. write core-flows.mdc
  6. create missing manual templates only
  7. create/update AGENTS.md
  8. 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

<!-- One short paragraph describing the verified project purpose. -->

flowchart LR

Entry[Entry Points] --> Core[Core Modules]

Core --> Data[Data / External Services]


## Generated information

- Generated at: <!-- YYYY-MM-DD HH:mm -->
- Project root: <!-- path or repository name -->
- Evidence scope: <!-- key files/directories scanned -->

## Navigation

### Generated technical docs

- [ ] [Project Structure](./generated/project-structure.mdc) - directories, modules, and responsibilities
- [ ] [Technical Architecture](./generated/technical-architecture.mdc) - layers, dependencies, and technology stack
- [ ] [Development Guide](./generated/development-guide.mdc) - setup, run, build, test, and config
- [ ] [Core Flows](./generated/core-flows.mdc) - important runtime or business call chains

### Human-maintained docs

- [ ] [Business Knowledge](./manual/business-knowledge.mdc) - domain terms, business rules, product context
- [ ] [Lessons Learned](./manual/lessons-learned.mdc) - pitfalls, decisions, and team experience

generated/project-structure.mdc

---
description: "Project structure - directories, modules, and responsibilities. Use when understanding code organization."
alwaysApply: false
---

# Project Structure

## Directory tree

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

---
description: "Technical architecture - layers, dependencies, and technology stack. Use when understanding technical design."
alwaysApply: false
---

# Technical Architecture

## Architecture overview

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

---
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 | <!-- TODO: verify --> | |
| Run locally | <!-- TODO: verify --> | |
| Build | <!-- TODO: verify --> | |
| Test | <!-- 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: <!-- name -->

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

1. `file:Class.method`
2. `file:Class.method`

### Key branches

- <!-- error handling / cache / fallback / async branch -->

manual/business-knowledge.mdc

Create this file only if it does not already exist.

---
description: "Business knowledge - product context, domain terms, and business rules. Use when business context is needed."
alwaysApply: false
---

# Business Knowledge

## Project context

<!-- TODO: human to fill: who uses this project, what problem it solves, and important product boundaries. -->

## Domain terms

| Term | Code name | Meaning |
| --- | --- | --- |

## Business rules

<!-- 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

<!-- One verified paragraph describing the project purpose and core capability. -->

## Development Commands

- Install dependencies: <!-- TODO: verify -->
- Run locally: <!-- TODO: verify -->
- Build: <!-- TODO: verify -->
- Test: <!-- TODO: verify -->

## Key Directories

- `src/` - <!-- responsibility -->
- `tests/` - <!-- responsibility, if present -->

## Boundaries and Constraints

<!-- 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:

  1. Re-read every generated path to confirm it exists.
  2. Check .mdc frontmatter is valid.
  3. Confirm manual files were not overwritten.
  4. List unresolved TODO items.
  5. 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

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-05-21 15:24 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

Research Papers

zjuncher
使用OpenAlex查找、排名和摘要学术论文;用于论文检索、DOI查询、引用链检查、开放获取PDF发现/下载等。
★ 2 📥 341

Research Paper Push

zjuncher
使用 OpenAlex 和 OpenClaw cron 创建定期论文提醒,订阅期刊、会议或研究主题,支持列出、更新和取消订阅。
★ 1 📥 304

QQBot Send Local Media

zjuncher
Safely send local files, images, audio, video, and other media through QQBot. Use when a user asks to send a desktop/dow
★ 1 📥 289