### Project setup commands Source: https://github.com/be1zebub/perfgraph/blob/master/CONTRIBUTING.md Standard commands to install dependencies, build the project, and run tests. ```bash npm install npm run build npm test ``` -------------------------------- ### Start PerfGraph MCP server Source: https://github.com/be1zebub/perfgraph/blob/master/AGENTS.md Initializes the MCP stdio server to allow AI agents to call the perfgraph_analyze tool. ```bash perfgraph mcp ``` -------------------------------- ### Development Commands Source: https://github.com/be1zebub/perfgraph/blob/master/README.md Standard npm scripts for managing the development lifecycle, including installation, compilation, and testing. ```bash npm install npm run build # compile TypeScript npm run typecheck # check types only npm test # run tests npm run test:watch # tests in watch mode npm run dev # tsx watch — no build step ``` -------------------------------- ### Install PerfGraph globally Source: https://github.com/be1zebub/perfgraph/blob/master/README.md Install the package globally using npm. ```bash npm install -g perfgraph ``` -------------------------------- ### Run PerfGraph without installation Source: https://github.com/be1zebub/perfgraph/blob/master/README.md Use npx to execute the CLI without a global installation. ```bash npx perfgraph --help ``` -------------------------------- ### perfgraph mcp Source: https://github.com/be1zebub/perfgraph/blob/master/README.md Starts an MCP stdio server for AI agent integration. ```APIDOC ## perfgraph mcp ### Description Starts an MCP stdio server for AI agent integration. No flags required. ``` -------------------------------- ### Add PerfGraph MCP Server via Prompt Source: https://github.com/be1zebub/perfgraph/blob/master/README.md Instructions for adding the PerfGraph MCP server to an AI agent using a prompt. ```text Add the PerfGraph MCP server to my configuration. Run: npx -y perfgraph@latest mcp This is a stdio MCP server. Add it as a local MCP server with command: npx -y perfgraph@latest mcp The server exposes a perfgraph_analyze tool that takes a URL and returns a full performance report. ``` -------------------------------- ### Execute step-by-step performance analysis Source: https://github.com/be1zebub/perfgraph/blob/master/README.md Perform data collection, normalization, extraction, and reporting as separate manual steps. ```bash # 1. Collect data perfgraph collect --url https://example.com --output ./results # 2. Normalize → Extract → Report perfgraph normalize ./results/perfgraph_example_20260609_120000 --output ir.json perfgraph extract ir.json --output features.json perfgraph report features.json --output report.json --pretty ``` -------------------------------- ### View perfgraph run options Source: https://github.com/be1zebub/perfgraph/blob/master/README.md List available flags for the full pipeline command. ```text --url Required. Target URL to analyze. --output Output directory (default: ./perfgraph-output). --runs Number of collection runs (default: 1). --pretty Pretty-print the final report JSON. --device Mobile emulation (e.g. "iPhone 13"). --no-lighthouse Skip Lighthouse collection. --no-coverage Skip JS/CSS coverage. --no-console Skip console log capture. --no-dom Skip DOM snapshot. ``` -------------------------------- ### Execute full performance pipeline Source: https://github.com/be1zebub/perfgraph/blob/master/README.md Run the complete collection and reporting pipeline in a single command. ```bash perfgraph run --url https://example.com --pretty ``` -------------------------------- ### PerfGraph development commands Source: https://github.com/be1zebub/perfgraph/blob/master/AGENTS.md Standard npm scripts for building, testing, and developing the PerfGraph project. ```bash npm install # install deps npm run build # compile TypeScript npm run typecheck # type-check only npm test # run tests npm run dev # tsx watch mode ``` -------------------------------- ### View perfgraph normalize options Source: https://github.com/be1zebub/perfgraph/blob/master/README.md List available flags for converting raw data into an IRBundle. ```text --output, -o Write to file (default: stdout). --pretty Pretty-print JSON. ``` -------------------------------- ### perfgraph run Source: https://github.com/be1zebub/perfgraph/blob/master/README.md Executes the full performance analysis pipeline in a single command. ```APIDOC ## perfgraph run ### Description Executes the full performance analysis pipeline, including data collection, normalization, extraction, and reporting. ### Parameters - **--url** (string) - Required - Target URL to analyze. - **--output** (string) - Optional - Output directory (default: ./perfgraph-output). - **--runs** (number) - Optional - Number of collection runs (default: 1). - **--pretty** (boolean) - Optional - Pretty-print the final report JSON. - **--device** (string) - Optional - Mobile emulation (e.g., "iPhone 13"). - **--no-lighthouse** (boolean) - Optional - Skip Lighthouse collection. - **--no-coverage** (boolean) - Optional - Skip JS/CSS coverage. - **--no-console** (boolean) - Optional - Skip console log capture. - **--no-dom** (boolean) - Optional - Skip DOM snapshot. ``` -------------------------------- ### View perfgraph analyze options Source: https://github.com/be1zebub/perfgraph/blob/master/README.md List available flags for building a degradation graph from feature sets. ```text --input, -i Path to FeatureSet JSON (alternative to positional). --output, -o Write to file (default: stdout). --pretty Pretty-print JSON. ``` -------------------------------- ### Run PerfGraph pipeline Source: https://github.com/be1zebub/perfgraph/blob/master/AGENTS.md Executes the full performance analysis pipeline for a specified URL and outputs a pretty-printed report. ```bash npx perfgraph run --url https://example.com --pretty ``` -------------------------------- ### OpenCode MCP Configuration Source: https://github.com/be1zebub/perfgraph/blob/master/README.md JSON configuration for adding PerfGraph to OpenCode. ```json { "mcp": { "perfgraph": { "type": "local", "command": ["npx", "-y", "perfgraph@latest", "mcp"], "enabled": true } } } ``` -------------------------------- ### Cursor MCP Configuration Source: https://github.com/be1zebub/perfgraph/blob/master/README.md JSON configuration for adding PerfGraph to Cursor. ```json { "mcpServers": { "perfgraph": { "command": "npx", "args": ["-y", "perfgraph@latest", "mcp"] } } } ``` -------------------------------- ### Claude MCP Configuration Source: https://github.com/be1zebub/perfgraph/blob/master/README.md Bash command to create a dedicated MCP server configuration file for Claude. ```bash # create the file if it doesn't exist cat > ~/.claude/mcp_servers.json << 'EOF' { "perfgraph": { "command": "npx", "args": ["-y", "perfgraph@latest", "mcp"] } } EOF ``` -------------------------------- ### Codex MCP Configuration Source: https://github.com/be1zebub/perfgraph/blob/master/README.md Configuration snippet for integrating PerfGraph into Codex. ```toml [mcp_servers.perfgraph] command = "npx" args = ["-y", "perfgraph@latest", "mcp"] startup_timeout_sec = 15 ``` -------------------------------- ### View perfgraph extract options Source: https://github.com/be1zebub/perfgraph/blob/master/README.md List available flags for computing diagnostic features from an IR bundle. ```text --input, -i Path to IR JSON (alternative to positional). --output, -o Write to file (default: stdout). --pretty Pretty-print JSON. ``` -------------------------------- ### Project directory structure Source: https://github.com/be1zebub/perfgraph/blob/master/CONTRIBUTING.md Overview of the source code organization for the perfgraph project. ```text src/ ├── index.ts CLI entry — lazy-loads everything else ├── collect/ Phase 1: browser data collection (Playwright + CDP) ├── normalize/ Phase 2: raw data → validated IRBundle ├── extract/ Phase 3: IRBundle → diagnostic FeatureSet ├── causal/ Phase 4: FeatureSet → causal degradation graph │ └── rules/ 30+ causal inference rules ├── report/ Phase 5: graph → JSON report with remediations ├── distill/ Agent-optimized summary layer (insights.json) ├── mcp/ MCP stdio server for AI agent integration ├── cli/ CLI command implementations ├── output/ Shared output writer helpers └── shared/ Utilities, types, fs helpers ``` -------------------------------- ### PerfGraph pipeline visualization Source: https://github.com/be1zebub/perfgraph/blob/master/AGENTS.md The 5-stage pipeline process used by PerfGraph to collect and analyze browser performance data. ```text collect → normalize → extract → analyze → report ``` -------------------------------- ### perfgraph analyze Source: https://github.com/be1zebub/perfgraph/blob/master/README.md Applies causal rules and builds a degradation graph. ```APIDOC ## perfgraph analyze ### Description Applies causal rules and builds a degradation graph from a FeatureSet JSON. ### Parameters - **--input, -i** (string) - Optional - Path to FeatureSet JSON (alternative to positional). - **--output, -o** (string) - Optional - Write to file (default: stdout). - **--pretty** (boolean) - Optional - Pretty-print JSON. ``` -------------------------------- ### perfgraph collect Source: https://github.com/be1zebub/perfgraph/blob/master/README.md Captures raw performance data from a specified URL. ```APIDOC ## perfgraph collect ### Description Captures performance data from a URL. Supports the same flags as the 'run' command. ``` -------------------------------- ### perfgraph JSON Report Structure Source: https://github.com/be1zebub/perfgraph/blob/master/README.md The report is a single JSON file containing metadata, summary scores, identified issues, causal chains, and optimization recommendations. ```jsonc { "meta": { "url": "https://example.com", "analyzedAt": "2026-06-09T19:15:19.000Z", "reportVersion": "1.0.0", "featureCount": 7, "graphNodeCount": 24, "graphEdgeCount": 31, "ruleCount": 32, }, "summary": { "score": "moderate", // "good" | "moderate" | "poor" "criticalIssues": 2, "warnings": 5, "infos": 3, "topIssues": [ { "id": "js-long-task", "label": "Long task", "severity": "critical", "confidence": "strong", }, ], }, "issues": [ { "id": "lcp-slow", "label": "LCP exceeds 2.5s threshold", "severity": "critical", "value": 4320, "unit": "ms", "threshold": 2500, "confidence": "strong", "remediation": "Optimize largest contentful paint element...", "chainId": "lcp:3", }, ], "chains": [ { "id": "lcp:3", "rootCause": "LCP > 2.5s", "impact": "Poor user experience", "path": [ "TTFB delayed by server response", "Render-blocking stylesheets", "LCP element render delay", ], "length": 3, }, ], "recommendations": [ { "priority": "critical", "category": "LCP", "title": "Optimize Largest Contentful Paint", "action": "Inline critical styles, defer non-critical CSS", "expectedImpact": "Reduces LCP by ~40%", "relatedIssues": ["lcp-slow"], }, ], "features": { /* raw extracted features for cross-referencing */ }, } ``` -------------------------------- ### perfgraph report Source: https://github.com/be1zebub/perfgraph/blob/master/README.md Generates the final performance report. ```APIDOC ## perfgraph report ### Description Generates the final performance report by running the causal engine internally. ### Parameters - **--input, -i** (string) - Optional - Path to FeatureSet JSON (alternative to positional). - **--output, -o** (string) - Optional - Write to file (default: stdout). - **--pretty** (boolean) - Optional - Pretty-print JSON. ``` -------------------------------- ### perfgraph normalize Source: https://github.com/be1zebub/perfgraph/blob/master/README.md Converts raw collected data into a validated IRBundle. ```APIDOC ## perfgraph normalize ### Description Converts raw collected data into a validated IRBundle. Accepts a run directory or a parent directory. ### Parameters - **--output, -o** (string) - Optional - Write to file (default: stdout). - **--pretty** (boolean) - Optional - Pretty-print JSON. ``` -------------------------------- ### perfgraph extract Source: https://github.com/be1zebub/perfgraph/blob/master/README.md Computes diagnostic features from a normalized IR bundle. ```APIDOC ## perfgraph extract ### Description Computes diagnostic features from a normalized IR bundle. ### Parameters - **--input, -i** (string) - Optional - Path to IR JSON (alternative to positional). - **--output, -o** (string) - Optional - Write to file (default: stdout). - **--pretty** (boolean) - Optional - Pretty-print JSON. ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.