optimize
Skill5 starsChanged 4 months agoMITView on GitHub
Audits and optimizes frontend, backend, and perceived performance against PRD budgets. This skill should be used when the user asks to "optimize performance", "run a performance audit", "improve page speed", "check Lighthouse scores", "fix Core Web Vitals", "reduce bundle size", "optimize queries", or "improve loading time", or when the transmute-pipeline agent reaches Stage 6C of the pipeline.
76 other projects use a version of this.
Adopted by
Most recently taken up by
- ansvisor/ansvisortheir own version, first seen Nov 8, 2026
- ai-search-guru/getcito-worlds-first-open-source-aio-aeo-or-geo-tooltheir own version, first seen Nov 8, 2026
- Mrbaeksang/skillstheir own version, first seen Nov 8, 2026
- cihantopac/searvextheir own version, first seen Nov 8, 2026
- daintreehq/daintreetheir own version, first seen Nov 5, 2026
- theexperiencecompany/gaiatheir own version, first seen Nov 3, 2026
Used with
Projects with it also use arrange, teach-impeccable and 9 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
HK-hubSkillarrange
Improve layout, spacing, and visual rhythm. Fixes monotonous grids, inconsistent spacing, and weak visual hierarchy. Use when the user mentions layout feeling off, spacing issues, visual hierarchy, crowded UI, alignment problems, or wanting better composition.
Also in 14 projects that use this
HK-hubSkillteach-impeccable
One-time setup that gathers design context for your project and saves it to your AI config file. Run once to establish persistent design guidelines.
Also in 17 projects that use this
zwy123zwySkillnormalize
将用户随意输入的提示词规范化为结构清晰、便于大模型执行的标准化提示词。适用于需要整理、统一提示词格式时调用。
Also in 19 projects that use this
open-coder-aiSkillpolicy-init
Create conformant Chock policy from request. args(request, target_path,
Also in 3 projects that use this
- +7 more from HK-hub
Other versions76 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 76
- Z3Prover/z3★ 13ksame name
- highcharts/highcharts★ 13ksame name
- whitecircle/halo★ 851same name
- hacan359/tonkatsu_box★ 597same name
- talesofai/cohub★ 585same name
- ai-search-guru/getcito-worlds-first-open-source-aio-aeo-or-geo-tool★ 432same name
- nexmoe/DayBee★ 424same name
- nexmoe/eve★ 424same name
- Southclaws/storyden★ 348same name
- 10xChengTu/Mux0★ 337same name
66 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository24 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- templates/CLAUDE.mdCLAUDE.md
- audit-a11ySkill
- audit-completenessSkill
- audit-securitySkill
- brdSkill
- docsSkill
- feedbackSkill
- hardenSkill
- implementSkill
- maintainSkill
- polishSkill
- prdSkill
- prelaunchSkill
- redesignSkill
- refactorSkill
- remediateSkill
- scaffoldSkill
- seed-dataSkill
- smokeSkill
- tech-stackSkill
- user-guideSkill
- validate-specsSkill
- verifySkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
43 rules. 0 are common, 26 are distinctive, and 17 are very specific to this project.
0
Common
Most of the 73 edited versions we read keep these.
26
Distinctive
This author's own choices. Worth a look.
17
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 17
Read the detailed guide at ${CLAUDE_SKILL_DIR}/references/optimize-detailed-guide.md for the complete optimization procedures, teammate …
- Distinctive: line 25
Before any optimization work, verify:
- Very specific: line 27
Check that ./plancasting/_audits/implementation-completeness/report.md exists and shows PASS or CONDITIONAL PASS.
- Very specific: line 28
If ./plancasting/_audits/security/report.md (6A) exists, read it to understand security changes that must not be undone during optimization …
- Very specific: line 29
If ./plancasting/_audits/accessibility/report.md (6B) exists, read it to understand accessibility patterns (focus ring styles, semantic …
- Distinctive: line 30
If 5B shows FAIL, STOP. If CONDITIONAL PASS, read documented Category C issues and skip optimization for those incomplete features.
- Very specific: line 31
Read ./CLAUDE.md and ./plancasting/tech-stack.md for project conventions.
- Distinctive: line 32
Read relevant PRD sections for implementation context.
- Very specific: line 43
Check ./plancasting/tech-stack.md for the Session Language setting.
- Distinctive: line 53
Read CLAUDE.md Part 2 for project-specific conventions.
- Very specific: line 55
Package Manager: Use the package manager specified in plancasting/tech-stack.md (default: bun).
- Very specific: line 59
Lighthouse in dev mode: Always measure against production build, never dev server.
- Distinctive: line 60
Premature React.memo: Do not add to every component.
- Distinctive: line 61
Lazy loading above-the-fold content: Do not defer critical content visible on initial render — this hurts LCP.
- Distinctive: line 62
Over-aggressive .take(N): Do not truncate queries below the feature's actual data volume.
- Distinctive: line 63
Breaking Server Components to Client Components: Do not convert SSR components to client-side solely for optimization hooks.
- Distinctive: line 64
Adding pagination to small lists: Do not add pagination to lists that will never exceed 50 items.
- Very specific: line 71
Read ./CLAUDE.md, ./plancasting/tech-stack.md, and ./plancasting/prd/15-non-functional-specifications.md.
- Very specific: line 83
Write ./plancasting/_audits/performance/targets.md with extracted targets.
- Distinctive: line 84
Create a task list for all teammates with dependency tracking.
- Very specific: line 96
Asset optimization: Verify font loading strategy (e.g., next/font with display: swap).
- Distinctive: line 102
Index audit: Verify every filtered query uses indexed query methods instead of unindexed filtering.
- Very specific: line 104
Mutation efficiency: Verify mutations don't read-then-write when direct .patch() works.
- Distinctive: line 105
Scheduled functions/crons: Verify cron frequencies match data change rates (cleanup: daily/weekly.
- Distinctive: line 111
Loading states: Verify every page/route has a loading state with a skeleton screen (not a spinner).
- Distinctive: line 113
Progressive loading: Verify pagination or infinite scroll for large datasets.
- Distinctive: line 114
Transition and feedback: Verify buttons show loading state during async operations.
- Distinctive: line 118
When an issue cannot be fixed without architectural changes:
- Distinctive: line 120
Document the full conflict with evidence.
- Very specific: line 123
If Core Web Vitals FAIL per PRD targets, document as a potential launch blocker for Stage 6H review.
- Distinctive: line 128
If backend adds new indexes, notify frontend (query response times may change).
- Distinctive: line 129
If perceived-performance finds waterfall patterns, notify backend (may need combined queries).
- Very specific: line 134
Run the full test suite: bun run typecheck, bun run lint, bun run build, bun run test, bun run test:e2e.
- Very specific: line 135
Run Lighthouse on key pages against a production build.
- Distinctive: line 154
PASS: All Core Web Vitals meet targets.
- Distinctive: line 162
Verify all file modifications are saved and committed.
- Distinctive: line 166
never optimize without measuring first — premature optimization adds complexity without benefit.
- Very specific: line 167
never convert Server Components to Client Components for optimization (Next.js).
- Distinctive: line 168
never run Lighthouse in development mode — always use production build and start commands.
- Distinctive: line 169
always verify optimizations don't break functionality — run the full test suite.
- Distinctive: line 170
always measure bundle size before and after changes using your framework's bundle analyzer.
- Very specific: line 171
never add .take(N) that is too small for the feature's actual data volume.
- Distinctive: line 172
Use commands from CLAUDE.md for testing.
“Common” is measured: kept by at least 6 in 10 of the 73 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Performance Optimization — Stage 6C
Read the detailed guide at ${CLAUDE_SKILL_DIR}/references/optimize-detailed-guide.md for the complete optimization procedures, teammate spawn prompts, benchmark patterns, and report templates.
Lead a multi-agent performance optimization project. Audit the complete product against PRD performance budgets, identify bottlenecks, and implement optimizations.
Stage Sequence (recommended ordering): Stage 5B → (6A ‖ 6B ‖ 6C (this stage)) → 6E → 6F → 6G → 6D → 6H → 6V → 6R → 6P/6P-R → 7 (Deploy). Note: 6A, 6B, and 6C run in parallel (each in a separate session). If running in parallel, commit 6A changes as soon as 6A completes to avoid config file conflicts — see CLAUDE.md § "Stage 6 ordering".
Prerequisite Checks
Before any optimization work, verify:
- Check that
./plancasting/_audits/implementation-completeness/report.mdexists and shows PASS or CONDITIONAL PASS. If missing, STOP: "Stage 5B report not found — run Stage 5B before starting Stage 6 audits." (Override: if the operator explicitly confirms 5B was intentionally skipped, proceed with a WARN.) - If
./plancasting/_audits/security/report.md(6A) exists, read it to understand security changes that must not be undone during optimization (validation, CSP headers, rate limiting). - If
./plancasting/_audits/accessibility/report.md(6B) exists, read it to understand accessibility patterns (focus ring styles, semantic HTML,prefers-reduced-motion) that should not be regressed. - If 5B shows FAIL, STOP. If CONDITIONAL PASS, read documented Category C issues and skip optimization for those incomplete features.
- Read
./CLAUDE.mdand./plancasting/tech-stack.mdfor project conventions. - Read relevant PRD sections for implementation context.
Inputs
- Codebase: Backend directory and
./src/(adapt paths per tech stack) - Tech Stack:
./plancasting/tech-stack.md - PRD Performance Specs:
./plancasting/prd/15-non-functional-specifications.md - PRD Screen Specs:
./plancasting/prd/08-screen-specifications.md(loading states, skeletons) - Schema: Your schema file (e.g.,
./convex/schema.ts) - Project Rules:
./CLAUDE.md
Check ./plancasting/tech-stack.md for the Session Language setting. Generate reports in that language. Keep code and file names in English.
Stack Adaptation
Adapt all references to your actual stack per plancasting/tech-stack.md:
convex/becomes your backend directoryconvex/schema.tsbecomes your schema/migration filessrc/app/becomes your frontend pages directory- Convex functions become your backend functions/endpoints
Read CLAUDE.md Part 2 for project-specific conventions.
Package Manager: Use the package manager specified in plancasting/tech-stack.md (default: bun).
Known Failure Patterns
- Lighthouse in dev mode: Always measure against production build, never dev server. never measure against
localhost:3000in development. - Premature React.memo: Do not add to every component. Only use where expensive re-renders with unchanged props are measured.
- Lazy loading above-the-fold content: Do not defer critical content visible on initial render — this hurts LCP.
- Over-aggressive .take(N): Do not truncate queries below the feature's actual data volume.
- Breaking Server Components to Client Components: Do not convert SSR components to client-side solely for optimization hooks. Net negative for performance.
- Adding pagination to small lists: Do not add pagination to lists that will never exceed 50 items.
- INP vs FID confusion: Agent optimizes for First Input Delay (FID) which was deprecated in March 2024 and replaced by Interaction to Next Paint (INP). Lighthouse cannot measure INP directly — use Total Blocking Time (TBT) as a lab proxy. TBT < 200ms generally correlates with good INP.
Phase 1: Analysis and Baseline
Complete these steps synchronously before spawning any teammates:
- Read
./CLAUDE.md,./plancasting/tech-stack.md, and./plancasting/prd/15-non-functional-specifications.md. - Create the performance baseline (must complete before spawning teammates — build production, measure, then spawn):
Record metrics inmkdir -p ./plancasting/_audits/performance bun run build && bun run start & until curl -s http://localhost:3000 > /dev/null 2>&1; do sleep 1; done bunx lighthouse http://localhost:3000 --only-categories=performance --output=json --output-path=./plancasting/_audits/performance/baseline-home.json # Repeat for other key pages kill $(lsof -ti:3000) 2>/dev/null./plancasting/_audits/performance/baseline.md. Mark with:<!-- ORIGINAL BASELINE — Do not recreate on subsequent 6C RUNS -->. This file is permanent. never measure against the dev server. - Extract all performance budgets from the PRD: page load targets, API response targets, bundle size budgets, Lighthouse score targets, Core Web Vitals targets (LCP, INP, CLS). If the PRD does not specify, use web.dev defaults: LCP < 2.5s, INP < 200ms, CLS < 0.1, Lighthouse Performance > 90.
- Write
./plancasting/_audits/performance/targets.mdwith extracted targets. Document the source (PRD vs defaults). - Create a task list for all teammates with dependency tracking.
Phase 2: Spawn Optimization Teammates
Spawn Teammate 2 (backend) FIRST. After Teammate 2 completes, spawn Teammates 1 and 3 in parallel. Exception: all 3 may start in parallel only if zero index/query optimization opportunities exist and the schema is fully indexed. When ambiguous, err on sequential (Teammate 2 first).
Teammate 1: frontend-performance
Scope: Bundle size, rendering, Core Web Vitals. Spawn AFTER Teammate 2 completes.
- Bundle analysis: Review framework config for optimization settings. Identify large dependencies (>50KB gzipped) and evaluate alternatives or dynamic imports. Use your framework's bundle analyzer (Next.js:
@next/bundle-analyzerwithANALYZE=true bun run build; Vite:npx vite-bundle-visualizer). If bundle analyzer cannot be installed: skip automated analysis, use Chrome DevTools Code Coverage instead, document limitation. If Next.js: verify minimal"use client"directives, implementnext/dynamicfor heavy non-initial components, verify images usenext/image. - Rendering optimization: Identify pages benefiting from SSR data loading. Verify loading skeleton screens exist for all routes. Check for unnecessary re-renders from unneeded data subscriptions. Apply
React.memo/useMemoonly where expensive computations or frequent re-renders occur — do not blanket-apply. Check for layout shift sources (images without dimensions, dynamically injected content). - Asset optimization: Verify font loading strategy (e.g.,
next/fontwithdisplay: swap). Verify CSS is not importing unused utilities. Check for render-blocking resources.
Teammate 2: backend-query-performance
Scope: Backend function performance, index utilization, data access patterns. Spawn FIRST.
- Index audit: Verify every filtered query uses indexed query methods instead of unindexed filtering. Identify queries benefiting from compound indexes. Add missing indexes to the schema file.
- Query efficiency: Flag
.collect()where.first()/.unique()suffices. Flag queries fetching more data than needed. Identify N+1 patterns and refactor to batch. Verify pagination for large result sets. - Mutation efficiency: Verify mutations don't read-then-write when direct
.patch()works. Check for unnecessary database reads. Identify opportunities to combine mutations. - Scheduled functions/crons: Verify cron frequencies match data change rates (cleanup: daily/weekly; aggregation: daily; notifications: hourly/per SLA). Check background job efficiency.
Teammate 3: perceived-performance
Scope: Perceived performance, loading states, optimistic updates. Spawn AFTER Teammate 2 completes.
- Loading states: Verify every page/route has a loading state with a skeleton screen (not a spinner). Verify skeletons match actual layout. Verify data-dependent components show skeletons while query returns undefined. Flag blank-screen loading.
- Optimistic updates: Identify user actions that should feel instant (form submissions, toggles, deletions). Implement optimistic updates with graceful rollback on error.
- Progressive loading: Verify pagination or infinite scroll for large datasets. Verify above-the-fold loads first. Identify and refactor waterfall loading patterns to parallel.
- Transition and feedback: Verify buttons show loading state during async operations. Verify form submit buttons disable to prevent double submission. Verify smooth navigation transitions.
Unfixable Violation Protocol
When an issue cannot be fixed without architectural changes:
- Document the full conflict with evidence.
- Mark as REQUIRES HUMAN DECISION.
- Include recommended approach and estimated effort.
- If Core Web Vitals FAIL per PRD targets, document as a potential launch blocker for Stage 6H review. Create
./plancasting/_audits/performance/unfixable-violations.md. - Continue with remaining fixable items.
Phase 3: Coordination
- If backend adds new indexes, notify frontend (query response times may change).
- If perceived-performance finds waterfall patterns, notify backend (may need combined queries).
- Resolve conflicts when multiple teammates modify the same file.
Phase 4: Verification and Report
- Run the full test suite:
bun run typecheck,bun run lint,bun run build,bun run test,bun run test:e2e. - Run Lighthouse on key pages against a production build. Methodology:
a. Build for production:
bun run buildb. Start production server:bun run startc. Run at least 3 times and average scores:for i in 1 2 3; do bunx lighthouse http://localhost:3000 --only-categories=performance --output=json --output-path=./plancasting/_audits/performance/lighthouse-run-$i.json; doned. Measure Core Web Vitals:- LCP (Largest Contentful Paint): Target < 2.5s
- INP (Interaction to Next Paint): Target < 200ms. Note: INP is a real-user metric — Lighthouse cannot measure it directly. Use TBT (Total Blocking Time) < 200ms as lab proxy. TBT = main thread blocking during load; INP = responsiveness to user interactions.
- CLS (Cumulative Layout Shift): Target < 0.1 e. Use Lighthouse default throttling (simulated 4G), cold cache. f. Baseline Preservation: On first 6C run, create baseline. On subsequent re-runs, do not recreate — always measure against the ORIGINAL baseline. g. Read PRD targets first; use web.dev Good thresholds only as defaults.
- Generate
./plancasting/_audits/performance/report.mdcontaining:- Performance budget compliance table (metric, target, actual, pass/fail)
- Lighthouse scores per page
- Optimizations applied by category (bundle, queries, indexes, loading, perceived)
- Before/after metrics
- Remaining gaps and recommendations
- PRD NFR compliance matrix
- Include a Gate Decision under a
## Gate Decisionheading (6H parses this heading):- PASS: All Core Web Vitals meet targets; performance budget compliant; no critical regressions
- CONDITIONAL PASS: Core Web Vitals on track; non-critical metrics miss targets but are documented as future optimization opportunities
- FAIL: Core Web Vitals FAIL thresholds; performance budget exceeded; critical pages do not load within acceptable time
- Output summary: total optimizations applied, budget compliance status.
Phase 5: Shutdown
- Request shutdown for all teammates.
- Verify all file modifications are saved and committed.
Critical Rules
- never optimize without measuring first — premature optimization adds complexity without benefit.
- never convert Server Components to Client Components for optimization (Next.js). For non-SSR frameworks: do not convert server-rendered routes to client-only.
- never run Lighthouse in development mode — always use production build and start commands.
- always verify optimizations don't break functionality — run the full test suite.
- always measure bundle size before and after changes using your framework's bundle analyzer.
- never add
.take(N)that is too small for the feature's actual data volume. - Use commands from CLAUDE.md for testing.
- Reference Stage 5B output to avoid optimizing incomplete features.
- INP replaces FID (deprecated March 2024). Use TBT as lab proxy for INP. See Measurement Standards above.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

