js-redirects
What it does
This skill finds pages that redirect using JavaScript and suggests server-side redirects instead. It is for developers who want faster, search-friendly navigation.
When to use it
- ✓When a page loads and then sends visitors elsewhere with a script.
- ✓When you move pages and redirects feel slow.
- ✓When search engines seem to struggle with your redirects.
Skill link
https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/js-redirects/SKILL.mdCopy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.
How to use
The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.
Ready-to-paste message
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agent’s skills folder.
Example of what to ask your AI
“Can you replace the JavaScript redirects on my site with proper server redirects?”
5 new skills a week. 1 minute to read.
How it works
The agent searches the code for window.location redirects and suggests moving them to 301 or 302 rules in the web server or edge configuration.
Technical content (original SKILL.md)
Original text by the author, straight from GitHub.
Avoid JavaScript-based redirects
JavaScript redirects force an additional round-trip after the initial page load, significantly increasing the time users spend waiting for content.
Quick Reference
- Use 301 or 302 server-side redirects instead of
window.location - JS redirects delay page load as the browser must first download and execute the script
- Client-side redirects can negatively impact SEO and indexability
Check
Check the project for instances where JavaScript is being used for page-level redirects (e.g., window.location).
Fix
Replace JavaScript-based redirects with server-side 301 or 302 redirects in your web server or edge configuration.
Explain
Explain why server-side redirects are faster and more SEO-friendly than client-side JavaScript redirects.
Code Review
Review the routes, assets, and loading behavior that affect Avoid JavaScript-based redirects. Flag exact files, requests, or rendering steps that add unnecessary network, CPU, or layout cost, and describe the measurement method used to confirm the issue.
For full implementation details, code examples, and framework-specific guidance,
see references/rule.md.
Rule page: https://frontendchecklist.io/rules/performance/js-redirects
FAQ
Why are server redirects faster?
The skill says a JavaScript redirect needs the page and script to load first, which adds an extra round trip.
Are server redirects better for SEO?
The skill says client-side redirects can hurt SEO, while server-side redirects are more search-friendly.
Where should the redirect be set?
The skill suggests the web server or edge configuration.
Details
Original description by the author
Use when auditing slow page loads, heavy assets, or rendering delays related to Avoid JavaScript-based redirects. Verify the actual bottleneck in DevTools, Lighthouse, or field data before recommending changes.
Popularity
- GitHub stars
- 75k
- Ranking position
- #2905
- License
- MIT
- Updated
- 10/31/2026
Comments
- …
More skills from this repository
frontendchecklist
75kChecks frontend code and live pages against 380+ rules for accessibility, speed, SEO and security, using a command-line tool.
frontend-checklist-global
75kAudits a frontend project against all 386 Front-End Checklist rules, and gives a specific fix for each issue found.
404-page
75kChecks that your missing-page screen offers helpful links and returns a real 404 status, to help lost visitors find their way.
about-page
75kReviews whether your site has a clear About page that explains who runs it, to build trust with visitors and search engines.
Similar skills
angular-developer
280kHelps your agent create Angular code and give project structure advice. Useful for starting new projects, creating code parts, or improving performance and accessibility.
frontend-a11y
280kHelps your agent make web interfaces accessible to everyone. It ensures websites and apps work well with screen readers and keyboard navigation.
frontend-patterns
280kHas your agent apply modern patterns in frontend development. It optimizes performance, manages state, and follows best practices in React and Next.js.