一键导入
optimize
Improve interface performance across loading speed, rendering, animations, images, and bundle size. Makes experiences faster and smoother.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Improve interface performance across loading speed, rendering, animations, images, and bundle size. Makes experiences faster and smoother.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
Generate ASCII block-art banner images for social posts and OG images. Dark midnight aesthetic with faded {company} text on near-black background. Two sizes — 1080x1080 (social) and 1200x630 (OG). Use for product announcements, project launches, concept visuals, and repo OG images.
Explore approaches and tradeoffs before committing to a PRD. Research HQ context, compare options, surface unknowns, generate brainstorm.md with recommendation.
Post-ship documentation sync — updates README, CLAUDE.md, architecture docs, and INDEX files to match what actually shipped. Use after merging a PR, completing a project, or deploying a release. Triggers on "update docs", "sync documentation", "docs are stale", "document what shipped".
Execute a single PRD story through coordinated worker phases (Ralph pattern). Each worker handles its domain, passes context to the next, with back-pressure (tests/lint/typecheck) keeping code on rails.
Prepare for a new session to continue this work. Captures session learnings, syncs domain knowledge and insights, commits dirty repos, writes a thread file and handoff.json, updates INDEX files, and refreshes the search index. Ensures continuity across sessions.
Capture and classify learnings, route to structured policy files (rules) or insight files (educational knowledge). Deduplicates via qmd (Grep fallback), rebuilds policy digest after policy changes. Callable manually or from /execute-task, /run-project, /handoff, /checkpoint. Use --hard flag for hard-enforcement rules.
基于 SOC 职业分类
| name | optimize |
| description | Improve interface performance across loading speed, rendering, animations, images, and bundle size. Makes experiences faster and smoother. |
| user-invokable | true |
| args | [{"name":"target","description":"The feature or area to optimize (optional)","required":false}] |
Identify and fix performance issues to create faster, smoother user experiences.
Understand current performance and identify problems:
Measure current state:
Identify bottlenecks:
CRITICAL: Measure before and after. Premature optimization wastes time. Optimize what actually matters.
Create systematic improvement plan:
Optimize Images:
srcset, picture element)<img
src="hero.webp"
srcset="hero-400.webp 400w, hero-800.webp 800w, hero-1200.webp 1200w"
sizes="(max-width: 400px) 400px, (max-width: 800px) 800px, 1200px"
loading="lazy"
alt="Hero image"
/>
Reduce JavaScript Bundle:
// Lazy load heavy component
const HeavyChart = lazy(() => import('./HeavyChart'));
Optimize CSS:
Optimize Fonts:
font-display: swap or optional@font-face {
font-family: 'CustomFont';
src: url('/fonts/custom.woff2') format('woff2');
font-display: swap; /* Show fallback immediately */
unicode-range: U+0020-007F; /* Basic Latin only */
}
Optimize Loading Strategy:
Avoid Layout Thrashing:
// ❌ Bad: Alternating reads and writes (causes reflows)
elements.forEach(el => {
const height = el.offsetHeight; // Read (forces layout)
el.style.height = height * 2; // Write
});
// ✅ Good: Batch reads, then batch writes
const heights = elements.map(el => el.offsetHeight); // All reads
elements.forEach((el, i) => {
el.style.height = heights[i] * 2; // All writes
});
Optimize Rendering:
contain property for independent regionscontent-visibility: auto for long listsReduce Paint & Composite:
transform and opacity for animations (GPU-accelerated)will-change sparingly for known expensive operationsGPU Acceleration:
/* ✅ GPU-accelerated (fast) */
.animated {
transform: translateX(100px);
opacity: 0.5;
}
/* ❌ CPU-bound (slow) */
.animated {
left: 100px;
width: 300px;
}
Smooth 60fps:
requestAnimationFrame for JS animationsIntersection Observer:
// Efficiently detect when elements enter viewport
const observer = new IntersectionObserver((entries) => {
entries.forEach(entry => {
if (entry.isIntersecting) {
// Element is visible, lazy load or animate
}
});
});
React-specific:
memo() for expensive componentsuseMemo() and useCallback() for expensive computationsFramework-agnostic:
Reduce Requests:
Optimize APIs:
Optimize for Slow Connections:
aspect-ratio CSS property/* Reserve space for image */
.image-container {
aspect-ratio: 16 / 9;
}
Tools to use:
Key metrics:
IMPORTANT: Measure on real devices with real network conditions. Desktop Chrome with fast connection isn't representative.
NEVER:
will-change everywhere (creates new layers, uses memory)Test that optimizations worked:
Remember: Performance is a feature. Fast experiences feel more responsive, more polished, more professional. Optimize systematically, measure ruthlessly, and prioritize user-perceived performance.