Skip to content

Bhanunamikaze/Agentic-SEO-Skill

Deterministic LLM-first SEO audits for websites, blog posts, and GitHub repositories. Use this when the user asks to "perform SEO analysis", "run SEO audit", "analyze SEO", "check technical SEO", "review schema", "Core Web Vitals", "E-E-A-T", "hreflang", "GEO", "AEO", or GitHub repository SEO optimization. For full/page/repo audits, run bundled scripts for evidence and return prioritized, confidence-labeled fixes.

FileKindSize
SKILL.mdskill md19.4 KB
scripts/__init__.pyscript34 B
scripts/a11y_seo_checker.pyscript3.4 KB
scripts/ai_crawler_policy_matrix.pyscript2.2 KB
scripts/analyze_visual.pyexecutablescript6.5 KB
scripts/anchor_text_audit.pyscript7.7 KB
scripts/answer_block_scanner.pyscript3.9 KB
scripts/article_seo.pyscript27.1 KB
scripts/audit_runner.pyscript3.1 KB
scripts/broken_links.pyscript8.3 KB
scripts/cache_compression_checker.pyscript6.7 KB
scripts/canonical_checker.pyscript3.4 KB
scripts/capture_screenshot.pyexecutablescript4.4 KB
scripts/citation_readiness.pyscript5.1 KB
scripts/collection_page_checker.pyscript4.2 KB
scripts/competitor_gap.pyscript10.2 KB
scripts/content_decay_detector.pyscript6.2 KB
scripts/content_intent_matcher.pyscript5.4 KB
scripts/crawl_audit.pyscript7.2 KB
scripts/critical_request_chain.pyscript4.8 KB
scripts/duplicate_content.pyscript14.0 KB
scripts/eeat_signal_checker.pyscript5.5 KB
scripts/entity_checker.pyscript19.4 KB
scripts/env_loader.pyscript3.6 KB
scripts/external_link_quality.pyscript6.6 KB
scripts/faceted_nav_audit.pyscript3.3 KB
scripts/fetch_page.pyexecutablescript3.6 KB
scripts/finding_verifier.pyscript4.9 KB
scripts/font_audit.pyscript5.9 KB
scripts/freshness_checker.pyscript6.2 KB
scripts/generate_report.pyscript80.7 KB
scripts/github_api.pyscript12.8 KB
scripts/github_community_health.pyscript8.9 KB
scripts/github_competitor_research.pyscript17.2 KB
scripts/github_readme_lint.pyscript14.9 KB
scripts/github_repo_audit.pyscript21.0 KB
scripts/github_search_benchmark.pyscript7.7 KB
scripts/github_seo_report.pyscript32.0 KB
scripts/github_traffic_archiver.pyscript6.3 KB
scripts/github_weekly_scorecard.pyscript4.4 KB
scripts/gsc_checker.pyscript11.4 KB
scripts/hreflang_checker.pyscript24.2 KB
scripts/hreflang_sitemap_validator.pyscript6.4 KB
scripts/image_inventory.pyscript2.8 KB
scripts/image_weight_audit.pyscript4.8 KB
scripts/indexability_matrix.pyscript3.5 KB
scripts/indexnow_checker.pyscript9.4 KB
scripts/internal_links.pyscript10.5 KB
scripts/javascript_render_audit.pyscript2.9 KB
scripts/lcp_subparts.pyscript7.3 KB
scripts/lib/__init__.pyscript46 B
scripts/lib/safe_http.pyscript6.1 KB
scripts/lighthouse_runner.pyscript6.0 KB
scripts/link_profile.pyscript12.5 KB
scripts/llms_txt_checker.pyscript7.5 KB
scripts/llms_txt_generator.pyscript2.9 KB
scripts/local_seo_checker.pyscript3.7 KB
scripts/log_file_analyzer.pyscript6.0 KB
scripts/mobile_render_checker.pyscript6.9 KB
scripts/orphan_pages_from_sitemap.pyscript6.2 KB
scripts/pagespeed.pyscript12.9 KB
scripts/parse_html.pyexecutablescript12.2 KB
scripts/pre_commit_seo_check.shexecutablescript2.9 KB
scripts/product_schema_checker.pyscript4.9 KB
scripts/readability.pyscript14.5 KB
scripts/redirect_backlink_reclaim.pyscript5.7 KB
scripts/redirect_checker.pyscript6.2 KB
scripts/reference_freshness.pyexecutablescript2.9 KB
scripts/repo_docs_site_checker.pyscript5.7 KB
scripts/repo_file_inventory.pyscript3.6 KB
scripts/repo_release_seo.pyscript6.6 KB
scripts/repo_social_preview_checker.pyscript4.1 KB
scripts/repo_topic_suggester.pyscript6.3 KB
scripts/review_schema_checker.pyscript4.0 KB
scripts/rich_results_guard.pyscript3.4 KB
scripts/robots_checker.pyscript7.2 KB
scripts/robots_path_tester.pyscript1.8 KB
scripts/schema_diff.pyscript3.1 KB
scripts/schema_required_props.pyscript8.1 KB
scripts/schema_template_generator.pyscript5.4 KB
scripts/security_headers.pyscript6.8 KB
scripts/seo_common.pyscript14.1 KB
scripts/sitemap_checker.pyscript6.5 KB
scripts/sitemap_generator.pyscript3.4 KB
scripts/social_meta.pyscript8.7 KB
scripts/third_party_script_audit.pyscript4.7 KB
scripts/topical_cluster_mapper.pyscript6.4 KB
scripts/url_quality.pyscript2.5 KB
scripts/validate_schema.pyexecutablescript4.3 KB
scripts/validate_skill_inventory.pyexecutablescript4.8 KB
scripts/video_schema_checker.pyscript3.6 KB
scripts/visual_regression_snapshot.pyscript5.3 KB
scripts/x_robots_header_checker.pyscript2.0 KB

