Token导航 LogoToken导航TokenDH.com
研究检索需要联网clawhub未标认证来源可访问clear审计通过

draft-docs草稿文件

Agent Skill

用于辅助文档、README、Markdown、说明文和内容稿件的整理与改写。它适合让 Agent 提炼结构、补齐章节、统一术语、检查链接或把零散材料整理成可读文档。使用时应保留项目已有事实、命令和路径,不要把未确认的信息写成确定结论;涉及对外文案时,还需要控制语气,避免过度营销或夸大能力。

总安装

3,564

周安装

150

GitHub Stars

公开资料未说明

下载量

1,248
OpenClaw

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

MIT-0

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:draft-docs(草稿文件)
来源仓库:https://github.com/anderskev/draft-docs
安装命令:
openclaw skills install draft-docs
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 OpenClaw 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

ClawHubOpenClaw
openclaw skills install draft-docs

简介

基于代码结构自动生成技术文档初稿的智能助手。

  • 适用于快速产出 API 说明与模块功能描述。
  • 保留原有注释与命名规范确保准确性。draft-docs 属于研究检索类 Skill,可作为该场景下的辅助能力补充。
  • 输出内容需人工复核以避免误解实现细节。适用宿主包括 OpenClaw,接入前应确认版本、权限和运行环境要求。
  • 建议结合项目实际需求补充用例与流程图。

SKILL.md

name
draft-docs
description
Generate first-draft technical documentation from code analysis
disable-model-invocation
true

Draft Docs

Generate Reference or How-To documentation drafts to docs/drafts/ for review before publishing.

Arguments

  • Topic prompt: Description of what to document (e.g., "Document the WebSocket API")
  • --publish [file]: Move reviewed draft to final location and update navigation

Mode 1: Generate Draft

/beagle-docs:draft-docs "Document the authentication middleware"

Step 0: Gather Context

Before parsing input, gather project context:

# Check for existing docs structure
ls -la docs/ 2>/dev/null || echo "No docs/ directory found"

# Identify documentation framework
ls docs/navigation.json docs/mint.json docs/docusaurus.config.js docs/mkdocs.yml 2>/dev/null | head -1

