Validate the structural and content integrity of the Doc-Smith workspace.
Usage
/doc-smith-check # 全部检查(结构 + 内容)
/doc-smith-check --structure # 只检查结构
/doc-smith-check --content # 只检查内容
/doc-smith-check --content --path /api/auth # 检查指定文档
Options
| Options | Alias | Description |
|---|---|---|
--structure |
-s |
Run only structural checks |
--content |
-c |
Run only content checks |
--path <docPath> |
-p |
Specify document path (can be used multiple times, only with --content to use together) |
Validation Rules
Structural Validation (--structure)
Execute script:node skills/doc-smith-check/scripts/check-structure.mjs
Validate planning/document-structure.yaml:
- YAML syntax is correct
- Each document has title, path, description
- path starts with
/starts with - sourcePaths format is correct
- Automatically fixable format errors will be automatically fixed and prompt to re-read
Content Validation (--content)
Execute script:node skills/doc-smith-check/scripts/check-content.mjs [--path <p>]
Validate the HTML in dist/ and the metadata in docs/ :
| Check Item | Description |
|---|---|
| HTML file exists | dist/{lang}/docs/{path}.html |
| .meta.yaml exists | docs/{path}/.meta.yaml, containing kind/source/default |
| nav.js exists | dist/assets/nav.js |
| Internal links are valid | Link target document exists, no .md suffix |
| Images are accessible | Local image files exist, remote images are reachable |
| Path format | MD source files should use /assets/ format,../../assets/ old format generates a warning |
Path Format Validation
Content validation automatically includes path format checks:
- If
docs/{path}/source files exist under.md, check the image reference format in them - Using
/assets/xxxformat → passed - Using
../../assets/xxxold format → generates a warning, recommend migrating to/assets/format - Paths in code blocks do not trigger warnings
Error Handling
- Structural check failed: fix
document-structure.yamlaccording to the error message, re-check - Content check failed: take corresponding action based on the problem type (missing document/broken link/image issue)
- Dependencies not installed:
cd skills/doc-smith-check/scripts && npm install
Called by other Skills
- After generating document-structure.yaml:
/doc-smith-check --structure - After generating document content:
/doc-smith-check --content - Final validation before finishing:
/doc-smith-check