一键导入
error-handling-gate
Verifies error handling including empty catch detection, user-friendly messages, and logging. WARNING gate triggered during /own:done flow.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Verifies error handling including empty catch detection, user-friendly messages, and logging. WARNING gate triggered during /own:done flow.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Transforms completed work into powerful resume bullet points with action verbs, technical context, and quantified impact. Use when completing tasks, updating portfolio, or preparing job applications.
Transforms completed work into STAR interview stories (Situation, Task, Action, Result). Use when completing tasks, preparing for behavioral interviews, or documenting achievements.
Reviews accessibility including WCAG, ARIA, keyboard navigation. Use when junior builds forms, buttons, modals, interactive elements, or asks "is this accessible", "a11y", "screen reader".
Reviews API design, REST conventions, and backend architecture. Use when junior builds API endpoints, Express routes, middleware, controllers, or asks "is this RESTful", "check my endpoint".
Reviews schema design, SQL queries, ORM patterns. Use when junior creates schema, writes queries, adds migrations, works with Prisma/MongoDB/PostgreSQL, or asks "is this SQL safe", "N+1", "index".
Guides systematic debugging through Protocol D (READ, ISOLATE, DOCS, HYPOTHESIZE, VERIFY). Use when junior says "stuck", "not working", "broken", "bug", "error", "crashed", "failing", "can't figure out", or expresses frustration. Do NOT use for general questions.
| name | error-handling-gate |
| description | Verifies error handling including empty catch detection, user-friendly messages, and logging. WARNING gate triggered during /own:done flow. |
"Happy path code is easy. Error handling is where senior engineers shine."
This gate ensures the code handles failures gracefully, provides meaningful feedback to users, and doesn't silently swallow errors.
"What happens if [main operation] fails? Walk me through the user experience."
Looking for:
Example scenarios:
"What does the user see when an error occurs? Would they understand what to do next?"
Looking for:
"How would you debug this in production if something went wrong?"
Looking for:
✅ ERROR HANDLING GATE: PASSED
Error handling looks solid:
- Async operations properly wrapped
- User-friendly error messages
- Errors logged for debugging
Moving to the next gate...
⚠️ ERROR HANDLING GATE: WARNING
Found [X] error handling concerns:
**Issue 1: [Empty catch block / Missing error handling]**
Location: `file.ts:42`
Question: "What happens when this fails silently?"
**Issue 2: [Technical error shown to user]**
Location: `file.ts:88`
Question: "Will users understand 'TypeError: Cannot read property...'?"
**Issue 3: [No loading state cleanup]**
Location: `file.ts:100`
Question: "What happens to the loading spinner if this fails?"
These should be addressed to ensure a good user experience.
❌ try {
await submitForm();
} catch (error) {
// Silent failure - user has no idea
}
✅ try {
await submitForm();
} catch (error) {
console.error('Form submission failed:', error);
setError('Could not submit. Please try again.');
}
❌ try {
setLoading(true);
await fetchData();
setLoading(false);
} catch (error) {
handleError(error);
// Loading stays true forever!
}
✅ try {
setLoading(true);
await fetchData();
} catch (error) {
handleError(error);
} finally {
setLoading(false);
}
❌ catch (error) {
setError(error.message);
// User sees: "TypeError: Cannot read property 'map' of undefined"
}
✅ catch (error) {
console.error('Load failed:', error);
setError('Something went wrong. Please try again.');
}
❌ catch (error) {
setError('Error');
}
✅ catch (error) {
if (error.status === 401) {
setError('Please log in to continue.');
redirectToLogin();
} else if (error.status === 404) {
setError('Item not found.');
} else if (error.name === 'NetworkError') {
setError('Check your internet connection.');
} else {
setError('Something went wrong. Please try again.');
}
}
Instead of pointing out the fix, ask:
| Bad Message | Better Message |
|---|---|
| "Error" | "Could not save. Please try again." |
| "An error occurred" | "Unable to load your profile. Check your connection." |
| "TypeError: undefined" | "Something went wrong. Please refresh and try again." |
| "500 Internal Server Error" | "Our servers are having trouble. Please try again in a moment." |
| "Failed" | "Could not complete your request. Need help? Contact support." |
| Issue | Severity | Impact |
|---|---|---|
| Empty catch block | HIGH | Silent failures, hard to debug |
| No loading state cleanup | MEDIUM | Stuck UI, poor UX |
| Technical error shown | MEDIUM | Confusing UX, potential info leak |
| No retry option | LOW | Minor UX friction |
| Generic error message | LOW | Less helpful but not broken |