Agent skill

avoid-null-returns

Instead of returning null, consider: throwing an exception for unexpected missing data, returning... Use when enforcing code quality standards. Quality category skill.

Stars 163
Forks 31

Install this agent skill to your Project

npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/other/avoid-null-returns

Metadata

Additional technical details for this skill

category
Quality
priority
medium
is built in
YES
session guardian id
builtin_avoid_null_returns

SKILL.md

Avoid Null Returns

Instead of returning null, consider: throwing an exception for unexpected missing data, returning an empty collection for list operations, using the Null Object pattern, or using Optional/Maybe types. When null is truly valid, document it clearly and consider making it explicit in the type system (e.g., User | null in TypeScript).

Expand your agent's capabilities with these related and highly-rated skills.

Didn't find tool you were looking for?

Be as detailed as possible for better results