Skill: vedantsingh60/seo-optimizer-pro (version 1.0.8)

# SEO Optimizer Pro **AI-powered SEO content optimization for both Google ranking and AI search (AEO).** Analyze and optimize content with AI for search visibility across traditional Google results and emerging AI search platforms (ChatGPT, Google AI Overviews, Claude, etc). --- ## 🚀 Why This Skill? ### Problem Statement SEO optimization requires balancing multiple objectives: - Content must rank on Google with proper technical SEO - AI search optimization (AEO) is a new frontier—getting cited in ChatGPT, Google AI Overviews, Claude responses - Manual analysis of readability, keyword density, heading structure is time-consuming - Unclear what will actually impact rankings vs. what's just best practice - Need both technical optimization AND compelling AI-optimized content ### The Solution Analyze and optimize content using AI combined with technical SEO audits. Get specific recommendations for both traditional Google ranking AND emerging AI search visibility. ### Why This Matters - **AI Search is Growing**: ChatGPT, Google AI Overviews, Claude are becoming major discovery channels - **2026 Trend**: Quality content with proper structure ranks better in both systems - **Data-Driven**: Real recommendations based on actual SEO metrics, not just generic advice - **Dual Optimization**: One analysis optimizes for both Google AND AI search platforms --- ## ✨ What You Get ### Comprehensive SEO Analysis Every analysis includes: - 📊 **Readability Score** - Flesch-Kincaid grade level and readability metrics - 🔑 **Keyword Analysis** - Density tracking and natural integration suggestions - 📐 **Content Structure** - Heading hierarchy, paragraph length, word count - 🎯 **Technical SEO** - Meta tags, link analysis, structured data - 🤖 **AI Search Optimization** - Recommendations for ChatGPT citations, AI Overviews ### Model-Agnostic AI Integration Pass any model ID — provider is auto-detected from the model name prefix. No hardcoded list; new models work without updates. | Provider | Tested Models | Prefix | |----------|--------------|--------| | **Anthropic** | claude-opus-4-6, claude-sonnet-4-6, claude-haiku-4-5-20251001 | `claude-` | | **OpenAI** | gpt-5.4, gpt-5.4-pro, gpt-5.4-mini, gpt-5.4-thinking, gpt-5.2-pro, gpt-5.2 | `gpt-`, `o1`, `o3` | | **Google** | gemini-3.1-pro-preview, gemini-3.1-flash-lite, gemini-3-flash, gemini-2.5-pro | `gemini-` | | **Mistral** | mistral-large-latest, mistral-small-latest | `mistral-`, `mixtral-` | | **DeepSeek** | deepseek-chat, deepseek-reasoner | `deepseek-` | | **xAI** | grok-4-1-fast, grok-3-beta | `grok-` | | **MiniMax** | MiniMax-M2.1 | `MiniMax`, `minimax` | | **Qwen** | qwen3.5-plus, qwen3-max-instruct | `qwen` | | **Meta Llama** | meta-llama/llama-4-maverick, meta-llama/llama-3.3-70b-instruct | `meta-llama/`, `llama-` | Features: - **Title Optimization** - SEO-friendly titles (40-60 chars) - **Meta Descriptions** - Auto-generated descriptions (150-160 chars) - **H1 Suggestions** - Optimized heading tags - **Key Points Expansion** - What topics to expand for better coverage - **Keyword Integration** - Natural ways to incorporate target keywords - **Internal Linking Ideas** - Strategic internal linking opportunities ### Answer Engine Optimization (AEO) Five specific recommendations to: - Get your content featured in AI search results - Appear as cited sources in ChatGPT, Google AI Overviews, Claude - Optimize for question-answer format (how AI searches work) - Build authority signals that AI systems recognize - Structure content for AI comprehension and citation ### Technical Metrics Analyze: - Word count and content length - Sentence and paragraph structure - Keyword density by target keyword - Heading structure (H1, H2, H3...) - Readability (Flesch-Kincaid grade) - Link analysis (internal/external) - Content organization --- ## 📊 Real-World Example ``` ANALYZING: Blog post about "Cloud Storage Solutions" ═══════════════════════════════════════════════════════════════ 📊 METRICS ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ • Word Count: 847 words • Readability Score: 68/100 (Good) • Flesch-Kincaid Grade: 8.2 (High school level - good) • Avg Paragraph: 32 words (Optimal range) 🔑 KEYWORD DENSITY ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ • cloud storage: 1.8% ✅ (Optimal) • data security: 0.8% (Increase to 1-2%) • backup solutions: 0.4% (Too low) 💡 TOP SUGGESTIONS ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 🟡 [KEYWORDS] "backup solutions" appears only 0.4% of the time Current: 0.4% → Recommended: 1-2% Impact: Better keyword relevance signal 🟢 [TECHNICAL] Heading structure is well organized Current: H1 (1), H2 (4), H3 (2) ✅ Impact: Excellent for SEO and accessibility 🟡 [CONTENT] Consider expanding "data encryption" section Current: 1 paragraph → Recommended: 2-3 paragraphs Impact: More thorough topic coverage, higher authority 🤖 AI SEARCH OPTIMIZATION (AEO) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1. Add a FAQ section with common questions about cloud storage → This format gets cited in ChatGPT and Google AI Overviews 2. Include specific comparison tables (Google vs AWS vs Azure) → Structured data that AI systems cite as authoritative 3. Add a "Quick Summary" box with key takeaways → AI search pulls these summaries for AI-generated responses 4. Link to authoritative sources in your references → Shows expertise, increases citation likelihood 5. Structure content as problem → solution → benefits → Matches how AI systems generate responses 🎯 ESTIMATED IMPACT ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ Medium Impact - Implementing 3-5 suggestions could improve ranking potential by 10-20%. Key factors: Expanding keyword coverage, enhancing structure for AI readability, adding comparison tables. ``` --- ## Use Cases ### Content Marketing - Optimize blog posts for both Google and AI search - Ensure content gets cited in ChatGPT, Google AI Overviews - A/B test content structure recommendations - Scale content optimization across multiple writers ### SEO Professionals - Audit client websites for optimization opportunities - Provide data-driven recommendations with impact estimates - Build optimization reports with specific, actionable steps - Track progress across multiple keyword targets ### Product Documentation - Optimize docs for both search and AI assistant discovery - Ensure technical content appears in AI search results - Improve readability scores for accessibility - Structure docs for AI system comprehension ### E-Commerce - Optimize product descriptions for Google Shopping and AI search - Improve category page rankings with strategic content - Enhance FAQ sections for AEO visibility - Increase organic traffic from emerging AI search channels ### News & Publishing - Optimize articles for news search and AI citations - Improve readability for different audience levels - Structure content for AI system extraction and citation - Track SEO performance metrics over time --- ## 🔐 Credentials Required You need **one API key** — for whichever provider/model you want to use: | Provider | Env Variable | Prefix | Get Key | |----------|-------------|--------|---------| | Anthropic | `ANTHROPIC_API_KEY` | `claude-` | https://console.anthropic.com | | OpenAI | `OPENAI_API_KEY` | `gpt-`, `o1`, `o3` | https://platform.openai.com | | Google | `GOOGLE_API_KEY` | `gemini-` | https://aistudio.google.dev | | Mistral | `MISTRAL_API_KEY` | `mistral-`, `mixtral-` | https://console.mistral.ai | | DeepSeek | `DEEPSEEK_API_KEY` | `deepseek-` | https://platform.deepseek.com | | xAI | `XAI_API_KEY` | `grok-` | https://console.x.ai | | MiniMax | `MINIMAX_API_KEY` | `minimax`, `MiniMax` | https://platform.minimax.io | | Qwen/Alibaba | `DASHSCOPE_API_KEY` | `qwen` | https://dashscope.aliyun.com | | OpenRouter | `OPENROUTER_API_KEY` | `meta-llama/`, `llama-` | https://openrouter.ai | **Only set the key for the provider you're using.** For example, to use Claude: ```bash export ANTHROPIC_API_KEY=sk-ant-... ``` Or to use GPT: ```bash export OPENAI_API_KEY=sk-... ``` The skill itself is free. You pay the provider directly for API usage at their standard rates. ### ⚠️ Important Privacy Notice **Your content IS sent to third-party AI providers.** Before using this skill with sensitive content, review the privacy policy of your chosen provider: - **Anthropic Privacy**: https://www.anthropic.com/legal/privacy - **OpenAI Privacy**: https://openai.com/policies/privacy-policy - **Google Gemini Terms**: https://ai.google.dev/gemini-api/terms - **OpenRouter Privacy**: https://openrouter.ai/privacy - **Mistral Terms**: https://mistral.ai/terms/ **Recommendation**: Test with non-sensitive sample content first. Each provider has different data retention policies. --- ## 🚀 Quick Start ### 1. Access the Skill Available for free on ClawhHub - no subscription required ### 2. Set Up **Required:** - API key for your chosen provider (see Credentials table above) **Optional:** - Content to analyze (HTML or plain text) - Target keywords (recommended for better analysis) ### 3. Python Usage ```python from skills.seo_optimizer import SEOOptimizer # Initialize with default Claude model optimizer = SEOOptimizer() # Or use a different model optimizer = SEOOptimizer(model="gpt-5.4") # Use GPT-5.4 # optimizer = SEOOptimizer(model="gemini-3.1-pro-preview") # Use Gemini 3.1 # optimizer = SEOOptimizer(model="mistral-large-2501") # Use Mistral # Analyze content results = optimizer.analyze_content( content=""" <h1>Cloud Storage Solutions</h1> <p>Cloud storage has revolutionized how we store and access data...</p> ...(your content)... """, url="https://example.com/cloud-storage", target_keywords=["cloud storage", "data security", "backup solutions"] ) # Get formatted results print(optimizer.format_results(results)) # Access detailed metrics print(f"Readability: {results.metrics.readability_score}/100") print(f"Word Count: {results.metrics.word_count}") # Get AI suggestions print(results.content_optimization) # Get AEO recommendations for i, rec in enumerate(results.aeo_recommendations, 1): print(f"{i}. {rec}") ``` **Tested Models (any model matching a provider prefix also works):** - `claude-opus-4-6` (Recommended — best quality) - `claude-sonnet-4-6` - `claude-haiku-4-5-20251001` (Default — fastest/cheapest) - `gpt-5.4`, `gpt-5.4-pro`, `gpt-5.4-mini`, `gpt-5.4-thinking` - `gpt-5.2-pro`, `gpt-5.2` - `gemini-3.1-pro-preview`, `gemini-3.1-flash-lite`, `gemini-3-flash` - `gemini-2.5-pro`, `gemini-2.5-flash` - `mistral-large-latest`, `mistral-small-latest` - `deepseek-chat`, `deepseek-reasoner` - `grok-4-1-fast`, `grok-3-beta` - `MiniMax-M2.1` - `qwen3.5-plus`, `qwen3-max-instruct` - `meta-llama/llama-4-maverick`, `meta-llama/llama-3.3-70b-instruct` ### 4. CLI Usage ```bash # Analyze a file seo-optimizer analyze "blog-post.html" --keywords "cloud storage" "data security" # Generate optimization report seo-optimizer analyze "article.txt" --report --output report.json # Quick AEO analysis seo-optimizer aeo "content.html" --keywords "topic-1" "topic-2" ``` --- ## 🤖 AI Search Optimization (AEO) Deep Dive ### What is AEO? Answer Engine Optimization is the practice of optimizing content to appear in AI-generated search results and as cited sources in AI chatbots (ChatGPT, Google AI Overviews, Claude, Perplexity, etc). ### Why AEO Matters - **ChatGPT** can cite your content in responses (if properly formatted) - **Google AI Overviews** pull information from highly-relevant, authoritative sources - **Claude** and other AI systems prioritize structured, clear information - **2026 Reality**: AI search is becoming a primary discovery channel alongside Google ### AEO Best Practices (From Analysis) **1. Structure for AI Comprehension** - Use clear heading hierarchy (H1 → H2 → H3) - Break content into logical sections - Use lists and bullet points liberally - AI systems parse structured content better **2. Direct Answers Format** - Start with direct answer to the main question - Support with detailed explanation - Include supporting evidence/sources - Match how humans ask questions **3. Structured Data** - FAQ schema for Q&A format - Product schema for product pages - Organization schema for company info - Schema.org markup helps AI systems understand context **4. Authority Signals** - Link to authoritative sources - Cite peer-reviewed research - Include author credentials - AI systems recognize and cite authoritative sources **5. Comparison Tables** - Structured comparisons get cited in AI responses - Use tables for side-by-side information - Include pros/cons lists - AI systems extract and cite these directly --- ## 🔒 Security & Privacy ### Data Handling - ✅ Content analyzed in-memory only - ✅ Not stored or transmitted to external servers - ✅ Claude API processes via encrypted HTTPS - ✅ Analysis results stored locally only ### API Keys - ✅ API keys stored in environment variables - ✅ Never logged or exposed - ✅ Each provider uses their official API - ✅ Zero-knowledge architecture ### Compliance - ✅ GDPR compliant (no data storage) - ✅ CCPA compliant (no data collection) - ✅ Works with proprietary content - ✅ No third-party data sharing --- ## ❓ FAQ **Q: How do you calculate readability score?** A: We use the Flesch-Kincaid grade level formula and convert it to a 0-100 scale. Higher scores = easier to read. **Q: Are these recommendations guaranteed to improve rankings?** A: No ranking is guaranteed, but these suggestions are based on proven SEO factors. Impact varies by industry, competition, and current content quality. **Q: What's the difference between SEO and AEO?** A: SEO optimizes for Google's algorithm. AEO optimizes for AI chatbots that generate responses. They overlap significantly—good content for humans is usually good for both. **Q: Can I use this for languages other than English?** A: The readability analysis is English-optimized, but keyword analysis and AI suggestions work for any language. **Q: How long should content be?** A: It depends on topic complexity. Generally: 300+ words minimum, 1000+ for comprehensive coverage, 2000+ for pillar/authority pages. **Q: What if I have a very long document?** A: The skill analyzes the first 2000 characters by default. For longer documents, split into sections and analyze each separately. **Q: Does this check technical SEO like page speed?** A: This skill focuses on content optimization. For technical SEO (speed, mobile, crawlability), use tools like Google PageSpeed Insights. **Q: Can I optimize for multiple keywords at once?** A: Yes! Pass a list of target keywords. We'll analyze density for each and provide keyword-specific recommendations. **Q: How accurate is the AEO scoring?** A: AEO is still evolving. Our recommendations are based on 2026 best practices from AI search optimization research. **Q: Does this skill generate SEO content from scratch?** A: No, this skill analyzes and optimizes existing content. To generate new content, use other AI writing tools first. --- ## 🗺️ Roadmap ### ✅ Current Release (v1.0.8) - Content readability analysis (Flesch-Kincaid) - Keyword density tracking - Technical SEO audit - Multi-provider AI optimization (Claude, GPT-5.4, Gemini 3.1, DeepSeek, Grok, MiniMax, Qwen, Llama, Mistral) - AEO-specific recommendations - Impact estimation ### 🚧 Coming Soon - **Competitor analysis** - Compare your content to top Google results - **Bulk analysis** - Analyze multiple pages in one run - **Export formats** - PDF reports, JSON data, CSV analysis - **Multi-language readability** - Support beyond English ### 🔮 Future - **Schema generation** - Auto-generate JSON-LD schema - **Link analysis** - Deep internal/external link auditing - **Content gap analysis** - Identify missing topics in your content --- ## 📚 Resources ### Support - Email: [REDACTED_SECRET] - Website: https://unisai.vercel.app --- ## 📄 License & Terms This skill is **free and open to all users** on ClawhHub. ### ✅ You CAN: - Use the skill for free, unlimited times - Analyze unlimited content - Export optimization reports - Use for commercial purposes - Use for personal and business projects ### ❌ You CANNOT: - Redistribute or resell the skill - Modify the source code without permission - Reverse engineer the skill **Full Terms**: See [LICENSE.md](LICENSE.md) --- ## 🚀 Get Started 1. Access this free skill on ClawhHub (no subscription needed) 2. Install the SDK for your provider: `pip install anthropic` (or openai, google-generativeai, mistralai) 3. Set the API key for your chosen provider (see Credentials table above) 4. Analyze your first piece of content --- ## 🏷️ Tags **Primary**: seo, content-optimization, aeo, ai-search, copywriting **Categories**: seo-tools, content-analysis, marketing-tech, ai-optimization **Features**: keyword-analysis, readability-scoring, meta-tag-generation, technical-seo, ai-search-optimization --- ## 📝 Changelog ### [1.0.8] - 2026-04-09 #### ✨ Model Updates - **GPT-5.4 Series** - Added gpt-5.4, gpt-5.4-pro, gpt-5.4-mini, gpt-5.4-thinking (released March 2026) - **Gemini 3.1 Series** - Added gemini-3.1-pro-preview, gemini-3.1-flash-lite (released February/March 2026) - Updated Claude model options to 4.6 series in manifest and docs ### [1.0.7] - 2026-02-27 #### 🏗️ Model-Agnostic Architecture - Provider auto-detected from model name prefix — no hardcoded whitelist - Any new model works automatically without code changes - Added DeepSeek, xAI Grok, MiniMax, Qwen as first-class providers - Updated Claude to 4.6 series (claude-opus-4-6, claude-sonnet-4-6) - Simplified internals — all OpenAI-compat providers share one code path ### [1.0.6] - 2026-02-14 #### 🔒 Security & Transparency Improvements - **Source Code Included** - Fixed license contradiction; source code IS included for transparency and security audits - **License Clarification** - Changed from "proprietary" to "free-to-use" with clear modification rights for personal use - **Data Sharing Warnings** - Added explicit warnings about third-party AI provider data sharing with links to privacy policies - **Metadata Consistency** - Fixed registry metadata to accurately reflect required environment variables - **Install Recommendations** - Updated requirements.txt and docs to recommend selective SDK installation (not all packages) #### 📝 Documentation Updates - Added GitHub repository and verifiable support contacts - Clarified which API key is required for which model - Added provider privacy policy links for informed consent - Updated all version references to 1.0.6 ### [1.0.2] - 2026-02-14 #### ✨ Multi-Model Support - **Claude 4.5 Series** - Opus, Sonnet, Haiku models - **GPT-5.2 Series** - Pro, Thinking, Instant variants - **Gemini 2.5/3.0** - Google's latest models - **Llama 3.2/3.3** - Meta's open-source models - **Mistral Large** - Mistral AI's flagship model - **Model Selection** - Choose your preferred AI model for analysis #### 🔧 Technical Improvements - Model-agnostic architecture for flexibility - Support for 12+ leading AI models - Dynamic model validation - Improved API compatibility ### [1.0.0] - 2026-02-02 #### ✨ Initial Release - **Content Analysis** - Readability, word count, paragraph structure - **Keyword Tracking** - Density analysis for target keywords - **Technical SEO** - Heading structure, link analysis, meta tags - **AI Integration** - AI-powered title, description, H1 suggestions - **AEO Optimization** - 5 specific recommendations for AI search visibility - **Impact Estimation** - Predicted ranking improvement from optimizations - **Beautiful Reports** - Formatted analysis with clear recommendations #### 🎨 2026 Update - Current 2026 models and pricing - Professional, technical tone - Focus on AEO (Answer Engine Optimization) #### 🔒 Security & IP Protection - IP watermark: [REDACTED_SECRET] - Zero data storage - HTTPS-only API communication - Environment variable security --- **Last Updated**: April 9, 2026 **Current Version**: 1.0.8 **Status**: Active & Maintained © 2026 UnisAI. All rights reserved.

