Skip to content

apps/cli: add /rank-me-up on-page SEO audit skill#3181

Merged
youknowriad merged 2 commits intotrunkfrom
claude/dreamy-bose-04a512
Apr 22, 2026
Merged

apps/cli: add /rank-me-up on-page SEO audit skill#3181
youknowriad merged 2 commits intotrunkfrom
claude/dreamy-bose-04a512

Conversation

@youknowriad
Copy link
Copy Markdown
Contributor

Related issues

  • Related to #

How AI was used in this PR

This PR was generated with Claude Code. It mirrors the existing need-for-speed performance audit pattern: a Playwright-based audit module, an MCP tool, a slash-command entry, a line in the local system prompt, and a SKILL.md. Reviewers should focus on:

  • Whether the Playwright BrowserContext lifecycle in seo-audit.ts matches the project's conventions (we use browser.newContext() + context.close() per request to check robots.txt / sitemap.xml, since Studio local sites use self-signed certs and Node's native fetch() would reject them).
  • Whether the SKILL.md's Jetpack-first routing is the right default, and whether the "Check Active Plugins First" workflow is specific enough that the agent won't blindly suggest installs on top of an already-configured site.

Proposed Changes

  • Add /rank-me-up — a DOM-based on-page SEO audit for local Studio sites.
  • New apps/cli/ai/seo-audit.ts module. Uses the shared Playwright browser to collect:
    • Meta: title, description (with lengths), canonical, robots, viewport, htmlLang, charset
    • Social: Open Graph + Twitter Card tags
    • Headings: counts per level, H1 text list, skipped-level detection
    • Images: total / with alt / without alt / empty alt, sample URLs missing alt
    • Links: internal/external counts, nofollow count, empty-text anchors
    • Structured data: JSON-LD count + @type list (including @graph walks)
    • Resources: robots.txt presence + Disallow: / detection, sitemap.xml / sitemap_index.xml / Sitemap: directive in robots.txt
    • Word count, HTTP status
  • Register rank_me_up MCP tool in apps/cli/ai/tools.ts and add it to the local-mode system prompt alongside need_for_speed.
  • Register /rank-me-up slash command.
  • Add apps/cli/ai/plugin/skills/rank-me-up/SKILL.md with:
    • Mandatory "Check Active Plugins First" step (inspects active plugins + Jetpack modules via wp plugin list and wp jetpack module list before recommending anything)
    • Jetpack-first recommendation (wp plugin install jetpack --activate + wp jetpack module activate seo-tools), falling back to Yoast / Rank Math / AIOSEO only if the user rejects Jetpack
    • Four explicit routing branches for every plugin-sensitive fix (Jetpack+module on, Jetpack+module off, other SEO plugin active, nothing active)
    • Interpretation thresholds (title/description lengths, heading rules, etc.) and explicit flags for non-plugin fixes (h1 count, alt text, viewport, htmlLang, blog_public)

Testing Instructions

  1. npm run cli:build
  2. Start a local site: node apps/cli/dist/cli/main.mjs site start <site>
  3. Launch the agent and run /rank-me-up against the site.
  4. Verify the audit returns structured JSON covering all categories above.
  5. Try each plugin-state branch:
    • Site with no SEO plugin → agent should recommend installing Jetpack + activating seo-tools.
    • wp plugin install jetpack --activate but leave seo-tools off → agent should recommend wp jetpack module activate seo-tools, not a new install.
    • With Jetpack + seo-tools on → agent should point at Jetpack → Settings → Traffic → SEO Tools for configuration, not suggest installing anything.
    • With Yoast/Rank Math/AIOSEO active → agent should surface that plugin's settings page, not install Jetpack on top.
  6. Confirm need_for_speed still works (no regression from sharing the Playwright browser).

Pre-merge Checklist

  • Have you checked for TypeScript, React or other console errors?

🤖 Generated with Claude Code

youknowriad and others added 2 commits April 22, 2026 11:19
Adds a Playwright-based on-page SEO audit that mirrors the existing
need-for-speed performance audit. Surfaces missing meta tags, broken
heading structure, alt-text gaps, missing OG/Twitter/JSON-LD, and
indexing issues (robots.txt, sitemap.xml). The skill guides the agent
to check already-active plugins and Jetpack modules before recommending
installs, favoring Jetpack as the default SEO toolchain to match the
WordPress.com production target.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@youknowriad youknowriad requested review from Poliuk and sejas April 22, 2026 10:25
@youknowriad youknowriad self-assigned this Apr 22, 2026
@wpmobilebot
Copy link
Copy Markdown
Collaborator

📊 Performance Test Results

Comparing c2f1152 vs trunk

app-size

Metric trunk c2f1152 Diff Change
App Size (Mac) 1491.74 MB 1491.75 MB +0.01 MB ⚪ 0.0%

site-editor

Metric trunk c2f1152 Diff Change
load 1786 ms 1905 ms +119 ms 🔴 6.7%

site-startup

Metric trunk c2f1152 Diff Change
siteCreation 10120 ms 10121 ms +1 ms ⚪ 0.0%
siteStartup 5930 ms 5948 ms +18 ms ⚪ 0.0%

Results are median values from multiple test runs.

Legend: 🟢 Improvement (faster) | 🔴 Regression (slower) | ⚪ No change (<50ms diff)

Copy link
Copy Markdown
Member

@sejas sejas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great skill, we could also consider having a skill for AEO (Agent Experience Optimization), similarly to Cloudflare's https://isitagentready.com/

We can also consider adding SEO in the skill name like /rank-me-up-seo. I knew it was about SEO but forgot what was the exact name.

I tried it in a site with Yoast and worked good, recommending how to modify the site using that plugin, and also in an empty site where Jetpack SEO was recommended.

Site with Yoast
Image Image Image
Empty site
Image Image
then I installed Jetpack SEO
Image Image

@youknowriad
Copy link
Copy Markdown
Contributor Author

Is it called AEO or GEO :) haha

I agree though, we'd need a skill for that too, maybe /rank-me-up could ask you if you want SEO, GEO or both.

@youknowriad youknowriad merged commit 06855e5 into trunk Apr 22, 2026
10 checks passed
@youknowriad youknowriad deleted the claude/dreamy-bose-04a512 branch April 22, 2026 14:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants