Skip to content
Skillpedia
Websites & UI (frontend)75k · #3032

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.md

Copy 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

Use this skill to help me: https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/speculation-rules/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
Want your AI to find skills like this on its own?Install the free Skillpedia MCP: one line, and it searches 15,000+ skills before each task.Install in 1 minute →

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.

repo: thedaviddias/Front-End-Checklist

Popularity

GitHub stars
75k
Ranking position
#3032
License
MIT
Updated
10/31/2026

Is this skill useful?

0

Sign in to vote.

Comments

  • …

More skills from this repository

Similar skills