Install with a coding agent
Last updated Edit this page View as Markdown
Machine-readable install recipes for coding agents, one per server: prerequisites, install, configure, verify and roll back, plus an install skill.
On this page
A coding agent can install mod_pagespeed 2.1 from a recipe: one Markdown file per server, written for an agent to run. Each recipe has the same five sections: prerequisites check, install, minimal configuration, verification and rollback. The commands are fenced, the values to fill in are placeholders in angle brackets, and there is no prose beyond what a command needs.
The recipes derive from these docs. Every command in a recipe comes from the docs pages it names at the top; when a command changes, the docs change first and the recipe follows.
The recipes
| Server | Recipe | Docs page |
|---|---|---|
| Index of all recipes | README.md | |
| nginx (native module) | nginx.md | Install the module on Apache and nginx |
| Apache (native module) | apache.md | Install the module on Apache and nginx |
| cPanel / EasyApache 4 | cpanel.md | cPanel / EasyApache 4 |
| IIS (native module) | iis.md | Install on IIS |
| ASP.NET Core (middleware) | aspnet-core.md | Install ASP.NET Core middleware |
| Docker (reverse proxy) | docker.md | Install with Docker |
| Kubernetes (Helm chart) | helm.md | Deploy with Helm |
How an agent uses a recipe
- Prerequisites. Pick the recipe for the server that serves the site’s HTML and run its checks. Stop at the first failure and report it.
- Install. Run the install commands as written. Privileged commands
(
sudo, an elevated PowerShell,msiexec,docker,helm) need the operator’s go-ahead, and so does any install on a server that takes production traffic. - Configure. Apply the minimal configuration, replacing each
<placeholder>with a value from the project. - Verify. Request the site’s own page and check one response header:
X-Page-Speed(nginx, IIS),X-Mod-Pagespeed(Apache) orX-PageSpeed(ASP.NET Core, Docker, Helm). The install is complete only when that header is present. - Roll back. If verification fails after one pass through the troubleshooting link, the rollback section is written to undo only what the run created and to leave anything that existed before in place.
The verification marker
The verification request carries a fixed query string, ?mps-verify=agent.
mod_pagespeed ignores the parameter. The request goes only to the server being
verified, so the marker lands only in that server’s own access log, where the
operator can count agent-run verifications:
grep -c 'mps-verify=agent' /var/log/nginx/access.log
Nothing in a recipe reports anywhere. The recipes themselves call only the documented install channels: the package repository, GHCR, the Helm repository, nuget.org and the download page. apt, dnf, Docker and Helm then pull dependencies from the sources they are configured with.
The install skill
The install-modpagespeed skill wraps the recipes for agents that load skills:
it detects the server, fetches the matching recipe, runs it and runs the
verification. Its source is in the
pagespeed-optimizer repository.
In Claude Code, add the repository as a plugin marketplace and install the plugin:
claude plugin marketplace add We-Amp/pagespeed-optimizer
claude plugin install modpagespeed@modpagespeed
Claude Code can then pick the skill when you ask for a mod_pagespeed install,
or you can run it directly as /modpagespeed:install-modpagespeed.
For other agents that read skill directories, the skills command-line tool
copies the skill into the current project:
npx skills add We-Amp/pagespeed-optimizer --skill install-modpagespeed
An agent without skill support can be given a recipe URL directly, for example “install mod_pagespeed by following https://modpagespeed.com/recipes/nginx.md”.