Skip to content

Conversation

@nearestnabors
Copy link
Contributor

@nearestnabors nearestnabors commented Jan 17, 2026

Summary

  • Adds a GitHub Action that runs on PRs modifying markdown files
  • Includes a local script (scripts/check-redirects.sh) that works via git comparison to main
  • Detects deleted .md/.mdx files and verifies they have redirect entries in next.config.ts
  • Blocks PRs and posts a comment with suggested redirect entries if any are missing

Test plan

  • Verify the action triggers on PRs that delete markdown files
  • Test locally by running ./scripts/check-redirects.sh on a branch with deleted files
  • Confirm the PR comment includes helpful fix instructions

🤖 Generated with Claude Code


Note

Adds automated protection against broken doc links and updates URLs for moved content.

  • CI: New GitHub Action check-redirects.yml runs scripts/check-redirects.sh to detect deleted app/**/*.md(x) without entries in next.config.ts, posting PR comments and failing the check.
  • Redirects: Adds mappings in next.config.ts for guides/agent-frameworksget-started/agent-frameworks and guides/tool-calling/mcp-clientsget-started/mcp-clients (including wildcards).
  • Docs/assets: Removes old menu entries, updates public/llms.txt links, and adjusts _meta.tsx to reflect the new get-started locations.

Written by Cursor Bugbot for commit 4142993. This will update automatically on new commits. Configure here.

Adds a GitHub Action and local script that compares the branch to main,
detects deleted markdown files, and ensures each has a corresponding
redirect entry in next.config.ts. Prevents broken bookmarks and SEO issues.

Co-Authored-By: Claude Opus 4.5 <[email protected]>
@vercel
Copy link

vercel bot commented Jan 17, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
docs Ready Ready Preview, Comment Jan 17, 2026 10:11pm

Request Review

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 4 potential issues.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

fi

# Get list of deleted markdown files (comparing to base branch)
DELETED_FILES=$(git diff --name-status "$BASE_BRANCH"...HEAD 2>/dev/null | grep "^D" | grep -E '\.(md|mdx)$' | awk '{print $2}' || true)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Script silently succeeds when base branch unavailable

High Severity

When the base branch cannot be fetched (network failure, invalid remote, wrong branch name), the script silently reports success with "No deleted markdown files found" instead of failing. The || true on the fetch command allows continuation, and the subsequent git diff against the non-existent branch fails silently due to 2>/dev/null || true. This allows PRs with deleted files to pass the check without any actual verification being performed.

Fix in Cursor Fix in Web

nearestnabors and others added 3 commits January 17, 2026 21:59
…t checker

Content moves:
- Move guides/agent-frameworks/* to get-started/agent-frameworks/*
- Move guides/tool-calling/mcp-clients/* to get-started/mcp-clients/*
- Add wildcard redirects for moved content
- Fix stale _meta.tsx references

Redirect checker enhancements:
- Interactive mode prompts for redirect destinations
- Validates existing redirects for placeholder text (REPLACE_WITH, TODO, FIXME)
- Catches circular redirects (source == destination)
- Verifies destination pages exist
- Detects both deletes and renames

Co-Authored-By: Claude Opus 4.5 <[email protected]>
- Fail with error when base branch is unavailable instead of silent success
- Fix root page URL path handling (app/en/page.mdx -> /:locale)
- Only check page.md/mdx files (skip non-routable markdown like README.md)
- Use cut with tab delimiter instead of awk to handle filenames with spaces

Co-Authored-By: Claude Opus 4.5 <[email protected]>
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

# Return the destination
echo "$destination"
return 0
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interactive prompts captured as destination value

Medium Severity

The prompt_for_destination function echoes informational prompts and messages to stdout (lines 223-230, 234, 240, 246), and the final destination path is also echoed to stdout (line 254). When called via command substitution at line 284 with destination=$(prompt_for_destination "$url_path"), all stdout output gets captured into destination, not just the intended path. This results in malformed redirect entries containing prompt text mixed with the actual destination, breaking the suggested redirect output in interactive mode.

Additional Locations (1)

Fix in Cursor Fix in Web

# Only match page.md or page.mdx files (actual routable pages in Next.js App Router)
# Use cut with tab delimiter instead of awk for proper field separation
COMMITTED_DELETES=$(git diff --name-status "$BASE_BRANCH"...HEAD 2>/dev/null | grep -E "^D|^R" | grep -E 'page\.(md|mdx)$' | cut -f2 || true)
UNCOMMITTED_DELETES=$(git diff --name-status HEAD 2>/dev/null | grep -E "^D|^R" | grep -E 'page\.(md|mdx)$' | cut -f2 || true)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Renamed page files to non-page files not detected

Medium Severity

The grep filter grep -E 'page\.(md|mdx)$' checks if the line ends with page.md(x), but for git renames the line format is R100<TAB>old-path<TAB>new-path, so it checks the new path, not the old one. If someone renames page.mdx to a non-page file (like component.tsx), the old page URL would break but the script won't detect it needs a redirect. The filter should check the old path (field 2), not the entire line.

Fix in Cursor Fix in Web

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants