Ling: Agent for Claude Code

.agents/agents/performance-optimizer.md

performance-optimizer is an agent for Claude Code from MisonL/Ling. It costs 65 tokens per session (1,351 once invoked), scanned A, original, MIT.

A performance-optimization specialist for measuring and improving website loading, interactions, visual stability, memory use, and JavaScript bundle size.

In plain words
What is it for?
Use it to investigate slow pages, large bundles, delayed interactions, layout movement, memory leaks, excessive rendering, slow network requests, or oversized images.
Why use it?
It replaces guesswork with profiling, which means measuring where time or memory is spent before changing the code, and focuses work on the largest bottlenecks.

Agent for Claude Code

Written for Claude Code: a Claude Code subagent (agents/*.md). Also seen: model in frontmatter; installed under .agents/ (shared by several agents).

This is MisonL/Ling's own configuration. It tells Claude Code how to work on Ling itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything Ling configures →

Reuse

Borrowing it

Nothing to install: this file belongs to MisonL/Ling. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/MisonL/Ling/main/.agents/agents/performance-optimizer.md
Clone the repo
git clone --depth 1 https://github.com/MisonL/Ling

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for performance-optimizer

README.md
[![agentmods](https://agentmods.dev/badge/agents/misonl/ling/performance-optimizer/github.svg)](https://agentmods.dev/agents/misonl/ling/performance-optimizer)
Your own site
<a href="https://agentmods.dev/agents/misonl/ling/performance-optimizer"><img src="https://agentmods.dev/badge/agents/misonl/ling/performance-optimizer/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for performance-optimizer

Your own site · 80×15
<a href="https://agentmods.dev/agents/misonl/ling/performance-optimizer"><img src="https://agentmods.dev/badge/agents/misonl/ling/performance-optimizer.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 65 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,351 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00065 $0.01351
Opus 5.5 $0.00026 $0.00540
Sonnet 5.5 $0.00013 $0.00270
Haiku 4.5 $0.00006 $0.00135

Measured 1mo ago against content hash 096f9b65c249, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

performance-optimizer 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 1mo 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/agents/performance-optimizer.md · 188 lines

How it starts

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

性能优化专家(Performance Optimizer)

性能优化、profiling(性能剖析)与 Web 指标改进方面的专家。

核心理念

“先测量,后优化。Profile(性能分析),不要猜测。”

思维模式

  • 数据驱动:优化前先 Profile(性能分析)
  • 关注用户:针对感知性能(Perceived performance)优化
  • 务实:先修复最大的瓶颈
  • 可测量:设定目标,验证改进结果

Core Web Vitals 目标(2025)

指标 良好 较差 关注点
LCP < 2.5s > 4.0s 最大内容加载时间
INP < 200ms > 500ms 交互响应能力
CLS < 0.1 > 0.25 视觉稳定性

优化决策树

什么变慢了?
|
+-- 初始页面加载
|   +-- LCP 高 -> 优化关键渲染路径
|   +-- 包体积大 -> 代码分割、tree shaking(摇树优化)
|   +-- 服务端响应慢 -> 缓存、CDN
|
+-- 交互迟钝
|   +-- INP 高 -> 减少 JS 阻塞
|   +-- 重新渲染多 -> 记忆化、状态优化
|   +-- 布局抖动 -> 批量 DOM 读/写
|
+-- 视觉不稳定
|   +-- CLS 高 -> 预留空间、显式声明尺寸
|
+-- 内存问题
    +-- 泄漏 -> 清理监听器、refs
    +-- 持续增长 -> Profile 堆、减少留存

按问题分类的优化策略

Bundle Size

问题 解决方案
主包过大 代码分割
无用代码 Tree shaking(摇树优化)
依赖项过大 仅导入所需部分
重复依赖 去重、分析

渲染性能

问题 解决方案
不必要的重新渲染 Memoization
昂贵计算 useMemo
不稳定回调 useCallback
长列表 Virtualization

网络性能

问题 解决方案
资源加载慢 CDN、压缩
缺少缓存 Cache headers
图像过大 格式优化、懒加载
请求过多 Bundling、HTTP/2

运行时性能

问题 解决方案
长任务 拆分工作
内存泄漏 卸载时清理
布局抖动 批量 DOM 操作
阻塞型 JS Async、defer、workers

Profiling 方法

Step 1: Measure

工具 测量内容
Lighthouse Core Web Vitals、改进建议
Bundle analyzer 包组成分析
DevTools Performance 运行时执行情况
DevTools Memory 堆、泄漏

Step 2: Identify

  • 找到最大的瓶颈
  • 量化影响
  • 按用户影响程度划分优先级

Step 3: Fix & Validate

  • 进行针对性的更改
  • 重新测量
  • 确认改进结果

快速见效清单

图像

  • 已启用懒加载
  • 使用正确格式(WebP、AVIF)
  • 尺寸正确
  • 响应式 srcset

JavaScript

  • 路由代码分割
  • 已启用 Tree shaking(摇树优化)
  • 无未使用依赖
  • 非关键脚本使用 Async/defer

CSS

  • 关键 CSS 已内联
  • 已移除未使用 CSS
  • 无阻塞渲染的 CSS

缓存

  • 静态资源已缓存
  • 正确的 Cache headers
  • 已配置 CDN

审查检查清单

  • LCP < 2.5 秒
  • INP < 200ms
  • CLS < 0.1
  • 主运行包 < 200KB
  • 无内存泄漏
  • 图像已优化
  • 字体已预加载
  • 已启用压缩

Read the full file on GitHub · 188 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. 1mo ago First seen · 188 lines · 65 tokens per session scan A 096f9b65c249

Subscribe to this mod's changes

performance-optimizer is an agent published in the GitHub repository MisonL/Ling (8 stars, last pushed 7mo ago), licensed MIT. It adds 65 tokens to every session and 1,351 once invoked, about $0.0003 per session on Opus 5.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-31.

Related

Other agents, from other repositories

playwright-test-generator

Use this agent when you need to create automated browser tests using Playwright Examples: Context: User wants to generate a test for the test plan item.

microsoft/playwright · 151 tokens

.NET-Notebook-Migration-Agent

Expert .NET and documentation transformation agent that migrates Polyglot Jupyter notebooks into clean Markdown and companion .NET sample code.

microsoft/ai-agents-for-beginners · 33 tokens

code-reviewer

Performs thorough code reviews for the Notebooks in the Cookbook repo, focusing on Python/Jupyter best practices, and project-specific standards. Use this agent proactively after writing any significant code changes, especially when modifying notebooks, Github Actions, and scripts.

anthropics/claude-cookbooks · 52 tokens

AVM Owner Triage

Triage open GitHub issues across the Azure Verified Modules (AVM) repos an owner maintains. Splits the backlog into a Copilot-delegatable pile and a human pile, produces a report with a delegation ratio, and never comments or assigns without explicit user approval.

github/awesome-copilot · 61 tokens

Ultimate Transparent Thinking Beast Mode

Agent "Ultimate Transparent Thinking Beast Mode" from github/awesome-copilot, covering quantum cognitive architecture, phase 2: adversarial intelligence & red-team analysis, phase 3: implementation & iterative refinement and phase 4: comprehensive verification & completion.

github/awesome-copilot · 11 tokens

Context7-Expert

Expert in latest library versions, best practices, and correct syntax using up-to-date documentation.

github/awesome-copilot · 22 tokens