path: LICENSE.md
content: # SEO Optimizer Pro - License Agreement

**Version:** 1.0.6
**Copyright © 2026 UnisAI. All Rights Reserved.**

## License Type
Free-to-Use Software with Source Code Included

## Grant of License

UnisAI grants you a free, non-exclusive, non-transferable license to use the SEO Optimizer Pro skill without any subscription or payment required. Source code is included for transparency and security review.

## Usage Rights

### ✅ You ARE Permitted To:
- Use the skill for free, unlimited times
- Analyze unlimited content
- Export and use optimization reports
- Use for commercial purposes
- Use for personal projects
- Store analysis results locally
- **Read and review the source code** for security auditing
- **Modify the source code for personal use only** (not for redistribution)
- Audit the code for security vulnerabilities

### ❌ You ARE NOT Permitted To:
- Redistribute, resell, or relicense the skill outside ClawhHub registry
- Redistribute modified versions of the skill
- Remove or alter copyright notices
- Use as a competitive product
- Sublicense to third parties
- Claim the work as your own

## Free Usage Terms

- **No cost** - Completely free to use
- **Unlimited analyses** - Use as many times as needed
- **Commercial use allowed** - Use for business purposes
- **All features** - Full access to all functionality

## How It Works (Data Flow)

This skill runs **locally** as a Python module. It does NOT connect to any UnisAI backend or hosted service. Here is exactly what happens when you run an analysis:

