원클릭으로
handle-edge-cases
For boundary conditions: empty collections, zero values, recursive base cases, null checks, prevent crashes at edges.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
For boundary conditions: empty collections, zero values, recursive base cases, null checks, prevent crashes at edges.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
Conducts iterative deep research on any topic using web search, progressive exploration, and structured synthesis. Use when asked for comprehensive research, deep investigation, thorough analysis, or multi-source exploration of any topic. Triggers: research, investigate, deep dive, comprehensive analysis, explore thoroughly, find everything about.
For cross-cutting concerns: add behavior without modifying functions, caching, timing, logging, validation wrappers.
For performance work: measure before changing, profile to find bottlenecks, compare before and after.
For symbolic computation: ASTs, mathematical expressions, code that manipulates code structure, expression transformations.
For ordered processing: A* search, Dijkstra, event simulation, task scheduling. Efficient min/max extraction with heap-based queue.
For dynamic programming: overlapping subproblems, recursive solutions with repeated computations, memoization to avoid redundant work.
| name | handle-edge-cases |
| description | For boundary conditions: empty collections, zero values, recursive base cases, null checks, prevent crashes at edges. |
Explicitly check boundary conditions before operations.
def process(items):
# Handle empty
if not items:
return default_value
# Handle single element
if len(items) == 1:
return items[0]
# Now safe to assume len >= 2
return combine(items[0], process(items[1:]))
def divide(a, b):
if b == 0:
return None # or raise, or return infinity
return a / b
# Sudoku constraint propagation (sudoku.py)
def eliminate(values, s, d):
"""Eliminate d from values[s]; propagate."""
if d not in values[s]:
return values # Already eliminated - edge case
values[s] = values[s].replace(d, '')
# Edge case: no values left
if len(values[s]) == 0:
return False # Contradiction
# Edge case: exactly one value left
if len(values[s]) == 1:
d2 = values[s]
if not all(eliminate(values, s2, d2) for s2 in peers[s]):
return False
# Edge case: only one place for d in unit
for u in units[s]:
dplaces = [s for s in u if d in values[s]]
if len(dplaces) == 0:
return False # No place for this value
if len(dplaces) == 1:
if not assign(values, dplaces[0], d):
return False
return values
# SET.py - zero division guard
def show(tallies, label):
for size in sorted(tallies):
y, n = tallies[size][True], tallies[size][False]
ratio = ('inft' if n == 0 else int(round(float(y)/n)))
print(f'{size:4d} |{y:7,d} |{n:7,d} | {ratio:4}:1')
# spell.py - word not found case
def candidates(word):
"""Generate possible spelling corrections for word."""
return (known([word]) or # Word itself if known
known(edits1(word)) or # 1 edit away
known(edits2(word)) or # 2 edits away
[word]) # Fallback: return original
list[0]or default patternif not items: shows intent