npx skills add https://github.com/boshu2/agentops --skill doc你必须执行此工作流程。不要仅仅描述它。
为任何项目生成并验证文档。
给定 /doc [命令] [目标]:
# 检查指标
ls package.json pyproject.toml go.mod Cargo.toml 2>/dev/null
# 检查现有文档
ls -d docs/ doc/ documentation/ 2>/dev/null
分类为:
discover - 查找未记录的功能:
# 查找没有文档字符串的公共函数(Python)
grep -r "^def " --include="*.py" | grep -v '"""' | head -20
# 查找没有注释的导出函数(Go)
grep -r "^func [A-Z]" --include="*.go" | head -20
coverage - 检查文档覆盖率:
# 统计已记录与未记录的数量
TOTAL=$(grep -r "^def \|^func \|^class " --include="*.py" --include="*.go" | wc -l)
DOCUMENTED=$(grep -r '"""' --include="*.py" | wc -l)
echo "Coverage: $DOCUMENTED / $TOTAL"
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
gen [功能] - 生成文档:
all - 更新所有文档:
生成文档时,包括:
对于函数/方法:
## function_name
**用途:** 它的作用
**参数:**
- `param1` (类型): 描述
- `param2` (类型): 描述
**返回:** 返回的内容
**示例:**
```python
result = function_name(arg1, arg2)
注意: 任何重要的注意事项
**对于类:**
```markdown
## ClassName
**用途:** 这个类代表什么
**属性:**
- `attr1`: 描述
- `attr2`: 描述
**方法:**
- `method1()`: 它的作用
- `method2()`: 它的作用
**用法:**
```python
obj = ClassName()
obj.method1()
### 步骤 4:创建代码映射(如果请求)
**写入到:** `docs/code-map/`
```markdown
# 代码映射: <项目>
## 概述
<高层次架构>
## 目录结构
src/ ├── module1/ # 用途 ├── module2/ # 用途 └── utils/ # 共享工具
## 关键组件
### 模块 1
- **用途:** 它的作用
- **入口点:** `main.py`
- **关键文件:** `handler.py`, `models.py`
### 模块 2
...
## 数据流
<数据如何在系统中流动>
## 依赖项
<外部依赖项及其原因>
检查:
写入到: .agents/doc/YYYY-MM-DD-<目标>.md
# 文档报告: <目标>
**日期:** YYYY-MM-DD
**项目类型:** <CODING/INFORMATIONAL/OPS>
## 覆盖率
- 可记录项总数: <数量>
- 已记录: <数量>
- 覆盖率: <百分比>%
## 已生成
- <生成的文档列表>
## 发现的空白
- <未记录项 1>
- <未记录项 2>
## 验证问题
- <问题 1>
- <问题 2>
## 后续步骤
- [ ] 记录剩余的空白
- [ ] 修复验证问题
告诉用户:
| 命令 | 操作 |
|---|---|
discover | 查找未记录的功能 |
coverage | 检查文档覆盖率 |
gen [功能] | 为特定功能生成文档 |
all | 更新所有文档 |
validate | 检查文档是否与代码匹配 |
用户说: /doc gen authentication
发生的情况:
package.json 并找到 Node.js 项目来检测项目类型docs/api/authentication.md结果: 为身份验证模块创建了完整的 API 文档,并附有可运行的代码示例。
用户说: /doc coverage
发生的情况:
pyproject.toml 检测到 Python 项目grep -r "^def \|^class " 统计函数/类的总数""")来统计已记录项的数量.agents/doc/2026-02-13-coverage.md结果: 文档覆盖率报告显示覆盖率为 67%,并附有需要文档的 22 个函数的具体列表。
| 问题 | 原因 | 解决方案 |
|---|---|---|
| 覆盖率计算不准确 | Grep 模式与所有代码风格不匹配 | 根据项目约定调整模式。对于 Python,检查 async def 和类方法。对于 Go,检查 func 和 type 定义。 |
| 生成的文档缺少示例 | 缺少关于典型用法的上下文 | 阅读现有测试以查找使用模式。检查 README 中的代码示例。如果不清楚,向用户询问典型用例。 |
| Discover 命令找到太多项 | 现有文档覆盖率低 | 通过先在特定子目录上运行 discover 来设置优先级。首先关注公共 API,然后是内部工具。使用 --limit 进行分批处理。 |
| 验证显示文档不同步 | 代码在文档编写后已更改 | 为受影响的功能重新运行 gen 命令。考虑在代码更改时添加 git 钩子来标记需要更新文档。 |
每周安装量
220
仓库
GitHub 星标数
197
首次出现
2026年2月2日
安全审计
安装于
opencode216
codex214
github-copilot213
gemini-cli213
amp211
kimi-cli211
YOU MUST EXECUTE THIS WORKFLOW. Do not just describe it.
Generate and validate documentation for any project.
Given /doc [command] [target]:
# Check for indicators
ls package.json pyproject.toml go.mod Cargo.toml 2>/dev/null
# Check for existing docs
ls -d docs/ doc/ documentation/ 2>/dev/null
Classify as:
discover - Find undocumented features:
# Find public functions without docstrings (Python)
grep -r "^def " --include="*.py" | grep -v '"""' | head -20
# Find exported functions without comments (Go)
grep -r "^func [A-Z]" --include="*.go" | head -20
coverage - Check documentation coverage:
# Count documented vs undocumented
TOTAL=$(grep -r "^def \|^func \|^class " --include="*.py" --include="*.go" | wc -l)
DOCUMENTED=$(grep -r '"""' --include="*.py" | wc -l)
echo "Coverage: $DOCUMENTED / $TOTAL"
gen [feature] - Generate documentation:
all - Update all documentation:
When generating docs, include:
For Functions/Methods:
## function_name
**Purpose:** What it does
**Parameters:**
- `param1` (type): Description
- `param2` (type): Description
**Returns:** What it returns
**Example:**
```python
result = function_name(arg1, arg2)
Notes: Any important caveats
**For Classes:**
```markdown
## ClassName
**Purpose:** What this class represents
**Attributes:**
- `attr1`: Description
- `attr2`: Description
**Methods:**
- `method1()`: What it does
- `method2()`: What it does
**Usage:**
```python
obj = ClassName()
obj.method1()
### Step 4: Create Code-Map (if requested)
**Write to:** `docs/code-map/`
```markdown
# Code Map: <Project>
## Overview
<High-level architecture>
## Directory Structure
src/ ├── module1/ # Purpose ├── module2/ # Purpose └── utils/ # Shared utilities
## Key Components
### Module 1
- **Purpose:** What it does
- **Entry point:** `main.py`
- **Key files:** `handler.py`, `models.py`
### Module 2
...
## Data Flow
<How data moves through the system>
## Dependencies
<External dependencies and why>
Check for:
Write to: .agents/doc/YYYY-MM-DD-<target>.md
# Documentation Report: <Target>
**Date:** YYYY-MM-DD
**Project Type:** <CODING/INFORMATIONAL/OPS>
## Coverage
- Total documentable items: <count>
- Documented: <count>
- Coverage: <percentage>%
## Generated
- <list of docs generated>
## Gaps Found
- <undocumented item 1>
- <undocumented item 2>
## Validation Issues
- <issue 1>
- <issue 2>
## Next Steps
- [ ] Document remaining gaps
- [ ] Fix validation issues
Tell the user:
| Command | Action |
|---|---|
discover | Find undocumented features |
coverage | Check documentation coverage |
gen [feature] | Generate docs for specific feature |
all | Update all documentation |
validate | Check docs match code |
User says: /doc gen authentication
What happens:
package.json and finding Node.js projectdocs/api/authentication.md with code samplesResult: Complete API documentation created for authentication module with working code examples.
User says: /doc coverage
What happens:
pyproject.tomlgrep -r "^def \|^class """").agents/doc/2026-02-13-coverage.mdResult: Documentation coverage report shows 67% coverage with specific list of 22 functions needing docs.
| Problem | Cause | Solution |
|---|---|---|
| Coverage calculation inaccurate | Grep pattern doesn't match all code styles | Adjust pattern for project conventions. For Python, check for async def and class methods. For Go, check both func and type definitions. |
| Generated docs lack examples | Missing context about typical usage | Read existing tests to find usage patterns. Check README for code samples. Ask user for typical use case if unclear. |
| Discover command finds too many items | Low existing documentation coverage | Prioritize by running discover on specific subdirectories. Focus on public API first, internal utilities later. Use --limit to process in batches. |
| Validation shows docs out of sync |
Weekly Installs
220
Repository
GitHub Stars
197
First Seen
Feb 2, 2026
Security Audits
Gen Agent Trust HubWarnSocketFailSnykPass
Installed on
opencode216
codex214
github-copilot213
gemini-cli213
amp211
kimi-cli211
agent-browser 浏览器自动化工具 - Vercel Labs 命令行网页操作与测试
140,500 周安装
OpenAI Agents SDK:构建文本/语音AI智能体、多智能体工作流与防护栏应用
359 周安装
Expo应用设计指南:使用Expo Router和NativeWind构建跨平台React Native移动应用
359 周安装
Autoresearch:自主实验循环工具,自动化代码优化与性能改进
564 周安装
LangChain4j RAG实现模式:构建文档对话与知识增强AI应用指南
381 周安装
Next.js 智能体技能编写指南:创建、优化与管理 AI 技能文件
432 周安装
OpenClaw 自动更新器技能 - 保持网关持续更新的自动化解决方案
483 周安装
| Code changed after docs written |
Re-run gen command for affected features. Consider adding git hook to flag doc updates needed when code changes. |