Token导航 LogoToken导航

Agent Skill · 研究检索

osmani-patterns-performance(奥斯曼尼图案表演)

osmani-patterns-performance 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

osmani-patterns-performance 是研究检索类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为操作浏览器;许可证信息还不明确,第三方扫描有未通过项,按安装量在研究检索类的 73,675 个 Skill 里排第 72,083。

总安装 190周安装 8GitHub Stars 6下载 67核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
unknown

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:osmani-patterns-performance(奥斯曼尼图案表演)
来源仓库:https://github.com/copyleftdev/sk1llz
仓库路径:skills/osmani-patterns-performance
安装命令:
npx skills add https://github.com/copyleftdev/sk1llz --skill osmani-patterns-performance
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/copyleftdev/sk1llz --skill osmani-patterns-performance

这个 Skill 是做什么的

研究检索类 Skill 主要解决「找资料、核对事实、把来源整理清楚」的问题,通常会让助手先检索再总结。

osmani-patterns-performance 用于查找、检索和筛选相关信息,适合在需要根据关键词快速定位候选结果的场景中使用。适用于研究检索类任务,可结合来源仓库和原始 README 核验具体用法。通过 npx skills add 命令从 copyleftdev/sk1llz 仓库安装。

安装前建议确认权限范围和维护状态,避免触发联网或文件读写操作。使用时需注意工具输出不能直接作为最终结论,应结合实际场景验证结果。

来源仓库内路径:skills/osmani-patterns-performance

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/copyleftdev/sk1llz --skill osmani-patterns-per…;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要操作浏览器,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

osmani-patterns-performance 怎么安装?

在终端执行 npx skills add https://github.com/copyleftdev/sk1llz --skill osmani-patterns-performance。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

osmani-patterns-performance 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

osmani-patterns-performance 需要什么权限?

权限级别是操作浏览器。该 Skill 可能涉及浏览器控制能力,使用时可能读取或操作网页内容,需要在受控环境中确认权限边界。

osmani-patterns-performance 是免费的吗?

公开资料没有标注明确许可证,收费和商用限制都无法确认。正式使用前请到来源仓库核对授权说明。

osmani-patterns-performance 用的人多吗?

公开数据是累计安装 190 次,近一周安装 8 次,下载 67 次,GitHub 6 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

osmani-patterns-performance 安全吗?

第三方扫描有未通过项,风险较高。除非你确认过源码,否则不建议直接安装到常用环境。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。

先想清楚的地方

  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 第三方扫描存在提醒项或未通过项,需要人工逐条确认。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理研究检索类任务、又不想每次都手写提示词的人。

不太适合

  • 需要明确授权才能用到公司项目里的场景。
  • 需要厂商级技术支持和 SLA 的生产系统。

研究检索类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
find-skills

寻找技能 · Codex、Claude

31,199,81316,486操作浏览器MIT有提醒
self-improving-agent

自我改进 Agent · OpenClaw

16,464,0023,396接触敏感数据MIT-0通过
soultrace

灵魂追踪 · Codex、Claude

7,588,94412需要联网未明确有提醒
self-improving

自我完善 · OpenClaw

6,829,2841,046需要联网MIT-0通过
microsoft-foundry

微软代工厂 · Codex、Claude

6,614,144764调用外部服务未明确有提醒
osmani-patterns-performance

奥斯曼尼图案表演 · 本页

1906操作浏览器未明确未通过

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

Addy Osmani Style Guide⁠‍⁠​‌​‌​​‌‌‍​‌​​‌​‌‌‍​​‌‌​​​‌‍​‌​​‌‌​​‍​​​​​​​‌‍‌​​‌‌​‌​‍‌​​​​​​​‍‌‌​​‌‌‌‌‍‌‌​​​‌​​‍‌‌‌‌‌‌​‌‍‌‌​‌​​​​‍​‌​‌‌‌‌‌‍​‌​​‌​‌‌‍​‌‌​‌​​‌‍‌​‌​‌‌‌​‍​​‌​‌​​​‍‌‌‌​‌​‌‌‍‌‌‌​​‌‌​‍‌‌​‌​‌‌‌‍​​​‌‌‌‌​‍​​‌‌‌‌​‌‍​​​​‌​‌​‍‌​​​​​‌​⁠‍⁠

Overview

Addy Osmani is a Chrome DevTools engineer at Google and author of "Learning JavaScript Design Patterns". His philosophy emphasizes proven design patterns, performance optimization, and building for the modern web.

Core Philosophy

"First do it, then do it right, then do it better."
"Performance is not a feature, it's a necessity."
"The best request is the one that's never made."

