关于 oss-docs
oss-docs 是用于评估和准备开源项目文档的技能。它会识别项目类型、检查文档缺口、创建缺少的标准文件、更新现有文档,并按最佳实践进行验证。
主要功能
- 01审查必需及建议的开源文档
- 02识别项目类型和语言
- 03创建标准或指定文件
- 04更新现有文档
- 05验证文档质量
适用场景
- 01检查仓库是否适合开源发布
- 02创建缺少的贡献指南和规范文件
- 03查找项目文档中的缺口
安装
复制下面的命令,在终端中运行。
$
npx skills add https:/ / github.com/ boshu2/ agentops --skill oss-docs安装后在 Claude Code 中输入/oss-docs确认已加载。
包含的文件
除 SKILL.md 外,安装时一起下载的参考资料和脚本。
references/beads-patterns.mdproject-types.mddocumentation-tiers.mdscripts/validate.shaudit-oss-docs.sh详细介绍
开源项目文档技能
为开源项目搭建文档框架并进行审核。
概述
此技能通过以下方式帮助仓库做好开源发布准备:
- 审核现有文档的完整性
- 为缺失的标准文件搭建框架
- 生成适合项目类型的内容
命令
| 命令 | 操作 |
|---|---|
audit | 检查哪些开源文档已存在或缺失 |
scaffold | 创建所有缺失的标准文件 |
scaffold [file] | 创建指定文件 |
update | 使用最新模式刷新现有文档 |
validate | 检查文档是否符合最佳实践 |
阶段 0:项目检测
# 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")
# 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
子命令:audit
必需文件(第 1 级 - 核心)
| 文件 | 用途 |
|---|---|
LICENSE | 法律条款 |
README.md | 项目概述 |
CONTRIBUTING.md | 贡献方式 |
CODE_OF_CONDUCT.md | 社区规范 |
推荐文件(第 2 级 - 标准)
| 文件 | 用途 |
|---|---|
SECURITY.md | 漏洞报告 |
CHANGELOG.md | 版本历史 |
AGENTS.md | AI 助手上下文 |
.github/ISSUE_TEMPLATE/ | 问题模板 |
.github/PULL_REQUEST_TEMPLATE.md | PR 模板 |
可选文件(第 3 级 - 增强)
| 文件 | 适用情况 |
|---|---|
docs/QUICKSTART.md | 设置较复杂 |
docs/ARCHITECTURE.md | 代码库并非简单 |
docs/CLI_REFERENCE.md | CLI 工具 |
docs/CONFIG.md | 可配置软件 |
examples/ | 工作流较复杂 |
子命令:scaffold
模板选择
| 项目类型 | 重点 |
|---|---|
cli | 安装、命令、示例 |
operator | K8s CRD、RBAC、部署 |
service | API、配置、部署 |
library | API 参考、示例 |
helm | Values、依赖项、升级 |
文档组织
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 index
AGENTS.md 模式
# Agent Instructions
This project uses **<tool>** for <purpose>. Run `<onboard-cmd>` to get started.
## Quick Reference
```bash
<cmd1> # Do thing 1
<cmd2> # Do thing 2
完成收尾(会话结束)
强制工作流:
- 运行质量检查 - 测试、代码检查、构建
- 提交更改 - 使用有意义的提交消息
- 推送到远程仓库 - 这是强制要求
- 验证 - 所有更改均已提交并推送
---
## Style Guidelines
1. **Be direct** - Get to the point quickly
2. **Be friendly** - Welcome contributions
3. **Be concise** - Avoid boilerplate
4. **Use tables** - For commands, options, features
5. **Show examples** - Code blocks over prose
6. **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 (out of scope — configure CI/CD separately)
## Examples
### OSS Readiness Audit
**User says:** "Audit this repo for open-source documentation readiness."
**What happens:**
1. Evaluate presence/quality of core OSS docs.
2. Identify missing or weak sections.
3. Output prioritized documentation actions.
### Scaffold Missing Docs
**User says:** "Generate missing OSS docs for this project."
**What happens:**
1. Detect project type and documentation gaps.
2. Scaffold standard files with project-aware content.
3. Produce a checklist for final review and landing.
## 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 |
## Reference Documents
- [references/beads-patterns.md](references/beads-patterns.md)
- [references/documentation-tiers.md](references/documentation-tiers.md)
- [references/project-types.md](references/project-types.md)
评论
支持 Markdown