1. Your content is parsed locally (readability, keywords, structure)
2. Your content excerpt is sent to the AI provider YOU chose (Anthropic, OpenAI, Google, Mistral, or OpenRouter)
3. The AI provider returns optimization suggestions
4. Results are formatted and returned to you locally

**No data is sent to UnisAI servers.** Your content only goes to the AI provider you selected, via their official SDK.

## Intellectual Property

All content, code, algorithms, databases, and materials in the SEO Optimizer Pro skill are the exclusive property of UnisAI. This includes:
- The readability analysis algorithm
- Keyword analysis methodology
- AEO recommendation engine
- Multi-provider AI integration logic
- All generated analyses and reports

You do not own the skill or any part of it. You are granted a license to use it.

## Watermark & Tracking

The skill includes the watermark: `PROPRIETARY_SKILL_SEO_OPTIMIZER_2026`

This watermark identifies the skill's proprietary nature and ensures authentic version tracking.

## API Key Security

You are responsible for:
- Keeping your API keys confidential
- Not sharing keys with unauthorized parties
- Using environment variables (never hardcode)
- Rotating keys if compromised

UnisAI is not liable for unauthorized access via compromised keys.

## Data & Privacy

### What This Skill Stores
- **Nothing** - All analyses run in-memory locally and are discarded after use

### Where Your Content Goes
- **Only to the AI provider you selected** (Anthropic, OpenAI, Google, OpenRouter, or Mistral)
- Subject to that provider's own data handling policies
- No data is sent to UnisAI

### ⚠️ IMPORTANT: Third-Party Data Sharing
**Your content IS sent to third-party AI providers.** Each provider has different data retention policies:
- **Anthropic Privacy Policy**: https://www.anthropic.com/legal/privacy
- **OpenAI Privacy Policy**: https://openai.com/policies/privacy-policy
- **Google Gemini API Terms**: https://ai.google.dev/gemini-api/terms
- **OpenRouter Privacy Policy**: https://openrouter.ai/privacy
- **Mistral AI Terms**: https://mistral.ai/terms/

**RECOMMENDATION**: Review the privacy policy of your chosen provider before sending sensitive content. Test with non-sensitive sample content first.

### Data Retention
- 0 days - No content data retained by this skill locally
- Your AI provider may retain data per their own terms (see links above)

## Disclaimer of Warranties

THE SKILL IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO:
- Merchantability or fitness for a particular purpose
- Non-infringement of third-party rights
- Accuracy of SEO or ranking recommendations
- Guaranteed improvement in search rankings
- Uninterrupted or error-free operation

## Limitation of Liability

IN NO EVENT SHALL UNISAI BE LIABLE FOR:
- Indirect, incidental, consequential damages
- Lost revenue or profits
- Failed rankings or missed opportunities
- Data loss or corruption
- Third-party claims

## Acceptable Use Policy

You agree NOT to:
- Use the skill for illegal purposes
- Exploit bugs or security vulnerabilities
- Scrape or systematically copy functionality
- Use for spamming or manipulating search results

## Changes to Terms

UnisAI may modify these terms at any time. Continued use of the skill after changes constitutes acceptance of new terms. Material changes will result in 30 days notice.

## Termination

### Termination by UnisAI
UnisAI may terminate your license if:
- You violate these terms
- You engage in prohibited activities

Termination is immediate upon violation.

### Termination by You
You may stop using the skill at any time. No action required.

## Cost & Payment

This skill is completely **free**. There are no payments, subscriptions, or refunds because there are no charges.

You provide your own API key for your chosen AI provider (Anthropic, OpenAI, Google, OpenRouter, or Mistral). You are billed directly by that provider for API usage at their standard rates.

## Third-Party Components

