Agent skill

Optimize

by arul28 in arul28/ADE

Profile a large ADE feature end-to-end, add temporary or permanent telemetry, run the Electron app, find real CPU/memory/IPC/render hot paths, fix them, and verify with stress tests.

AGPL-3.0Auto-check passedTesting & QA

Install Optimize

skills CLI
$ npx skills add arul28/ADE --skill optimize -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install arul28/ADE optimize --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/arul28/ADE.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/optimize .claude/skills/optimize && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
optimize
GitHub stars
113
Token cost
~3.3k tokens
SKILL.md length
1,578 words
Files
1
Skills in repo
30
Repo updated
First seen
Licence
AGPL-3.0

At a glance

Profile a large ADE feature end-to-end, add temporary or permanent telemetry, run the Electron app, find real CPU/memory/IPC/render hot paths, fix them, and verify with stress tests.

  • Works in 7 steps: Understand the surface → Establish observability → Run the app and attach to the real… → …
  • Tasks that involve Load testing
  • SKILL.md covers Operating mode, Phase 0: Understand the surface, Phase 1: Establish observability and Phase 2: Run the app and…, plus 5 more sections
  • Calls npm, git and node

What it does

Optimize is an agent skill from arul28/ADE. Profile a large ADE feature end-to-end, add temporary or permanent telemetry, run the Electron app, find real CPU/memory/IPC/render hot paths, fix them, and verify with stress tests.

Its SKILL.md is about 3.3k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Testing & QA, covering Load testing. It works with Electron. The licence is AGPL-3.0.

When your agent uses it

  • Tasks that involve Load testing

Example prompts

  • “/optimize”

Workflow steps

7 steps, taken from the step headings in SKILL.md.

  1. Understand the surface
  2. Establish observability
  3. Run the app and attach to the real Electron surface
  4. Navigate and profile the feature
  5. Stress the real workflow
  6. Fix the highest-impact causes
  7. Verify

What it can do on your machine

Read from SKILL.md and the folder at commit 7390d95. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • npm
    • git
    • node

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use npm and git, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Optimize loads about 3.3k tokens when it runs. Until then it costs about 48 tokens; SKILL.md has 1,578 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~48
When it runs · the whole SKILL.md, loaded when a task matches
~3.3k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from arul28/ADE at commit 7390d95, republished under its AGPL-3.0 licence (© arul28). 1,578 words, ~3,275 tokens.

