agentleFS
MindrallyMindrally/skills/performance-optimization/SKILL.md

performance-optimization

Skill266 starsChanged 10 months agoApache-2.0View on GitHub

Performance optimization guidelines for web development including server-side rendering, CSS best practices, and JavaScript optimization

83 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use constraint-driven-development, using-agent-skills and 10 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.
  • vinvcnSkill

    constraint-driven-development

    把一个项目的质量线确立为书面契约,并阻止 agent 悄悄降低它。通过访谈确定用户在意哪些维度,当用户心里没有数字时提供合理的默认阈值,把一切记录进 CONSTRAINTS.md,并盯住 diff 中质量线被削弱的迹象——新增的 @ts-ignore 或 eslint-disable 抑制注释、被跳过或删除的测试、被剥掉的断言、未实现的 stub、被调低的阈值。当没有任何质量线被写下来时使用;当用户说 "set up constraints" 或 "define our standards" 时;当用户希望把他们在意的维度——无障碍性、Web 性能、覆盖率——设置成被强制执行的约束时;当 agent 为了变绿不断静默检查或跳过测试时;当你需要一个覆盖率或性能阈值却不知道该选什么数字时;或者当 agent 写下的代码超出任何人会读的体量时。

    Also in 4 projects that use this

  • LLl0k0laDSkill

    using-agent-skills

    Use when starting a session or when you need to discover which skill applies to the current task. This is the meta-skill that governs how all other skills are discovered and invoked.

    Also in 21 projects that use this

  • LLl0k0laDSkill

    git-workflow-and-versioning

    Use when making any code change. Use when committing, branching, resolving conflicts, or when you need to organize work across multiple parallel streams.

    Also in 23 projects that use this

  • borhen68Skill

    observability-and-instrumentation

    Instruments code so production behavior is visible and diagnosable. Use when adding logging, metrics, tracing, or alerting. Use when shipping any feature that runs in production and you need evidence it works. Use when production issues are reported but you can't tell what happened from the available data.

    Also in 12 projects that use this

  • az9713Skill

    deprecation-and-migration

    Manages deprecation and migration. Use when removing old systems, APIs, or features. Use when migrating users from one implementation to another. Use when deciding whether to maintain or sunset existing code.

    Also in 21 projects that use this

  • az9713Skill

    code-simplification

    Simplifies code for clarity. Use when refactoring code for clarity without changing behavior. Use when code works but is harder to read, maintain, or extend than it should be. Use when reviewing code that has accumulated unnecessary complexity.

    Also in 29 projects that use this

  • +6 more from LLl0k0laD

The file

Show its rules and text

We split this skill into the rules it gives an agent

36 rules. 0 are common, 36 are distinctive, and 0 are very specific to this project.

  • 0

    Common

    Most of the 72 edited versions we read keep these.

  • 36

    Distinctive

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Consider performance impact of every architectural decision

    line 16
  2. Distinctive:

    Use streaming rendering for faster Time to First Byte

    line 21
  3. Distinctive:

    Avoid blocking resources that delay rendering

    line 23
  4. Distinctive:

    Avoid ID selectors for styling.

    line 29
  5. Distinctive:

    Avoid deep nesting of selectors (max 3 levels)

    line 31
  6. Distinctive:

    Use BEM or similar naming conventions for clarity

    line 32
  7. Distinctive:

    Prefer class selectors over element selectors

    line 33
  8. Distinctive:

    Use CSS variables for colors, spacing, and repeated values

    line 36
  9. Distinctive:

    Remove unused CSS to reduce payload

    line 38
  10. Distinctive:

    Consider critical CSS inlining for above-the-fold content

    line 39
  11. Distinctive:

    Use CSS containment for complex layouts

    line 40
  12. Distinctive:

    Avoid layout thrashing (forced synchronous layouts)

    line 43
  13. Distinctive:

    Use transform and opacity for animations (GPU accelerated)

    line 44
  14. Distinctive:

    Use will-change sparingly and intentionally

    line 46
  15. Distinctive:

    Prefer flexbox and grid over floats and positioning

    line 47
  16. Distinctive:

    Use the module pattern for code organization

    line 52
  17. Distinctive:

    Prefer const over let; avoid var

    line 54
  18. Distinctive:

    Avoid external dependencies when native APIs suffice

    line 55
  19. Distinctive:

    Use async loading for independent scripts

    line 60
  20. Distinctive:

    Use requestAnimationFrame for visual updates

    line 67
  21. Distinctive:

    Avoid long-running synchronous operations

    line 68
  22. Distinctive:

    Use Web Workers for CPU-intensive tasks

    line 70
  23. Distinctive:

    Use modern formats (WebP, AVIF) with fallbacks

    line 75
  24. Distinctive:

    Use appropriate image dimensions

    line 79
  25. Distinctive:

    Use font-display: swap for better perceived performance

    line 83
  26. Distinctive:

    Consider system fonts for non-branded text

    line 86
  27. Distinctive:

    Use versioned filenames for cache busting

    line 91
  28. Distinctive:

    Use proper folder structure for maintainability

    line 100
  29. Distinctive:

    Create reusable, composable components

    line 102
  30. Distinctive:

    Document component APIs and usage

    line 103
  31. Distinctive:

    Use clear, descriptive naming conventions

    line 107
  32. Distinctive:

    Ensure all text is translatable

    line 114
  33. Distinctive:

    Use proper locale detection

    line 116
  34. Distinctive:

    Consider right-to-left (RTL) layout implications

    line 118
  35. Distinctive:

    Use Real User Monitoring (RUM) for production insights

    line 122
  36. Distinctive:

    Use caching for frequently accessed data

    line 132

