umbraco-skill-validator

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Skill Content Validator

Skill内容验证器

Validates all SKILL.md files in the repository for broken links, missing references, and invalid paths.
验证仓库中所有SKILL.md文件的失效链接、缺失引用和无效路径。

What This Skill Does

本工具功能

  1. Runs deterministic validation script - Fast, consistent checking of all links
  2. Generates structured report - JSON output with all issues found
  3. Spawns fixer subagent - AI-powered fix suggestions for issues
  4. Presents fix plan - Diff-style changes for approval
  5. Executes approved fixes - Only applies changes user approves
  1. 运行确定性验证脚本 - 快速、一致地检查所有链接
  2. 生成结构化报告 - 包含所有问题的JSON输出
  3. 启动修复子Agent - 基于AI的问题修复建议
  4. 展示修复方案 - 以Diff格式呈现变更供审核
  5. 执行已批准的修复 - 仅应用用户认可的变更

Validation Checks

验证检查项

Check TypeDescription
External URLsHTTP HEAD request to verify accessibility
Skill referencesVerify referenced skills exist (e.g.,
umbraco-dashboard
)
Internal linksCheck relative paths resolve (e.g.,
patterns/foo.md
)
File pathsVerify Umbraco-CMS paths via GitHub API if not local
Import pathsCheck
@umbraco-cms/backoffice/*
imports are valid
检查类型描述
外部URL通过HTTP HEAD请求验证可访问性
Skill引用验证被引用的Skill是否存在(例如:
umbraco-dashboard
内部链接检查相对路径是否可解析(例如:
patterns/foo.md
文件路径若本地不存在,通过GitHub API验证Umbraco-CMS路径
导入路径检查
@umbraco-cms/backoffice/*
导入是否有效

Running the Validator

运行验证器

Via Slash Command

通过Slash命令

/validate-skills
/validate-skills

Via Script Directly (CI/CD)

直接通过脚本运行(CI/CD)

bash
cd .claude/skills/umbraco-skill-validator/scripts
npm install
npm run validate
bash
cd .claude/skills/umbraco-skill-validator/scripts
npm install
npm run validate

Report Format

报告格式

The script outputs JSON that gets formatted as:
markdown
undefined
脚本输出的JSON会被格式化为:
markdown
undefined

Skill Validation Report

Skill验证报告

Summary

摘要

  • Skills scanned: 25
  • Issues found: 3
  • Auto-fixable: 2
  • 已扫描Skill数量:25
  • 发现问题数:3
  • 可自动修复数:2

Issues by Skill

各Skill的问题

umbraco-dashboard

umbraco-dashboard

LineTypeIssueStatus
45Broken URL[example-broken-url] returns 404:x:
行号类型问题状态
45失效URL[example-broken-url] 返回404:x:

umbraco-tree

umbraco-tree

LineTypeIssueStatus
72Missing skill[example-missing-skill] not found:x:
undefined
行号类型问题状态
72缺失Skill[example-missing-skill] 未找到:x:
undefined

Fix Plan Format

修复方案格式

When issues are found, the fixer subagent generates:
markdown
undefined
当发现问题时,修复子Agent会生成:
markdown
undefined

Fix Plan

修复方案

Fix 1: Update broken URL

修复1:更新失效URL

File: plugins/.../umbraco-dashboard/SKILL.md Line: 45 Action: Replace with current documentation URL
  • [Dashboard docs][old-url]
  • [Dashboard docs][new-url]
文件: plugins/.../umbraco-dashboard/SKILL.md 行号: 45 操作: 替换为当前文档URL
  • [Dashboard文档][old-url]
  • [Dashboard文档][new-url]

Approval

审核

  • Fix 1: Update broken URL
  • Fix 2: ...
undefined
  • 修复1:更新失效URL
  • 修复2: ...
undefined

Link Patterns Detected

可检测的链接模式

External URLs

外部URL

https://docs.umbraco.com/...
https://github.com/umbraco/...
https://docs.umbraco.com/...
https://github.com/umbraco/...

Skill References

Skill引用

`umbraco-dashboard`
`umbraco-workspace`
`umbraco-dashboard`
`umbraco-workspace`

Internal Pattern Links

内部模式链接

[Pattern Name](patterns/pattern-name.md)
[Example](examples/example-name/)
[Pattern Name](patterns/pattern-name.md)
[Example](examples/example-name/)

File Paths

文件路径

/Umbraco-CMS/src/Umbraco.Web.UI.Client/...
src/packages/core/...
/Umbraco-CMS/src/Umbraco.Web.UI.Client/...
src/packages/core/...

Import Paths (in code blocks)

导入路径(代码块中)

typescript
import { ... } from '@umbraco-cms/backoffice/notification';
typescript
import { ... } from '@umbraco-cms/backoffice/notification';

Workflow Instructions

工作流说明

When this skill is invoked:
  1. Run the validation script
    bash
    cd .claude/skills/umbraco-skill-validator/scripts
    npx tsx validate-links.ts
  2. Read the JSON output from stdout or
    validation-report.json
  3. Format as markdown report using the template above
  4. If issues found, spawn the
    skill-content-fixer
    agent:
    • Pass the JSON report as context
    • Request fix suggestions with diffs
  5. Present fix plan to user with AskUserQuestion
  6. Execute only approved fixes using Edit tool
调用本工具时:
  1. 运行验证脚本
    bash
    cd .claude/skills/umbraco-skill-validator/scripts
    npx tsx validate-links.ts
  2. 读取JSON输出 从标准输出或
    validation-report.json
    文件
  3. 格式化为Markdown报告 使用上述模板
  4. 若发现问题,启动
    skill-content-fixer
    Agent:
    • 将JSON报告作为上下文传入
    • 请求带有Diff的修复建议
  5. 向用户展示修复方案 并使用AskUserQuestion询问
  6. 仅执行已批准的修复 使用Edit工具

Edge Cases

边缘情况处理

  • Rate limiting: Script batches URL checks with 100ms delays
  • Redirects: Reported as warnings with new URL suggestion
  • Missing Umbraco-CMS: Falls back to GitHub API
  • Timeouts: 5 second timeout per URL request
  • Large repos: Processes files in batches of 10
  • 速率限制:脚本将URL检查分批处理,每批间隔100ms
  • 重定向:作为警告报告并建议新URL
  • 缺失Umbraco-CMS:回退使用GitHub API
  • 超时:每个URL请求超时时间为5秒
  • 大型仓库:按每批10个文件处理