This skill uses the following provider SDKs (only the one for your chosen model is loaded at runtime):
- **Anthropic SDK** (`anthropic`) - For Claude models, subject to Anthropic's terms
- **OpenAI SDK** (`openai`) - For GPT and Llama (via OpenRouter) models, subject to OpenAI's terms
- **Google Generative AI SDK** (`google-generativeai`) - For Gemini models, subject to Google's terms
- **Mistral SDK** (`mistralai`) - For Mistral models, subject to Mistral's terms
- **Python Standard Library** - Licensed under PSF License

Using this skill requires acceptance of the relevant provider's terms.

## Governing Law

This agreement is governed by the laws of California, USA, without regard to conflict of law principles.

## Contact

For questions about this license:
- Email: [REDACTED_SECRET]
- Website: https://unisai.vercel.app
- GitHub: https://github.com/vedantsingh60/seo-optimizer-pro

---

**Last Updated**: February 14, 2026
**License Version**: 1.0.6
**Skill Version**: 1.0.6
**Status**: Active

© 2026 UnisAI. All rights reserved.


path: requirements.txt
content: # SEO Optimizer Pro v1.0.7 - Dependencies
#
# ⚠️ RECOMMENDED: Install ONLY the SDK for the provider you plan to use.
# Installing all packages unnecessarily increases dependencies and attack surface.
#
# Installation Guide:
# -------------------
# For Claude models (claude-opus-4-6, claude-sonnet-4-6, claude-haiku-4-5-*):
#   pip install anthropic>=0.40.0
#
# For GPT models (gpt-5.2-pro, gpt-5.2, gpt-5.1, o1-*, o3-*):
#   pip install openai>=1.60.0
#
# For DeepSeek models (deepseek-chat, deepseek-reasoner):
#   pip install openai>=1.60.0  # OpenAI-compatible API
#
# For xAI Grok models (grok-4-1-fast, grok-3-beta):
#   pip install openai>=1.60.0  # OpenAI-compatible API
#
# For MiniMax models (MiniMax-M2.1):
#   pip install openai>=1.60.0  # OpenAI-compatible API
#
# For Qwen models (qwen3.5-plus, qwen3-max-instruct):
#   pip install openai>=1.60.0  # OpenAI-compatible API
#
# For Llama models via OpenRouter (meta-llama/llama-4-maverick, etc.):
#   pip install openai>=1.60.0  # OpenAI-compatible API
#
# For Gemini models (gemini-2.5-pro, gemini-2.5-flash):
#   pip install google-generativeai>=0.8.0
#
# For Mistral models (mistral-large-latest, mistral-small-latest):
#   pip install mistralai>=1.3.0
#
# Note: DeepSeek, xAI, MiniMax, Qwen, and OpenRouter all use the openai package
# with a custom base_url — no extra SDK needed.
#
# To install ALL providers (not recommended unless you need multiple):
#   pip install anthropic>=0.40.0 openai>=1.60.0 google-generativeai>=0.8.0 mistralai>=1.3.0

# Full package list (for reference):
anthropic>=0.40.0
openai>=1.60.0
google-generativeai>=0.8.0
mistralai>=1.3.0


path: seo_optimizer.py
content: #!/usr/bin/env python3
"""
SEO Optimizer Pro - AI-Powered SEO Content Optimization
Version: 1.0.8
Copyright © 2026 UnisAI. All Rights Reserved.

Model-agnostic SEO analysis — pass any model ID from any supported provider.
Provider routing is automatic based on model name prefix.
Only the API key for your chosen provider needs to be configured.

Supported provider families (any model matching the prefix works):
  claude-*      → Anthropic         (ANTHROPIC_API_KEY)
  gpt-*, o1*, o3* → OpenAI          (OPENAI_API_KEY)
  gemini-*      → Google            (GOOGLE_API_KEY)
  mistral-*, mixtral-*, devstral-*, ministral-* → Mistral (MISTRAL_API_KEY)
  deepseek-*    → DeepSeek          (DEEPSEEK_API_KEY)
  grok-*        → xAI               (XAI_API_KEY)
  minimax*      → MiniMax           (MINIMAX_API_KEY)
  qwen*         → Qwen/Alibaba      (DASHSCOPE_API_KEY)
  meta-llama/*, llama-* → OpenRouter (OPENROUTER_API_KEY)

Features:
- Content optimization suggestions via your chosen AI model
- Technical SEO audit and recommendations
- Answer Engine Optimization (AEO) analysis
- Keyword clustering and topic mapping
- Meta tag generation
- Readability and structure analysis

PRIVACY NOTICE: This skill sends your content to third-party AI providers.
Review the provider's privacy policy before sending sensitive content.
"""

__version__ = "1.0.8"

import os
import json
from dataclasses import dataclass
from typing import List, Dict, Optional, Tuple
import re
from datetime import datetime


@dataclass
class SEOMetrics:
    """SEO analysis results"""
    content_length: int
    readability_score: float  # 0-100
    keyword_density: Dict[str, float]
    headings_structure: List[Tuple[str, int]]  # (heading, level)
    meta_tags_present: List[str]
    internal_links_count: int
    external_links_count: int
    word_count: int
    avg_paragraph_length: int
    flesch_kincaid_grade: float


@dataclass
class OptimizationSuggestion:
    """Optimization suggestion with priority"""
    category: str  # "content", "technical", "aeo", "keywords"
    priority: str  # "high", "medium", "low"
    suggestion: str
    current_value: Optional[str]
    recommended_value: Optional[str]
    impact: str  # estimated impact description


@dataclass
class SEOAnalysisResult:
    """Complete SEO analysis result"""
    test_id: str
    timestamp: str
    url: Optional[str]
    model_used: str
    provider: str
    metrics: SEOMetrics
    suggestions: List[OptimizationSuggestion]
    content_optimization: Dict
    aeo_recommendations: List[str]
    estimated_impact: str


