원클릭으로
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 };
}