scripts/redirect_checker.py

View on GitHub
#!/usr/bin/env python3
"""
Check redirect chains for a URL.

Follows the full redirect chain, reports each hop (status + destination),
detects mixed HTTP/HTTPS, redirect loops, and chain length issues.

Usage:
    python redirect_checker.py https://example.com
    python redirect_checker.py https://example.com http://example.com --json
"""

import argparse
import json
import sys
from urllib.parse import urlparse

try:
    import requests
except ImportError:
    print("Error: requests library required. Install with: pip install requests")
    sys.exit(1)

try:
    from lib.safe_http import default_headers, safe_head
except ImportError:
    from scripts.lib.safe_http import default_headers, safe_head


HEADERS = default_headers()


def check_redirects(url: str, max_redirects: int = 10, timeout: int = 10) -> dict:
    """
    Follow and analyze the redirect chain for a URL.

    Args:
        url: URL to check
        max_redirects: Maximum redirects to follow
        timeout: Request timeout in seconds

    Returns:
        Dictionary with redirect chain analysis
    """
    parsed = urlparse(url)
    if not parsed.scheme:
        url = f"https://{url}"

    result = {
        "url": url,
        "final_url": None,
        "chain": [],
        "total_hops": 0,
        "total_time_ms": 0,
        "has_loop": False,
        "has_mixed_protocol": False,
        "issues": [],
        "error": None,
    }

    seen = set()
    current = url

    try:
        for i in range(max_redirects + 1):
            if current in seen:
                result["has_loop"] = True
                result["issues"].append(f"🔴 Redirect loop detected at: {current}")
                break
            seen.add(current)

            resp = safe_head(current, timeout=timeout, headers=HEADERS,
                             allow_redirects=False)

            hop = {
                "step": i + 1,
                "url": current,
                "status": resp.status_code,
                "time_ms": round(resp.elapsed.total_seconds() * 1000),
            }

            if resp.status_code in (301, 302, 303, 307, 308):
                location = resp.headers.get("Location", "")
                if not location:
                    hop["error"] = "Redirect with no Location header"
                    result["chain"].append(hop)
                    result["issues"].append(f"🔴 Redirect at step {i+1} has no Location header")
                    break

                # Resolve relative URLs
                if not urlparse(location).scheme:
                    from urllib.parse import urljoin
                    location = urljoin(current, location)

                hop["redirect_to"] = location
                hop["redirect_type"] = {
                    301: "permanent (301)",
                    302: "temporary (302)",
                    303: "see other (303)",
                    307: "temporary (307)",
                    308: "permanent (308)",
                }.get(resp.status_code, f"unknown ({resp.status_code})")

                result["chain"].append(hop)
                result["total_time_ms"] += hop["time_ms"]
                current = location
            else:
                # Final destination
                hop["final"] = True
                result["chain"].append(hop)
                result["final_url"] = current
                result["total_time_ms"] += hop["time_ms"]
                break
        else:
            result["issues"].append(f"🔴 Too many redirects (>{max_redirects})")

    except requests.exceptions.RequestException as e:
        result["error"] = str(e)

    result["total_hops"] = max(0, len(result["chain"]) - 1)

    # Check for mixed protocol
    protocols = set()
    for hop in result["chain"]:
        protocols.add(urlparse(hop["url"]).scheme)
    if "http" in protocols and "https" in protocols:
        result["has_mixed_protocol"] = True
        result["issues"].append("⚠️ Mixed HTTP/HTTPS in redirect chain")

    # Check chain length
    if result["total_hops"] > 2:
        result["issues"].append(
            f"🔴 Long redirect chain ({result['total_hops']} hops) — degrades crawl efficiency"
        )
    elif result["total_hops"] > 1:
        result["issues"].append(
            f"⚠️ Redirect chain has {result['total_hops']} hops — aim for max 1"
        )

    # Check for 302 where 301 should be used
    for hop in result["chain"]:
        if hop["status"] == 302:
            result["issues"].append(
                f"⚠️ Temporary redirect (302) at step {hop['step']} — "
                f"use 301 for permanent moves to preserve link equity"
            )

    return result


