readme-craft
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseREADME Craft
README 编写指南
Audience: Developers creating or improving project documentation.
Goal: Generate README files that convert scanners into users within 60 seconds.
受众: 正在创建或优化项目文档的开发者。
目标: 编写能在60秒内将浏览者转化为用户的README文件。
Core Philosophy
核心理念
A README is a sales pitch, onboarding guide, AND reference manual. Lead with value, prove with examples, document with precision.
README既是销售说辞、入门指南,也是参考手册。以价值为导向,用示例佐证,精准记录内容。
Common Failures
常见误区及修复方案
| Failure | Fix |
|---|---|
| Installation first | Lead with TL;DR and value prop |
| Describes what it IS | Describe what problem it SOLVES |
| No examples | One example per feature minimum |
| Hidden limitations | Dedicated limitations section |
| Single install method | Three+ pathways (curl, package manager, source) |
| No troubleshooting | Document top 5 common errors |
| 误区 | 修复方案 |
|---|---|
| 先讲安装步骤 | 先展示TL;DR(摘要)和价值主张 |
| 描述工具本身 | 说明工具解决的问题 |
| 无示例内容 | 每个功能至少配一个示例 |
| 隐藏局限性 | 增设专门的局限性板块 |
| 仅提供一种安装方式 | 提供三种及以上途径(curl、包管理器、源码编译) |
| 无故障排查内容 | 记录Top5常见错误 |
Golden Structure
黄金结构
Tier 1: Hero Section
第一层:标题区
markdown
<p align="center">
<img src="logo.png" width="200" alt="Project Name">
</p>
<p align="center">
<a href="..."><img src="https://img.shields.io/..." alt="CI"></a>
<a href="..."><img src="https://img.shields.io/..." alt="Version"></a>
<a href="..."><img src="https://img.shields.io/..." alt="License"></a>
</p>
<p align="center">
<b>One-line description of what problem this solves</b>
</p>
```bash
curl -sSL https://example.com/install.sh | bashundefinedmarkdown
<p align="center">
<img src="logo.png" width="200" alt="Project Name">
</p>
<p align="center">
<a href="..."><img src="https://img.shields.io/..." alt="CI"></a>
<a href="..."><img src="https://img.shields.io/..." alt="Version"></a>
<a href="..."><img src="https://img.shields.io/..." alt="License"></a>
</p>
<p align="center">
<b>一句话说明工具解决的问题</b>
</p>
```bash
curl -sSL https://example.com/install.sh | bashundefinedTier 2: TL;DR
第二层:TL;DR(摘要)
markdown
undefinedmarkdown
undefinedTL;DR
TL;DR
Problem: [Specific pain point users face]
Solution: [How this tool solves it]
| Feature | Benefit |
|---|---|
| Feature 1 | Quantified benefit |
| Feature 2 | Quantified benefit |
| Feature 3 | Quantified benefit |
undefined问题: [用户面临的具体痛点]
解决方案: [该工具的解决方式]
| 功能 | 收益 |
|---|---|
| 功能1 | 可量化的收益 |
| 功能2 | 可量化的收益 |
| 功能3 | 可量化的收益 |
undefinedTier 3: Quick Example
第三层:快速入门示例
markdown
undefinedmarkdown
undefinedQuick Start
快速入门
1. Install
1. 安装
curl -sSL https://example.com/install.sh | bash
curl -sSL https://example.com/install.sh | bash
2. Initialize
2. 初始化
mytool init
mytool init
3. Run core workflow
3. 运行核心流程
mytool process input.txt --output result.json
mytool process input.txt --output result.json
4. Verify
4. 验证
mytool status
**Rule:** 5-10 commands demonstrating the core workflow.mytool status
**规则:** 用5-10条命令展示核心工作流程。Tier 4: Reference Sections
第四层:参考板块
- Philosophy/Design decisions
- Alternatives comparison
- Installation (multiple methods)
- Command reference
- Configuration options
- Architecture (for complex systems)
- 设计理念/决策依据
- 竞品对比
- 安装方式(多种途径)
- 命令参考
- 配置选项
- 架构说明(针对复杂系统)
Tier 5: Support Sections
第五层:支持板块
- Troubleshooting
- Limitations
- FAQ
- Contributing
- License
- 故障排查
- 局限性说明
- 常见问题(FAQ)
- 贡献指南
- 许可证
Section Templates
板块模板
Comparison Table
竞品对比表格
markdown
undefinedmarkdown
undefinedWhy [Tool] Over Alternatives?
为何选择[工具]而非竞品?
| Feature | [Tool] | Alternative A | Alternative B |
|---|---|---|---|
| Speed | 50ms | 200ms | 150ms |
| Memory | 10MB | 50MB | 30MB |
| Feature X | Yes | No | Partial |
| Feature Y | Yes | Yes | No |
Choose [Tool] when: [specific use case]
Choose Alternative A when: [specific use case]
undefined| 功能 | [工具] | 竞品A | 竞品B |
|---|---|---|---|
| 速度 | 50ms | 200ms | 150ms |
| 内存占用 | 10MB | 50MB | 30MB |
| 功能X | 支持 | 不支持 | 部分支持 |
| 功能Y | 支持 | 支持 | 不支持 |
选择[工具]的场景: [具体适用场景]
选择竞品A的场景: [具体适用场景]
undefinedInstallation (Multiple Methods)
多方式安装模板
markdown
undefinedmarkdown
undefinedInstallation
安装
Quick Install (Recommended)
快速安装(推荐)
bash
curl -sSL https://example.com/install.sh | bashbash
curl -sSL https://example.com/install.sh | bashPackage Managers
包管理器安装
bash
undefinedbash
undefinedmacOS
macOS
brew install mytool
brew install mytool
Linux
Linux
apt install mytool # Debian/Ubuntu
dnf install mytool # Fedora
apt install mytool # Debian/Ubuntu
dnf install mytool # Fedora
Windows
Windows
winget install mytool
undefinedwinget install mytool
undefinedFrom Source
源码编译安装
bash
git clone https://github.com/user/mytool
cd mytool
make installundefinedbash
git clone https://github.com/user/mytool
cd mytool
make installundefinedCommand Reference
命令参考模板
markdown
undefinedmarkdown
undefinedCommands
命令说明
Global Flags
全局参数
| Flag | Description |
|---|---|
| Increase output verbosity |
| Suppress non-error output |
| Use custom config file |
| 参数 | 描述 |
|---|---|
| 提升输出详细程度 |
| 抑制非错误输出 |
| 使用自定义配置文件 |
mytool init
mytool initmytool init
mytool initInitialize a new project.
bash
mytool init # Interactive setup
mytool init --template minimal # Use template
mytool init --force # Overwrite existing初始化新项目。
bash
mytool init # 交互式设置
mytool init --template minimal # 使用极简模板
mytool init --force # 覆盖现有项目mytool run
mytool runmytool run
mytool runExecute the main workflow.
bash
mytool run input.txt # Basic usage
mytool run -o output.json # Custom output
mytool run --dry-run # Preview changesundefined执行主工作流程。
bash
mytool run input.txt # 基础用法
mytool run -o output.json # 指定自定义输出
mytool run --dry-run # 预览变更undefinedTroubleshooting
故障排查模板
markdown
undefinedmarkdown
undefinedTroubleshooting
故障排查
Error: "Permission denied"
错误:"Permission denied"(权限不足)
Cause: Installation script lacks execute permissions.
Fix:
bash
chmod +x install.sh
./install.sh原因: 安装脚本缺少执行权限。
修复方案:
bash
chmod +x install.sh
./install.shError: "Command not found"
错误:"Command not found"(命令未找到)
Cause: Binary not in PATH.
Fix:
bash
export PATH="$HOME/.local/bin:$PATH"原因: 二进制文件未在PATH路径中。
修复方案:
bash
export PATH="$HOME/.local/bin:$PATH"Add to ~/.bashrc or ~/.zshrc for persistence
如需持久生效,添加到~/.bashrc或~/.zshrc中
undefinedundefinedError: "Config file not found"
错误:"Config file not found"(配置文件未找到)
Cause: Missing configuration.
Fix:
bash
mytool init --configundefined原因: 缺少配置文件。
修复方案:
bash
mytool init --configundefinedLimitations
局限性说明模板
markdown
undefinedmarkdown
undefinedLimitations
局限性
Current constraints:
| Limitation | Workaround | Planned Fix |
|---|---|---|
| Max 10MB files | Split large files | v2.0 |
| No Windows GUI | Use WSL | Under review |
| Single-threaded | Use multiple instances | v1.5 |
Out of scope:
- Feature X (use [Alternative] instead)
- Feature Y (not planned)
undefined当前限制:
| 限制 | 临时解决方案 | 计划修复版本 |
|---|---|---|
| 最大支持10MB文件 | 拆分大文件 | v2.0 |
| 无Windows图形界面 | 使用WSL | 评估中 |
| 单线程运行 | 多实例并行 | v1.5 |
暂不支持范围:
- 功能X(建议使用[替代工具])
- 功能Y(暂无计划)
undefinedFAQ
常见问题(FAQ)模板
markdown
undefinedmarkdown
undefinedFAQ
常见问题
<details>
<summary><b>Q: How does this compare to [Alternative]?</b></summary>
[Tool] focuses on [specific strength], while [Alternative] excels at [different use case]. Choose [Tool] when you need [criteria].
</details>
<details>
<summary><b>Q: Can I use this in production?</b></summary>
Yes. [Tool] is used in production by [companies/projects]. See our stability policy.
</details>
```<details>
<summary><b>问:该工具与[竞品]相比如何?</b></summary>
[工具]专注于[特定优势],而[竞品]擅长[不同场景]。当你需要[特定条件]时选择[工具]。
</details>
<details>
<summary><b>问:能否在生产环境中使用?</b></summary>
可以。[工具]已被[企业/项目]用于生产环境。详见我们的稳定性政策。
</details>
```Badge Reference
徽章引用模板
markdown
<!-- CI Status -->

