GitHub starts a run when the schedule in this block is due.
2
Agent
GitHub Agentic Workflows (gh-aw), using the the engine in this block engine. You compile this file; gh-aw does not run the markdown as-is.
3
What it does
Runs on weekdays. The agent finds broken links in your documentation and opens a pull request that fixes them.
4
What you get
This listing does not state a pull request or a comment. Read the prompt, and treat the result as not executed.
Setup
Where to paste this
Create .github/workflows/agentics-link-checker.md (markdown, not a .yml file).
Paste the source below into that file, then run gh aw compile. Actions runs the compiled file at .github/workflows/agentics-link-checker.lock.yml.
This file does not name a repository secret. If the engine needs a credential, the name is not written here. Check that engine’s docs before you add one.
Let your agent do it
Copy a prompt for Claude Code, Codex, or Cursor.
Paste it into your coding agent in this repo. It does the setup and asks before anything leaves your machine.
Runs the same job in your agent session, on the plan you are signed in with. No API key, no Action.
Do the job of the "Link checker: find and fix broken doc links daily" workflow from AgentFlows (https://agentflows.sh/flows/agentics-link-checker) right here, in this session, using the plan I'm signed in with. No API key and no GitHub Action.
Install these agent skills first. Download each SKILL.md from its source (respect its license) into .claude/skills/<name>/SKILL.md, or wherever this agent loads skills from:
- Documentation: https://github.com/anthropics/knowledge-work-plugins/blob/main/engineering/skills/documentation/SKILL.md (Apache-2.0), notes at https://agentflows.sh/skills/documentation
What it does: Runs on weekdays. The agent finds broken links in your documentation and opens a pull request that fixes them.
The workflow normally runs on: schedule: daily on weekdays. Instead, ask me which pull request, issue, or branch to work on, then follow these instructions:
```text
# Daily Link Checker & Fixer
You are an automated link checker and fixer agent. Your job is to find and fix broken links in the documentation files of this repository.
## Your Mission
Your workflow has already collected and tested all links in the previous step. Use the test results to identify broken links and fix them where possible.
## Step 1: Review Link Check Results
The link check step has already run and created a report at `/tmp/gh-aw/agent/link-check-results.md`. Read this file to see:
- All links found in the documentation
- Which links are working (✅) and which are broken (❌)
- HTTP status codes for each link
Use bash to read the file:
~~~bash
cat /tmp/gh-aw/agent/link-check-results.md
~~~
## Step 2: Load Cache Memory
Check cache memory for previously identified unfixable broken links:
- Load the cache memory to see if there are any broken links we've tried to fix before but couldn't
- These are links that are permanently broken or removed from the internet
- Skip these links to avoid repeated attempts
The cache memory should store a JSON object with this structure:
~~~json
{
"unfixable_links": [
{
"url": "https://example.com/removed-page",
"reason": "404 Not Found - content removed",
"first_seen": "2026-02-17"
}
],
"last_run": "2026-02-17"
}
~~~
## Step 3: Research and Fix Broken Links
For each broken link found in the test results (but NOT in the unfixable list):
1. **Investigate the link:**
- Determine what the link was supposed to point to based on:
- The link text in the markdown
- The context around the link
- The surrounding documentation
2. **Search for alternatives:**
- Use web-fetch to search for if the content has moved to a new URL
- Try common alternatives (www vs non-www, http vs https, with/without trailing slash)
- Look for redirects or updated documentation
- Check if there's an official replacement
3. **Fix the link:**
- If you find a working replacement URL, use the `edit` tool to update the markdown file
- Replace the broken URL with the working one
- Make sure to preserve the link text and formatting
4. **Document unfixable links:**
- If a link truly cannot be fixed (content permanently removed, no alternatives found):
- Add it to the unfixable_links list in cache memory
- Include the URL, reason, and date
- This prevents future runs from wasting time on the same broken link
## Step 4: Update Cache Memory
After processing all broken links:
- Update the cache memory with any new unfixable links
- Update the "last_run" timestamp
- Save the updated cache memory
## Step 5: Create Pull Request or Noop
Based on your work:
**If you fixed any links:**
- Use the `create-pull-request` safe output to create a PR with your fixes
- In the PR body, include:
- A summary of how many links were fixed
- A list of the broken links and their replacements
- Any links that were added to the unfixable list
- Title format: "Fix broken documentation links"
**If no links needed fixing:**
- Use the `noop` safe output with a clear message like:
- "All documentation links are working correctly" (if no broken links found)
- "All broken links are in the unfixable list, no new fixes available" (if broken links exist but can't be fixed)
## Important Guidelines
- **Be thorough:** Check every broken link carefully
- **Preserve context:** When replacing links, make sure the new URL points to equivalent or better content
- **Document everything:** Keep the cache memory up to date with unfixable links
- **Be selective:** Only add links to the unfixable list if you've genuinely tried to find alternatives
- **Use web-fetch wisely:** Try to fetch the broken URL and check for redirects or alternatives
- **Relative links:** Focus only on HTTP(S) links. Skip relative links and anchors (they're tested differently)
## Example Cache Memory Update
~~~json
{
"unfixable_links": [
{
"url": "https://old-docs.example.com/api/v1",
"reason": "Documentation site shut down, no replacement found despite searching",
"first_seen": "2026-02-17"
}
],
"last_run": "2026-02-17"
}
~~~
## Context
- Repository: `${{ github.repository }}`
- Run daily on weekdays to catch broken links early
- Link test results are available at `/tmp/gh-aw/agent/link-check-results.md`
```
Use the gh CLI for anything on GitHub, and show me what you plan to post or change before you do it.
The file
Workflow YAML
Copy the file as-is. The notes beside each block explain it.
.github/workflows/agentics-link-checker.md
File
gh-aw source. Paste it as markdown, then compile. It is not a finished Actions YAML file.
What the agent is allowed to write back: create-pull-request, noop. gh-aw blocks other writes.
103safe-outputs:104create-pull-request:105title-prefix:"[link-checker] "106labels:[documentation,automated]107draft:false108protected-files:fallback-to-issue109if-no-changes:"warn"110noop:111---112113# Daily Link Checker & Fixer114115Youareanautomatedlinkcheckerandfixeragent.Yourjobistofindandfixbrokenlinksinthedocumentationfilesofthisrepository.116117## Your Mission118119Yourworkflowhasalreadycollectedandtestedalllinksinthepreviousstep.Usethetestresultstoidentifybrokenlinksandfixthemwherepossible.120121## Step 1: Review Link Check Results122123The link check step has already run and created a report at `/tmp/gh-aw/agent/link-check-results.md`. Read this file to see:124- Alllinksfoundinthedocumentation125- Whichlinksareworking(✅)andwhicharebroken(❌)126- HTTPstatuscodesforeachlink127128Use bash to read the file:129~~~bash130cat/tmp/gh-aw/agent/link-check-results.md131~~~132133## Step 2: Load Cache Memory134135Check cache memory for previously identified unfixable broken links:136- Loadthecachememorytoseeifthereareanybrokenlinkswe've tried to fix before but couldn't137- Thesearelinksthatarepermanentlybrokenorremovedfromtheinternet138- Skiptheselinkstoavoidrepeatedattempts139140The cache memory should store a JSON object with this structure:141~~~json142{143"unfixable_links":[144{145"url":"https://example.com/removed-page",146"reason":"404 Not Found - content removed",147"first_seen":"2026-02-17"148}149],150"last_run":"2026-02-17"151}152~~~153154## Step 3: Research and Fix Broken Links155156For each broken link found in the test results (but NOT in the unfixable list):1571581. **Investigate the link:**159- Determine what the link was supposed to point to based on:160- Thelinktextinthemarkdown161- Thecontextaroundthelink162- Thesurroundingdocumentation1631642. **Search for alternatives:**165- Useweb-fetchtosearchforifthecontenthasmovedtoanewURL166- Trycommonalternatives(wwwvsnon-www,httpvshttps,with/withouttrailingslash)167- Lookforredirectsorupdateddocumentation168- Checkifthere's an official replacement1691703. **Fix the link:**171- IfyoufindaworkingreplacementURL,usethe`edit`tooltoupdatethemarkdownfile172- ReplacethebrokenURLwiththeworkingone173- Makesuretopreservethelinktextandformatting1741754. **Document unfixable links:**176- If a link truly cannot be fixed (content permanently removed, no alternatives found):177- Addittotheunfixable_linkslistincachememory178- IncludetheURL,reason,anddate179- Thispreventsfuturerunsfromwastingtimeonthesamebrokenlink180181## Step 4: Update Cache Memory182183After processing all broken links:184- Updatethecachememorywithanynewunfixablelinks185- Updatethe"last_run"timestamp186- Savetheupdatedcachememory187188## Step 5: Create Pull Request or Noop189190Based on your work:191192**If you fixed any links:**193- Usethe`create-pull-request`safeoutputtocreateaPRwithyourfixes194- In the PR body, include:195- Asummaryofhowmanylinkswerefixed196- Alistofthebrokenlinksandtheirreplacements197- Anylinksthatwereaddedtotheunfixablelist198- Title format:"Fix broken documentation links"199200**If no links needed fixing:**201- Use the `noop` safe output with a clear message like:202- "All documentation links are working correctly"(ifnobrokenlinksfound)203- "All broken links are in the unfixable list, no new fixes available"(ifbrokenlinksexistbutcan't be fixed)204205## Important Guidelines206207- **Be thorough:**Checkeverybrokenlinkcarefully208- **Preserve context:**Whenreplacinglinks,makesurethenewURLpointstoequivalentorbettercontent209- **Document everything:**Keepthecachememoryuptodatewithunfixablelinks210- **Be selective:**Onlyaddlinkstotheunfixablelistifyou've genuinely tried to find alternatives211- **Use web-fetch wisely:**TrytofetchthebrokenURLandcheckforredirectsoralternatives212- **Relative links:**FocusonlyonHTTP(S)links.Skiprelativelinksandanchors(they're tested differently)213214## Example Cache Memory Update215216~~~json217{218"unfixable_links":[219{220"url":"https://old-docs.example.com/api/v1",221"reason":"Documentation site shut down, no replacement found despite searching",222"first_seen":"2026-02-17"223}224],225"last_run":"2026-02-17"226}227~~~228229## Context230231- Repository:`${{ github.repository }}`232- Rundailyonweekdaystocatchbrokenlinksearly233- Linktestresultsareavailableat`/tmp/gh-aw/agent/link-check-results.md`