# Check for existing drafts
ls docs/drafts/*.md 2>/dev/null || echo "No existing drafts"

# Get recent code changes for context
git diff --name-only $(git merge-base HEAD main)..HEAD 2>/dev/null | head -20

Capture:

  • Docs structure: docs/ subdirectories present
  • Navigation system: navigation.json, mint.json, or other config
  • Tech stack hints: from file extensions and imports in changed files
  • Existing drafts: to avoid duplicates

Step 1: Parse Input

Extract from the prompt:

  1. Topic: What to document (e.g., "authentication middleware")
  2. Content type: Detect from keywords:
KeywordsTypeSkill
"how to", "guide", "steps", "configure", "set up"How-Tohowto-docs
"API", "reference", "parameters", "function", "endpoint"Referencereference-docs

If ambiguous, ask: "Should this be a Reference doc (technical lookup) or How-To guide (task completion)?"

Step 2: Load Skills

Always load both:

  1. beagle-docs:docs-style - Core writing principles
  2. Detected type skill:

- beagle-docs:reference-docs for Reference - beagle-docs:howto-docs for How-To

Step 3: Analyze Code

Search the codebase for relevant code:

  1. Symbol search: Find functions, classes, types matching the topic
  2. File search: Locate related files by name patterns
  3. Reference search: Find usage examples

Gather:

  • Function/method signatures
  • Type definitions
  • Existing comments/docstrings
  • Usage patterns in tests or examples

Step 4: Generate Draft

Apply the loaded skills to generate documentation:

For Reference docs:

  • Follow reference-docs template structure
  • Document all parameters with types
  • Include complete, runnable examples from actual code
  • Add Related section linking to connected symbols

For How-To docs:

  • Follow howto-docs template structure
  • Start title with "How to"
  • List concrete prerequisites
  • Break into single-action steps
  • Include verification section

Step 5: Write Draft

  1. Create output path:

- docs/drafts/{slug}.md - Slug from topic: "WebSocket API" → websocket-api.md

  1. Ensure directory exists:
   mkdir -p docs/drafts
  1. Write the draft file (see Hard gates → Write gate: confirm file on disk before the next step)
  1. Report to user:
   ## Draft Created

   **File:** `docs/drafts/{slug}.md`
   **Type:** Reference | How-To
   **Based on:** [list of analyzed symbols/files]

   ### Next Steps

   1. Review the draft for accuracy
   2. Add any missing context or examples
   3. When ready, publish with:

/beagle-docs:draft-docs --publish docs/drafts/{slug}.md

Step 6: End-of-Run Verification

Verify draft generation completed successfully:

# Confirm draft file exists
ls -la docs/drafts/{slug}.md

# Validate frontmatter (YAML header)
head -10 docs/drafts/{slug}.md | grep -E "^---$|^title:|^description:"

# Check markdown syntax (if markdownlint available)
markdownlint docs/drafts/{slug}.md 2>/dev/null || echo "markdownlint not available"

Verification Checklist:

  • [ ] Draft file created at docs/drafts/{slug}.md
  • [ ] Frontmatter includes title and description
  • [ ] Content type matches detected type (Reference or How-To)
  • [ ] Code examples are complete and runnable
  • [ ] All analyzed symbols referenced in draft

If any verification fails, report the specific issue and offer to regenerate.

Mode 2: Publish Draft

/beagle-docs:draft-docs --publish docs/drafts/websocket-api.md

Step 1: Read Draft

Read the draft file and extract:

  • Title
  • Content type (from frontmatter or structure)

Step 2: Determine Destination

Ask user which section:

Where should this document go?

1. **API Reference** → `docs/api/{slug}.md`
2. **Guides** → `docs/guides/{slug}.md`
3. **How-To** → `docs/how-to/{slug}.md`
4. **Other** → Specify path

Step 3: Move File

mv docs/drafts/{slug}.md {destination}/{slug}.md

Step 4: Update Navigation

Check for docs/navigation.json and update navigation:

  1. Read current navigation.json
  2. Find appropriate navigation group
  3. Add new page entry
  4. Write updated navigation.json

Example update:

{
  "navigation": [
    {
      "group": "API Reference",
      "pages": [
        "api/existing-page",
        "api/websocket-api"
      ]
    }
  ]
}

Step 5: Report

## Published

**From:** `docs/drafts/{slug}.md`
**To:** `{destination}/{slug}.md`
**Navigation:** Updated `docs/navigation.json`

The document is now live in your docs.

Step 6: End-of-Run Verification

Verify publish completed successfully:

# Confirm file moved to destination
ls -la {destination}/{slug}.md

# Confirm draft removed
ls docs/drafts/{slug}.md 2>/dev/null && echo "WARNING: Draft still exists" || echo "Draft cleaned up"

# Verify navigation updated
grep -q "{slug}" docs/navigation.json && echo "Navigation includes new page" || echo "WARNING: Navigation may need manual update"

# Check markdown syntax at final location
markdownlint {destination}/{slug}.md 2>/dev/null || echo "markdownlint not available"

Verification Checklist:

  • [ ] Document moved to {destination}/{slug}.md
  • [ ] Draft removed from docs/drafts/
  • [ ] Navigation file updated with new page entry
  • [ ] No broken links in navigation structure
  • [ ] Document accessible at expected URL path

If any verification fails, report the specific issue and offer remediation steps.

Content Type Detection

Reference Indicators

  • Prompt mentions: API, endpoint, function, method, class, type, parameters, returns
  • Target is a specific symbol or set of symbols
  • User wants technical specification

How-To Indicators

  • Prompt mentions: how to, guide, steps, configure, set up, integrate
  • Target is a task or workflow
  • User wants procedural instructions

Rules

  • Always load docs-style skill for every draft
  • Generate to docs/drafts/ - never directly to final location
  • Include frontmatter with title and description
  • Use realistic examples from actual codebase
  • Reference analyzed symbols in draft metadata
  • Preserve existing navigation structure when publishing
  • Ask before overwriting existing files

Hard gates (sequenced)

Do not skip ahead: each Pass must be true before the next step. Use commands or explicit artifacts—not internal assurance.

Generate draft (Mode 1)

  1. Context gate — Pass: Step 0 commands ran (or equivalent) and you recorded at least one concrete outcome: e.g. docs/ listing snippet, or explicit note that docs/ is missing and will be created.
  2. Type gate — Pass: Reference vs How-To is decided using the keyword table or the user’s explicit answer (quote or paraphrase with “user chose …”). Do not start Step 3: Analyze Code until this is locked.
  3. Skills gate — Pass: Before analysis, both are in play: beagle-docs:docs-style and the type skill (beagle-docs:reference-docs or beagle-docs:howto-docs). In your run, name the two skills loaded (IDs/paths)—not “I reviewed writing guidelines.”
  4. Write gate — Pass: After writing the draft, test -f docs/drafts/{slug}.md succeeds (or ls shows the file). Only then emit the Draft Created block.

Publish draft (Mode 2)

  1. Destination gate — Pass: User chose a destination (from the menu or a specific path). Resolve {destination} to a full path; Pass when the parent directory exists (test -d "$(dirname "$path")" or project-appropriate check) and you are not overwriting an existing file without explicit user approval.
  2. Move gate — Pass: After mv, the file exists at {destination}/{slug}.md (test -f) and navigation updates (if applicable) are applied before claiming Published.

适合场景

01

OpenClaw 用户查找和安装 Skill 时

02

用户想查找某类 Agent Skill 时

03

需要根据任务场景推荐可安装能力包时

04

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

OpenClaw

77.61%
按下载量换算969

安全审计

VirusTotal

未展示

ClawScan

通过

Static analysis

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills