doc-smith-check
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseDoc-Smith 文档检查
Doc-Smith Document Check
校验 Doc-Smith workspace 的结构和内容完整性。
Validates the structure and content integrity of Doc-Smith workspaces.
用法
Usage
bash
/doc-smith-check # 全部检查(结构 + 内容)
/doc-smith-check --structure # 只检查结构
/doc-smith-check --content # 只检查内容
/doc-smith-check --content --path /api/auth # 检查指定文档bash
/doc-smith-check # Full check (structure + content)
/doc-smith-check --structure # Check structure only
/doc-smith-check --content # Check content only
/doc-smith-check --content --path /api/auth # Check specified document选项
Options
| 选项 | 别名 | 说明 |
|---|---|---|
| | 只运行结构检查 |
| | 只运行内容检查 |
| | 指定文档路径(可多次使用,仅与 |
| Option | Alias | Description |
|---|---|---|
| | Run structure check only |
| | Run content check only |
| | Specify document path (can be used multiple times, only works with |
校验规则
Validation Rules
结构校验 (--structure)
Structure Check (--structure)
执行脚本:
node skills/doc-smith-check/scripts/check-structure.mjs校验 :
planning/document-structure.yaml- YAML 语法正确
- 每个文档有 title、path、description
- path 以 开头
/ - sourcePaths 格式正确
- 可自动修复的格式错误会自动修复并提示重新读取
Execution script:
node skills/doc-smith-check/scripts/check-structure.mjsValidates :
planning/document-structure.yaml- Correct YAML syntax
- Each document has title, path, and description
- Path starts with
/ - sourcePaths format is correct
- Automatically fixable format errors will be fixed automatically with a prompt to re-read
内容校验 (--content)
Content Check (--content)
执行脚本:
node skills/doc-smith-check/scripts/check-content.mjs [--path <p>]校验 中的 HTML 和 中的元数据:
dist/docs/| 校验项 | 说明 |
|---|---|
| HTML 文件存在 | |
| .meta.yaml 存在 | |
| nav.js 存在 | |
| 内部链接有效 | 链接目标文档存在,无 |
| 图片可访问 | 本地图片文件存在,远程图片可达 |
| 路径格式 | MD 源文件应使用 |
Execution script:
node skills/doc-smith-check/scripts/check-content.mjs [--path <p>]Validates HTML in and metadata in :
dist/docs/| Validation Item | Description |
|---|---|
| HTML file exists | |
| .meta.yaml exists | |
| nav.js exists | |
| Internal links are valid | Linked target documents exist, no |
| Images are accessible | Local image files exist, remote images are reachable |
| Path format | MD source files should use |
路径格式校验
Path Format Check
内容校验自动包含路径格式检查:
- 若 下存在
docs/{path}/源文件,检查其中的图片引用格式.md - 使用 格式 → 通过
/assets/xxx - 使用 旧格式 → 产生警告,建议迁移到
../../assets/xxx格式/assets/ - 代码块中的路径不触发警告
Content check automatically includes path format validation:
- If source files exist under
.md, check the image reference format in themdocs/{path}/ - Uses format → Pass
/assets/xxx - Uses old format → Warning triggered, migration to
../../assets/xxxformat is recommended/assets/ - Paths in code blocks do not trigger warnings
错误处理
Error Handling
- 结构检查失败:根据错误信息修正 ,重新检查
document-structure.yaml - 内容检查失败:根据问题类型(缺失文档/链接错误/图片问题)采取对应行动
- 依赖未安装:
cd skills/doc-smith-check/scripts && npm install
- Structure check failed: Fix according to the error message and re-check
document-structure.yaml - Content check failed: Take corresponding actions based on the issue type (missing document/link error/image issue)
- Dependencies not installed:
cd skills/doc-smith-check/scripts && npm install
被其他 Skill 调用
Called by Other Skills
- 生成 document-structure.yaml 后:
/doc-smith-check --structure - 生成文档内容后:
/doc-smith-check --content - 结束前最终校验:
/doc-smith-check
- After generating document-structure.yaml:
/doc-smith-check --structure - After generating document content:
/doc-smith-check --content - Final validation before completion:
/doc-smith-check