oss-docs
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseOSS Documentation Skill
OSS文档技能
Scaffold and audit documentation for open source projects.
为开源项目搭建和审核文档。
Overview
概述
This skill helps prepare repositories for open source release by:
- Auditing existing documentation completeness
- Scaffolding missing standard files
- Generating content tailored to project type
该技能通过以下方式帮助仓库为开源发布做好准备:
- 审核现有文档的完整性
- 搭建缺失的标准文件
- 生成适配项目类型的内容
Commands
命令
| Command | Action |
|---|---|
| Check which OSS docs exist/missing |
| Create all missing standard files |
| Create specific file |
| Refresh existing docs with latest patterns |
| Check docs follow best practices |
| 命令 | 操作 |
|---|---|
| 检查OSS文档的存在/缺失情况 |
| 创建所有缺失的标准文件 |
| 创建指定文件 |
| 用最新范式刷新现有文档 |
| 检查文档是否遵循最佳实践 |
Phase 0: Project Detection
阶段0:项目检测
bash
undefinedbash
undefinedDetermine project type and language
Determine project type and language
PROJECT_NAME=$(basename $(pwd))
LANGUAGES=()
[[ -f go.mod ]] && LANGUAGES+=("go")
[[ -f pyproject.toml ]] || [[ -f setup.py ]] && LANGUAGES+=("python")
[[ -f package.json ]] && LANGUAGES+=("javascript")
[[ -f Cargo.toml ]] && LANGUAGES+=("rust")
PROJECT_NAME=$(basename $(pwd))
LANGUAGES=()
[[ -f go.mod ]] && LANGUAGES+=("go")
[[ -f pyproject.toml ]] || [[ -f setup.py ]] && LANGUAGES+=("python")
[[ -f package.json ]] && LANGUAGES+=("javascript")
[[ -f Cargo.toml ]] && LANGUAGES+=("rust")
Detect project category
Detect project category
if [[ -f Dockerfile ]] && [[ -d cmd ]]; then
PROJECT_TYPE="cli"
elif [[ -d config/crd ]]; then
PROJECT_TYPE="operator"
elif [[ -f Chart.yaml ]]; then
PROJECT_TYPE="helm"
else
PROJECT_TYPE="library"
fi
---if [[ -f Dockerfile ]] && [[ -d cmd ]]; then
PROJECT_TYPE="cli"
elif [[ -d config/crd ]]; then
PROJECT_TYPE="operator"
elif [[ -f Chart.yaml ]]; then
PROJECT_TYPE="helm"
else
PROJECT_TYPE="library"
fi
---Subcommand: audit
子命令:audit
Required Files (Tier 1 - Core)
必备文件(层级1 - 核心)
| File | Purpose |
|---|---|
| Legal terms |
| Project overview |
| How to contribute |
| Community standards |
| 文件 | 用途 |
|---|---|
| 法律条款 |
| 项目概述 |
| 贡献指南 |
| 社区准则 |
Recommended Files (Tier 2 - Standard)
推荐文件(层级2 - 标准)
| File | Purpose |
|---|---|
| Vulnerability reporting |
| Version history |
| AI assistant context |
| Issue templates |
| PR template |
| 文件 | 用途 |
|---|---|
| 漏洞上报 |
| 版本历史 |
| AI助手上下文 |
| 问题模板 |
| PR模板 |
Optional Files (Tier 3 - Enhanced)
可选文件(层级3 - 增强)
| File | When Needed |
|---|---|
| Complex setup |
| Non-trivial codebase |
| CLI tools |
| Configurable software |
| Complex workflows |
| 文件 | 适用场景 |
|---|---|
| 复杂安装配置 |
| 非平凡代码库 |
| CLI工具 |
| 可配置软件 |
| 复杂工作流 |
Subcommand: scaffold
子命令:scaffold
Template Selection
模板选择
| Project Type | Focus |
|---|---|
| Installation, commands, examples |
| K8s CRDs, RBAC, deployment |
| API, configuration, deployment |
| API reference, examples |
| Values, dependencies, upgrading |
| 项目类型 | 重点内容 |
|---|---|
| 安装、命令、示例 |
| K8s CRDs、RBAC、部署 |
| API、配置、部署 |
| API参考、示例 |
| 配置值、依赖、升级 |
Documentation Organization
文档组织结构
project/
├── README.md # Overview + quick start
├── AGENTS.md # AI assistant context
├── CONTRIBUTING.md # Contributor guide
├── CHANGELOG.md # Keep a Changelog format
├── docs/
│ ├── QUICKSTART.md # Detailed getting started
│ ├── CLI_REFERENCE.md # Complete command reference
│ ├── ARCHITECTURE.md # System design
│ └── CONFIG.md # Configuration options
└── examples/
└── README.md # Examples indexproject/
├── README.md # Overview + quick start
├── AGENTS.md # AI assistant context
├── CONTRIBUTING.md # Contributor guide
├── CHANGELOG.md # Keep a Changelog format
├── docs/
│ ├── QUICKSTART.md # Detailed getting started
│ ├── CLI_REFERENCE.md # Complete command reference
│ ├── ARCHITECTURE.md # System design
│ └── CONFIG.md # Configuration options
└── examples/
└── README.md # Examples indexAGENTS.md Pattern
AGENTS.md 范式
markdown
undefinedmarkdown
undefinedAgent Instructions
Agent Instructions
This project uses <tool> for <purpose>. Run to get started.
<onboard-cmd>This project uses <tool> for <purpose>. Run to get started.
<onboard-cmd>Quick Reference
Quick Reference
bash
<cmd1> # Do thing 1
<cmd2> # Do thing 2bash
<cmd1> # Do thing 1
<cmd2> # Do thing 2Landing the Plane (Session Completion)
Landing the Plane (Session Completion)
MANDATORY WORKFLOW:
- Run quality gates - Tests, linters, builds
- Commit changes - Meaningful commit message
- PUSH TO REMOTE - This is MANDATORY
- Verify - All changes committed AND pushed
---MANDATORY WORKFLOW:
- Run quality gates - Tests, linters, builds
- Commit changes - Meaningful commit message
- PUSH TO REMOTE - This is MANDATORY
- Verify - All changes committed AND pushed
---Style Guidelines
风格指南
- Be direct - Get to the point quickly
- Be friendly - Welcome contributions
- Be concise - Avoid boilerplate
- Use tables - For commands, options, features
- Show examples - Code blocks over prose
- Link liberally - Cross-reference related docs
- 直接明了 - 尽快切入主题
- 友好热情 - 欢迎贡献
- 简洁精炼 - 避免冗余内容
- 使用表格 - 用于展示命令、选项、特性
- 提供示例 - 优先使用代码块而非文字描述
- 大量链接 - 交叉引用相关文档
Skill Boundaries
技能边界
DO:
- Audit existing documentation
- Generate standard OSS files
- Validate documentation quality
DON'T:
- Overwrite existing content without confirmation
- Generate code documentation (use )
$doc - Create CI/CD files (use )
$golden-init
可执行操作:
- 审核现有文档
- 生成标准OSS文件
- 验证文档质量
不可执行操作:
- 未经确认覆盖现有内容
- 生成代码文档(使用)
$doc - 创建CI/CD文件(使用)
$golden-init
Examples
示例
OSS Readiness Audit
OSS就绪性审核
User says: "Audit this repo for open-source documentation readiness."
What happens:
- Evaluate presence/quality of core OSS docs.
- Identify missing or weak sections.
- Output prioritized documentation actions.
用户指令: "Audit this repo for open-source documentation readiness."
执行流程:
- 评估核心OSS文档的存在情况/质量。
- 识别缺失或薄弱的部分。
- 输出按优先级排序的文档改进措施。
Scaffold Missing Docs
搭建缺失的文档
User says: "Generate missing OSS docs for this project."
What happens:
- Detect project type and documentation gaps.
- Scaffold standard files with project-aware content.
- Produce a checklist for final review and landing.
用户指令: "Generate missing OSS docs for this project."
执行流程:
- 检测项目类型和文档缺口。
- 搭建带有项目专属内容的标准文件。
- 生成最终审核和收尾的检查清单。
Troubleshooting
故障排查
| Problem | Cause | Solution |
|---|---|---|
| Generated docs feel generic | Project signals too sparse | Add concrete repo context (commands, architecture, workflows) |
| Existing docs conflict | Legacy text diverges from current behavior | Reconcile with current code/process and mark obsolete sections |
| Contributor path unclear | Missing setup/testing guidance | Add explicit quickstart and validation commands |
| Open-source handoff incomplete | Session-end workflow not reflected | Add landing-the-plane and release hygiene steps |
| 问题 | 原因 | 解决方案 |
|---|---|---|
| 生成的文档过于通用 | 项目特征信息不足 | 添加具体的仓库上下文(命令、架构、工作流) |
| 现有文档存在冲突 | 旧文本与当前行为不符 | 与当前代码/流程对齐,并标记过时部分 |
| 贡献路径不清晰 | 缺失安装/测试指南 | 添加明确的快速入门和验证命令 |
| 开源交接不完整 | 未体现会话收尾工作流 | 添加「着陆流程」和发布规范步骤 |