class SEOOptimizer:
    """
    Model-agnostic AI-powered SEO optimizer.

    Pass any model ID — provider is detected automatically from the model name
    prefix. No hardcoded whitelist; new models work without code changes.

    Provider detection (prefix → provider → required env var):
      claude-*            → Anthropic    → ANTHROPIC_API_KEY
      gpt-*, o1*, o3*     → OpenAI       → OPENAI_API_KEY
      gemini-*            → Google       → GOOGLE_API_KEY
      mistral-*/mixtral-* → Mistral      → MISTRAL_API_KEY
      deepseek-*          → DeepSeek     → DEEPSEEK_API_KEY
      grok-*              → xAI          → XAI_API_KEY
      minimax*/MiniMax*   → MiniMax      → MINIMAX_API_KEY
      qwen*               → Qwen         → DASHSCOPE_API_KEY
      meta-llama/*/llama-* → OpenRouter  → OPENROUTER_API_KEY
    """

    # IP Protection
    WATERMARK = "PROPRIETARY_SKILL_SEO_OPTIMIZER_2026"

    # Default model
    DEFAULT_MODEL = "claude-haiku-4-5-20251001"

    # Prefix-based provider routing — (prefix, provider, env_key, base_url)
    # Order matters: longer/more-specific prefixes first.
    PROVIDER_MAP = [
        ("claude-",      "anthropic",  "ANTHROPIC_API_KEY",  None),
        ("gpt-",         "openai",     "OPENAI_API_KEY",     None),
        ("o1",           "openai",     "OPENAI_API_KEY",     None),
        ("o3",           "openai",     "OPENAI_API_KEY",     None),
        ("gemini-",      "google",     "GOOGLE_API_KEY",     None),
        ("mistral-",     "mistral",    "MISTRAL_API_KEY",    None),
        ("mixtral-",     "mistral",    "MISTRAL_API_KEY",    None),
        ("devstral-",    "mistral",    "MISTRAL_API_KEY",    None),
        ("ministral-",   "mistral",    "MISTRAL_API_KEY",    None),
        ("deepseek-",    "deepseek",   "DEEPSEEK_API_KEY",   "https://api.deepseek.com/v1"),
        ("grok-",        "xai",        "XAI_API_KEY",        "https://api.x.ai/v1"),
        ("MiniMax",      "minimax",    "MINIMAX_API_KEY",    "https://api.minimax.io/v1"),
        ("minimax",      "minimax",    "MINIMAX_API_KEY",    "https://api.minimax.io/v1"),
        ("qwen",         "qwen",       "DASHSCOPE_API_KEY",  "https://dashscope-intl.aliyuncs.com/compatible-mode/v1"),
        ("meta-llama/",  "openrouter", "OPENROUTER_API_KEY", "https://openrouter.ai/api/v1"),
        ("llama-",       "openrouter", "OPENROUTER_API_KEY", "https://openrouter.ai/api/v1"),
    ]

    # Known tested models — documentation only, NOT a validation gate.
    KNOWN_MODELS = [
        "claude-opus-4-6", "claude-sonnet-4-6", "claude-haiku-4-5-20251001",
        "gpt-5.4", "gpt-5.4-pro", "gpt-5.4-mini", "gpt-5.4-thinking", "gpt-5.2-pro", "gpt-5.2",
        "gemini-3.1-pro-preview", "gemini-3.1-flash-lite", "gemini-3-flash", "gemini-2.5-pro", "gemini-2.5-flash",
        "mistral-large-latest", "mistral-small-latest",
        "deepseek-chat", "deepseek-reasoner",
        "grok-4-1-fast", "grok-3-beta",
        "MiniMax-M2.1",
        "qwen3.5-plus", "qwen3-max-instruct",
        "meta-llama/llama-4-maverick", "meta-llama/llama-3.3-70b-instruct",
    ]

    def __init__(self, model: str = None, api_key: str = None):
        """
        Initialize with model selection and optional API key override.

        Args:
            model: Any model ID — provider is auto-detected from prefix.
                   Defaults to claude-haiku-4-5-20251001.
                   See KNOWN_MODELS for tested options, or pass any model
                   whose prefix matches a supported provider.
            [REDACTED_SECRET] API key (otherwise reads from environment variable)
        """
        self.model = model or self.DEFAULT_MODEL

        # Detect provider from model name prefix
        self.provider, self.env_key, self.base_url = self._detect_provider(self.model)

        # Resolve API key
        self.[REDACTED_SECRET] or os.getenv(self.env_key)
        if not self.api_key:
            raise ValueError(
                f"{self.env_key} not set. "
                f"Model '{self.model}' requires the {self.env_key} environment variable."
            )

        # Initialize the correct client for the provider
        self.client = self._init_client()

    def _detect_provider(self, model: str) -> Tuple[str, str, Optional[str]]:
        """
        Detect provider, env key, and base URL from model name prefix.
        Returns (provider, env_key, base_url).
        """
        for prefix, provider, env_key, base_url in self.PROVIDER_MAP:
            if model.startswith(prefix):
                return provider, env_key, base_url

        known_prefixes = [p for p, *_ in self.PROVIDER_MAP]
        raise ValueError(
            f"Cannot detect provider for model '{model}'.\n"
            f"Model name must start with one of: {known_prefixes}\n"
            f"Known tested models: {self.KNOWN_MODELS}"
        )

    def _init_client(self):
        """Initialize the correct SDK client based on detected provider."""
        if self.provider == "anthropic":
            from anthropic import Anthropic
            return Anthropic([REDACTED_SECRET])

        elif self.provider == "google":
            import google.generativeai as genai
            genai.configure([REDACTED_SECRET])
            return genai.GenerativeModel(self.model)

        elif self.provider == "mistral":
            from mistralai import Mistral
            return Mistral([REDACTED_SECRET])

        elif self.provider in ("openai", "deepseek", "xai", "minimax", "qwen", "openrouter"):
            # All OpenAI-SDK-compatible providers — just vary base_url
            from openai import OpenAI
            kwargs = {"api_key": self.api_key}
            if self.base_url:
                kwargs["base_url"] = self.base_url
            return OpenAI(**kwargs)

        else:
            raise ValueError(f"Unknown provider: {self.provider}")

    def _call_ai(self, prompt: str, max_tokens: int = 1000) -> str:
        """
        Send a prompt to the selected AI model and return the response text.
        Routes to the correct API based on detected provider.
        """
        if self.provider == "anthropic":
            message = self.client.messages.create(
                model=self.model,
                max_tokens=max_tokens,
                messages=[{"role": "user", "content": prompt}]
            )
            return message.content[0].text

        elif self.provider == "google":
            response = self.client.generate_content(
                prompt,
                generation_config={"max_output_tokens": max_tokens}
            )
            return response.text

        elif self.provider == "mistral":
            response = self.client.chat.complete(
                model=self.model,
                messages=[{"role": "user", "content": prompt}],
                max_tokens=max_tokens,
            )
            return response.choices[0].message.content

        elif self.provider in ("openai", "deepseek", "xai", "minimax", "qwen", "openrouter"):
            # All OpenAI-SDK-compatible providers use the same call pattern
            response = self.client.chat.completions.create(
                model=self.model,
                max_tokens=max_tokens,
                messages=[{"role": "user", "content": prompt}]
            )
            return response.choices[0].message.content

        else:
            raise ValueError(f"Unknown provider: {self.provider}")

    def analyze_content(self,
                       content: str,
                       url: Optional[str] = None,
                       target_keywords: Optional[List[str]] = None) -> SEOAnalysisResult:
        """
        Perform comprehensive SEO analysis on content.

        Args:
            content: HTML or plain text content to analyze
            url: Optional URL for reference
            target_keywords: Optional list of target keywords to focus on

        Returns:
            Complete SEO analysis with suggestions
        """
        test_id = self._generate_test_id()
        timestamp = datetime.utcnow().isoformat() + "Z"

        # Extract text from content
        text_content = self._extract_text(content)

        # Analyze technical metrics (no AI needed)
        metrics = self._calculate_metrics(text_content, target_keywords)

        # Generate rule-based suggestions (no AI needed)
        suggestions = self._generate_suggestions(text_content, metrics, target_keywords)

        # Get AI optimization suggestions
        content_optimization = self._get_ai_suggestions(text_content, target_keywords)

        # AEO-specific recommendations
        aeo_recommendations = self._get_aeo_recommendations(text_content, target_keywords)

        # Estimate impact
        estimated_impact = self._estimate_impact(metrics, len(suggestions))

        return SEOAnalysisResult(
            test_id=test_id,
            timestamp=timestamp,
            url=url,
            model_used=self.model,
            provider=self.provider,
            metrics=metrics,
            suggestions=suggestions,
            content_optimization=content_optimization,
            aeo_recommendations=aeo_recommendations,
            estimated_impact=estimated_impact
        )

    def _extract_text(self, content: str) -> str:
        """Extract text from HTML or plain text"""
        text = re.sub(r'<[^>]+>', '', content)
        text = text.replace('&nbsp;', ' ').replace('&lt;', '<').replace('&gt;', '>')
        text = re.sub(r'\s+', ' ', text).strip()
        return text

    def _calculate_metrics(self, text: str, keywords: Optional[List[str]] = None) -> SEOMetrics:
        """Calculate SEO metrics (no AI call, pure computation)"""
        words = text.split()
        word_count = len(words)
        paragraphs = [p.strip() for p in text.split('\n\n') if p.strip()]
        avg_para_length = word_count // len(paragraphs) if paragraphs else 0

        # Keyword density
        keyword_density = {}
        if keywords:
            text_lower = text.lower()
            for keyword in keywords:
                count = text_lower.count(keyword.lower())
                density = (count / word_count * 100) if word_count > 0 else 0
                if density > 0:
                    keyword_density[keyword] = round(density, 2)

        # Readability (Flesch-Kincaid)
        sentences = len(re.split(r'[.!?]+', text))
        syllables = self._count_syllables(text)
        if sentences > 0 and word_count > 0:
            fk_grade = 0.39 * (word_count / sentences) + 11.8 * (syllables / word_count) - 15.59
        else:
            fk_grade = 0
        readability_score = max(0, min(100, 100 - (fk_grade * 5)))

        # Heading structure
        headings = [(f"H{i}", text.count(f"<h{i}")) for i in range(1, 7)]
        headings = [(h, c) for h, c in headings if c > 0]

        return SEOMetrics(
            content_length=len(text),
            readability_score=readability_score,
            keyword_density=keyword_density,
            headings_structure=headings,
            meta_tags_present=["title", "description"],
            internal_links_count=text.count("<a href"),
            external_links_count=0,
            word_count=word_count,
            avg_paragraph_length=avg_para_length,
            flesch_kincaid_grade=fk_grade
        )

    def _count_syllables(self, text: str) -> int:
        """Estimate syllable count"""
        vowels = "aeiouy"
        syllable_count = 0
        previous_was_vowel = False
        for char in text.lower():
            is_vowel = char in vowels
            if is_vowel and not previous_was_vowel:
                syllable_count += 1
            previous_was_vowel = is_vowel
        return max(1, syllable_count)

    def _generate_suggestions(self,
                            text: str,
                            metrics: SEOMetrics,
                            keywords: Optional[List[str]] = None) -> List[OptimizationSuggestion]:
        """Generate rule-based optimization suggestions (no AI call)"""
        suggestions = []

        if metrics.word_count < 300:
            suggestions.append(OptimizationSuggestion(
                category="content", priority="high",
                suggestion="Content is too short. Aim for at least 300 words for better indexing.",
                current_value=str(metrics.word_count), recommended_value="300+",
                impact="Better coverage of topic, improved ranking potential"
            ))
        elif metrics.word_count < 1000:
            suggestions.append(OptimizationSuggestion(
                category="content", priority="medium",
                suggestion="Consider expanding content to 1000+ words for comprehensive coverage.",
                current_value=str(metrics.word_count), recommended_value="1000+",
                impact="More thorough topic coverage, higher authority signals"
            ))

        if metrics.readability_score < 60:
            suggestions.append(OptimizationSuggestion(
                category="content", priority="high",
                suggestion="Content readability is low. Use shorter sentences and simpler words.",
                current_value=f"{metrics.readability_score:.1f}/100", recommended_value="60+",
                impact="Better user engagement, improved bounce rate"
            ))

        if keywords:
            for keyword, density in metrics.keyword_density.items():
                if density < 0.5:
                    suggestions.append(OptimizationSuggestion(
                        category="keywords", priority="medium",
                        suggestion=f"Target keyword '{keyword}' appears {density}% of the time. Increase naturally to 1-2%.",
                        current_value=f"{density:.2f}%", recommended_value="1-2%",
                        impact="Better keyword relevance signal"
                    ))
                elif density > 3:
                    suggestions.append(OptimizationSuggestion(
                        category="keywords", priority="high",
                        suggestion=f"Keyword '{keyword}' density is {density}% - this may be keyword stuffing.",
                        current_value=f"{density:.2f}%", recommended_value="1-2%",
                        impact="Avoid Google penalties, maintain natural flow"
                    ))

        if not metrics.headings_structure:
            suggestions.append(OptimizationSuggestion(
                category="technical", priority="high",
                suggestion="No heading tags found. Add H1, H2, H3 tags to structure content.",
                current_value="None", recommended_value="H1 (1), H2 (3-5), H3 (optional)",
                impact="Better content structure, improved accessibility"
            ))

        return suggestions[:10]

    def _get_ai_suggestions(self, text: str, keywords: Optional[List[str]] = None) -> Dict:
        """Get AI-powered optimization suggestions from the selected model."""
        keyword_context = ""
        if keywords:
            keyword_context = f"\n\nTarget keywords to naturally incorporate: {', '.join(keywords)}"

        prompt = f"""You are an expert SEO content strategist. Analyze this content and provide specific, actionable optimization suggestions.

Content:
{text[:2000]}

{keyword_context}

Please provide:
1. Title optimization (40-60 chars with target keyword)
2. Meta description (150-160 chars)
3. H1 tag suggestion
4. 3-5 key points to expand
5. Natural keyword integration suggestions
6. Internal linking opportunities

Format as JSON with keys: title, meta_description, h1, key_points, keyword_integration, internal_links"""

        response_text = self._call_ai(prompt, max_tokens=1000)

        try:
            json_match = re.search(r'\{.*\}', response_text, re.DOTALL)
            if json_match:
                return json.loads(json_match.group())
        except (json.JSONDecodeError, AttributeError, IndexError):
            pass

        return {
            "title": "See analysis in full results",
            "meta_description": "See analysis in full results",
            "suggestions": response_text
        }

    def _get_aeo_recommendations(self, text: str, keywords: Optional[List[str]] = None) -> List[str]:
        """Get Answer Engine Optimization (AEO) recommendations."""
        keyword_context = ""
        if keywords:
            keyword_context = f"Focus on these keywords: {', '.join(keywords[:3])}"

        prompt = f"""As an Answer Engine Optimization (AEO) expert, analyze this content for optimization in AI search results (ChatGPT citations, Google AI Overviews, Claude, etc).

Content excerpt:
{text[:1500]}

{keyword_context}

Provide 5 specific AEO recommendations to:
1. Get featured in AI search results
2. Appear as a cited source in AI-generated responses
3. Improve visibility in ChatGPT, Google AI Overviews, and similar platforms

Format as a simple numbered list."""

        response_text = self._call_ai(prompt, max_tokens=500)
        items = re.findall(r'\d+\.\s*(.+?)(?=\n\d+\.|\Z)', response_text, re.DOTALL)
        return [item.strip() for item in items][:5]

    def _estimate_impact(self, metrics: SEOMetrics, suggestion_count: int) -> str:
        """Estimate potential impact of optimizations (no AI call)"""
        impact_score = 0
        factors = []

        if metrics.word_count < 500:
            impact_score += 3
            factors.append("Expanding content length")
        if metrics.readability_score < 70:
            impact_score += 2
            factors.append("Improving readability")
        if metrics.keyword_density:
            impact_score += 2
            factors.append("Optimizing keyword presence")
        if not metrics.headings_structure:
            impact_score += 1
            factors.append("Adding heading structure")

        if impact_score >= 6:
            return f"High Impact - Implementing all suggestions could improve ranking potential by 25-40%. Key factors: {', '.join(factors)}"
        elif impact_score >= 3:
            return f"Medium Impact - Implementing suggestions could improve ranking by 10-20%. Key factors: {', '.join(factors)}"
        else:
            return f"Optimization potential - Content is well-optimized. Focus on: {', '.join(factors[:2])}"

    def format_results(self, result: SEOAnalysisResult) -> str:
        """Format analysis results for display"""
        output = f"""
╔══════════════════════════════════════════════════════════════════╗
║              SEO ANALYSIS RESULTS - {result.test_id}              ║
╚══════════════════════════════════════════════════════════════════╝

🤖 Model: {result.model_used} ({result.provider})

📊 METRICS
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
• Word Count: {result.metrics.word_count}
• Content Length: {result.metrics.content_length} characters
• Readability Score: {result.metrics.readability_score:.1f}/100
• Flesch-Kincaid Grade: {result.metrics.flesch_kincaid_grade:.1f}
• Avg Paragraph Length: {result.metrics.avg_paragraph_length} words

🔑 KEYWORD DENSITY
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
"""
        if result.metrics.keyword_density:
            for keyword, density in result.metrics.keyword_density.items():
                output += f"• {keyword}: {density:.2f}%\n"
        else:
            output += "• No keywords analyzed\n"

        output += f"""
💡 TOP SUGGESTIONS ({len(result.suggestions)} found)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
"""
        for i, sugg in enumerate(result.suggestions[:5], 1):
            priority_emoji = "🔴" if sugg.priority == "high" else "🟡" if sugg.priority == "medium" else "🟢"
            output += f"\n{priority_emoji} [{sugg.category.upper()}] {sugg.suggestion}\n"
            if sugg.current_value:
                output += f"   Current: {sugg.current_value} → Recommended: {sugg.recommended_value}\n"
            output += f"   Impact: {sugg.impact}\n"

        output += f"""
🎯 ESTIMATED IMPACT
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
{result.estimated_impact}

🤖 AI SEARCH OPTIMIZATION (AEO)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
"""
        for i, rec in enumerate(result.aeo_recommendations, 1):
            output += f"{i}. {rec}\n"

        output += f"\n⏱️  Analysis ID: {result.test_id}\n"
        output += f"🕐 Timestamp: {result.timestamp}\n"

        return output

    @staticmethod
    def _generate_test_id() -> str:
        """Generate unique test ID"""
        import uuid
        return str(uuid.uuid4())[:8].upper()