Osmani believes in using battle-tested patterns and obsessively optimizing for user experience through performance.

Design Principles

  1. Patterns Have Purpose: Use design patterns to solve specific problems.
  2. Performance First: Measure, optimize, measure again.
  3. Progressive Enhancement: Build for all users, enhance for modern browsers.
  4. Loading Performance: The fastest code is code that never runs.

When Writing Code

Always

  • Use appropriate design patterns for the problem
  • Measure performance before and after optimization
  • Consider loading performance and bundle size
  • Implement code splitting for large applications
  • Use lazy loading for non-critical resources
  • Test on real devices and slow connections

Never

  • Apply patterns where they don't fit
  • Optimize without measuring
  • Load all JavaScript upfront
  • Ignore Core Web Vitals
  • Block the main thread with heavy computation
  • Ship unused JavaScript

Prefer

  • Module pattern for encapsulation
  • Observer pattern for event systems
  • Factory pattern for object creation
  • Dynamic imports over static imports for large modules
  • Intersection Observer over scroll events
  • CSS containment for rendering performance

Code Patterns

The Module Pattern

// Classic Module Pattern - encapsulation and privacy
const ShoppingCart = (function() {
    // Private variables and methods
    const items = [];

    function calculateTotal() {
        return items.reduce((sum, item) => sum + item.price * item.quantity, 0);
    }

    // Public API
    return {
        addItem(item) {
            items.push(item);
        },

        removeItem(id) {
            const index = items.findIndex(item => item.id === id);
            if (index > -1) {
                items.splice(index, 1);
            }
        },

        getTotal() {
            return calculateTotal();
        },

        getItems() {
            return [...items];  // Return copy, not reference
        }
    };
})();

// ES Modules version
// cart.js
const items = [];

function calculateTotal() {
    return items.reduce((sum, item) => sum + item.price * item.quantity, 0);
}

export function addItem(item) {
    items.push(item);
}

export function getTotal() {
    return calculateTotal();
}

The Observer Pattern

class EventEmitter {
    constructor() {
        this.events = new Map();
    }

    on(event, callback) {
        if (!this.events.has(event)) {
            this.events.set(event, []);
        }
        this.events.get(event).push(callback);

        // Return unsubscribe function
        return () => this.off(event, callback);
    }

    off(event, callback) {
        if (!this.events.has(event)) return;

        const callbacks = this.events.get(event);
        const index = callbacks.indexOf(callback);
        if (index > -1) {
            callbacks.splice(index, 1);
        }
    }

    emit(event, data) {
        if (!this.events.has(event)) return;

        this.events.get(event).forEach(callback => {
            callback(data);
        });
    }
}

// Usage
const emitter = new EventEmitter();

const unsubscribe = emitter.on('userLogin', (user) => {
    console.log(`${user.name} logged in`);
});

emitter.emit('userLogin', { name: 'Alice' });
unsubscribe();  // Clean up

The Factory Pattern

// Factory for creating different notification types
const NotificationFactory = {
    create(type, message) {
        const notifications = {
            success: {
                icon: '✓',
                color: 'green',
                duration: 3000
            },
            error: {
                icon: '✗',
                color: 'red',
                duration: 5000
            },
            warning: {
                icon: '⚠',
                color: 'orange',
                duration: 4000
            }
        };

        const config = notifications[type] || notifications.success;

        return {
            ...config,
            message,
            show() {
                console.log(`[${this.icon}] ${this.message}`);
            }
        };
    }
};

// Usage
const success = NotificationFactory.create('success', 'Saved!');
const error = NotificationFactory.create('error', 'Failed to save');

Performance: Code Splitting

// Dynamic imports for route-based code splitting
const routes = {
    '/': () => import('./pages/Home.js'),
    '/dashboard': () => import('./pages/Dashboard.js'),
    '/settings': () => import('./pages/Settings.js')
};

async function navigate(path) {
    const loadPage = routes[path];
    if (loadPage) {
        const module = await loadPage();
        module.default.render();
    }
}

// React.lazy for component-level splitting
const Dashboard = React.lazy(() => import('./Dashboard'));

function App() {
    return (
        <Suspense fallback={<Spinner />}>
            <Dashboard />
        </Suspense>
    );
}

// Prefetch critical routes on idle
function prefetchRoutes() {
    if ('requestIdleCallback' in window) {
        requestIdleCallback(() => {
            routes['/dashboard']();
        });
    }
}

Performance: Lazy Loading