“Common” is measured: kept by at least 6 in 10 of the 72 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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Performance Optimization

Apply these performance optimization principles when developing web applications, themes, and frontend interfaces.

Core Performance Principles

  • Prioritize server-side rendering as a first principle, as opposed to client-side JavaScript
  • Minimize client-side JavaScript to reduce bundle size and improve Time to Interactive
  • Optimize for Core Web Vitals: LCP, FID, and CLS
  • Measure performance continuously and establish baselines
  • Consider performance impact of every architectural decision

Server-Side Rendering

  • Render content server-side whenever possible
  • Use streaming rendering for faster Time to First Byte
  • Implement proper caching strategies for rendered content
  • Avoid blocking resources that delay rendering
  • Pre-render static content where applicable

CSS Best Practices

Selector Efficiency

  • Avoid ID selectors for styling; use classes instead
  • Maintain specificity at 0 1 0 where possible
  • Avoid deep nesting of selectors (max 3 levels)
  • Use BEM or similar naming conventions for clarity
  • Prefer class selectors over element selectors

CSS Organization

  • Use CSS variables for colors, spacing, and repeated values
  • Group related styles logically
  • Remove unused CSS to reduce payload
  • Consider critical CSS inlining for above-the-fold content
  • Use CSS containment for complex layouts

Layout Performance

  • Avoid layout thrashing (forced synchronous layouts)
  • Use transform and opacity for animations (GPU accelerated)
  • Minimize paint and composite operations
  • Use will-change sparingly and intentionally
  • Prefer flexbox and grid over floats and positioning

JavaScript Optimization

Code Organization

  • Use the module pattern for code organization
  • Prefix private methods with appropriate indicators
  • Prefer const over let; avoid var
  • Avoid external dependencies when native APIs suffice
  • Split code into logical, loadable chunks

Loading Strategies

  • Defer non-critical JavaScript
  • Use async loading for independent scripts
  • Implement code splitting for large applications
  • Lazy load components and routes
  • Preload critical resources

Runtime Performance

  • Debounce and throttle event handlers appropriately
  • Use requestAnimationFrame for visual updates
  • Avoid long-running synchronous operations
  • Implement efficient DOM manipulation patterns
  • Use Web Workers for CPU-intensive tasks

Asset Optimization

Images

  • Use modern formats (WebP, AVIF) with fallbacks
  • Implement responsive images with srcset
  • Lazy load below-the-fold images
  • Optimize and compress all images
  • Use appropriate image dimensions

Fonts

  • Subset fonts to include only needed characters
  • Use font-display: swap for better perceived performance
  • Preload critical fonts
  • Limit the number of font variations
  • Consider system fonts for non-branded text

Caching Strategies

  • Implement appropriate cache headers for static assets
  • Use versioned filenames for cache busting
  • Configure CDN caching effectively
  • Implement service workers for offline support
  • Cache API responses where appropriate

Architecture Patterns

Theme and Component Architecture

  • Organize code into logical sections and blocks
  • Use proper folder structure for maintainability
  • Implement clear separation of concerns
  • Create reusable, composable components
  • Document component APIs and usage

Configuration and Settings

  • Organize settings logically with clear groupings
  • Use clear, descriptive naming conventions
  • Implement conditional logic to reduce complexity
  • Provide sensible defaults
  • Validate configuration at build time

Internationalization Performance

  • Ensure all text is translatable
  • Load translations efficiently (split by locale)
  • Use proper locale detection
  • Cache translated content appropriately
  • Consider right-to-left (RTL) layout implications

Measurement and Monitoring

  • Use Real User Monitoring (RUM) for production insights
  • Set up synthetic monitoring for baseline tracking
  • Monitor Core Web Vitals continuously
  • Track performance budgets in CI/CD
  • Analyze and act on performance regressions

Database Performance

  • Optimize queries and use proper indexing
  • Implement connection pooling
  • Use caching for frequently accessed data
  • Paginate large result sets
  • Monitor slow queries and optimize regularly

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.