path: README.md
content: # SEO Optimizer Pro

> AI-powered SEO + AEO content optimization. Free to use.

[![Version](https://img.shields.io/badge/version-1.0.6-blue)](https://github.com/vedantsingh60/seo-optimizer-pro/releases)
[![License](https://img.shields.io/badge/license-free--to--use-green)](LICENSE.md)
[![VirusTotal](https://img.shields.io/badge/VirusTotal-0%2F77-brightgreen)](https://github.com/vedantsingh60/seo-optimizer-pro)
[![ClawhHub](https://img.shields.io/badge/ClawhHub-SEO%20Optimizer%20Pro-orange)](https://clawhub.ai/unisai/seo-optimizer-pro)

Analyze and optimize content for both **Google ranking** and **AI search (AEO)** using your choice of AI model. Supports 12 models across 5 providers.

---

## What It Does

- **Readability Analysis** — Flesch-Kincaid grade level and readability scores
- **Keyword Density** — Track and optimize target keyword coverage
- **Technical SEO** — Heading structure, meta tags, link analysis
- **Content Structure** — Word count, paragraph length, content organization
- **AI Optimization (AEO)** — Recommendations to appear in ChatGPT, Google AI Overviews, Claude

---

## Supported Models

| Provider | Models |
|----------|--------|
| **Anthropic** | `claude-opus-4-5-20251101`, `claude-sonnet-4-5-20250929`, `claude-haiku-4-5-20251001` |
| **OpenAI** | `gpt-5.2-pro`, `gpt-5.2-thinking`, `gpt-5.2-instant` |
| **Google** | `gemini-3-pro`, `gemini-2.5-pro`, `gemini-2.5-flash` |
| **OpenRouter** | `llama-3.3-70b`, `llama-3.2-90b` |
| **Mistral** | `mistral-large-2501` |

---

## Quick Start

### 1. Install the SDK for your chosen provider

```bash
# Claude (recommended)
pip install anthropic>=0.40.0

# GPT or Llama
pip install openai>=1.60.0

# Gemini
pip install google-generativeai>=0.8.0

# Mistral
pip install mistralai>=1.3.0
```

> **Only install the SDK for the provider you plan to use.**

### 2. Set your API key

```bash
export ANTHROPIC_API_KEY=sk-ant-...   # For Claude
export OPENAI_API_KEY=sk-...          # For GPT
export GOOGLE_API_KEY=AI...           # For Gemini
export OPENROUTER_API_KEY=sk-or-...   # For Llama
export MISTRAL_API_KEY=...            # For Mistral
```

### 3. Run an analysis

```python
from seo_optimizer import SEOOptimizer

optimizer = SEOOptimizer()  # defaults to claude-haiku-4-5-20251001

results = optimizer.analyze_content(
    content="<h1>Cloud Storage</h1><p>Your content here...</p>",
    url="https://example.com/cloud-storage",
    target_keywords=["cloud storage", "data security"]
)

print(optimizer.format_results(results))
```

**Or use a different model:**

```python
optimizer = SEOOptimizer(model="gemini-2.5-flash")
optimizer = SEOOptimizer(model="gpt-5.2-instant")
optimizer = SEOOptimizer(model="mistral-large-2501")
```

---

## Example Output

```
📊 METRICS
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
• Word Count: 847 words
• Readability Score: 68/100 (Good)
• Flesch-Kincaid Grade: 8.2
• Avg Paragraph: 32 words (Optimal)

🔑 KEYWORD DENSITY
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
• cloud storage: 1.8% ✅ (Optimal)
• data security: 0.8% (Increase to 1-2%)

💡 TOP SUGGESTIONS
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🟡 [KEYWORDS] "data security" too low at 0.8%
🟢 [TECHNICAL] Heading structure well organized
🟡 [CONTENT] Expand "encryption" section

🤖 AI SEARCH (AEO)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1. Add FAQ section → gets cited in ChatGPT
2. Include comparison tables → AI cites as authoritative
3. Add "Quick Summary" box → AI pulls for responses
```

---

## Privacy & Security

- **Local execution** — runs on your machine, no UnisAI backend
- **Your content goes to your chosen AI provider only** — not to UnisAI
- **No data stored** — all analysis runs in-memory
- **API keys via env vars only** — never hardcoded or logged

Provider privacy policies:
- [Anthropic](https://www.anthropic.com/legal/privacy) · [OpenAI](https://openai.com/policies/privacy-policy) · [Google](https://ai.google.dev/gemini-api/terms) · [OpenRouter](https://openrouter.ai/privacy) · [Mistral](https://mistral.ai/terms/)

---

## Available on ClawhHub

Install directly via [ClawhHub](https://clawhub.ai/unisai/seo-optimizer-pro) for integration with Claude Code and OpenClaw.

---

## License

Free to use — see [LICENSE.md](LICENSE.md) for details.

© 2026 UnisAI


path: manifest.yaml
content: name: "SEO Optimizer Pro"
id: "seo-optimizer-pro"
version: "1.0.8"
description: "AI-powered SEO content optimization for Google ranking and AI search (AEO). Model-agnostic: pass any model from Claude, GPT, Gemini, DeepSeek, Grok, MiniMax, Qwen, Llama, Mistral — provider auto-detected from model name."

# Top-level registry fields (for ClawhHub registry indexing)
homepage: "https://unisai.vercel.app"
repository: "https://github.com/vedantsingh60/seo-optimizer-pro"
source: "included"  # Source code is included in this package
required_env_vars:
  - "ANTHROPIC_API_KEY"   # Required if using Claude models
  - "OPENAI_API_KEY"      # Required if using GPT models
  - "GOOGLE_API_KEY"      # Required if using Gemini models
  - "MISTRAL_API_KEY"     # Required if using Mistral models
  - "DEEPSEEK_API_KEY"    # Required if using DeepSeek models
  - "XAI_API_KEY"         # Required if using Grok/xAI models
  - "MINIMAX_API_KEY"     # Required if using MiniMax models
  - "DASHSCOPE_API_KEY"   # Required if using Qwen/Alibaba models
  - "OPENROUTER_API_KEY"  # Required if using Llama/OpenRouter models
primary_credential: "At least ONE provider API key is required (see required_env_vars)"

# Runtime
runtime: "local"  # Runs locally as a Python module — no hosted backend
execution: "python"

# IP Protection & Source Availability
intellectual_property:
  license: "free-to-use"  # Free to use with source code provided for transparency
  license_file: "LICENSE.md"
  copyright: "© 2026 UnisAI. All rights reserved."
  distribution: "via-clawhub-only"  # Distribute only through ClawhHub registry
  source_code_access: "included"  # Source code included for transparency and trust
  modification: "personal-use-only"  # Users may modify for personal use but not redistribute modifications
  reverse_engineering: "allowed-for-security-audit"  # Allowed for security review

author:
  company: "UnisAI"
  contact: "[REDACTED_SECRET]"
  website: "https://unisai.vercel.app"

category: "seo"
tags:
  - "seo"
  - "content-optimization"
  - "aeo"
  - "ai-search"
  - "copywriting"
  - "readability"
  - "keyword-analysis"
  - "technical-seo"
  - "marketing-tech"
  - "ai-optimization"
  - "seo-tools"
  - "content-analysis"

pricing:
  model: "free"

# Dependencies — must be installed before use
dependencies:
  python: ">=3.9"
  packages:
    - "anthropic>=0.40.0"          # Required ONLY for Claude models
    - "openai>=1.60.0"             # Required ONLY for GPT and Llama (via OpenRouter) models
    - "google-generativeai>=0.8.0" # Required ONLY for Gemini models
    - "mistralai>=1.3.0"           # Required ONLY for Mistral models
  install_all: "pip install anthropic openai google-generativeai mistralai"
  install_selective: |
    # Install ONLY the SDK for your chosen provider:
    pip install anthropic          # Claude
    pip install openai             # GPT, DeepSeek, xAI, MiniMax, Qwen, Llama (OpenAI-compat)
    pip install google-generativeai  # Gemini
    pip install mistralai          # Mistral
  note: "RECOMMENDED: Install only the SDK for the provider you plan to use. DeepSeek, xAI, MiniMax, Qwen, and Llama all use the openai package with a custom base URL."
  requirements_file: "requirements.txt"

security:
  data_retention: "0 days"  # No storage by this skill — all analysis runs in-memory locally
  data_flow: "content-sent-to-chosen-ai-provider"  # Your content is sent to whichever AI provider you select
  third_party_data_sharing: |
    WARNING: This skill sends your content to third-party AI providers (Anthropic, OpenAI, Google, OpenRouter, or Mistral).
    Each provider has their own data retention and privacy policies. Review the provider's terms before sending sensitive content:
    - Anthropic: https://www.anthropic.com/legal/privacy
    - OpenAI: https://openai.com/policies/privacy-policy
    - Google: https://ai.google.dev/gemini-api/terms
    - OpenRouter: https://openrouter.ai/privacy
    - Mistral: https://mistral.ai/terms/
  privacy_recommendation: "Test with non-sensitive sample content first. Do not send confidential data without reviewing the AI provider's data policies."
  api_key_storage: "Environment variables only — never hardcoded or logged"
  network_access: "Required to call chosen AI provider's API"

capabilities:
  functions:
    - name: "analyzeContent"
      description: "Analyze content for SEO optimization opportunities"
      parameters:
        content:
          type: "string"
          description: "HTML or plain text content to analyze"
          required: true
          max_length: 50000
        url:
          type: "string"
          description: "Optional URL for reference"
          required: false
        target_keywords:
          type: "array"
          description: "Target keywords to analyze"
          items:
            type: "string"
          max_items: 20
          required: false

    - name: "generateOptimization"
      description: "Get AI-powered optimization suggestions"
      parameters:
        content:
          type: "string"
          description: "Content to optimize"
          required: true
        model:
          type: "string"
          description: "AI model to use (Claude, GPT-5.2, Gemini, Llama, Mistral)"
          options:
            - "claude-opus-4-6"
            - "claude-sonnet-4-6"
            - "claude-haiku-4-5-20251001"
            - "gpt-5.4"
            - "gpt-5.4-pro"
            - "gpt-5.4-mini"
            - "gpt-5.4-thinking"
            - "gpt-5.2-pro"
            - "gpt-5.2"
            - "gemini-3.1-pro-preview"
            - "gemini-3.1-flash-lite"
            - "gemini-3-flash"
            - "gemini-2.5-pro"
            - "gemini-2.5-flash"
            - "llama-3.3-70b"
            - "mistral-large-latest"
          required: false
        keywords:
          type: "array"
          items:
            type: "string"
          description: "Keywords to focus on"
          required: false

    - name: "getAEORecommendations"
      description: "Get Answer Engine Optimization recommendations for AI search"
      parameters:
        content:
          type: "string"
          description: "Content to analyze for AI search"
          required: true
        model:
          type: "string"
          description: "AI model to use"
          required: false
        keywords:
          type: "array"
          items:
            type: "string"
          description: "Target keywords"
          required: false

# Credentials — at least ONE provider key is required depending on chosen model.
# The skill will raise an error at initialization without the key for the selected provider.
credentials:
  required: true  # At least one provider API key MUST be set
  note: "Exactly one provider API key is required for whichever model you choose."

environment_variables:
  ANTHROPIC_API_KEY:
    description: "Anthropic API key — required for any claude-* model"
    required_for_prefix: "claude-"
  OPENAI_API_KEY:
    description: "OpenAI API key — required for any gpt-*, o1*, o3* model"
    required_for_prefix: "gpt-, o1, o3"
  GOOGLE_API_KEY:
    description: "Google AI API key — required for any gemini-* model"
    required_for_prefix: "gemini-"
  MISTRAL_API_KEY:
    description: "Mistral API key — required for mistral-*, mixtral-*, devstral-*, ministral-* models"
    required_for_prefix: "mistral-, mixtral-, devstral-, ministral-"
  DEEPSEEK_API_KEY:
    description: "DeepSeek API key — required for any deepseek-* model"
    required_for_prefix: "deepseek-"
  XAI_API_KEY:
    description: "xAI API key — required for any grok-* model"
    required_for_prefix: "grok-"
  MINIMAX_API_KEY:
    description: "MiniMax API key — required for minimax* or MiniMax* models"
    required_for_prefix: "minimax, MiniMax"
  DASHSCOPE_API_KEY:
    description: "Alibaba DashScope API key — required for any qwen* model"
    required_for_prefix: "qwen"
  OPENROUTER_API_KEY:
    description: "OpenRouter API key — required for meta-llama/* or llama-* models"
    required_for_prefix: "meta-llama/, llama-"

support:
  support_email: "[REDACTED_SECRET]"
  website: "https://unisai.vercel.app"
  github: "https://github.com/vedantsingh60/seo-optimizer-pro"
  documentation: "See SKILL.md in this package"
  response_time: "Best effort — community supported"

restrictions:
  - "No redistribution outside ClawhHub registry"
  - "No resale or sublicensing"
  - "No trademark usage without permission"
  - "Modifications allowed for personal use only (no redistribution of modified versions)"

changelog:
  "1.0.8":
    - "✨ Updated GPT models to 5.4 series (gpt-5.4, gpt-5.4-pro, gpt-5.4-mini, gpt-5.4-thinking)"
    - "✨ Updated Gemini models to 3.1 series (gemini-3.1-pro-preview, gemini-3.1-flash-lite)"
    - "✨ Updated Claude model options to 4.6 series in manifest"
    - "📦 Bumped version to 1.0.8"
  "1.0.7":
    - "🏗️ Model-agnostic architecture — provider auto-detected from model name prefix, no hardcoded whitelist"
    - "✨ Added DeepSeek (deepseek-chat, deepseek-reasoner), xAI (grok-4-1-fast), MiniMax (MiniMax-M2.1), Qwen (qwen3.5-plus)"
    - "✨ Updated Claude to 4.6 series (claude-opus-4-6, claude-sonnet-4-6)"
    - "✨ Any future model works automatically without code changes — just pass the model ID"
    - "🔧 Simplified _call_ai — all OpenAI-compat providers share one code path"
  "1.0.6":
    - "🔒 Fixed license contradiction — source code IS included for transparency"
    - "🔒 Changed license from 'proprietary' to 'free-to-use' with source included"
    - "🔒 Clarified IP restrictions — modifications allowed for personal use only"
    - "📝 Fixed metadata inconsistency — required_env_vars now accurately reflects code requirements"
    - "⚠️ Added explicit third-party data sharing warnings for AI provider usage"
    - "📦 Updated install instructions to RECOMMEND selective SDK installation (not all)"
    - "📦 Clarified requirements.txt with version pins and usage notes"
    - "🌐 Added GitHub repository and documentation links to support section"
    - "🔧 Updated all version references to 1.0.6 across manifest, LICENSE, SKILL.md"
  "1.0.2":
    - "✨ Multi-model support: Claude, GPT-5.2, Gemini, Llama, Mistral"
    - "✨ Choose your preferred AI model for analysis"
    - "✨ 12 models across 5 providers"
    - "✨ Real provider SDK integration (not mocked)"
    - "✨ Updated to latest 2026 models"
    - "✨ Added requirements.txt / install instructions"
    - "🔧 Fixed credentials metadata consistency"
    - "🔧 Removed non-existent integrations and API endpoints"
  "1.0.0":
    - "✨ Content readability analysis with Flesch-Kincaid scoring"
    - "✨ Keyword density tracking for target keywords"
    - "✨ Technical SEO audit (headings, structure, links)"
    - "✨ AI-powered optimization suggestions"
    - "✨ Answer Engine Optimization (AEO) recommendations"
    - "✨ Real-time impact estimation"

metadata:
  status: "active"
  created_at: "2026-02-02T00:00:00Z"
  updated_at: "2026-04-09T00:00:00Z"
  maturity: "production"
  maintenance: "actively-maintained"
  required_env_vars: "At least ONE of: ANTHROPIC_API_KEY, OPENAI_API_KEY, GOOGLE_API_KEY, OPENROUTER_API_KEY, MISTRAL_API_KEY"
  credentials_note: "Exactly one provider API key is REQUIRED for whichever model you choose. The skill will raise an error at initialization if the key for the selected model is missing. Keys must be set as environment variables."
  data_sharing_notice: "This skill sends your content to third-party AI providers. Review provider privacy policies before sending sensitive content."
  install_recommendation: "Install only the SDK(s) for your chosen provider to minimize dependencies."
  compatibility:
    - "OpenClaw v1.0+"
    - "Claude Code"
    - "ClawhHub v2.0+"
  security_audit: "Source code included for security review and transparency"


Security scan verdicts — ClawScan: suspicious | static analysis: clean | VirusTotal: clean | SkillSpector: suspicious (HIGH)