project-setup-guide
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseProject Setup Guide Skill
项目设置指南Skill
Generate professional, comprehensive README.md files for any project type requiring setup documentation.
为任何需要设置文档的项目类型生成专业、全面的README.md文件。
Supported Project Types
支持的项目类型
| Type | Examples | Key Sections |
|---|---|---|
| Dotfiles | Shell configs, vim, tmux, git | Tool configs, aliases, keybindings |
| CLI Tools | Scripts, utilities, automation | Installation, usage, options |
| Libraries | npm packages, Python modules | API reference, examples |
| Applications | Web apps, mobile apps, services | Environment setup, deployment |
| Frameworks | Starter kits, boilerplates | Configuration, extending |
| Dev Environments | Docker setups, Nix configs | Prerequisites, bootstrapping |
| 类型 | 示例 | 核心章节 |
|---|---|---|
| Dotfiles | Shell配置、vim、tmux、git | 工具配置、别名、快捷键 |
| CLI工具 | 脚本、实用程序、自动化工具 | 安装、使用、选项 |
| 库 | npm包、Python模块 | API参考、示例 |
| 应用程序 | Web应用、移动应用、服务 | 环境设置、部署 |
| 框架 | 启动模板、脚手架 | 配置、扩展 |
| 开发环境 | Docker配置、Nix配置 | 前置要求、引导设置 |
6-Step Workflow
六步工作流程
Follow these steps sequentially to create a complete setup guide:
按顺序遵循以下步骤,创建完整的设置指南:
Step 1: Audit the Project
步骤1:项目审查
Goal: Understand what exists before documenting.
Actions:
1. List all configuration files and their purposes
2. Identify dependencies (package.json, requirements.txt, Brewfile, etc.)
3. Find existing documentation (README, docs/, wiki)
4. Note installation scripts or makefiles
5. Check for environment variables or secretsQuestions to answer:
- What does this project do?
- Who is the target audience?
- What are the prerequisites?
- Are there automated setup options?
目标: 在记录前了解项目现有内容。
Actions:
1. 列出所有配置文件及其用途
2. 识别依赖项(package.json、requirements.txt、Brewfile等)
3. 查找现有文档(README、docs/、wiki)
4. 记录安装脚本或makefile
5. 检查环境变量或密钥需要回答的问题:
- 这个项目的功能是什么?
- 目标受众是谁?
- 前置要求有哪些?
- 是否有自动化设置选项?
Step 2: Determine Structure
步骤2:确定结构
Goal: Choose sections based on project type.
Universal sections (all projects):
- Title with badges
- One-line description
- Features overview
- Table of Contents
- Installation
- Basic usage
Conditional sections (by type):
| If Project Has... | Include Section |
|---|---|
| Multiple tools/configs | Repository Structure |
| CLI commands | Command Reference |
| Configuration options | Configuration Guide |
| Shell customizations | Aliases & Functions |
| Keyboard shortcuts | Keybindings |
| API surface | API Reference |
| Visual components | Screenshots |
| Breaking changes | Migration Guide |
| Community | Contributing Guide |
目标: 根据项目类型选择章节。
通用章节(所有项目):
- 带徽章的标题
- 一句话描述
- 功能概述
- 目录
- 安装
- 基础使用
条件章节(按类型):
| 如果项目包含... | 包含章节 |
|---|---|
| 多个工具/配置 | 仓库结构 |
| CLI命令 | 命令参考 |
| 配置选项 | 配置指南 |
| Shell自定义 | 别名与函数 |
| 键盘快捷键 | 快捷键 |
| API接口 | API参考 |
| 可视化组件 | 截图 |
| 破坏性变更 | 迁移指南 |
| 社区 | 贡献指南 |
Step 3: Document Core Information
步骤3:记录核心信息
Goal: Write the essential sections every README needs.
目标: 编写每个README都需要的核心章节。
Title Block Pattern
标题块模板
markdown
undefinedmarkdown
undefinedProject Name
项目名称
One-line description of what this project does
undefined一句话描述项目功能
undefinedFeatures Section Pattern
功能章节模板
Use a table for scannable feature lists:
markdown
undefined使用表格呈现便于扫描的功能列表:
markdown
undefinedFeatures at a Glance
功能概览
| Category | Features |
|---|---|
| Shell | Zsh with Powerlevel10k, syntax highlighting, autosuggestions |
| Editor | Neovim with LSP, Telescope, Treesitter |
| Terminal | Tmux with custom keybindings, Alacritty config |
undefined| 类别 | 功能 |
|---|---|
| Shell | Zsh + Powerlevel10k、语法高亮、自动建议 |
| 编辑器 | Neovim + LSP、Telescope、Treesitter |
| 终端 | Tmux + 自定义快捷键、Alacritty配置 |
undefinedRepository Structure Pattern
仓库结构模板
markdown
undefinedmarkdown
undefinedRepository Structure
仓库结构
```
project-root/
├── config/ # Application configurations
│ ├── app.config.ts
│ └── database.ts
├── src/ # Source code
│ ├── components/
│ └── utils/
├── scripts/ # Automation scripts
│ └── setup.sh
└── README.md
```
undefined```
project-root/
├── config/ # 应用配置
│ ├── app.config.ts
│ └── database.ts
├── src/ # 源代码
│ ├── components/
│ └── utils/
├── scripts/ # 自动化脚本
│ └── setup.sh
└── README.md
```
undefinedStep 4: Write Setup Instructions
步骤4:编写设置说明
Goal: Provide clear, tested installation steps.
目标: 提供清晰、经过测试的安装步骤。
The Dual Setup Pattern
双重设置模板
Always offer both automated AND manual options when possible:
markdown
undefined尽可能同时提供自动化和手动两种选项:
markdown
undefinedInstallation
安装
Quick Start (Recommended)
快速开始(推荐)
```bash
```bash
One-line installation
一键安装
curl -fsSL https://example.com/install.sh | bash
```
curl -fsSL https://example.com/install.sh | bash
```
Manual Installation
手动安装
<details>
<summary>Click to expand manual steps</summary>
-
Clone the repository: ```bash git clone https://github.com/user/project.git cd project ```
-
Install dependencies: ```bash npm install ```
-
Configure environment: ```bash cp .env.example .env
Edit .env with your values
```
<details>
<summary>点击展开手动步骤</summary>
-
克隆仓库: ```bash git clone https://github.com/user/project.git cd project ```
-
安装依赖: ```bash npm install ```
-
配置环境: ```bash cp .env.example .env
编辑.env文件填入你的值
```
Prerequisites Pattern
前置要求模板
markdown
undefinedmarkdown
undefinedPrerequisites
前置要求
| Requirement | Version | Check Command |
|---|---|---|
| Node.js | ≥18.0 | |
| npm | ≥9.0 | |
| Git | ≥2.0 | |
undefined| 要求 | 版本 | 检查命令 |
|---|---|---|
| Node.js | ≥18.0 | |
| npm | ≥9.0 | |
| Git | ≥2.0 | |
undefinedEnvironment Variables Pattern
环境变量模板
markdown
undefinedmarkdown
undefinedEnvironment Variables
环境变量
| Variable | Required | Default | Description |
|---|---|---|---|
| Yes | - | PostgreSQL connection string |
| Yes | - | External service API key |
| No | | Enable debug logging |
undefined| 变量 | 是否必填 | 默认值 | 描述 |
|---|---|---|---|
| 是 | - | PostgreSQL连接字符串 |
| 是 | - | 外部服务API密钥 |
| 否 | | 启用调试日志 |
undefinedStep 5: Document Commands & Usage
步骤5:记录命令与使用方法
Goal: Show users how to actually use the project.
目标: 向用户展示如何实际使用项目。
Command Reference Pattern
命令参考模板
markdown
undefinedmarkdown
undefinedCommands
命令
| Command | Description |
|---|---|
| Start development server |
| Run test suite |
| Build for production |
| Check code style |
undefined| 命令 | 描述 |
|---|---|
| 启动开发服务器 |
| 运行测试套件 |
| 构建生产版本 |
| 检查代码风格 |
undefinedUsage Examples Pattern
使用示例模板
markdown
undefinedmarkdown
undefinedUsage
使用方法
Basic Example
基础示例
```typescript
import { something } from 'project';
const result = something({
option: 'value'
});
```
```typescript
import { something } from 'project';
const result = something({
option: 'value'
});
```
Advanced Example
进阶示例
```typescript
// More complex usage with all options
import { something, configure } from 'project';
configure({
debug: true,
timeout: 5000
});
const result = await something({
option: 'value',
callback: (data) => console.log(data)
});
```
undefined```typescript
// 包含所有选项的复杂用法
import { something, configure } from 'project';
configure({
debug: true,
timeout: 5000
});
const result = await something({
option: 'value',
callback: (data) => console.log(data)
});
```
undefinedStep 6: Add Supporting Sections
步骤6:添加辅助章节
Goal: Complete the README with helpful extras.
目标: 用实用的补充内容完善README。
Configuration Pattern
配置模板
markdown
undefinedmarkdown
undefinedConfiguration
配置
Configuration file:
config.json```json
{
"setting1": "value",
"setting2": true,
"nested": {
"option": "value"
}
}
```
| Option | Type | Default | Description |
|---|---|---|---|
| string | | Description of setting1 |
| boolean | | Description of setting2 |
undefined配置文件:
config.json```json
{
"setting1": "value",
"setting2": true,
"nested": {
"option": "value"
}
}
```
| 选项 | 类型 | 默认值 | 描述 |
|---|---|---|---|
| string | | setting1的描述 |
| boolean | | setting2的描述 |
undefinedTroubleshooting Pattern
故障排除模板
markdown
undefinedmarkdown
undefinedTroubleshooting
故障排除
<details>
<summary><strong>Error: Module not found</strong></summary>
Cause: Dependencies not installed properly.
Solution:
```bash
rm -rf node_modules
npm install
```
</details>
<details>
<summary><strong>Permission denied</strong></summary>
Cause: Script lacks execute permission.
Solution:
```bash
chmod +x scripts/setup.sh
```
</details>
```<details>
<summary><strong>错误:模块未找到</strong></summary>
原因: 依赖项未正确安装。
解决方案:
```bash
rm -rf node_modules
npm install
```
</details>
<details>
<summary><strong>权限被拒绝</strong></summary>
原因: 脚本缺少执行权限。
解决方案:
```bash
chmod +x scripts/setup.sh
```
</details>
```Updating Pattern
更新模板
markdown
undefinedmarkdown
undefinedUpdating
更新
```bash
```bash
Pull latest changes
拉取最新变更
git pull origin main
git pull origin main
Update dependencies
更新依赖
npm install
npm install
Run migrations (if applicable)
运行迁移(如适用)
npm run migrate
```
undefinednpm run migrate
```
undefinedUninstall Pattern
卸载模板
markdown
undefinedmarkdown
undefinedUninstallation
卸载
```bash
```bash
Remove installed files
移除已安装文件
npm uninstall -g project-name
npm uninstall -g project-name
Clean up configuration (optional)
清理配置(可选)
rm -rf ~/.config/project-name
```
---rm -rf ~/.config/project-name
```
---Project-Specific Guidance
项目特定指南
For Dotfiles Projects
针对Dotfiles项目
Must include:
- Tool-by-tool breakdown with features
- Aliases and abbreviations table
- Custom functions documentation
- Keybindings reference (especially for tmux/vim)
- Backup instructions before installation
- Symlink strategy explanation
Example structure:
markdown
undefined必须包含:
- 按工具拆分的功能说明
- 别名与缩写表格
- 自定义函数文档
- 快捷键参考(尤其是tmux/vim)
- 安装前的备份说明
- 符号链接策略解释
示例结构:
markdown
undefinedTools Included
包含的工具
Zsh
Zsh
- Theme: Powerlevel10k
- Plugins: syntax-highlighting, autosuggestions, fzf
- Custom aliases: see below
- 主题:Powerlevel10k
- 插件:语法高亮、自动建议、fzf
- 自定义别名:见下方
Neovim
Neovim
- Plugin manager: lazy.nvim
- LSP servers: typescript, lua, python
- Keybindings: see below
- 插件管理器:lazy.nvim
- LSP服务器:typescript、lua、python
- 快捷键:见下方
Shell Aliases
Shell别名
| Alias | Expansion | Description |
|---|---|---|
| | Long list with hidden |
| | Go up one directory |
| | Git shorthand |
| 别名 | 展开内容 | 描述 |
|---|---|---|
| | 显示长列表及隐藏文件 |
| | 返回上一级目录 |
| | Git简写 |
Keybindings
快捷键
Tmux
Tmux
| Key | Action |
|---|---|
| Prefix key |
| Vertical split |
| Horizontal split |
undefined| 按键 | 操作 |
|---|---|
| 前缀键 |
| 垂直拆分 |
| 水平拆分 |
undefinedFor Libraries/Packages
针对库/包
Must include:
- Installation via package manager
- Import/require examples
- API reference with types
- Multiple usage examples (basic → advanced)
- TypeScript types documentation (if applicable)
Example structure:
markdown
undefined必须包含:
- 通过包管理器安装
- 导入/引用示例
- 带类型的API参考
- 多个使用示例(基础→进阶)
- TypeScript类型文档(如适用)
示例结构:
markdown
undefinedInstallation
安装
```bash
npm install package-name
```bash
npm install package-name
or
或
yarn add package-name
yarn add package-name
or
或
pnpm add package-name
```
pnpm add package-name
```
Quick Start
快速开始
```typescript
import { mainFunction } from 'package-name';
const result = mainFunction('input');
```
```typescript
import { mainFunction } from 'package-name';
const result = mainFunction('input');
```
API Reference
API参考
mainFunction(input, options?)
mainFunction(input, options?)mainFunction(input, options?)
mainFunction(input, options?)| Parameter | Type | Required | Description |
|---|---|---|---|
| | Yes | The input to process |
| | No | Configuration options |
Returns:
ResultExample:
```typescript
const result = mainFunction('hello', { uppercase: true });
// => 'HELLO'
```
undefined| 参数 | 类型 | 是否必填 | 描述 |
|---|---|---|---|
| | 是 | 要处理的输入 |
| | 否 | 配置选项 |
返回:
Result示例:
```typescript
const result = mainFunction('hello', { uppercase: true });
// => 'HELLO'
```
undefinedFor Applications
针对应用程序
Must include:
- System requirements
- Environment setup (env vars, config files)
- Development vs production instructions
- Database setup (if applicable)
- Deployment guide
Example structure:
markdown
undefined必须包含:
- 系统要求
- 环境设置(环境变量、配置文件)
- 开发与生产环境说明
- 数据库设置(如适用)
- 部署指南
示例结构:
markdown
undefinedGetting Started
快速开始
Prerequisites
前置要求
- Node.js 18+
- PostgreSQL 14+
- Redis (optional, for caching)
- Node.js 18+
- PostgreSQL 14+
- Redis(可选,用于缓存)
Development Setup
开发环境设置
-
Clone and install: ```bash git clone https://github.com/user/app.git cd app npm install ```
-
Set up database: ```bash createdb myapp_dev npm run db:migrate npm run db:seed ```
-
Configure environment: ```bash cp .env.example .env ```
-
Start development server: ```bash npm run dev ```
-
克隆并安装: ```bash git clone https://github.com/user/app.git cd app npm install ```
-
设置数据库: ```bash createdb myapp_dev npm run db:migrate npm run db:seed ```
-
配置环境: ```bash cp .env.example .env ```
-
启动开发服务器: ```bash npm run dev ```
Production Deployment
生产部署
See Deployment Guide
---查看部署指南
---Formatting Standards
格式标准
Tables
表格
- Use tables for: features, commands, env vars, options, keybindings
- Always include header row
- Align columns for readability in raw markdown
- 使用表格展示:功能、命令、环境变量、选项、快捷键
- 始终包含表头行
- 在原始Markdown中对齐列以提高可读性
Code Blocks
代码块
- Always specify language for syntax highlighting
- Use for shell commands
bash - Use over
typescriptwhen types are shownjavascript - Keep examples concise but complete
- 始终指定语言以启用语法高亮
- Shell命令使用
bash - 显示类型时使用而非
typescriptjavascript - 示例保持简洁但完整
Collapsible Sections
可折叠章节
Use for:
<details>- Long installation steps
- Troubleshooting items
- Optional/advanced content
- Manual alternatives to automated steps
markdown
<details>
<summary>Click to expand</summary>
Content here...
</details>使用标签展示:
<details>- 冗长的安装步骤
- 故障排除项
- 可选/进阶内容
- 自动化步骤的手动替代方案
markdown
<details>
<summary>Click to expand</summary>
Content here...
</details>Badges
徽章
Place at top of README, common badges:
- License
- Version/Release
- Build status
- npm/PyPI downloads
- Code coverage
markdown
[](LICENSE)
[](https://npmjs.com/package/package)放置在README顶部,常见徽章:
- 许可证
- 版本/发布
- 构建状态
- npm/PyPI下载量
- 代码覆盖率
markdown
[](LICENSE)
[](https://npmjs.com/package/package)Table of Contents
目录
Generate for READMEs with 5+ sections:
markdown
undefined当README包含5个以上章节时生成目录:
markdown
undefinedTable of Contents
目录
Section Templates Reference
章节模板参考
For detailed, copy-paste-ready templates for each project type, see:
references/section-templates.md
如需各项目类型的详细可复制模板,请查看:
references/section-templates.md
Quality Checklist
质量检查清单
Before finalizing any README, verify:
- Accurate: All commands tested and working
- Complete: All prerequisites listed
- Scannable: Uses tables, headers, and formatting
- Accessible: Both quick start and detailed options
- Maintainable: Easy to update when project changes
- Consistent: Formatting uniform throughout
在最终确定任何README前,验证以下内容:
- 准确: 所有命令均经过测试且可用
- 完整: 列出所有前置要求
- 易扫描: 使用表格、标题和格式
- 易访问: 同时提供快速开始和详细选项
- 易维护: 项目变更时易于更新
- 一致: 整个文档格式统一
Example Workflow
示例工作流程
User: "Create a setup guide for my dotfiles repo"
Claude's approach:
- Read the repository structure to understand what's included
- Identify all configuration files and tools
- Check for existing install scripts
- Ask clarifying questions if needed (target OS, experience level)
- Generate README using dotfiles-specific sections
- Include tool breakdown, aliases, keybindings tables
- Provide both automated and manual install options
用户: "为我的dotfiles仓库创建设置指南"
Claude的处理方式:
- 读取仓库结构以了解包含的内容
- 识别所有配置文件和工具
- 检查现有安装脚本
- 如有需要,提出澄清问题(目标操作系统、经验水平)
- 使用Dotfiles特定章节生成README
- 包含工具分解、别名、快捷键表格
- 提供自动化和手动两种安装选项