重要前提
安装AI Skills的关键前提是:必须科学上网,且开启TUN模式,这一点至关重要,直接决定安装能否顺利完成,在此郑重提醒三遍:科学上网,科学上网,科学上网。查看完整安装教程 →
link-validator by terrylica/cc-skills
npx skills add https://github.com/terrylica/cc-skills --skill link-validator验证 Claude Code 技能中的 Markdown 链接,确保在不同安装位置间的可移植性。
使用绝对仓库路径的技能在安装到其他位置时会失效:
| 路径类型 | 示例 | 安装后是否有效 |
|---|---|---|
| 绝对仓库路径 | /skills/foo/SKILL.md | 否 - 路径不存在 |
| 相对路径 | ./references/guide.md | 是 - 始终可解析 |
| 父级相对路径 | ../sibling/SKILL.md | 是 - 始终可解析 |
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
1. 确定要验证的技能路径
2. 运行:uv run scripts/validate_links.py <skill-path>
3. 查看违规报告(如果有)
4. 对每个违规项,应用建议的修复
5. 重新运行验证器以确认全部修复
1. 确定插件根目录
2. 运行:uv run scripts/validate_links.py <plugin-path>
3. 查看按技能分组的违规项
4. 逐个技能修复违规项
5. 重新验证整个插件
1. 阅读违规报告输出
2. 定位文件和行号
3. 查看建议的相对路径
4. 使用编辑工具应用修复
5. 重新运行文件验证器
修改此技能后:
# 验证单个技能
uv run scripts/validate_links.py ~/.claude/skills/my-skill/
# 验证包含多个技能的插件
uv run scripts/validate_links.py ~/.claude/plugins/my-plugin/
# 在当前目录进行试运行
uv run scripts/validate_links.py .
| 代码 | 含义 |
|---|---|
| 0 | 所有链接有效(相对路径) |
| 1 | 发现违规项(绝对仓库路径) |
| 2 | 错误(无效路径,无 Markdown 文件) |
标记为违规项:
/skills/foo/SKILL.md - 绝对仓库路径/docs/guide.md - 绝对仓库路径允许通过:
./references/guide.md - 同级目录相对路径../sibling/SKILL.md - 父级目录相对路径https://example.com - 外部 URL#section - 锚点链接| 问题 | 原因 | 解决方案 |
|---|---|---|
| 找不到脚本 | 路径或插件未安装 | 使用 claude plugin list 验证插件是否安装 |
| 退出代码 2 | 无效路径或无 .md 文件 | 检查目标路径是否存在且包含 Markdown 文件 |
| URL 误报 | 正则表达式匹配了外部链接 | 以 http 开头的 URL 应被忽略 |
| 锚点链接被标记 | 脚本将 # 视为路径 | 锚点链接(#section)按设计应允许 |
| 相对路径仍失败 | 相对方向错误 | 同级目录使用 ./,父级目录使用 ../ |
| 本地验证通过 | CI 使用不同的工作目录 | 确保 CI 从正确的仓库根目录运行 |
| 违规项过多 | 遗留代码库 | 增量修复,优先处理高影响文件 |
| 无法确定修复方案 | 复杂的路径结构 | 阅读 link-patterns.md 获取详细的修复策略 |
每周安装量
63
仓库
GitHub 星标数
25
首次出现
2026年1月24日
安全审计
安装于
opencode59
gemini-cli58
codex57
claude-code56
github-copilot56
cursor56
Validates markdown links in Claude Code skills for portability across installation locations.
Skills with absolute repo paths break when installed elsewhere:
| Path Type | Example | Works When Installed? |
|---|---|---|
| Absolute repo | /skills/foo/SKILL.md | No - path doesn't exist |
| Relative | ./references/guide.md | Yes - always resolves |
| Relative parent | ../sibling/SKILL.md | Yes - always resolves |
1. Identify skill path to validate
2. Run: uv run scripts/validate_links.py <skill-path>
3. Review violation report (if any)
4. For each violation, apply suggested fix
5. Re-run validator to confirm all fixed
1. Identify plugin root directory
2. Run: uv run scripts/validate_links.py <plugin-path>
3. Review grouped violations by skill
4. Fix violations skill-by-skill
5. Re-validate entire plugin
1. Read violation report output
2. Locate file and line number
3. Review suggested relative path
4. Apply fix using Edit tool
5. Re-run validator on file
After modifying this skill:
# Validate a single skill
uv run scripts/validate_links.py ~/.claude/skills/my-skill/
# Validate a plugin with multiple skills
uv run scripts/validate_links.py ~/.claude/plugins/my-plugin/
# Dry-run in current directory
uv run scripts/validate_links.py .
| Code | Meaning |
|---|---|
| 0 | All links valid (relative paths) |
| 1 | Violations found (absolute repo paths) |
| 2 | Error (invalid path, no markdown files) |
Flagged as Violations:
/skills/foo/SKILL.md - Absolute repo path/docs/guide.md - Absolute repo pathAllowed (Pass):
./references/guide.md - Relative same directory../sibling/SKILL.md - Relative parenthttps://example.com - External URL#section - Anchor link| Issue | Cause | Solution |
|---|---|---|
| Script not found | Path or plugin not installed | Verify plugin installed with claude plugin list |
| Exit code 2 | Invalid path or no .md files | Check target path exists and contains markdown |
| False positive on URL | Regex matched external link | URLs starting with http should be ignored |
| Anchor link flagged | Script treating # as path | Anchor links (#section) are allowed by design |
| Relative path still fails | Wrong relative direction | Use for same dir, for parent |
Weekly Installs
63
Repository
GitHub Stars
25
First Seen
Jan 24, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
opencode59
gemini-cli58
codex57
claude-code56
github-copilot56
cursor56
GitHub Actions 官方文档查询助手 - 精准解答 CI/CD 工作流问题
47,200 周安装
iOS Now Playing MusicKit 技能 - 集成 Apple MusicKit 实现音乐播放控制
1 周安装
Health Coach:临床级个人健康管理技能 - 营养分析、医学解读、运动计划
63 周安装
iOS CarPlay 现在播放控制技能 - 在 GitHub 上查看 derklinke/codex-config 项目
1 周安装
iOS网络迁移工具 - 代码库配置迁移助手,简化iOS项目网络层重构
1 周安装
iOS 网络诊断工具 - 网络协议分析、调试与性能优化 | derklinke/codex-config
1 周安装
iOS 网络编程技能 - 开发者工具与代码配置管理
1 周安装
./../| Validation passes locally | CI uses different working dir | Ensure CI runs from correct repo root |
| Too many violations | Legacy codebase | Fix incrementally, prioritize high-impact files |
| Can't determine fix | Complex path structure | Read link-patterns.md for detailed fix strategies |