speculation-rules
What it does
This skill sets up the browser's Speculation Rules feature for likely next pages and checks that the rules are not too broad. It is for web builders who want faster page transitions on multi-page sites.
When to use it
- ✓When you ask the agent to make navigation between pages on your site feel faster.
- ✓When page transitions feel slow and visitors often go to the same few next pages.
- ✓When you want to review speculation rules so they do not load unrelated or personal pages.
Skill link
https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/speculation-rules/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
“Moving between pages on my site feels slow. Can you add speculation rules so the next page loads ahead of time?”
5 new skills a week. 1 minute to read.
How it works
The agent adds a Speculation Rules block that targets the most likely next-page links. It starts with prefetch, which loads the HTML early, and suggests prerender for pages that are very likely to be opened next.
Technical content (original SKILL.md)
Original text by the author, straight from GitHub.
Use the Speculation Rules API to prefetch and prerender navigations
Navigation latency is one of the biggest contributors to poor Interaction to Next Paint (INP) and overall perceived performance. Prerendering the most likely next page eliminates all network and rendering latency — the user sees the new page in under 100 ms regardless of server response time. Google Search has used this API to deliver its "instant" results page experience.
Quick Reference
- Use prefetch rules to load the next page's HTML ahead of time
- Use prerender rules to fully render the next page in the background (instant navigation)
- Scope rules with href-matches or CSS selector patterns to avoid wasting bandwidth
- Prefer document rules (CSS selectors) over URL list rules for dynamic sites
Check
Check whether the site uses the Speculation Rules API or equivalent prefetch/prerender techniques for likely navigation targets.
Fix
Add a Speculation Rules JSON block targeting the most likely next-page links, starting with prefetch and graduating to prerender.
Explain
Explain how the Speculation Rules API differs from rel=prefetch and rel=prerender, and how prerendering achieves near-zero navigation latency.
Code Review
Review speculation rule selectors for over-eagerness — flag patterns that would prerender unrelated pages, third-party URLs, or pages with personalised/authenticated content that should not be pre-fetched.
For full implementation details, code examples, and framework-specific guidance,
see references/rule.md.
Rule page: https://frontendchecklist.io/rules/performance/speculation-rules
FAQ
What is the difference between prefetch and prerender?
The skill says prefetch loads the page HTML ahead of time, while prerender fully renders the page in the background.
Could this waste bandwidth?
It can if the rules are too broad, so the skill recommends scoping them tightly.
Should personal pages be included?
No. The skill says to avoid prerendering personalized or authenticated pages.
Details
Original description by the author
Use when optimising multi-page navigation performance, reducing INP on page transitions, or implementing progressive enhancement for fast page loads.
Popularity
- GitHub stars
- 75k
- Ranking position
- #3032
- 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.