Skip to content

Adonis0123/adonis-skills / skills/web-performance-audit

web-performance-audit

Verified

Run a read-only, evidence-led runtime performance audit of a real web application, especially authenticated editors, dashboards, media tools, long-lived SPAs, and pages with many tabs or states. Use when the user asks to profile slowness, inspect every tab, use Chrome DevTools or Chrome Recorder, run React Scan, compare normal and throttled interactions, find memory or rendering risks, or produce a performance report and recommendations without changing code. Discover available browser capabilities, guide the user through official installation when an important capability is missing, route to validated fallbacks, isolate measurement pollution, and distinguish measured facts from screen observations, hypotheses, and unverified paths. Do not use for a Lighthouse-only SEO/accessibility audit, tool installation with no audit goal, or when the user already wants a specific optimization implemented.

scripts/test_public_portability.py

View on GitHub
#!/usr/bin/env python3
"""Public-package portability and capability-bootstrap regression tests."""

from __future__ import annotations

import re
import unittest
from pathlib import Path


SKILL_DIR = Path(__file__).resolve().parents[1]
TEXT_SUFFIXES = {".md", ".json", ".yaml", ".yml", ".py"}


def public_text() -> str:
    chunks: list[str] = []
    current_test = Path(__file__).resolve()
    for path in sorted(SKILL_DIR.rglob("*")):
        if not path.is_file() or path.suffix not in TEXT_SUFFIXES:
            continue
        if path.resolve() == current_test or "__pycache__" in path.parts:
            continue
        chunks.append(f"\nFILE:{path.relative_to(SKILL_DIR)}\n")
        chunks.append(path.read_text(encoding="utf-8"))
    return "".join(chunks)


class PublicPortabilityTests(unittest.TestCase):
    def test_public_package_has_no_machine_or_product_fingerprints(self) -> None:
        text = public_text()
        forbidden = {
            "macOS user directory": r"/Users/[A-Za-z0-9._-]+/",
            "Linux user directory": r"/home/[A-Za-z0-9._-]+/",
            "Windows user directory": r"[A-Za-z]:\\Users\\[^\\]+\\",
            "fixed remote-debugging port": r"(?:127\.0\.0\.1|localhost):9222",
            "private project marker": r"(?i)(?:ai-video-collection|pollo\.ai|/director/|cmta[0-9a-z]+)",
            "source-audit duration": r"9:40\.68",
            "legacy branded skill name": "co" + r"co-web-performance-audit",
            "legacy branded installer": r"@co" + r"co/skills",
        }
        for label, pattern in forbidden.items():
            with self.subTest(label=label):
                self.assertIsNone(re.search(pattern, text), label)

    def test_bootstrap_covers_install_fallback_authorization_and_acceptance(self) -> None:
        bootstrap = (SKILL_DIR / "references" / "capability-bootstrap.md").read_text(
            encoding="utf-8"
        )
        required = [
            "Chrome DevTools MCP",
            "Playwright MCP",
            "Computer Use",
            "Chrome Recorder",
            "React Scan",
            "Fallback available now",
            "Authorization required: yes",
            "discovery, handshake, and one harmless real call",
            "https://github.com/ChromeDevTools/chrome-devtools-mcp",
            "https://cursor.com/docs/cli/mcp",
            "https://playwright.dev/mcp/",
            "https://developer.chrome.com/docs/devtools/recorder/",
            "https://github.com/aidenybai/react-scan",
        ]
        for phrase in required:
            with self.subTest(phrase=phrase):
                self.assertIn(phrase, bootstrap)

    def test_cursor_cli_contract_uses_verified_read_only_route(self) -> None:
        compatibility = (
            SKILL_DIR / "references" / "cross-agent-compatibility.md"
        ).read_text(encoding="utf-8")
        acceptance = (
            SKILL_DIR / "evals" / "host-acceptance-2026-08-30.md"
        ).read_text(encoding="utf-8")
        required_compatibility = [
            "Cursor CLI",
            ".agents/skills/",
            "/web-performance-audit",
            "--mode ask",
            "exit code alone is not acceptance proof",
            "https://cursor.com/docs/skills",
        ]
        for phrase in required_compatibility:
            with self.subTest(phrase=phrase):
                self.assertIn(phrase, compatibility)
        self.assertIn("cursor-agent 2026.08.25-3e8eec8", acceptance)
        self.assertIn("16/16 blocked coverage", acceptance)
        self.assertIn("not accepted", acceptance.lower())

    def test_core_skill_routes_missing_capabilities_without_silent_install(self) -> None:
        skill = (SKILL_DIR / "SKILL.md").read_text(encoding="utf-8")
        self.assertIn("capability-bootstrap.md", skill)
        self.assertIn("Guide installation; never install silently", skill)
        self.assertIn("discovery, handshake, and one real harmless call", skill)
        self.assertNotIn("/tmp/web-performance-audit", skill)


if __name__ == "__main__":
    unittest.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