PerfGraph AGENTS.md

An instruction file for PerfGraph, a command-line tool that measures real browser performance and produces a structured report. It explains how coding agents should run it and read its results.

In plain words
What is it for?
It helps analyze a website URL, collect browser data, inspect performance issues and causal chains, and use PerfGraph through its command line or MCP server.
Why use it?
It gives agents a defined process for turning browser measurements into identified problems, causes, and prioritized fixes.

Instructions file for CodexOpenCode

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add instructions/be1zebub/perfgraph/agents-md
Clone the repo
git clone --depth 1 https://github.com/Be1zebub/PerfGraph

Made for: Codex, OpenCode.

Per session 915 This file is loaded in full into every session.
When invoked 915 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00915 $0.00915
Opus 5 $0.00458 $0.00458
Sonnet 5 $0.00183 $0.00183
Haiku 4.5 $0.00092 $0.00092

Measured 2d ago against content hash 311d6855d470, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

PerfGraph AGENTS.md scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

AGENTS.md · 99 lines

How it starts

The opening of the file, as written. The whole thing — 99 lines — stays where its author put it; the contents beside it link to each section on GitHub.

PerfGraph — AI Agent Instructions

This file tells AI coding agents (Claude, ChatGPT, Copilot, etc.) how to work with PerfGraph.

What PerfGraph is

A CLI tool that collects real browser performance data via CDP, runs it through a 5-stage pipeline, and produces a structured JSON report with causal chains and prioritized fixes. Designed to be consumed by AI agents.

collect → normalize → extract → analyze → report

How AI agents should use PerfGraph

Quick entry point

npx perfgraph run --url https://example.com --pretty

This runs the full pipeline. The output is a report.json with:

  • summary.scoregood / moderate / poor
  • issues[] — each with severity, confidence, metric value, threshold, remediation
  • chains[] — causal degradation paths from root cause to user-facing impact
  • recommendations[] — prioritized, with evidence and expected impact

MCP mode (for AI agents with MCP support)

perfgraph mcp

Starts an MCP stdio server. Agents can call perfgraph_analyze with a URL and get structured results back. The response includes paths to:

File When to read
insights.json Read first. Agent-optimized ~5-15 KB summary: Lighthouse scores, LCP element selector, render-blocking URLs, critical path depth
report.json Read for causal chains and prioritized recommendations
manifest.json File index with descriptions. Only needed if you want raw data
lighthouse.json / trace.json Deep dives only — these are large

Workflow for agents

  1. Call perfgraph_analyze or run perfgraph run --url ... --pretty
  2. Read insights.json for the quick picture
  3. Read report.json for causal analysis and prioritized fixes
  4. Only open raw files (lighthouse.json, trace.json, network.json) when you need specifics not covered by insights

Diagnostics categories

Category What it detects
LCP Large Contentful Paint, TTFB, render-blocking resources
JavaScript Long tasks, Total Blocking Time, heavy execution, unused code
Network Request chains, bandwidth bottlenecks, waterfall depth
Layout Layout shifts (CLS), DOM size, forced reflows
Third-party Overhead from embedded scripts, tracking pixels, widgets

Read the full file on GitHub · 99 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 99 lines · 915 tokens per session scan A 311d6855d470

Subscribe to this mod's changes

PerfGraph AGENTS.md is an instructions file published in the GitHub repository Be1zebub/PerfGraph (11 stars, last pushed 3d ago), licensed MIT. It adds 915 tokens to every session, about $0.0046 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.