README Generator
Instructions
Generate a comprehensive, professional README.md file for the project. Follow this structured approach:
Step 1: Analyze Project Structure
First, understand what kind of project this is:
Explore the project directory using list_directory to understand the structure
Identify the project type by looking for key files:
- Python:
setup.py, pyproject.toml, requirements.txt, Pipfile
- Node.js:
package.json, package-lock.json, yarn.lock
- Rust:
Cargo.toml, Cargo.lock
- Go:
go.mod, go.sum
- Java:
pom.xml, build.gradle
- Other: Look for configuration files, main entry points
Read configuration files using read_file to extract:
- Project name and description
- Version information
- Dependencies and requirements
- Scripts and commands
- License information
- Author/maintainer information
Step 2: Identify Key Components
Find the main entry point:
- Look for
main.py, index.js, src/main.rs, main.go, etc.
- Use
grep_search to find executable scripts or entry points
- Check package.json "bin" field, setup.py entry_points, etc.
Discover project features:
- Read source files to understand what the project does
- Look for
__init__.py, index.js, or main modules
- Check for example files, demo scripts, or test files
Identify usage patterns:
- Look for CLI commands defined in package.json, setup.py, or Cargo.toml
- Check for configuration files (
.env.example, config.yaml, etc.)
- Find example usage in code comments or test files
Step 3: Generate README Sections
Create a well-structured README.md with these sections (include only relevant ones):
Required Sections:
Project Title - Clear, descriptive title
- Use the project name from config files (package.json, setup.py, etc.)
- Add a brief one-line description if available
Description - What the project does
- Extract from config files (package.json "description", setup.py "long_description")
- If not found, analyze source code to write a clear description
- Explain the purpose and main features
Installation - How to install
- Python:
pip install, pip install -e ., or pip install -r requirements.txt
- Node.js:
npm install or yarn install
- Rust: Installation from crates.io or
cargo install
- Go:
go install or go get
- Include prerequisites if needed (Python version, Node version, etc.)
Usage - How to use the project
- Basic usage examples
- CLI commands if applicable (from package.json scripts, setup.py entry_points)
- Code examples showing key functionality
- Configuration options if there's a config file
Optional Sections (include if relevant):
Features - Key features and capabilities
- List main features discovered from code analysis
- Highlight unique or important capabilities
Configuration - Setup and configuration
- Environment variables (check for
.env.example or .env)
- Configuration files (describe structure and options)
- Default settings
Development - For contributors
- How to set up development environment
- How to run tests (
npm test, pytest, cargo test, etc.)
- How to build/compile if applicable
- Development dependencies
Requirements/Dependencies - What's needed
- List key dependencies (from requirements.txt, package.json, etc.)
- System requirements
- Version constraints if critical
Contributing - How to contribute
- Link to contributing guidelines if CONTRIBUTING.md exists
- Or provide basic contribution instructions
License - Project license
- Extract from LICENSE file if present
- Or from config files (package.json "license", setup.py "license")
- Include license badge if applicable
Author/Credits - Who made it
- From package.json "author", setup.py "author", etc.
Badges - Status badges (optional)
- Add badges if repository info suggests GitHub/GitLab (CI/CD, coverage, etc.)
Step 4: Write the README
Use markdown formatting:
- Headers for sections
- Code blocks with language tags for examples
- Lists for features, requirements, etc.
- Links for external resources
- Tables if appropriate (for configuration options, etc.)
Make it scannable:
- Use clear section headers
- Include table of contents for long READMEs (if > 5 sections)
- Use consistent formatting
- Add emoji sparingly for visual interest (🚀 for getting started, ⚙️ for configuration, etc.)
Include actual examples:
- Copy relevant code snippets from the project
- Use real function names and API patterns from the codebase
- Show actual CLI commands from the project
Check for existing README:
- If README.md exists, read it first to preserve important information
- Enhance and update rather than completely replace
- Merge new sections with existing valuable content
Step 5: Verify and Complete
Read the generated README back to ensure:
- All sections are properly formatted
- No placeholder text remains
- Examples are accurate and work
- Links are correct (if any)
Ensure completeness:
- Installation instructions are clear
- Usage examples are practical
- All necessary information is included
Examples
Example 1: Python Package
User: "Generate a README for this Python project"
- Read
setup.py or pyproject.toml for metadata
- Check
requirements.txt for dependencies
- Find main module or entry point
- Generate README with pip install instructions
Example 2: Node.js Application
User: "Create a README file"
- Read
package.json for project info
- Extract scripts and commands
- Check for
.env.example for configuration
- Generate README with npm/yarn commands
Example 3: Existing README Update
User: "Update the README"
- Read existing README.md
- Analyze project changes
- Enhance with new sections or update existing ones
- Preserve valuable existing content
Best Practices
- Be specific: Use actual project information, not generic placeholders
- Match style: Follow existing code style and naming conventions in the project
- Practical examples: Show real usage patterns from the codebase
- Complete: Include all necessary information for someone new to the project
- Accurate: Verify all commands and examples work with the actual project setup
Notes
- Always analyze the actual project before generating the README
- Don't guess - read configuration files and source code
- Adapt the README structure to the project's complexity
- Simple projects need simpler READMEs, complex projects need more detail
1---2name: generating-readmes3description: Generate comprehensive README files for projects. Use when the user asks to create, generate, or write a README, readme file, or project documentation.4---5
6# README Generator
7
8## Instructions
9
10Generate a comprehensive, professional README.md file for the project. Follow this structured approach:
11
12### Step 1: Analyze Project Structure
13
14First, understand what kind of project this is:
15
161. **Explore the project directory** using `list_directory` to understand the structure
172. **Identify the project type** by looking for key files:
18 - Python: `setup.py`, `pyproject.toml`, `requirements.txt`, `Pipfile`
19 - Node.js: `package.json`, `package-lock.json`, `yarn.lock`
20 - Rust: `Cargo.toml`, `Cargo.lock`
21 - Go: `go.mod`, `go.sum`
22 - Java: `pom.xml`, `build.gradle`
23 - Other: Look for configuration files, main entry points
24
253. **Read configuration files** using `read_file` to extract:
26 - Project name and description
27 - Version information
28 - Dependencies and requirements
29 - Scripts and commands
30 - License information
31 - Author/maintainer information
32
33### Step 2: Identify Key Components
34
351. **Find the main entry point**:
36 - Look for `main.py`, `index.js`, `src/main.rs`, `main.go`, etc.
37 - Use `grep_search` to find executable scripts or entry points
38 - Check package.json "bin" field, setup.py entry_points, etc.
39
402. **Discover project features**:
41 - Read source files to understand what the project does
42 - Look for `__init__.py`, `index.js`, or main modules
43 - Check for example files, demo scripts, or test files
44
453. **Identify usage patterns**:
46 - Look for CLI commands defined in package.json, setup.py, or Cargo.toml
47 - Check for configuration files (`.env.example`, `config.yaml`, etc.)
48 - Find example usage in code comments or test files
49
50### Step 3: Generate README Sections
51
52Create a well-structured README.md with these sections (include only relevant ones):
53
54#### Required Sections:
55
561. **Project Title** - Clear, descriptive title
57 - Use the project name from config files (package.json, setup.py, etc.)
58 - Add a brief one-line description if available
59
602. **Description** - What the project does
61 - Extract from config files (package.json "description", setup.py "long_description")
62 - If not found, analyze source code to write a clear description
63 - Explain the purpose and main features
64
653. **Installation** - How to install
66 - Python: `pip install`, `pip install -e .`, or `pip install -r requirements.txt`
67 - Node.js: `npm install` or `yarn install`
68 - Rust: Installation from crates.io or `cargo install`
69 - Go: `go install` or `go get`
70 - Include prerequisites if needed (Python version, Node version, etc.)
71
724. **Usage** - How to use the project
73 - Basic usage examples
74 - CLI commands if applicable (from package.json scripts, setup.py entry_points)
75 - Code examples showing key functionality
76 - Configuration options if there's a config file
77
78#### Optional Sections (include if relevant):
79
805. **Features** - Key features and capabilities
81 - List main features discovered from code analysis
82 - Highlight unique or important capabilities
83
846. **Configuration** - Setup and configuration
85 - Environment variables (check for `.env.example` or `.env`)
86 - Configuration files (describe structure and options)
87 - Default settings
88
897. **Development** - For contributors
90 - How to set up development environment
91 - How to run tests (`npm test`, `pytest`, `cargo test`, etc.)
92 - How to build/compile if applicable
93 - Development dependencies
94
958. **Requirements/Dependencies** - What's needed
96 - List key dependencies (from requirements.txt, package.json, etc.)
97 - System requirements
98 - Version constraints if critical
99
1009. **Contributing** - How to contribute
101 - Link to contributing guidelines if CONTRIBUTING.md exists
102 - Or provide basic contribution instructions
103
10410. **License** - Project license
105 - Extract from LICENSE file if present
106 - Or from config files (package.json "license", setup.py "license")
107 - Include license badge if applicable
108
10911. **Author/Credits** - Who made it
110 - From package.json "author", setup.py "author", etc.
111
11212. **Badges** - Status badges (optional)
113 - Add badges if repository info suggests GitHub/GitLab (CI/CD, coverage, etc.)
114
115### Step 4: Write the README
116
1171. **Use markdown formatting**:
118 - Headers for sections
119 - Code blocks with language tags for examples
120 - Lists for features, requirements, etc.
121 - Links for external resources
122 - Tables if appropriate (for configuration options, etc.)
123
1242. **Make it scannable**:
125 - Use clear section headers
126 - Include table of contents for long READMEs (if > 5 sections)
127 - Use consistent formatting
128 - Add emoji sparingly for visual interest (🚀 for getting started, ⚙️ for configuration, etc.)
129
1303. **Include actual examples**:
131 - Copy relevant code snippets from the project
132 - Use real function names and API patterns from the codebase
133 - Show actual CLI commands from the project
134
1354. **Check for existing README**:
136 - If README.md exists, read it first to preserve important information
137 - Enhance and update rather than completely replace
138 - Merge new sections with existing valuable content
139
140### Step 5: Verify and Complete
141
1421. **Read the generated README** back to ensure:
143 - All sections are properly formatted
144 - No placeholder text remains
145 - Examples are accurate and work
146 - Links are correct (if any)
147
1482. **Ensure completeness**:
149 - Installation instructions are clear
150 - Usage examples are practical
151 - All necessary information is included
152
153## Examples
154
155### Example 1: Python Package
156User: "Generate a README for this Python project"
157- Read `setup.py` or `pyproject.toml` for metadata
158- Check `requirements.txt` for dependencies
159- Find main module or entry point
160- Generate README with pip install instructions
161
162### Example 2: Node.js Application
163User: "Create a README file"
164- Read `package.json` for project info
165- Extract scripts and commands
166- Check for `.env.example` for configuration
167- Generate README with npm/yarn commands
168
169### Example 3: Existing README Update
170User: "Update the README"
171- Read existing README.md
172- Analyze project changes
173- Enhance with new sections or update existing ones
174- Preserve valuable existing content
175
176## Best Practices
177
1781. **Be specific**: Use actual project information, not generic placeholders
1792. **Match style**: Follow existing code style and naming conventions in the project
1803. **Practical examples**: Show real usage patterns from the codebase
1814. **Complete**: Include all necessary information for someone new to the project
1825. **Accurate**: Verify all commands and examples work with the actual project setup
183
184## Notes
185
186- Always analyze the actual project before generating the README
187- Don't guess - read configuration files and source code
188- Adapt the README structure to the project's complexity
189- Simple projects need simpler READMEs, complex projects need more detail
190