Skip to content

Universal SEO skill for Claude Code. 26 sub-skills + 19 sub-agents covering technical SEO, E-E-A-T, schema, GEO/AEO, agent readiness (Lighthouse Agentic Browsing, WebMCP, llms.txt), backlinks, local SEO, e-commerce, international SEO, Google APIs, and PDF/Excel reporting. 9 optional extensions for live SEO data.

v1.2.0: Security hardening, frontmatter fix, install improvements

Daniel323e105ac84a
diff --git a/CHANGELOG.md b/CHANGELOG.md
index cffef6f..96e61e9 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -5,6 +5,26 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
+## [1.2.0] - 2026-02-19
+
+### Security
+- **SSRF prevention**: Added private IP blocking to `fetch_page.py` and `analyze_visual.py`
+- **Path traversal prevention**: Added output path sanitization to `capture_screenshot.py` and file validation to `parse_html.py`
+- **Install hardening**: Removed `--break-system-packages`, switched to venv-based pip install
+- **requirements.txt**: Now persisted to `~/.claude/skills/seo/` for user retry
+
+### Fixed
+- **YAML frontmatter parsing**: Removed HTML comments before `---` delimiter in 8 files (skills: seo-content, seo-images, seo-programmatic, seo-schema, seo-technical; agents: seo-content, seo-performance, seo-technical). Thanks @kylewhirl for identifying this in the codex-seo fork.
+- **Windows installer**: Merged @kfrancis improvements — `python -m pip`, `py -3` launcher fallback, requirements.txt persistence, non-fatal subagent copy, better error diagnostics (PR #6)
+- **requirements.txt missing after install**: Now copied to skill directory so users can retry (#1)
+
+### Changed
+- Python dependencies now installed in a venv at `~/.claude/skills/seo/.venv/` with `--user` fallback (#2)
+- Playwright marked as explicitly optional in install output
+- Windows installer uses `Resolve-Python` helper for robust Python detection (#5)
+
+---
+
## [1.1.0] - 2026-02-07
### Security (CRITICAL)
diff --git a/TODO.md b/TODO.md
index 66785c8..fa9841f 100644
--- a/TODO.md
+++ b/TODO.md
@@ -1,27 +1,49 @@
# TODO — claude-seo
-## Deferred from February 2026 Research Report
+## Completed in v1.2.0
+
+- [x] **Fix YAML frontmatter parsing** — Removed HTML comments before `---` in 8 files (from @kylewhirl fork)
+- [x] **SSRF prevention in Python scripts** — Private IP blocking in fetch_page.py and analyze_visual.py (from @artyomsv #7)
+- [x] **Install hardening** — venv-based pip, no `--break-system-packages` (from @JawandS #2)
+- [x] **Windows install fixes** — `python -m pip`, `py -3` fallback, requirements.txt persistence (from @kfrancis #5, PR #6)
+- [x] **requirements.txt persistence** — Copied to skill dir after install (from @edustef #1)
+- [x] **Path traversal prevention** — Output path sanitization in capture_screenshot.py, file validation in parse_html.py
+
+## Deferred from Community Feedback
+
+- [ ] **Reduce Bash scope on agents** (Priority: Medium, from @artyomsv #7)
+ Evaluate which agents truly need Bash access. Consider replacing with WebFetch where possible.
+
+- [ ] **Docker-based script execution** (Priority: Low, from @artyomsv #7)
+ Sandbox Python scripts in Docker for users who want extra isolation.
-Items identified during the Feb 2026 SEO research audit that require additional implementation work.
+- [ ] **Opencode compatibility** (Priority: Low, from @Ehtz #4)
+ Adapt skill architecture for Opencode. @kylewhirl already ported to OpenAI Codex.
+
+- [ ] **Subagent timeout/compact handling** (Priority: Medium, from @JawandS #3)
+ Primary agent sometimes terminates before subagents finish. Consider encouraging subagents
+ to run /compact and adding explicit wait logic.
+
+- [ ] **Native Chrome tools vs Playwright** (Priority: Medium, from @artyomsv #7, @btafoya PR #8)
+ Claude Code has native browser automation. Evaluate replacing Playwright with built-in tools
+ to eliminate the ~200MB Chromium dependency.
+
+## Deferred from February 2026 Research Report
- [ ] **Fake freshness detection** (Priority: Medium)
Compare visible dates (`datePublished`, `dateModified`) against actual content modification signals.
- Flag pages with updated dates but unchanged body content. This is a spam pattern Google targets.
+ Flag pages with updated dates but unchanged body content.
- [ ] **Mobile content parity check** (Priority: Medium)
Compare mobile vs desktop meta tags, structured data presence, and content completeness.
- Flag discrepancies that could affect mobile-first indexing. Currently only viewport/touch targets
- are checked, not content equivalence.
+ Flag discrepancies that could affect mobile-first indexing.
- [ ] **Discover optimization checks** (Priority: Low-Medium)
Clickbait title detection, content depth scoring, local relevance signals, sensationalism flags.
- Relevant to Feb 2026 Discover Core Update which emphasizes original reporting and E-E-A-T signals.
- [ ] **Brand mention analysis Python implementation** (Priority: Low)
- Currently documented in `seo-geo/SKILL.md` but no programmatic scoring. Consider implementing
- a check that searches for brand entity presence signals (unlinked mentions, co-citation patterns,
- entity authority indicators).
+ Currently documented in `seo-geo/SKILL.md` but no programmatic scoring.
---
-*Last updated: February 2026*
+*Last updated: February 19, 2026*
diff --git a/agents/seo-content.md b/agents/seo-content.md
index 64807f2..1c40092 100644
--- a/agents/seo-content.md
+++ b/agents/seo-content.md
@@ -1,4 +1,3 @@
-<!-- Updated: 2026-02-07 -->
---
name: seo-content
description: Content quality reviewer. Evaluates E-E-A-T signals, readability, content depth, AI citation readiness, and thin content detection.
diff --git a/agents/seo-performance.md b/agents/seo-performance.md
index 15af84c..0311fa0 100644
--- a/agents/seo-performance.md
+++ b/agents/seo-performance.md
@@ -1,4 +1,3 @@
-<!-- Updated: 2026-02-07 -->
---
name: seo-performance
description: Performance analyzer. Measures and evaluates Core Web Vitals and page load performance.
diff --git a/agents/seo-technical.md b/agents/seo-technical.md
index fbb620a..c1f2c95 100644
--- a/agents/seo-technical.md
+++ b/agents/seo-technical.md
@@ -1,4 +1,3 @@
-<!-- Updated: 2026-02-07 -->
---
name: seo-technical
description: Technical SEO specialist. Analyzes crawlability, indexability, security, URL structure, mobile optimization, Core Web Vitals, and JavaScript rendering.
diff --git a/docs/INSTALLATION.md b/docs/INSTALLATION.md
index 2f997dd..9caa5d7 100644
--- a/docs/INSTALLATION.md
+++ b/docs/INSTALLATION.md
@@ -40,17 +40,25 @@ cd claude-seo
3. **Install Python dependencies** (if not done automatically)
+The installer creates a venv at `~/.claude/skills/seo/.venv/`. If that fails, install manually:
+
```bash
-pip install -r requirements.txt
+# Option A: Use the venv
+~/.claude/skills/seo/.venv/bin/pip install -r ~/.claude/skills/seo/requirements.txt
+
+# Option B: User-level install
+pip install --user -r ~/.claude/skills/seo/requirements.txt
```
-4. **Install Playwright browsers** (optional, for screenshots)
+4. **Install Playwright browsers** (optional, for visual analysis)
```bash
pip install playwright
playwright install chromium
```
+Playwright is optional — without it, visual analysis uses WebFetch as a fallback.
+
## Installation Paths
The installer copies files to:
diff --git a/docs/TROUBLESHOOTING.md b/docs/TROUBLESHOOTING.md
index 6e59013..34bd70d 100644
--- a/docs/TROUBLESHOOTING.md
+++ b/docs/TROUBLESHOOTING.md
@@ -36,15 +36,50 @@ curl -fsSL https://raw.githubusercontent.com/AgriciDaniel/claude-seo/main/instal
**Symptom:** `ModuleNotFoundError: No module named 'requests'`
**Solution:**
+
+As of v1.2.0, dependencies are installed in a venv. Try:
+
+```bash
+# Use the venv pip
+~/.claude/skills/seo/.venv/bin/pip install -r ~/.claude/skills/seo/requirements.txt
+```
+
+If the venv doesn't exist, install with `--user`:
```bash
-pip install -r ~/.claude/skills/seo/requirements.txt
+pip install --user -r ~/.claude/skills/seo/requirements.txt
```
Or install individually:
```bash
-pip install beautifulsoup4 requests lxml playwright Pillow urllib3 validators
+pip install --user beautifulsoup4 requests lxml playwright Pillow urllib3 validators
+```
+
+### requirements.txt Not Found
+
+**Symptom:** `No such file: requirements.txt` after install
+
+**Solution:** As of v1.2.0, requirements.txt is copied to the skill directory:
+
+```bash
+ls ~/.claude/skills/seo/requirements.txt
+```
+
+If missing, download it directly:
+```bash
+curl -fsSL https://raw.githubusercontent.com/AgriciDaniel/claude-seo/main/requirements.txt \
+ -o ~/.claude/skills/seo/requirements.txt
```
+### Windows Python Detection Issues
+
+**Symptom:** `python is not recognized` or `pip points to wrong Python`
+
+**Solution (v1.2.0+):** The Windows installer now tries both `python` and `py -3`. If both fail:
+
+1. Install Python from [python.org](https://python.org) and check "Add to PATH"
+2. Or use the Windows launcher: `py -3 -m pip install -r requirements.txt`
+3. Use `python -m pip` instead of bare `pip`
+
---
### Playwright Screenshot Errors
diff --git a/install.ps1 b/install.ps1
index 7bf5c74..93b5d86 100644
--- a/install.ps1
+++ b/install.ps1
@@ -9,12 +9,49 @@ Write-Host "║ Claude Code SEO Skill ║" -ForegroundColor Cyan
Write-Host "════════════════════════════════════════" -ForegroundColor Cyan
Write-Host ""
+function Resolve-Python {
+ $pythonCmd = Get-Command -Name python -ErrorAction SilentlyContinue
+ if ($null -ne $pythonCmd) {
+ return @{ Exe = 'python'; Args = @() }
+ }
+
+ $pyCmd = Get-Command -Name py -ErrorAction SilentlyContinue
+ if ($null -ne $pyCmd) {
+ return @{ Exe = 'py'; Args = @('-3') }
+ }
+
+ return $null
+}
+
+function Invoke-External {
+ param(
+ [Parameter(Mandatory = $true)][string]$Exe,
+ [Parameter(Mandatory = $true)][string[]]$Args,
+ [switch]$Quiet
+ )
+
+ $output = & $Exe @Args 2>&1
+ $exitCode = $LASTEXITCODE
+
+ if (-not $Quiet -and $null -ne $output -and $output.Count -gt 0) {
+ $output | ForEach-Object { Write-Host $_ }
+ }
+
+ return @{ ExitCode = $exitCode; Output = $output }
+}
+
# Check prerequisites
+$python = Resolve-Python
+if ($null -eq $python) {
+ Write-Host "✗ Python is required but was not found (tried 'python' and 'py')." -ForegroundColor Red
+ exit 1
+}
+
try {
- $pythonVersion = python --version 2>&1
+ $pythonVersion = & $python.Exe @($python.Args + @('--version')) 2>&1
Write-Host "✓ $pythonVersion detected" -ForegroundColor Green
} catch {
- Write-Host "✗ Python is required but not installed." -ForegroundColor Red
+ Write-Host "✗ Python is installed but could not be executed." -ForegroundColor Red
exit 1
}
@@ -41,81 +78,126 @@ if (Test-Path $TempDir) {
Remove-Item -Recurse -Force $TempDir
}
-Write-Host "↓ Downloading Claude SEO..." -ForegroundColor Yellow
-git clone --depth 1 $RepoUrl $TempDir 2>$null
+$keepTemp = ($env:CLAUDE_SEO_KEEP_TEMP -eq '1')
-# Copy skill files
-Write-Host "→ Installing skill files..." -ForegroundColor Yellow
-Copy-Item -Recurse -Force "$TempDir\seo\*" $SkillDir
+try {
+ Write-Host "↓ Downloading Claude SEO..." -ForegroundColor Yellow
+ $clone = Invoke-External -Exe 'git' -Args @('clone','--depth','1',$RepoUrl,$TempDir) -Quiet
+ if ($clone.ExitCode -ne 0) {
+ throw "git clone failed. Output:`n$($clone.Output -join "`n")"
+ }
-# Copy sub-skills
-$SkillsPath = "$TempDir\skills"
-if (Test-Path $SkillsPath) {
- Get-ChildItem -Directory $SkillsPath | ForEach-Object {
- $target = "$env:USERPROFILE\.claude\skills\$($_.Name)"
- New-Item -ItemType Directory -Force -Path $target | Out-Null
- Copy-Item -Recurse -Force "$($_.FullName)\*" $target
+ # Copy skill files
+ Write-Host "→ Installing skill files..." -ForegroundColor Yellow
+ $skillSource = Join-Path $TempDir 'seo'
+ if (-not (Test-Path $skillSource)) {
+ $skillSource = Join-Path $TempDir 'skills\seo'
+ }
+ if (-not (Test-Path $skillSource)) {
+ throw "Could not find skill source folder in repo clone."
+ }
+ Copy-Item -Recurse -Force (Join-Path $skillSource '*') $SkillDir
+
+ # Copy sub-skills
+ $SkillsPath = "$TempDir\skills"
+ if (Test-Path $SkillsPath) {
+ Get-ChildItem -Directory $SkillsPath | ForEach-Object {
+ $target = "$env:USERPROFILE\.claude\skills\$($_.Name)"
+ New-Item -ItemType Directory -Force -Path $target | Out-Null
+ Copy-Item -Recurse -Force "$($_.FullName)\*" $target
+ }
}
-}
-# Copy schema templates
-$SchemaPath = "$TempDir\schema"
-if (Test-Path $SchemaPath) {
- $SkillSchema = "$SkillDir\schema"
- New-Item -ItemType Directory -Force -Path $SkillSchema | Out-Null
- Copy-Item -Recurse -Force "$SchemaPath\*" $SkillSchema
-}
+ # Copy schema templates
+ $SchemaPath = "$TempDir\schema"
+ if (Test-Path $SchemaPath) {
+ $SkillSchema = "$SkillDir\schema"
+ New-Item -ItemType Directory -Force -Path $SkillSchema | Out-Null
+ Copy-Item -Recurse -Force "$SchemaPath\*" $SkillSchema
+ }
-# Copy reference docs
-$PdfPath = "$TempDir\pdf"
-if (Test-Path $PdfPath) {
- $SkillPdf = "$SkillDir\pdf"
- New-Item -ItemType Directory -Force -Path $SkillPdf | Out-Null
- Copy-Item -Recurse -Force "$PdfPath\*" $SkillPdf
-}
+ # Copy reference docs
+ $PdfPath = "$TempDir\pdf"
+ if (Test-Path $PdfPath) {
+ $SkillPdf = "$SkillDir\pdf"
+ New-Item -ItemType Directory -Force -Path $SkillPdf | Out-Null
+ Copy-Item -Recurse -Force "$PdfPath\*" $SkillPdf
+ }
-# Copy agents
-Write-Host "→ Installing subagents..." -ForegroundColor Yellow
-Copy-Item -Force "$TempDir\agents\*.md" $AgentDir 2>$null
+ # Copy agents
+ Write-Host "→ Installing subagents..." -ForegroundColor Yellow
+ $AgentsPath = Join-Path $TempDir 'agents'
+ if (Test-Path $AgentsPath) {
+ Copy-Item -Force (Join-Path $AgentsPath '*.md') $AgentDir -ErrorAction SilentlyContinue
+ }
-# Copy shared scripts
-$ScriptsPath = "$TempDir\scripts"
-if (Test-Path $ScriptsPath) {
- $SkillScripts = "$SkillDir\scripts"
- New-Item -ItemType Directory -Force -Path $SkillScripts | Out-Null
- Copy-Item -Recurse -Force "$ScriptsPath\*" $SkillScripts
-}
+ # Copy shared scripts
+ $ScriptsPath = "$TempDir\scripts"
+ if (Test-Path $ScriptsPath) {
+ $SkillScripts = "$SkillDir\scripts"
+ New-Item -ItemType Directory -Force -Path $SkillScripts | Out-Null
+ Copy-Item -Recurse -Force "$ScriptsPath\*" $SkillScripts
+ }
-# Copy hooks
-$HooksPath = "$TempDir\hooks"
-if (Test-Path $HooksPath) {
- $SkillHooks = "$SkillDir\hooks"
- New-Item -ItemType Directory -Force -Path $SkillHooks | Out-Null
- Copy-Item -Recurse -Force "$HooksPath\*" $SkillHooks
-}
+ # Copy hooks
+ $HooksPath = "$TempDir\hooks"
+ if (Test-Path $HooksPath) {
+ $SkillHooks = "$SkillDir\hooks"
+ New-Item -ItemType Directory -Force -Path $SkillHooks | Out-Null
+ Copy-Item -Recurse -Force "$HooksPath\*" $SkillHooks
+ }
-# Install Python dependencies
-Write-Host "→ Installing Python dependencies..." -ForegroundColor Yellow
-try {
- pip install -q -r "$TempDir\requirements.txt" 2>$null
-} catch {
- Write-Host "⚠ Could not auto-install Python packages. Run: pip install -r requirements.txt" -ForegroundColor Yellow
-}
+ # Copy requirements.txt to skill dir for retry
+ $reqFile = Join-Path $TempDir 'requirements.txt'
+ $installedReqFile = Join-Path $SkillDir 'requirements.txt'
+ if (Test-Path $reqFile) {
+ Copy-Item -Force $reqFile $installedReqFile
+ }
-# Optional: Install Playwright browsers
-Write-Host "→ Installing Playwright browsers (optional)..." -ForegroundColor Yellow
-try {
- python -m playwright install chromium 2>$null
+ # Install Python dependencies
+ Write-Host "→ Installing Python dependencies..." -ForegroundColor Yellow
+ if (Test-Path $reqFile) {
+ try {
+ $pip = Invoke-External -Exe $python.Exe -Args @($python.Args + @('-m','pip','install','-q','-r',$reqFile)) -Quiet
+ if ($pip.ExitCode -ne 0) {
+ throw ($pip.Output -join "`n")
+ }
+ } catch {
+ Write-Host " ⚠ Could not auto-install Python packages." -ForegroundColor Yellow
+ Write-Host " Try: $($python.Exe) $($python.Args -join ' ') -m pip install -r `"$installedReqFile`"" -ForegroundColor Yellow
+ }
+ } else {
+ Write-Host " ⚠ No requirements.txt found; skipping Python dependency install." -ForegroundColor Yellow
+ }
+
+ # Optional: Install Playwright browsers
+ Write-Host "→ Installing Playwright browsers (optional, for visual analysis)..." -ForegroundColor Yellow
+ try {
+ $pw = Invoke-External -Exe $python.Exe -Args @($python.Args + @('-m','playwright','install','chromium')) -Quiet
+ if ($pw.ExitCode -ne 0) {
+ throw ($pw.Output -join "`n")
+ }
+ } catch {
+ Write-Host " ⚠ Playwright install failed. Visual analysis will use WebFetch fallback." -ForegroundColor Yellow
+ }
} catch {
- Write-Host "⚠ Playwright browser install failed. Screenshots won't work." -ForegroundColor Yellow
+ Write-Host ""
+ Write-Host "✗ Installation failed: $($_.Exception.Message)" -ForegroundColor Red
+ if ($keepTemp -and (Test-Path $TempDir)) {
+ Write-Host "Temp dir kept at: $TempDir" -ForegroundColor Yellow
+ }
+ throw
+} finally {
+ if (-not $keepTemp -and (Test-Path $TempDir)) {
+ Remove-Item -Recurse -Force $TempDir
+ }
}
-# Cleanup
-Remove-Item -Recurse -Force $TempDir
-
Write-Host ""
Write-Host "✓ Claude SEO installed successfully!" -ForegroundColor Green
Write-Host ""
Write-Host "Usage:" -ForegroundColor Cyan
Write-Host " 1. Start Claude Code: claude"
Write-Host " 2. Run commands: /seo audit https://example.com"
+Write-Host ""
+Write-Host "Python deps location: $installedReqFile" -ForegroundColor Gray
diff --git a/install.sh b/install.sh
index bf3a11f..7171a51 100755
--- a/install.sh
+++ b/install.sh
@@ -78,16 +78,30 @@ main() {
chmod +x "${SKILL_DIR}/hooks/"*.py 2>/dev/null || true
fi
- # Install Python dependencies
+ # Copy requirements.txt to skill dir so users can retry later
+ cp "${TEMP_DIR}/claude-seo/requirements.txt" "${SKILL_DIR}/requirements.txt" 2>/dev/null || true
+
+ # Install Python dependencies (venv preferred, --user fallback)
echo "→ Installing Python dependencies..."
- pip install --quiet --break-system-packages -r "${TEMP_DIR}/claude-seo/requirements.txt" 2>/dev/null || \
- pip install --quiet -r "${TEMP_DIR}/claude-seo/requirements.txt" 2>/dev/null || \
- echo "⚠ Could not auto-install Python packages. Run: pip install -r requirements.txt"
+ VENV_DIR="${SKILL_DIR}/.venv"
+ if python3 -m venv "${VENV_DIR}" 2>/dev/null; then
+ "${VENV_DIR}/bin/pip" install --quiet -r "${TEMP_DIR}/claude-seo/requirements.txt" 2>/dev/null && \
+ echo " ✓ Installed in venv at ${VENV_DIR}" || \
+ echo " ⚠ Venv pip install failed. Run: ${VENV_DIR}/bin/pip install -r ${SKILL_DIR}/requirements.txt"
+ else
+ pip install --quiet --user -r "${TEMP_DIR}/claude-seo/requirements.txt" 2>/dev/null || \
+ echo " ⚠ Could not auto-install. Run: pip install --user -r ${SKILL_DIR}/requirements.txt"
+ fi
- # Optional: Install Playwright browsers
- echo "→ Installing Playwright browsers (optional)..."
- python3 -m playwright install chromium 2>/dev/null || \
- echo "⚠ Playwright browser install failed. Screenshots won't work. Run: playwright install chromium"
+ # Optional: Install Playwright browsers (for screenshot analysis)
+ echo "→ Installing Playwright browsers (optional, for visual analysis)..."
+ if [ -f "${VENV_DIR}/bin/playwright" ]; then
+ "${VENV_DIR}/bin/python" -m playwright install chromium 2>/dev/null || \
+ echo " ⚠ Playwright install failed. Visual analysis will use WebFetch fallback."
+ else
+ python3 -m playwright install chromium 2>/dev/null || \
+ echo " ⚠ Playwright install failed. Visual analysis will use WebFetch fallback."
+ fi
echo ""
echo "✓ Claude SEO installed successfully!"
@@ -96,6 +110,7 @@ main() {
echo " 1. Start Claude Code: claude"
echo " 2. Run commands: /seo audit https://example.com"
echo ""
+ echo "Python deps location: ${SKILL_DIR}/requirements.txt"
echo "To uninstall: curl -fsSL ${REPO_URL}/raw/main/uninstall.sh | bash"
}
diff --git a/scripts/analyze_visual.py b/scripts/analyze_visual.py
index e5a643e..4b248c9 100755
--- a/scripts/analyze_visual.py
+++ b/scripts/analyze_visual.py
@@ -7,8 +7,11 @@ Usage:
"""
import argparse
+import ipaddress
import json
+import socket
import sys
+from urllib.parse import urlparse
try:
from playwright.sync_api import sync_playwright, TimeoutError as PlaywrightTimeout
@@ -51,6 +54,17 @@ def analyze_visual(url: str, timeout: int = 30000) -> dict:
"error": None,
}
+ # SSRF prevention: block private/internal IPs
+ try:
+ parsed = urlparse(url)
+ resolved_ip = socket.gethostbyname(parsed.hostname)
+ ip = ipaddress.ip_address(resolved_ip)
+ if ip.is_private or ip.is_loopback or ip.is_reserved:
+ result["error"] = f"Blocked: URL resolves to private/internal IP ({resolved_ip})"
+ return result
+ except (socket.gaierror, ValueError):
+ pass
+
try:
with sync_playwright() as p:
browser = p.chromium.launch(headless=True)
diff --git a/scripts/capture_screenshot.py b/scripts/capture_screenshot.py
index fe0a7d7..135a11e 100755
--- a/scripts/capture_screenshot.py
+++ b/scripts/capture_screenshot.py
@@ -102,6 +102,14 @@ def main():
args = parser.parse_args()
+ # Sanitize output path — prevent directory traversal
+ output_dir = os.path.realpath(args.output)
+ cwd = os.getcwd()
+ home = os.path.expanduser("~")
+ if not (output_dir.startswith(cwd) or output_dir.startswith(home)):
+ print("Error: Output path must be within current directory or home directory", file=sys.stderr)
+ sys.exit(1)
+
# Create output directory
os.makedirs(args.output, exist_ok=True)
diff --git a/scripts/fetch_page.py b/scripts/fetch_page.py
index 80df189..be2f85b 100755
--- a/scripts/fetch_page.py
+++ b/scripts/fetch_page.py
@@ -8,6 +8,8 @@ Usage:
"""
import argparse
+import ipaddress
+import socket
import sys
from typing import Optional
from urllib.parse import urlparse
@@ -71,6 +73,16 @@ def fetch_page(
result["error"] = f"Invalid URL scheme: {parsed.scheme}"
return result
+ # SSRF prevention: block private/internal IPs
+ try:
+ resolved_ip = socket.gethostbyname(parsed.hostname)
+ ip = ipaddress.ip_address(resolved_ip)
+ if ip.is_private or ip.is_loopback or ip.is_reserved:
+ result["error"] = f"Blocked: URL resolves to private/internal IP ({resolved_ip})"
+ return result
+ except (socket.gaierror, ValueError):
+ pass # DNS resolution failure handled by requests below
+
try:
session = requests.Session()
session.max_redirects = max_redirects
diff --git a/scripts/parse_html.py b/scripts/parse_html.py
index 748f0d6..d65f69d 100755
--- a/scripts/parse_html.py
+++ b/scripts/parse_html.py
@@ -9,6 +9,7 @@ Usage:
import argparse
import json
+import os
import re
import sys
from typing import Optional
@@ -164,7 +165,11 @@ def main():
args = parser.parse_args()
if args.file:
- with open(args.file, "r", encoding="utf-8") as f:
+ real_path = os.path.realpath(args.file)
+ if not os.path.isfile(real_path):
+ print(f"Error: File not found: {args.file}", file=sys.stderr)
+ sys.exit(1)
+ with open(real_path, "r", encoding="utf-8") as f:
html = f.read()
else:
html = sys.stdin.read()
diff --git a/skills/seo-content/SKILL.md b/skills/seo-content/SKILL.md
index bbd014f..3a4e6e8 100644
--- a/skills/seo-content/SKILL.md
+++ b/skills/seo-content/SKILL.md
@@ -1,4 +1,3 @@
-<!-- Updated: 2026-02-07 -->
---
name: seo-content
description: >
diff --git a/skills/seo-images/SKILL.md b/skills/seo-images/SKILL.md
index 14b0f6f..1db5846 100644
--- a/skills/seo-images/SKILL.md
+++ b/skills/seo-images/SKILL.md
@@ -1,4 +1,3 @@
-<!-- Updated: 2026-02-07 -->
---
name: seo-images
description: >
diff --git a/skills/seo-programmatic/SKILL.md b/skills/seo-programmatic/SKILL.md
index b85ff6c..7c7c55a 100644
--- a/skills/seo-programmatic/SKILL.md
+++ b/skills/seo-programmatic/SKILL.md
@@ -1,4 +1,3 @@
-<!-- Updated: 2026-02-07 -->
---
name: seo-programmatic
description: >
diff --git a/skills/seo-schema/SKILL.md b/skills/seo-schema/SKILL.md
index 741c3d9..9bc59e0 100644
--- a/skills/seo-schema/SKILL.md
+++ b/skills/seo-schema/SKILL.md
@@ -1,4 +1,3 @@
-<!-- Updated: 2026-02-07 -->
---
name: seo-schema
description: >
diff --git a/skills/seo-technical/SKILL.md b/skills/seo-technical/SKILL.md
index 4ad936a..3a9288f 100644
--- a/skills/seo-technical/SKILL.md
+++ b/skills/seo-technical/SKILL.md
@@ -1,4 +1,3 @@
-<!-- Updated: 2026-02-07 -->
---
name: seo-technical
description: >
diff --git a/uninstall.sh b/uninstall.sh
index 81a37f9..2b43adb 100755
--- a/uninstall.sh
+++ b/uninstall.sh
@@ -4,7 +4,7 @@ set -euo pipefail
main() {
echo "→ Uninstalling Claude SEO..."
- # Remove main skill
+ # Remove main skill (includes venv and requirements.txt)
rm -rf "${HOME}/.claude/skills/seo"
# Remove sub-skills