ワンクリックで
early-return-from-functions
Use early returns to reduce nesting and clarify control flow. Use when simplifying conditionals or guard clauses.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
Use early returns to reduce nesting and clarify control flow. Use when simplifying conditionals or guard clauses.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
Use when the task asks for a visually strong landing page, website, app, prototype, demo, or game UI. This skill enforces restrained composition, image-led hierarchy, cohesive content structure, and tasteful motion while avoiding generic cards, weak branding, and UI clutter.
Automate browser interactions, test web pages and work with Playwright tests.
Advanced guidelines and best practices for writing tests using Vitest. Apply this skill when generating, reviewing, or refactoring test codes to prevent common pitfalls and ensure high performance.
Fixed 1536×864 touch viewport — grid, margins, 8px rhythm, touch targets, typography, components, vertical rhythm, and QA checklist for panel/kiosk/HMI. Use when designing or implementing UIs for this resolution with touch-first input.
Lists available Cursor agents (planner, architect, tdd-guide, code-reviewer, security-reviewer, build-error-resolver, e2e-runner, refactor-cleaner, doc-updater) and when to use each. Use when the user asks which agent to use, how to delegate work, or what agents are available.
Async parallelization patterns — Promise.all, waterfall prevention, dependency-based parallelism, RSC component composition, deferred await. Use when optimizing async operations, API routes, or data fetching.
| name | early-return-from-functions |
| description | Use early returns to reduce nesting and clarify control flow. Use when simplifying conditionals or guard clauses. |
Return early when result is determined to skip unnecessary processing.
Incorrect (processes all items even after finding answer):
function validateUsers(users: User[]) {
let hasError = false;
let errorMessage = '';
for (const user of users) {
if (!user.email) {
hasError = true;
errorMessage = 'Email required';
}
if (!user.name) {
hasError = true;
errorMessage = 'Name required';
}
// Continues checking all users even after error found
}
return hasError ? { valid: false, error: errorMessage } : { valid: true };
}
Correct (returns immediately on first error):
function validateUsers(users: User[]) {
for (const user of users) {
if (!user.email) {
return { valid: false, error: 'Email required' };
}
if (!user.name) {
return { valid: false, error: 'Name required' };
}
}
return { valid: true };
}