Download SKILL.mdSave it as .claude/skills/optimize/SKILL.md (or your agent's skills folder).
name
optimize
description
Profile a large ADE feature end-to-end, add temporary or permanent telemetry, run the Electron app, find real CPU/memory/IPC/render hot paths, fix them, and verify with stress tests.

/optimize — Performance Steward

You are the performance steward for ADE. Use this after a large feature lands, when the app works but might be too heavy for normal laptops.

Argument: $ARGUMENTS — optional feature or surface hint, for example /optimize Work and Lanes, /optimize iOS simulator drawer, or /optimize graph route.

Your job is not to make the app feel stripped down. Preserve the product's intent and interaction quality while removing waste, polling, avoidable rendering, memory spikes, runaway logs, redundant IPC, and expensive cold-start behavior.


Operating mode

Run autonomously. Do not stop at a plan. Read, instrument, run, measure, fix, and verify. Ask the user only if a required action would spend money, use an expensive model, destroy data, or cannot be inferred from repo context.

Be concrete. Every optimization should be backed by at least one of:

  • A live log finding.
  • Process CPU/RSS/GPU evidence.
  • A renderer/DOM/animation finding.
  • A repeated IPC or polling pattern.
  • A testable code path that clearly does unnecessary work.

Do not make speculative cleanup the main result. If you cannot reproduce a suspected issue, leave a short note and move to the next measurable surface.

Every optimization must hold on Windows too. Parity is a default requirement for all new code, and perf work is where it quietly breaks: caching a path as a raw string then comparing it with ===, replacing a process-tree kill with a cheaper child.kill(), dropping a windowsHide: true spawn option, removing a file-lock retry loop as "dead code", or reusing a PID as identity. Check any such change against ../quality/references/windows-quirks.md first. A measurement taken only on macOS does not establish that the Windows path is unaffected — say which host produced each number. If a win is achievable on one platform only, keep the other platform's correct path rather than regressing it, and say so in the final report.


Phase 0: Understand the surface

  1. Read the relevant docs before editing:

    • AGENTS.md or the prompt-provided project instructions.
    • docs/ARCHITECTURE.md if the change crosses app/service boundaries.
    • Feature docs under docs/features/** that match $ARGUMENTS.
    • Existing playbooks if the surface involves PRs, lanes, computer use, sync, or release.
  2. Inspect the changed surface:

    • git status --short
    • git diff --stat
    • git diff -- <relevant files>
    • rg for the feature's IPC channels, services, hooks, intervals, observers, animations, and route components.
  3. Identify the likely hot paths:

    • Renderer route mount and tab switches.
    • Work/Lanes session lists and terminal panes.
    • IPC polling and fan-out calls.
    • Main-process services doing filesystem, git, SQLite, model discovery, sync, or embedding work.
    • Hidden drawers or panes that still run effects while closed.
    • Infinite CSS animations, WebGL/canvas surfaces, resize loops, observers, and timers.
    • Startup, project switch, and route navigation cold paths.

Keep a working list of surfaces to test. Prefer a small number of realistic flows over broad shallow poking.


Phase 1: Establish observability

Before making performance edits, make sure the app can tell you what is happening.

  1. Look for existing instrumentation:

    • IPC begin/done/summary logs.
    • Route change logs.
    • Service phase summaries.
    • PTY/session output summaries.
    • Renderer debug logs.
    • Cache hit/miss or model discovery summaries.
  2. If logs are missing, add narrow instrumentation first:

    • For IPC handlers: log channel, duration, slow count, failure count, and top callers when available.
    • For expensive service methods: log phase timings, input size/counts, cache hits, and result counts.
    • For terminal/session output: log chunks, batches, bytes/chars, listener count, active session count.
    • For renderer effects: log route mount/unmount or ready state only when the structural signature changes, not every render.
  3. Instrumentation rules:

    • Summaries beat per-item spam.
    • Redact user prompts, secrets, command input, tokens, and file contents.
    • Add logs behind existing logger/debug patterns.
    • Avoid permanent noisy logs. If a log is only useful during this run, remove it before finishing or gate it behind an existing dev/debug flag.

Phase 2: Run the app and attach to the real Electron surface

Use the local desktop app as the source of truth.

  1. Start the dev app from apps/desktop:
bash
npm run dev
  1. Keep the dev terminal visible. Watch for:

    • dev launcher using http://localhost:5173
    • DevTools listening on ws://127.0.0.1:9222
    • window.loading_url
    • renderer.route_change
    • ipc.invoke.summary
    • Feature-specific summary logs.
  2. Attach to Electron, not Safari:

    • Prefer the Electron app entry when using computer-use.
    • Confirm the window URL contains localhost:5173.
    • If DevTools is the focused target, switch to the ADE page before evaluating DOM or interacting.
  3. If using CDP/agent-browser, target the ADE tab:

bash
agent-browser --cdp 9222 tab
agent-browser --cdp 9222 tab <ADE-tab-index>
  1. Collect baseline process data:
bash
pgrep -fl "Electron . --remote-debugging-port=9222|Electron Helper|vite --port 5173|tsup --watch|esbuild --service"
ps -axo pid,ppid,%cpu,%mem,rss,comm,args

Use process names carefully:

  • Main Electron process: app services, SQLite, IPC handlers.
  • Renderer helper: React route work, DOM rendering, terminal rendering.
  • GPU helper: WebGL/canvas/compositing/animation pressure.
  • Network utility: fetch/WebSocket behavior.

Close extra DevTools targets before trusting memory numbers. DevTools can inflate RSS and CPU.


Phase 3: Navigate and profile the feature

Run realistic flows with logs open.

  1. Sweep relevant tabs/routes:
    • Work
    • Lanes
    • Files
    • Run
    • Graph
    • PRs
    • Review
    • History
    • Automations
    • CTO
    • Settings

If $ARGUMENTS names a surface, spend most time there but still check adjacent routes that stay mounted or subscribe to the same data.

  1. For each route, record:
    • Cold navigation IPC summary.
    • Idle IPC summary after 10-20 seconds.
    • Main/renderer/GPU CPU and RSS.
    • document.getAnimations({ subtree: true }).
    • Number of canvases/WebGL/xterm instances if relevant.
    • Obvious repeated logs, repeated effects, or repeated identical IPC calls.

Useful renderer probes:

js
JSON.stringify({
  href: location.href,
  hidden: document.hidden,
  visibility: document.visibilityState,
  animations: document.getAnimations({ subtree: true }).map((a) => ({
    state: a.playState,
    tag: a.effect?.target?.tagName,
    cls: String(a.effect?.target?.className).slice(0, 160),
    text: a.effect?.target?.textContent?.slice(0, 80),
  })),
  xterms: document.querySelectorAll(".xterm").length,
  xtermCanvases: document.querySelectorAll(".xterm canvas").length,
  canvases: document.querySelectorAll("canvas").length,
})
  1. Watch for these patterns:
    • Same IPC call every second or every render.
    • Multiple identical IPC calls during mount.
    • A route refreshing full decorated snapshots when it only needs counts.
    • Hidden panels polling, probing devices, or reading files.
    • Model discovery or provider probing blocking composer open.
    • Large transcript reads on route mount.
    • Fit/resize loops in terminals.
    • Infinite status animations keeping GPU/compositor awake.
    • WebGL/canvas rendering where DOM/static rendering is enough.
    • Cache misses for data that changes rarely, like project icons, auth status, model inventories, or GitHub status.

Show full SKILL.md (636 more words)Show less

Phase 4: Stress the real workflow

For ADE, always stress Work and Lanes unless the feature is completely unrelated. Most users live there.

  1. Work tab stress:
    • Open or reuse a lane.
    • Create a shell session and run a bounded output stream.
    • Keep the terminal visible so renderer cost is real.

Example shell stress:

bash
node -e 'let i=0; const t=setInterval(()=>{process.stdout.write("ade-stress "+(++i)+" abcdefghijklmnopqrstuvwxyz0123456789\n"); if(i>=3000){clearInterval(t); process.exit(0)}},2)'
  1. Lanes tab stress:

    • Navigate to Lanes while a session is running or immediately after heavy terminal output.
    • Observe whether Lanes does full status snapshots, rebase suggestions, git/diff reads, or presence updates repeatedly.
    • Confirm idle logs calm down.
  2. Chat stress:

    • Prefer a cheap model only: Haiku, a mini Codex/OpenAI model, or the cheapest available local/dev model.
    • Do not use expensive models for performance testing.
    • If cheap model availability cannot be confirmed, use shell/session stress instead and note why.
    • Start multiple chats only when the user explicitly asked for multi-agent load or the feature depends on parallel chats.
  3. Computer-use/iOS/simulator stress:

    • Only stress if the feature touches those panels.
    • Closed drawers should not probe devices, fetch previews, or run screenshot loops.
    • Open drawer, measure, close drawer, measure again.
  4. Memory checks:

    • Use ps/Activity Monitor-style process sampling repeatedly.
    • On macOS, vmmap <pid> -summary can help explain big RSS spikes.
    • Distinguish DevTools memory from actual app memory by closing DevTools targets and rechecking.
  5. Cleanup after stress:

    • Stop or dispose test PTYs/sessions you created.
    • Do not kill user-created sessions unless they are clearly from the test.
    • Stop the dev server before finishing unless the user asked to keep it running.

Phase 5: Fix the highest-impact causes

Prefer fixes in this order:

  1. Remove runaway work:

    • Stop polling when hidden, closed, or unfocused.
    • Deduplicate identical in-flight calls.
    • Debounce or throttle high-frequency refresh.
    • Narrow full refreshes to runtime-only or count-only queries when possible.
  2. Reduce IPC and main-process load:

    • Cache cold data with clear invalidation.
    • Coalesce event streams, especially PTY data.
    • Avoid repeated resize/write/status no-ops.
    • Add service-level phase summaries so future regressions are visible.
  3. Reduce renderer and GPU load:

    • Remove infinite decorative/status animations in persistent chrome.
    • Make expensive renderers opt-in when the default can be cheaper.
    • Do not mount hidden heavy panels if they can lazy-mount.
    • Avoid re-render logs/effects that depend on unstable object identities.
    • Virtualize large lists or cap expensive previews when needed.
  4. Reduce memory pressure:

    • Lazy-load embedding/model/device work.
    • Bound caches and transcripts.
    • Avoid retaining full snapshots or logs in renderer state when summaries are enough.
    • Reuse cached project/model/provider metadata with invalidation.
  5. Preserve UX:

    • Keep controls responsive.
    • Keep clear status feedback, but use static state where animation is not essential.
    • Do not remove core functionality to make numbers look better.
    • If an expensive feature is valuable, make it lazy, cached, or opt-in.

Phase 6: Verify

Run the smallest meaningful checks first, then broaden.

Desktop checks to choose from:

bash
npm --prefix apps/desktop run typecheck
npm --prefix apps/desktop run test -- <targeted test files>
npm --prefix apps/desktop run test
npm --prefix apps/desktop run build
npm --prefix apps/desktop run lint

For IPC/preload/type changes, verify all synced surfaces:

  • main handler
  • shared IPC/type
  • preload exposure
  • renderer caller
  • tests/mocks

For renderer performance changes:

  • Re-run the route sweep.
  • Re-run Work/Lanes stress if touched.
  • Confirm document.getAnimations() does not show persistent unnecessary animations.
  • Confirm process CPU returns near idle after stress.
  • Confirm logs do not show repeated full refreshes or identical calls.

For terminal changes:

  • Verify output is not lost on fast exit.
  • Verify output streams while visible.
  • Verify resize still works.
  • Verify cleanup/dispose flushes pending data.

For cache changes:

  • Verify cold call and warm call behavior.
  • Verify invalidation when the underlying file/config/state changes.
  • Keep cache bounded.

Final report

End with a concise report:

  1. Surfaces tested.
  2. Hot paths found, with concrete measurements or log evidence.
  3. Fixes made.
  4. Before/after observations.
  5. Validation commands and results.
  6. Residual risks or future optimization targets.
  7. Cleanup performed, including whether the dev server is stopped.

If you found a suspected issue but did not fix it, say exactly why: not reproducible, too risky, needs product decision, or requires credentials/model spend.

© arul28, AGPL-3.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .agents/skills/optimize of arul28/ADE.

Open the folder on GitHubat commit 7390d95

Compare with similar skills

Optimize next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Optimize compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Optimize this skillarul28/ADE113—~3.3kAutomated safety check: PassAGPL-3.0
K6 Perf Test Websitegrafana/skills278—~3.3kAutomated safety check: PassApache-2.0
Otel Telemetrygenollygarden/opentelemetry-agent-skills106—~2.2kAutomated safety check: PassApache-2.0
Supercheck Execution Enginesupercheck-io/supercheck215—~1.2kAutomated safety check: PassAGPL-3.0
K6 Cloud Investigate Testgrafana/skills278—~3.8kAutomated safety check: PassApache-2.0
K6 Test Maintenancegrafana/skills278—~2.4kAutomated safety check: PassApache-2.0

Similar skills

  • K6 Perf Test Website

    grafana/skills

    Official

    A skill your agent uses when the user wants to performance-test, load-test, or stress-test a public website end-to-end with k6.

    278 GitHub stars~3.3k tokensUpdated yesterday
    Testing & QAAuto-check passed
  • Otel Telemetrygen

    ollygarden/opentelemetry-agent-skills

    Build safe, version-pinned telemetrygen commands for synthetic OTLP traces, metrics, and logs.

    106 GitHub stars~2.2k tokensUpdated 4 days ago
    Testing & QAAuto-check passed
  • Supercheck Execution Engine

    supercheck-io/supercheck

    Work on Supercheck BullMQ queues, schedulers, capacity management, Playwright or k6 execution, monitors, dynamic locations, cancellation, Redis, Kubernetes Jobs, gVisor, or app-worker execution…

    215 GitHub stars~1.2k tokensUpdated today
    Testing & QAAuto-check passed
  • Official

    Investigate a Grafana Cloud k6 test — describe the script, list run history, identify pass/fail status, pull raw metric time-series and log lines for one or more runs, and (if asked) safely edit the…

    278 GitHub stars~3.8k tokensUpdated yesterday
    Testing & QAAuto-check passed
  • K6 Test Maintenance

    grafana/skills

    Official

    Maintain and improve existing k6 test scripts. An agent skill from grafana/skills.

    278 GitHub stars~2.4k tokensUpdated yesterday
    Testing & QAAuto-check passed
  • K6

    grafana/skills

    Official

    Generate, validate, and review k6 test scripts — load, stress, spike, soak, smoke, breakpoint, functional, and protocol.

    278 GitHub stars~3.1k tokensUpdated yesterday
    Testing & QAAuto-check passed

More from arul28/ADE

All 30 skills in this repo
  • Ade App Control

    arul28/ADE

    A skill your agent uses when you need to run or drive a local Electron/desktop app and capture what it does — launch it or attach to a running renderer, read its logs or answer its terminal prompts…

    113 GitHub stars~3.4k tokensUpdated yesterday
    Auto-check passed
  • Iteratively optimize an ADE tab's CPU/memory/IPC/render performance.

    113 GitHub stars~4.2k tokensUpdated yesterday
    Auto-check passed
  • Ade Browser

    arul28/ADE

    A skill your agent uses for any browser behavior at all — opening a URL, checking a localhost page, clicking or filling a form, logging in, screenshotting, inspecting the DOM, or verifying a page…

    113 GitHub stars~2.8k tokensUpdated yesterday
    Auto-check passed
  • Ade Deeplinks

    arul28/ADE

    A skill your agent uses when an agent needs to mint, share, or open ADE deeplinks (lane, work session, file, commit, artifact, branch, PR, Linear issue) so users — or the agent itself — can jump…

    113 GitHub stars~3.2k tokensUpdated yesterday
    Auto-check passed
  • Ade Harnesses

    arul28/ADE

    A skill your agent uses when you need to run a chat, a CLI session, or a subagent on a specific setup — any model you pay for inside any harness (e.g.

    113 GitHub stars~1.6k tokensUpdated yesterday
    Auto-check passed
  • Ade Lanes Git

    arul28/ADE

    A skill your agent uses when creating, inspecting, syncing, committing, pushing, archiving, or rebasing ADE lanes and lane worktrees through ade lanes and ade git.

    113 GitHub stars~594 tokensUpdated yesterday
    Auto-check passed

Works with

Questions about Optimize

What does Optimize do?

Profile a large ADE feature end-to-end, add temporary or permanent telemetry, run the Electron app, find real CPU/memory/IPC/render hot paths, fix them, and verify with stress tests. Optimize is an agent skill from arul28/ADE. Profile a large ADE feature end-to-end, add temporary or permanent telemetry, run the Electron app, find real CPU/memory/IPC/render hot paths, fix them, and verify with stress tests.

When should I use Optimize?

Optimize fits situations like: tasks that involve Load testing.

How do I install Optimize in Claude Code?

Run `npx skills add arul28/ADE --skill optimize -a claude-code`. Or copy the skill folder (.agents/skills/optimize in arul28/ADE) into .claude/skills/optimize in your project. Claude Code loads it when a task matches its description.

How do I install Optimize in Codex?

Run `npx skills add arul28/ADE --skill optimize -a codex`. Or copy the skill folder (.agents/skills/optimize in arul28/ADE) into .agents/skills/optimize in your project. Codex loads it when a task matches its description.

Can I use Optimize in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add arul28/ADE --skill optimize -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/optimize, .gemini/skills/optimize, .github/skills/optimize and .opencode/skills/optimize in your project.

What does Optimize need to run?

Going by SKILL.md and its folder, Optimize needs the command-line tools its instructions call (npm, git and node).

Does Optimize access the network?

SKILL.md contains no URLs. Its commands use npm and git, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Optimize safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Optimize use?

Optimize is published under the AGPL-3.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Optimize use?

About 3.3k tokens (SKILL.md is roughly 13k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Optimize?

Skills that share tags, products or a category with Optimize: K6 Perf Test Website (grafana/skills, 278 stars), Otel Telemetrygen (ollygarden/opentelemetry-agent-skills, 106 stars), Supercheck Execution Engine (supercheck-io/supercheck, 215 stars) and K6 Cloud Investigate Test (grafana/skills, 278 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Optimize?

arul28 (a GitHub user) maintains it in arul28/ADE, which has 113 GitHub stars. The repository holds 30 skills in this directory. The repository was last updated on October 7, 2026.

Source: arul28/ADE on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.