<!-- Version -->

<!-- License -->

<!-- Downloads -->

<!-- Package Managers -->



markdown
<!-- CI状态 -->

<!-- 版本号 -->

<!-- 许可证 -->

<!-- 下载量 -->

<!-- 包管理器版本 -->



Progressive Disclosure
渐进式展示
For long READMEs (1000+ lines):
markdown
<details>
<summary><b>Advanced Configuration</b></summary>
[Detailed content here]
</details>Or externalize:
docs/CONFIGURATION.mddocs/ARCHITECTURE.mddocs/CONTRIBUTING.md
Keep README focused on the 80% use case.
对于超过1000行的长README:
markdown
<details>
<summary><b>高级配置</b></summary>
[详细内容]
</details>或拆分至外部文档:
docs/CONFIGURATION.mddocs/ARCHITECTURE.mddocs/CONTRIBUTING.md
保持README聚焦于80%用户的核心需求。
Pre-Publication Checklist
发布前检查清单
Hero:
- Logo/image present
- Badges current and working
- One-liner describes the problem solved
- Quick install command visible
Content:
- TL;DR within first scroll
- Every feature has an example
- Code blocks are copy-paste ready
- 3+ installation methods documented
Trust:
- Comparison with alternatives (honest)
- Limitations documented
- Top 5 errors in troubleshooting
- All links verified
Polish:
- Consistent terminology
- No stale badges
- Grammar/spelling checked
标题区:
- 包含Logo/图片
- 徽章为最新且可正常显示
- 一句话描述清晰说明解决的问题
- 快速安装命令可见
内容:
- TL;DR在首屏范围内
- 每个功能都配有示例
- 代码块可直接复制使用
- 记录了3种及以上安装方式
可信度:
- 与竞品的对比真实客观
- 已记录局限性
- 故障排查包含Top5常见错误
- 所有链接均已验证
细节优化:
- 术语表述一致
- 无失效徽章
- 语法/拼写检查无误
Anti-Patterns
反模式
| Do NOT | Do Instead |
|---|---|
| Start with installation | Start with value proposition |
| "This tool is a..." | "This tool solves..." |
| Screenshot-only demos | Executable code blocks |
| Claim without example | Example per feature |
| Hide limitations | Dedicated section |
| Single install method | Multiple pathways |
| Ignore errors | Troubleshooting section |
| 切勿 | 正确做法 |
|---|---|
| 开篇就讲安装步骤 | 先展示价值主张 |
| “该工具是一款...” | “该工具解决了...” |
| 仅用截图演示 | 提供可执行的代码块 |
| 空口无凭的宣称 | 每个功能配示例 |
| 隐藏局限性 | 设置专门板块说明 |
| 仅提供一种安装方式 | 提供多种途径 |
| 忽略错误场景 | 增设故障排查板块 |
Reference Examples
参考示例
Study these for excellent README patterns:
- ripgrep - Benchmark data, comparison matrices
- bat - Feature highlights, visual demos
- starship - Configuration presets, install matrix
- jq - Tutorial progression, manual linking
以下项目的README是优秀范式,可参考学习:
- ripgrep - 基准数据、对比矩阵
- bat - 功能亮点、可视化演示
- starship - 配置预设、安装矩阵
- jq - 教程进阶、手册链接