# Onpage Optimization

> >

- **Type:** Skill
- **Install:** `agentstack add skill-thisisahsaniqbal-nextjs-seo-audit-onpage-optimization`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [thisisAhsanIqbal](https://agentstack.voostack.com/s/thisisahsaniqbal)
- **Installs:** 0
- **Category:** [Agent Skills](https://agentstack.voostack.com/c/agent-skills)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [thisisAhsanIqbal](https://github.com/thisisAhsanIqbal)
- **Source:** https://github.com/thisisAhsanIqbal/nextjs-seo-audit/tree/main/skills/onpage-optimization
- **Website:** https://nextjs-seo-skill.vercel.app/

## Install

```sh
agentstack add skill-thisisahsaniqbal-nextjs-seo-audit-onpage-optimization
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# 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](../backlink-monitoring/SKILL.md) skill.

## 1. Heading validation

Check all `` through `` elements:

| Check | Status | Rule |
|---|---|---|
| No headings at all | ❌ FAIL | Every page must have at least one heading |
| No `` tag | ❌ FAIL | Every page must have exactly one `` |
| Multiple `` tags | ⚠️ WARN | Recommend a single `` per page |
| Hierarchy skipped (e.g. H2 → H4) | ⚠️ WARN | Headings should follow sequential order: H1 → H2 → H3 |
| Empty heading (no text content) | ❌ FAIL | All headings must have descriptive text |
| Single H1, proper hierarchy | ✅ PASS | Heading 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:

| Location | How to check | Missing = |
|---|---|---|
| `` tag | Does the title contain the keyword? | ⚠️ WARN |
| `` tag | Does the H1 text contain the keyword? | ⚠️ WARN |
| Meta description | Does `` contain the keyword? | ⚠️ WARN |
| First `` tag | Does the first paragraph contain the keyword? | ⚠️ WARN |
| Image alt text | Does any `` 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 `` elements:

### Classify links

- **Internal**: `href` starts with `/`, `./`, `../`, or `#`
- **External**: `href` starts with `http://` or `https://`

### Checks

| Check | Threshold | Status |
|---|---|---|
| Internal link count ≥ 3 | Minimum 3 per page | ⚠️ WARN if below |
| Links with no anchor text (and no child ``) | 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 `` components render as standard `` 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

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [thisisAhsanIqbal](https://github.com/thisisAhsanIqbal)
- **Source:** [thisisAhsanIqbal/nextjs-seo-audit](https://github.com/thisisAhsanIqbal/nextjs-seo-audit)
- **License:** MIT
- **Homepage:** https://nextjs-seo-skill.vercel.app/

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-thisisahsaniqbal-nextjs-seo-audit-onpage-optimization
- Seller: https://agentstack.voostack.com/s/thisisahsaniqbal
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