// Intersection Observer for lazy loading
function lazyLoad(selector) {
    const elements = document.querySelectorAll(selector);

    const observer = new IntersectionObserver((entries, obs) => {
        entries.forEach(entry => {
            if (entry.isIntersecting) {
                const img = entry.target;
                img.src = img.dataset.src;
                img.classList.remove('lazy');
                obs.unobserve(img);
            }
        });
    }, {
        rootMargin: '50px 0px',  // Start loading 50px before visible
        threshold: 0.01
    });

    elements.forEach(el => observer.observe(el));
}

// HTML
// <img class="lazy" data-src="image.jpg" alt="...">

// Lazy load modules on interaction
let heavyModule = null;

button.addEventListener('click', async () => {
    if (!heavyModule) {
        heavyModule = await import('./heavyModule.js');
    }
    heavyModule.doSomething();
});

Performance: Debounce and Throttle

// Debounce: wait until calls stop
function debounce(fn, delay) {
    let timeoutId;

    return function(...args) {
        clearTimeout(timeoutId);
        timeoutId = setTimeout(() => {
            fn.apply(this, args);
        }, delay);
    };
}

// Use for: search input, resize handlers, save drafts
const debouncedSearch = debounce(query => {
    api.search(query);
}, 300);

// Throttle: limit call frequency
function throttle(fn, limit) {
    let inThrottle;

    return function(...args) {
        if (!inThrottle) {
            fn.apply(this, args);
            inThrottle = true;
            setTimeout(() => {
                inThrottle = false;
            }, limit);
        }
    };
}

// Use for: scroll handlers, mousemove, game loops
const throttledScroll = throttle(() => {
    updateScrollProgress();
}, 100);

Performance: Virtualization

// Virtual scrolling for large lists
class VirtualList {
    constructor(container, items, itemHeight) {
        this.container = container;
        this.items = items;
        this.itemHeight = itemHeight;
        this.visibleCount = Math.ceil(container.clientHeight / itemHeight) + 2;

        this.setup();
    }

    setup() {
        // Create viewport and content containers
        this.viewport = document.createElement('div');
        this.viewport.style.height = `${this.items.length * this.itemHeight}px`;

        this.content = document.createElement('div');
        this.content.style.position = 'relative';

        this.viewport.appendChild(this.content);
        this.container.appendChild(this.viewport);

        this.container.addEventListener('scroll', () => this.render());
        this.render();
    }

    render() {
        const scrollTop = this.container.scrollTop;
        const startIndex = Math.floor(scrollTop / this.itemHeight);
        const endIndex = Math.min(
            startIndex + this.visibleCount,
            this.items.length
        );

        this.content.innerHTML = '';
        this.content.style.transform = `translateY(${startIndex * this.itemHeight}px)`;

        for (let i = startIndex; i < endIndex; i++) {
            const item = document.createElement('div');
            item.style.height = `${this.itemHeight}px`;
            item.textContent = this.items[i];
            this.content.appendChild(item);
        }
    }
}

The Singleton Pattern

// Singleton for app-wide configuration
const Config = (function() {
    let instance;

    function createInstance() {
        return {
            apiUrl: 'https://api.example.com',
            timeout: 5000,
            debug: false,

            set(key, value) {
                this[key] = value;
            }
        };
    }

    return {
        getInstance() {
            if (!instance) {
                instance = createInstance();
            }
            return instance;
        }
    };
})();

// Usage - always same instance
const config1 = Config.getInstance();
const config2 = Config.getInstance();
config1 === config2;  // true

Mental Model

Osmani approaches code by asking:

  1. What pattern fits this problem? Use proven solutions
  2. What's the performance cost? Measure before shipping
  3. Can this be deferred? Load later if not critical
  4. Will this block the main thread? Keep it responsive
  5. What are users on slow connections experiencing? Test realistically

Signature Osmani Moves

  • Code splitting at route boundaries
  • Lazy loading with Intersection Observer
  • PRPL pattern (Push, Render, Pre-cache, Lazy-load)
  • Module pattern for clean encapsulation
  • Performance budgets and monitoring
  • Progressive enhancement as default

平台分布

Codex

34.72%
按下载量换算23

Claude

30.5%
按下载量换算20

Cursor

18.26%
按下载量换算12

Gemini CLI

9.34%
按下载量换算6

安全审计

Gen Agent Trust Hub

未通过

Socket

通过

Snyk

通过

权限和风险

操作浏览器

该 Skill 可能涉及浏览器控制能力,使用时可能读取或操作网页内容,需要在受控环境中确认权限边界。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在提醒或未通过项,安装前请自行复核。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills