
link-validation
Offline markdown link validation with lychee (tasks/link-check.sh, moon run repo:link-check). Detect broken internal links and anchors on demand.
- Installs
- 134
- Last 24h
- —
- Trending rank
- —
- Security
- Not audited
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/terrylica/cc-skills --skill link-validation- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads link-validation automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
SKILL.md
The instructions your agent reads when the skill is triggered.
Link Validation Skill
Validates markdown links in your workspace using lychee.
Self-Evolving Skill: This skill improves through use. If instructions are wrong, parameters drifted, or a workaround was needed — fix this file immediately, don't defer. Only update for real, reproducible issues.
When to Use This Skill
Use this skill when:
- Checking for broken links in markdown files
- Validating link paths before committing documentation
- Proving a doc change left no dangling internal link
How to Run It
The working path is the offline lychee check in tasks/link-check.sh. Inside the cc-skills repository it is part of the quality gate:
moon run repo:link-check # this check alone
moon run repo:check # the whole gate, link-check included
bash tasks/link-check.sh # the same script without moon
In any other workspace, run the same lychee command from the repository root:
lychee --offline --no-progress --root-dir "$(git rev-parse --show-toplevel)" './**/*.md'
Add --config lychee.toml when the repository has one; lychee also loads ./lychee.toml by itself.
What the Check Does
tasks/link-check.sh:
cds to the working-tree root (git rev-parse --show-toplevel, so it is correct inside a worktree too)- Runs
bunx lychee --config lychee.toml --offline --no-progress --root-dir <repo root> './**/*.md' - Excludes
plugins/statusline-tools/tests/fixtures, whose links are broken on purpose - Prints lychee's summary line, then
✓ every internal link resolvesor✗ broken internal links found (lychee exit N), and exits with lychee's exit code
It checks relative links, root-relative links (/docs/adr/x.md, resolved through --root-dir) and #anchor fragments. It is offline by design: external URL liveness depends on the network and on other sites' uptime, so it is not checked. Nothing is written to disk except lychee's own .lycheecache; the result is the terminal output and the exit code.
A path that exists on one machine only (~/..., another repository) cannot pass. Write it as inline code instead of a link.
Requirements
- lychee:
tasks/link-check.shruns it throughbunx, so Bun is enough there; elsewhere install it (brew install lychee)
Configuration
cc-skills keeps one lychee config, lychee.toml at the repository root. It holds the path and URL exclusions and include_fragments = "anchor-only" (lychee 0.24 rejects the old boolean true). The statusline-tools Stop hook reads the same file when it exists.
Related Checks
- Link portability in skills (absolute repo paths that break once installed): the link-validator skill
- Path policy at session end: the statusline-tools Stop hook runs
lint-relative-pathsand lychee, and writes.lychee-results.jsonfor the status line
History
This skill used to describe a Stop hook, hooks/stop-link-check.py, that wrote .link-check-results.md. link-tools never had a hooks.json, so the hook never ran; it was deleted in issue #33.
References
- ADR: Link Checker Plugin Extraction
- lychee Documentation
Troubleshooting
| Issue | Cause | Solution |
|---|---|---|
| lychee not found | Not installed | brew install lychee, or run through bunx lychee |
| Config fails to load | include_fragments = true | Use include_fragments = "anchor-only" (lychee 0.24 and later) |
Every /docs/... link fails | No --root-dir | Pass --root-dir with the absolute repository root |
A link to ~/... fails | Path exists on one machine only | Write it as inline code, not a link |
| A fixture's broken link fails | Fixture not excluded | Add it to --exclude-path or the config's exclude_path |
Post-Execution Reflection
After this skill completes, check before closing:
- Did the command succeed? — If not, fix the instruction or error table that caused the failure.
- Did parameters or output change? — If the underlying tool's interface drifted, update Usage examples and Parameters table to match.
- Was a workaround needed? — If you had to improvise (different flags, extra steps), update this SKILL.md so the next invocation doesn't need the same workaround.
Only update if the issue is real and reproducible — not speculative.
FAQ
What does the link-validation skill do?
Offline markdown link validation with lychee (tasks/link-check.sh, moon run repo:link-check). Detect broken internal links and anchors on demand.
How do I install link-validation?
Run npx skills add https://github.com/terrylica/cc-skills --skill link-validation in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/link-validation/ (personal) or .claude/skills/link-validation/ (project).
Which AI agents can use link-validation?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is link-validation safe to install?
No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.
Who maintains link-validation?
It is published by terrylica in terrylica/cc-skills. It has 134 recorded installs.
More from terrylica/cc-skills
mise-tasks
terrylica/cc-skills
Orchestrate multi-step project workflows using mise task definitions with dependency management and argument handling. Use whenever the user.
pandoc-pdf-generation
terrylica/cc-skills
PDF generation from markdown via Pandoc/XeLaTeX. TRIGGERS - markdown for PDF, print document, pandoc
mql5-indicator-patterns
terrylica/cc-skills
MQL5 indicator development patterns. TRIGGERS - MQL5 indicator, OnCalculate, indicator buffers, MetaTrader 5.
python-logging-best-practices
terrylica/cc-skills
Python logging with loguru, structlog, and orjson. TRIGGERS - loguru, structlog, structured logging
Popular docs & writing skills
grill-with-docs
mattpocock/skills
A relentless interview to sharpen a plan or design, which also creates docs (ADR's and glossary) as we go.
lark-markdown
open.feishu.cn
飞书 Markdown:查看、创建、上传、编辑和比较飞书中的原生 Markdown 文件。当用户要操作飞书 Markdown 文件,或比较其远端版本及本地草稿时使用。纯本地 Markdown 文件操作不触发本 skill。不负责将 Markdown 导入为飞书在线文档,也不负责文件搜索、权限、评论、移动、删除等云空间管理操作。
writing-beats
mattpocock/skills
Writing, exploit; assemble raw material into a journey of beats, grounding each term before a beat leans on it.
writing-shape
mattpocock/skills
Writing, exploit: shape raw material into an article, paragraph by paragraph.
writing-fragments
mattpocock/skills
Writing, explore: mine raw fragments, no structure yet.
writing-for-agents
mattpocock/skills
Writing documents for agents. Use when creating or editing skills, or modifying AGENTS.md or CLAUDE.md.