agentleFS
thisisAhsanIqbalthisisAhsanIqbal/nextjs-seo-audit/skills/onpage-optimization/SKILL.md

onpage-optimization

Skill7 starsChanged 10 months agoMITView on GitHub

Validates heading hierarchy, keyword density and placement, and internal/external link structure. Use when auditing on-page SEO factors for an HTML page.

The file

We split this skill into the rules it gives an agent

4 rules. About 0 are common, 3 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Check all <h1> through <h6> elements:

    line 21
  2. Distinctive:

    If a target keyword is provided, check its usage across the page:

    line 34
  3. Distinctive:

    Always report the count of internal and external links found.

    line 77
  4. Distinctive:

    If no keyword is supplied, skip keyword analysis and note: "No target keyword supplied — skipping keyword analysis"

    line 81

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

On-Page Optimization

Analyse the HTML page for heading structure, keyword usage, and link health.

Note: This skill owns internal link analysis. For external/outbound link strategy (dofollow/nofollow, anchor text quality, domain diversity), see the backlink-monitoring skill.

1. Heading validation

Check all <h1> through <h6> elements:

CheckStatusRule
No headings at all❌ FAILEvery page must have at least one heading
No <h1> tag❌ FAILEvery page must have exactly one <h1>
Multiple <h1> tags⚠️ WARNRecommend a single <h1> per page
Hierarchy skipped (e.g. H2 → H4)⚠️ WARNHeadings should follow sequential order: H1 → H2 → H3
Empty heading (no text content)❌ FAILAll headings must have descriptive text
Single H1, proper hierarchy✅ PASSHeading structure is correct

2. Keyword analysis

If a target keyword is provided, check its usage across the page:

Keyword density

  • Calculate: (keyword_count / total_words) × 100
  • Ideal range: 1.0–3.0%
  • Below 1.0% → ⚠️ WARN "Keyword density is low"
  • Above 3.0% → ❌ FAIL "Keyword stuffing detected"
  • Within range → ✅ PASS

Keyword placement — check all of these:

LocationHow to checkMissing =
<title> tagDoes the title contain the keyword?⚠️ WARN
<h1> tagDoes the H1 text contain the keyword?⚠️ WARN
Meta descriptionDoes <meta name="description"> contain the keyword?⚠️ WARN
First <p> tagDoes the first paragraph contain the keyword?⚠️ WARN
Image alt textDoes any <img alt="..."> contain the keyword?⚠️ WARN

Title keyword position

  • Keyword at position 0 (start of title) → ✅ PASS "Best placement"
  • Keyword at position ≤ 20 → ✅ PASS "Near the start"
  • Keyword at position > 20 → ⚠️ WARN "Place it earlier for better ranking"

3. Link analysis

Examine all <a href="..."> elements:

Classify links

  • Internal: href starts with /, ./, ../, or #
  • External: href starts with http:// or https://

Checks

CheckThresholdStatus
Internal link count ≥ 3Minimum 3 per page⚠️ WARN if below
Links with no anchor text (and no child <img>)Any count > 0⚠️ WARN
Internal links with rel="nofollow"Any count > 0⚠️ WARN "Prevents PageRank flow within your site"

Always report the count of internal and external links found.

Edge cases

  • If no keyword is supplied, skip keyword analysis and note: "No target keyword supplied — skipping keyword analysis"
  • Count words by splitting text on whitespace; keyword matching is case-insensitive
  • For link classification, ignore javascript:, mailto:, and tel: hrefs
  • Single-page applications (SPAs) with hash-based routing (#/page) — treat #-prefixed hrefs as internal links
  • Next.js <Link> components render as standard <a> tags in HTML output — audit the rendered HTML, not the JSX
  • Pages with zero links (e.g. legal/privacy pages) should receive ⚠️ WARN, not ❌ FAIL

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.