wp-static-clone
安装方式
先用 Prompt 核对来源与依赖。也可下载安装包。
用 AI 助手安装
复制提示词,让助手先核对固定版本和依赖。
查看 Prompt收起 Prompt
先检查当前 Agent 是否已安装 SkillPI Skill Finder。如果尚未安装,请按官方仓库的说明安装并启用:https://github.com/Findskills/skillpi。然后使用 Skill Finder 打开此 SkillPI 详情页并定位 "wp-static-clone":https://skillpi.com/zh/skills/deepskill-aa24088034c607ce902dbbd6ba00d0b95892308ecdf4f261855324b5d3ac226a。安装前核对上游来源和版本:https://github.com/jdevalk/skills。来源不一致时停止并说明差异。核对通过后,用 Skill Finder 安装目标 Skill,并报告安装路径和来源版本。
来源与配置
github.com
配置方式待核实
请查看原始来源中的适用工具、依赖和权限要求。
安装实测待补充
将动态的 WordPress(或其他 CMS 驱动)网站克隆为可部署在任意静态主机(如 Cloudflare Pages、Netlify、Vercel、S3+CloudFront、普通 Apache/nginx)上的静态 HTML 站点。流程包括从 sitemap_index.xml 提取所有 URL、抓取所有资源、将路径重写为根相对路径、移除 WordPress 运行时标记,并输出无需构建命令即可直接部署的扁平化目录,适用于“抓取”“静态化”“归档”或“迁移到 [主机]”的场景。
介绍来源: third_party · jdevalk · 0.0.1 参考来源
SkillPi 解读
- 能完成的任务
- 翻译待完成,请参阅来源文档。
- 适合谁
- 翻译待完成,请参阅来源文档。
- 输入和输出
- 翻译待完成,请参阅来源文档。
- 软件、账号及付费要求
- 来源文档未说明。
- 限制与区别
- 来源文档未说明。
- 实测状态
- 未测试
文件浏览
Frontmatter
name: wp-static-clone
description: >
Clones a live WordPress (or other CMS-driven) site into a static HTML
site deployable on any static host (Cloudflare Pages, Netlify, Vercel,
S3+CloudFront, plain Apache/nginx). Use when the user wants to "scrape",
"freeze", "archive", "static-ify", or "move to [host]" a WordPress site,
or asks to turn a sitemap into deployable static HTML. Pulls every URL
from sitemap_index.xml, fetches all assets, rewrites paths to be
root-relative, strips WP runtime markup, and outputs a flat directory
ready to deploy with no build command.wp-static-clone
Turn a live WordPress site into a static HTML clone deployable on any static host. Driven by the site's XML sitemap. Handles the WordPress-specific gotchas — Cloudflare bot protection, mid-scrape link rewriting, proxied analytics, R2-offloaded uploads, comment-form runtime, Yoast attribution, Gravatar privacy — that a naïve wget run misses.
Recipes live in AGENTS.md; reusable scripts in scripts/. This file is the workflow, gotchas, and output structure.
When to use
Trigger on requests like:
- "Scrape this WordPress site for [host]"
- "Freeze [domain] as static HTML"
- "Pull all the pages from this sitemap and turn them into static files"
- "Move this WP site to [host] with no build step"
The broad shape (sitemap → wget → root-relative paths → static host) generalises to any CMS that emits a standard XML sitemap. The runtime cleanup (comment forms, Plausible proxy, Gravatar, Yoast) is WordPress-specific.
Workflow
Phase 0 — Confirm intent
Before scraping, confirm:
- Source URL (the live site).
- Target host — Cloudflare Pages, Netlify, Vercel, generic static. Drives Phase 9.
- Same or different domain at the destination. Drives whether
og:url,<link rel="canonical">, and JSON-LD@idstay absolute (same domain — correct SEO behaviour) or get rewritten (different domain). - What to do with analytics and forms. WP plugins for both can't run statically. Plausible gets replaced with the standard tracker (recipe in
AGENTS.md); contact/search forms either get removed or wired through Pages Functions / Formspree / Netlify Forms — host-specific.
Phase 1 — Discover URLs and pull XML sitemaps
Fetch the sitemap index. Try <root>/sitemap_index.xml (Yoast convention) first, then <root>/sitemap.xml. If the index references sub-sitemaps (page-sitemap.xml, post-sitemap.xml, …), fetch each and concatenate <loc> values into urls.txt. Skip image-sitemap entries.
Also fetch the XML sitemaps themselves and the Yoast XSL stylesheet now (recipe in AGENTS.md) — they aren't linked from HTML, so wget -p won't find them later.
Phase 2 — Scrape in one shot
Critical: scrape every URL in a single wget invocation so its --convert-links pass sees all downloaded files and rewrites cross-page links correctly. Scraping URLs in separate runs leaves residual absolute links on whichever page was scraped first/last. Recipe in AGENTS.md.
Phase 3 — Pull assets the page-requisites pass missed
Some assets aren't -p-followed because they appear only in og:image, apple-touch-icon, JSON-LD image/logo, msapplication-TileImage, or <link rel="modulepreload">. Audit and fetch the long tail. Recipe in AGENTS.md covers all three asset roots (uploads, themes, plugins).
Phase 4 — Convert paths to root-relative
wget -k produces a mix of ../wp-content/... (depth-relative) and bare wp-content/... (homepage). Both work locally but break the moment a page moves. Convert to root-relative /wp-content/... everywhere:
python3 scripts/rewrite-paths.py output/ urls.txt --source-domain example.com
The script derives the page-slug list from urls.txt, not from a directory walk — otherwise wget-grabbed archive directories like category/, feed/, author/, wp-json/ get wrongly classified as pages and their inter-page links get mis-rewritten.
The script defaults to WordPress asset roots (wp-content, wp-includes). For non-WP sources, override with --asset-roots: e.g. --asset-roots sites/default/files,sites/default/themes for Drupal, --asset-roots content/images for Ghost. The rest of the rewriter is CMS-agnostic.
Phase 5 — Brand the static output
So future-you (or anyone reading view-source) can tell at a glance that this is the static clone, not the live WP install:
python3 scripts/insert-banner.py output/
Inserts an HTML comment after <!DOCTYPE html> on every page. Idempotent. Then replace the "Generated by Yoast SEO" attribution in wp-content/plugins/wordpress-seo/css/main-sitemap.xsl — recipe in AGENTS.md.
Phase 6 — Replace WP runtime hooks
Three categories of WP-only markup that breaks once the backend is gone:
1. Comment forms, reply links, and dead head tags. One pass:
python3 scripts/strip-wp-runtime.py output/
Removes <div id="respond"> blocks (the comment form), comment-reply-link anchors in both block-theme and classic-theme variants, the comment-reply-js script tag and its underlying file, and dead <head> tags (REST API discovery, RSD, oEmbed alternates, RSS alternates, archive next links). Match-by-class throughout — no language assumptions about link text.
2. Plausible analytics proxy. The WP plugin proxies the script through /wp-content/uploads/<hash>/pa-XXX.js and posts events back to /wp-json/.... Both endpoints disappear. Replace the two-script block with the standard tracker — recipe in AGENTS.md.
3. Gravatar avatars. Self-host every distinct (hash, size) pair, drop the ?s=N&d=mm requests to a third party:
python3 scripts/selfhost-gravatars.py output/
Saves under avatars/ and rewrites every reference. Detects extension from response bytes (PNG fallback vs JPEG real avatar), keeps size variants separate (?s=40 and ?s=80 are different files).
After the scripts, audit remaining absolute source-domain URLs (recipe in AGENTS.md) and triage by case: author archives → strip the <a> wrapper, server-rendered iframes → drop the wrapping <p>, Gravity Forms script blocks → strip on gform-mention, etc.
Phase 7 — Copy robots.txt
Not linked from HTML; fetch it explicitly. Adjust the Sitemap: reference if the deployed sitemap path differs from the source.
Phase 8 — Verify locally
Serve from output/ with python3 -m http.server, then run the verify checklist in AGENTS.md:
- Every URL in
urls.txtresolves to a file (no missed pages). - No remaining
https://<source-domain>/outside the canonical /og:url/ JSON-LD allow-list. - No broken internal links from
wget --spider. - Spot-check the homepage and a deep page in a browser. Watch srcset images, sidebar widgets, and the header banner — those break silently if missed.
Phase 9 — Deploy
Host-specific recipes in AGENTS.md:
- Cloudflare Pages —
_redirects,_headers, "no build command, no output directory" defaults. - Netlify — same
_redirects/_headerssyntax, plusnetlify.toml. - Vercel —
vercel.jsonwithredirects/headers. - Generic — nginx
try_files, ApacheOptions +MultiViews.
Gotchas
These are the things that bit us. Don't repeat them.
-
Cloudflare bot protection 403s the default
Wget/1.xUA. Always set a real browser UA +Accept/Accept-Languageheaders (recipe). If you see403 Forbiddenafter a burst of requests, that's it — back off, switch UA, retry. -
Cross-page link rewriting only works in a single wget invocation. wget's
-konly rewrites to local paths it sees in the current run. If a page was downloaded in a separate invocation (e.g. to recover from a 403 on one URL), its links to the rest stay absolute. Solution: redo the full scrape once you have the right UA. Don't piecemeal it. If you're scraping at scale (10K+ URLs) and can't fit in one run, scrape in batches and re-runscripts/rewrite-paths.pyafterwards as the canonical pass —-k's output is then redundant. -
Default publish directory by host. Cloudflare Pages serves the repo root when no build command is configured. Netlify and Vercel also default to root. If you scraped into
output/, either move files to the repo root (git mv output/* .) or configure the host to publish fromoutput/. Symptom of the wrong setup on Pages: every URL 404s with R2-style headers (access-control-allow-origin: *,cache-control: no-store) instead of a Pages-branded 404. -
WordPress Offload Media plugins route
/wp-content/uploads/to R2 / S3 buckets. wget may successfully fetch an image even when later direct access 404s (intermittent or partial bucket sync). Trust your local copy — that's why we scrape and self-host. -
Sitemaps and the Yoast XSL aren't linked from HTML. wget
-pwon't find them. Fetch explicitly in Phase 1. -
Filenames with
?ver=...query strings. wget keeps these as literal filenames; HTML uses%3Fencoding. Standard servers (Pages, Netlify, Vercel,python -m http.server) URL-decode and serve correctly. Don't try to "clean these up" unless something actually breaks. -
og:url, canonical, JSON-LD stay absolute. They identify the canonical resource and are correct as-is when redeploying to the same domain. Only rewrite if changing domains. -
sed -i ''is macOS / BSD only. GNU sed needssed -i(no empty-string argument). Recipes inAGENTS.mdflag the macOS-isms; default to the Python scripts where there's a choice — they're portable.
Output structure
<repo-root>/
index.html ← homepage
<slug>/index.html ← one per URL from sitemap
wp-content/ ← assets (themes, uploads, plugins)
wp-includes/ ← block library CSS, et al.
avatars/ ← self-hosted Gravatars (Phase 6)
sitemap_index.xml
page-sitemap.xml ← + any other child sitemaps
wp-content/plugins/wordpress-seo/css/main-sitemap.xsl
robots.txt
_redirects ← optional, host-specific
_headers ← optional, host-specific
Push to a git host and connect to the static host with no build command and no build output directory — defaults work.
版本历史
-
v0.5
GitHub ↗
原版更新说明
## What's new in 0.5 ### Self-updating skills - Every skill's pre-flight update check is now **consent-gated self-install**. When a skill detects it's behind the manifest, it offers to update itself — on agreement, it downloads the `.skill` from the latest release and unpacks it over the installed skill directory. The unpack path is resolved from where the running skill lives, so this works for any agent whose skills directory is writable, not just Claude Code. - All skills bumped a minor to carry the new flow: `astro-seo` → 0.6, `readability-check` → 0.5, the rest → 0.4. ### Astro SEO skill - Updated for `@jdevalk/astro-seo-graph` 1.1.1 and 1.2.0. - **1.1.1 bug fixes folded in.** `validateInternalLinks` now recognises `public/` assets as valid link targets (the `skip` callback trims back to just SSR-only routes and dynamic params), and `validateMetadataLength` no longer truncates descriptions at raw apostrophes — both workarounds removed. - **1.2.0 markdown alternates.** New **Should** in category 6 (agent discovery): serve clean `.md` copies of every page for AI agents. Integration example enables `markdownAlternate: true` (gated on wiring the route first), and a new Phase 2 subsection covers `createMarkdownEndpoint`, route-before-discovery-link ordering, Cloudflare Transform Rules for `Accept: text/markdown` content negotiation, and the `renderMarkdownAlternate` export. ### Repository - Reframed as **agent skills** rather than Claude Code-specific — repo tagline, README intro, and the self-install flow all drop the Claude Code hardcoding. - `.claude/` session state is now gitignored. ## Install Download the `.skill` file for the skill you want and open it — Claude installs it automatically. Or, for any agent that supports the skills format, unzip the `.skill` (or clone the repo) and copy the skill folder into your agent's skills directory. Once installed, the skill will offer to keep itself up to date.
-
v0.4
GitHub ↗
原版更新说明
## What's new in 0.4 ### Version tracking across all skills - Every skill now declares a `version:` in its frontmatter and runs a pre-flight update check against [`versions.json`](https://raw.githubusercontent.com/jdevalk/skills/main/versions.json), so you're told when the installed copy is behind the latest release. - CI validates that manifest entries and frontmatter versions stay in sync. ### Astro SEO skill - Updated for `@jdevalk/astro-seo-graph` 1.0 and 1.1. Category 4 flags missing `alt` attributes; category 5 notes that IndexNow excludes `/404` by default in ≥ 1.0.1; category 9 enables `validateImageAlt`, `validateMetadataLength` (title 30–65, description 70–200), and `validateInternalLinks` (with the `skip` escape hatch pre-wired for `/images/`, `/fonts/`, `/api/`). - Fixed validator option names: `validateDuplicateMeta` → `validateUniqueMetadata`; dropped non-existent `validateSchema`. - `llmsTxt` now passes the required options object (`title`, `siteUrl`, …) rather than a boolean. - IndexNow is gated on a production-host env check (`CF_PAGES`/`VERCEL_ENV`/`CONTEXT`) so local `npm run build` and preview deploys don't ping the endpoint and invalidate the key. - OG image section replaced with a concrete recipe: satori for text-heavy, sharp-composite for photo-heavy, woff2 fonts with locale fallbacks, minimal route sketch. - Upgrade step calls out the 1.0.0 migration (`buildAstroSeoProps` → `buildSeoContext`) and the three silent bugs the rewrite fixes (articlePublisher rendering, canonical on noindex, duplicate og:image and robots tags). ### Readability check skill - New **metadata mode** for short strings (page titles, meta descriptions, schema `description` fields, FAQ answers, profile bios) where Flesch and paragraph-level checks don't apply. Checks front-loading, concreteness, aggressive filler-cutting, active voice, title/description duplication, difficult words, SERP-truncation fit, and one-idea-per-field. Output is per-string ✓/⚠/✗ with rewrites. ### Repository - README intro now names all five skill domains (GitHub, WordPress, EmDash, Astro, readability) and the installation section splits Claude Code one-click from a manual-copy path for any agent that supports the skills format. - Repo tagline and topics refreshed. ## Install Download the `.skill` file for the skill you want and open it — Claude installs it automatically. Or, for any agent that supports the skills format, unzip the `.skill` (or clone the repo) and copy the skill folder into your agent's skills directory.
-
v0.3
GitHub ↗
原版更新说明
## What's new in 0.3 ### Astro SEO skill - Document `llms.txt` support shipped in `@jdevalk/astro-seo-graph` 0.9.0. Category 6 (agent discovery) gains a **Should** check for `llms.txt` at the site root, the integration config example enables `llmsTxt: true`, and a new Phase 2 subsection covers auto-collection and the `sections` / `filter` / `autoSectionName` / `outputPath` tuning options plus the `renderLlmsTxt` export. ## Install Download the `.skill` file for the skill you want and open it — Claude installs it automatically.
-
v0.2.1
GitHub ↗
原版更新说明
## What's new in 0.2.1 ### Astro SEO skill - Phase 0 now checks the installed `@jdevalk/astro-seo-graph` version against npm and flags drift; Phase 2 has an explicit upgrade step with a changelog pointer. ### Repository hardening - Stricter skill validation ([#1](https://github.com/jdevalk/skills/pull/1) by @dknauss): closing-delimiter check on frontmatter, `name:` must match directory, referenced support files must exist, `evals.json` validated when present. - Validator extracted to `.github/scripts/validate-skills.sh` so it can run locally. - Validation triggers expanded to `references/`, `evals/`, and `test-cases/` paths. - `workflow_dispatch` added to validation workflows for manual re-runs. - Baseline contributor files: `CONTRIBUTING.md`, `SECURITY.md`, `CODE_OF_CONDUCT.md`, `SUPPORT.md`, PR template, issue templates, Dependabot for GitHub Actions. ## Install Download the `.skill` file for the skill you want and open it — Claude installs it automatically.
-
v0.2
GitHub ↗
原版更新说明
## What's new in 0.2 ### New skills - **📖 Readability Check** — Audits blog post drafts calibrated for L2 English readers. Nine checks (paragraph structure, opening paragraph, tiered sentence length, passive voice, difficult words, filler/hedging, transitions, variation, heading hierarchy) with a Flesch Reading Ease score and per-category status. - **🚀 Astro SEO** — Audits and improves SEO for Astro sites across nine categories. Routes most fixes through [`@jdevalk/astro-seo-graph`](https://github.com/jdevalk/seo-graph): `<Seo>` component, linked JSON-LD graph, per-collection sitemaps with git-based lastmod, IndexNow, auto-generated OG images, schema endpoints, FuzzyRedirect, broken link checker in CI, and deployment-target-aware performance headers (Cloudflare / Netlify / Vercel). - **🔷 EmDash GitHub Actions** — Sets up CI/CD workflows for EmDash plugins (TypeScript type-check, ESLint, Vitest, npm publishing). ### Improvements - `github-repo`, `github-profile`, and `wp-readme-optimizer` now chain into `readability-check` on generated prose, with skill-specific guidance on which sections matter most. - Source blocks converted to expandable `<details>` to keep the README scannable. ## Install Download the `.skill` file for the skill you want and open it — Claude installs it automatically.
此处仅展示最近 5 个版本。 在原站查看完整版本历史 ↗
当前收录版本
0.0.1
安全与评测信息
质量评测
满分100 · 来自 SkillPi LAB 实验室的评测报告。
亮点
- 解决 WordPress 站点静态化这一明确的高频需求,适用于归档、迁移、性能优化等多种场景
- 提供完整的端到端解决方案,从 sitemap 抓取到部署,覆盖主流静态主机平台
亮点
- 触发词精准完整,覆盖 scrape/freeze/archive/static-ify/move to [host] 等多种用户表达方式
- 边界清晰,明确区分 WordPress 特定逻辑与通用 CMS 静态化流程
亮点
- Phase/步骤划分清晰,每个阶段有明确目标和出口条件
- 包含详细的端到端示例和 host-specific 部署配置说明
- frontmatter 完整,文档结构良好,易于理解和执行
待提升项
-
引用文件缺失 原报告严重程度:重大
SKILL.md 中引用了 AGENTS.md 和 scripts/ 目录下的多个 Python 脚本(如 rewrite-paths.py, insert-banner.py, strip-wp-runtime.py, selfhost-gravatars.py),但这些文件未在 ZIP 包中提供
改进建议:请补充所有被引用的脚本文件和 AGENTS.md 文档,或明确说明这些文件将由 Skill 运行时自动生成/下载
亮点
- 工具来源明确(wget, Python 脚本),参数使用正确
- 覆盖了主要异常情况处理(Cloudflare bot protection, link rewriting, asset fetching)
- 在 Phase 0 设置了用户意图确认机制,避免误操作
取前四项原始分值的算术平均,四舍五入取整。可通过收录报告核对各项评分与说明,运行记录需单独查证。
正文静态检测
100 / 100 · skillpi-20261123-no-r3-v1
正文未命中当前规则。
分数仅反映正文中的规则命中,供使用前参考。附件与运行行为不在此评分范围内。
权限与使用前检查
根据当前主文档自动整理,命中内容可能是示例或防护说明;不是实际权限声明,也未覆盖附件、外部依赖或运行行为。
未从主文档识别到上述常见操作,不能据此判断无需权限或没有风险。
安全评级与访问范围
safe · 静态证据核验,不代表运行安全保证。
来源文档未说明。
使用前请由宿主核对并授权实际文件读写、外部服务和联网目的地;本站的核验不会授予任何运行权限。
用户讨论
还没有已核实的点评。