P
Communityprompt
Project Knowledge Base & README Generator
一条主提示词,让助手通读整个代码库,生成含 30 多个章节的 README——覆盖架构、数据库、API、部署与排障。
概览安全
它给模型设定「架构师 + 技术写作 + DevOps」的复合角色,并规定了精确的 README 大纲:项目概览、含 Mermaid 图的架构、目录树、技术栈表、环境变量、安装指南、数据库与 API 文档、角色权限矩阵、安全与性能分析、错误处理等。目标是产出一份新人可独立上手的单一事实来源。
# MASTER PROMPT — PROJECT KNOWLEDGE BASE & README GENERATOR
You are a Senior Software Architect, Technical Writer, DevOps Engineer, Product Manager, System Analyst, QA Lead, Security Auditor, and Documentation Specialist.
Your task is to analyze my entire project codebase and automatically generate a world-class `README.md` file that serves as the **Single Source of Truth (SSOT)** for the entire project.
The README must be written in professional GitHub-standard Markdown format and should be detailed enough that a completely new developer can understand, install, maintain, extend, troubleshoot, and deploy the project without asking additional questions.
---
## PRIMARY OBJECTIVE
Scan and analyze:
* All source code
* All folders
* All configuration files
* All environment files
* Database schema
* API routes
* Components
* Utilities
* Middleware
* Services
* Hooks
* Libraries
* Documentation
* Deployment files
* Docker files
* CI/CD configuration
* Package dependencies
* Scripts
* Assets
* Build configuration
Then generate a fully documented README.md.
---
# README STRUCTURE
Generate the following sections in order.
---
# 1. Project Overview
Include:
* Project Name
* Project Type
* Purpose
* Business Goal
* Main Features
* Target Users
* Project Scope
* Current Version
* Development Status
---
# 2. Executive Summary
Explain:
* What the system does
* Why it exists
* Who uses it
* Core workflow
* Key business benefits
---
# 3. System Architecture
Generate:
## Architecture Diagram (Markdown)
Include:
* Frontend
* Backend
* Database
* Authentication
* Storage
* External APIs
* Cron Jobs
* Webhooks
* Integrations
Create visual Mermaid diagrams.
Example:
```mermaid
graph TD
Frontend --> API
API --> Database
API --> Storage
API --> ExternalServices
```
---
# 4. Complete Folder Structure
Generate a tree view.
Example:
```txt
src/
├── app/
├── components/
├── hooks/
├── lib/
├── services/
├── utils/
└── types/
```
Explain:
* Purpose of every folder
* Purpose of every important file
---
# 5. Technology Stack
Generate detailed table.
Include:
| Layer | Technology | Purpose |
| -------- | ---------- | --------------- |
| Frontend | Next.js | UI |
| Backend | Node.js | API |
| Database | PostgreSQL | Data |
| ORM | Prisma | Database Access |
Include:
* Frameworks
* Libraries
* Packages
* SDKs
* APIs
---
# 6. Environment Variables
Analyze all `.env` usage.
Generate:
```env
DATABASE_URL=
NEXTAUTH_SECRET=
```
For every variable explain:
* Purpose
* Required
* Optional
* Example Value
---
# 7. Installation Guide
Step-by-step setup.
Include:
### Local Development
### Production
### Docker
### VPS
### Cloud Deployment
Include exact commands.
---
# 8. Development Workflow
Explain:
* How project starts
* Build process
* Runtime flow
* Data flow
* User flow
* Admin flow
---
# 9. Database Documentation
Analyze schema.
Generate:
## ER Diagram
Mermaid format.
Document:
* Tables
* Relationships
* Fields
* Constraints
* Indexes
Explain business logic.
---
# 10. Authentication System
Document:
* Login
* Registration
* Roles
* Permissions
* Session Management
* Token Management
Create access matrix.
---
# 11. User Roles & Permissions
Create tables.
Example:
| Role | Create | Edit | Delete |
| ------ | ------ | ---- | ------ |
| Admin | Yes | Yes | Yes |
| Editor | Yes | Yes | No |
Explain each role.
---
# 12. API Documentation
Auto-discover all endpoints.
Generate:
## Endpoint List
For every endpoint include:
* Method
* URL
* Request Body
* Query Parameters
* Authentication
* Response
* Errors
Example:
```http
POST /api/customers
```
---
# 13. Component Documentation
Analyze every major component.
Document:
* Purpose
* Props
* State
* Dependencies
Generate component hierarchy.
---
# 14. Business Logic Documentation
Explain:
* Customer Management
* Invoice Management
* Subscription Management
* Payments
* Notifications
* Reports
* Analytics
Automatically detect actual business modules.
---
# 15. Feature Documentation
Create complete feature inventory.
For each feature include:
* Description
* Dependencies
* Files Used
* Workflow
---
# 16. Third-Party Integrations
Document:
* Google APIs
* Stripe
* PayPal
* OpenAI
* Gemini
* Email Services
* SMS Services
* WhatsApp APIs
Explain:
* Where used
* Why used
* Required setup
---
# 17. Automation & Scheduled Jobs
Document:
* Cron Jobs
* Background Tasks
* Queues
* Workers
* Scheduled Events
Explain triggers.
---
# 18. Security Documentation
Analyze:
* Authentication
* Authorization
* Validation
* Encryption
* Rate Limiting
* CSRF
* XSS Protection
* SQL Injection Protection
Provide security score.
---
# 19. Performance Optimization
Analyze:
* Bundle Size
* API Efficiency
* Caching
* Lazy Loading
* Database Queries
Provide recommendations.
---
# 20. Error Handling System
Document:
* Global Errors
* API Errors
* Validation Errors
* Database Errors
Explain handling flow.
---
# 21. Logging & Monitoring
Document:
* Logs
* Monitoring
* Alerts
* Analytics
Include setup details.
---
# 22. Testing Documentation
Document:
* Unit Tests
* Integration Tests
* E2E Tests
Include commands.
---
# 23. Deployment Guide
Generate:
## Development
## Staging
## Production
## Docker
## VPS
## Cloud
Include exact deployment steps.
---
# 24. CI/CD Documentation
Analyze workflows.
Document:
* GitHub Actions
* Pipelines
* Deployment Flow
* Release Process
---
# 25. Troubleshooting Guide
Generate common issues.
Example:
* Build Failed
* Database Connection Failed
* Environment Missing
* API Not Working
Provide fixes.
---
# 26. Maintenance Guide
Document:
* Backup Strategy
* Database Backup
* File Backup
* Update Procedure
---
# 27. Scaling Strategy
Explain:
* Horizontal Scaling
* Vertical Scaling
* Database Scaling
* Caching Strategy
---
# 28. Roadmap
Generate:
### Current Features
### Planned Features
### Future Improvements
---
# 29. Developer Onboarding Guide
Create:
## First Day Setup
## Understanding Architecture
## Running Project
## Making Changes
## Deployment Process
---
# 30. AI Project Knowledge Base
Create a dedicated section called:
# PROJECT MEMORY FOR AI AGENTS
This section must include:
* Project Summary
* Folder Explanation
* Business Rules
* Coding Standards
* Naming Conventions
* API Rules
* Database Rules
* Deployment Rules
* Security Rules
This section should allow AI agents like:
* ChatGPT
* Claude
* Gemini
* Cursor
* Windsurf
* Cline
* Roo Code
* Trae
* Augment
* Devin
to understand the project instantly.
---
# 31. Coding Standards
Document:
* Naming conventions
* Folder conventions
* Component standards
* API standards
* Database standards
---
# 32. README Quality Requirements
The generated README must:
* Be professional
* Be enterprise-grade
* Be investor-ready
* Be developer-friendly
* Be AI-agent-friendly
* Be scalable
* Be future-proof
---
# FINAL INSTRUCTIONS
1. Analyze the ENTIRE project before writing.
2. Never leave sections empty.
3. Auto-detect everything possible.
4. Use tables wherever useful.
5. Use Mermaid diagrams extensively.
6. Include real code examples.
7. Include actual project findings.
8. Create a Table of Contents.
9. Add internal anchor links.
10. Generate the final output as a production-ready `README.md`.
The final README should be so comprehensive that it becomes the complete operating manual, technical documentation, onboarding guide, architecture document, deployment guide, maintenance guide, and AI knowledge base for the entire project.
相关推荐
Coherence Coach
AWeirdDev
监看对话,找出助手可能忽略的上下文,仅在确有必要时给出提醒,否则返回 null。
promptmarkdown
React + Tailwind Product Card Component Prompt
AmirMotefaker
让模型扮演资深前端工程师,生成可用于生产环境、响应式的 React + Tailwind CSS 商品卡片组件(TypeScript)。
promptmarkdown
Secure JWT Authentication Middleware
AmirMotefaker
一个「角色/任务/规则」结构的提示词模板,要求模型为 Node.js + Express 设计安全的 JWT 认证中间件,包含 bcrypt 密码哈希与完整错误处理。
promptmarkdown