def main():
    parser = argparse.ArgumentParser(description="Check redirect chains")
    parser.add_argument("urls", nargs="+", help="URL(s) to check")
    parser.add_argument("--json", "-j", action="store_true", help="Output as JSON")

    args = parser.parse_args()

    results = []
    for url in args.urls:
        results.append(check_redirects(url))

    if args.json:
        output = results if len(results) > 1 else results[0]
        print(json.dumps(output, indent=2))
        return

    for result in results:
        if result["error"]:
            print(f"Error checking {result['url']}: {result['error']}")
            continue

        print(f"Redirect Chain — {result['url']}")
        print("=" * 50)

        if not result["chain"]:
            print("  No response received")
            continue

        for hop in result["chain"]:
            status = hop["status"]
            time_ms = hop["time_ms"]

            if hop.get("final"):
                icon = "✅" if 200 <= status < 300 else "🔴"
                print(f"  {icon} [{status}] {hop['url']} ({time_ms}ms) — FINAL")
            else:
                redirect_type = hop.get("redirect_type", "")
                print(f"  ↪️ [{status}] {hop['url']} ({time_ms}ms)")
                print(f"       → {hop.get('redirect_to', '?')} ({redirect_type})")

        print(f"\nTotal hops: {result['total_hops']} | Total time: {result['total_time_ms']}ms")

        if result["issues"]:
            print(f"\nIssues:")
            for issue in result["issues"]:
                print(f"  {issue}")
        print()


if __name__ == "__main__":
    main()
rea-analysis-optimizationmorluto/reaOptimize REA providers and shared analysis workflows for agent context, latency, CPU, and memory while preserving correctness and Evidence. Use for analysis bottlenecks and cache or query design; CI/test-suite optimization belongs to rea-ci-tests-audit.Stars: 471kUpdated Claude CodeCodexVerifiedInstall
rea-ci-tests-auditmorluto/reaAudit REA CI and test suites for correctness, fixture drift, false passes, and measured performance; use for suite or workflow investigations and efficiency changes, rather than ordinary feature testing or a single test failure.Stars: 471kUpdated Claude CodeCodexVerifiedInstall
rea-tool-designmorluto/reaAudit, investigate, design, or change REA investigation tools, CLI/MCP contracts, provider capabilities, and Evidence semantics.Stars: 471kUpdated Claude CodeCodexVerifiedInstall
ponytail-auditDietrichGebert/ponytailQuality audit of the whole repo: bugs, security, real load, missing tests, speed, and what to delete. Most important first.Stars: 194kUpdated Claude CodeCodexVerifiedInstall