Skip to content
cognitedata avatar

Correctness And Error Handling

Fix correctness and error-handling defects, add missing error states, and validate external data before use in a Flows app.

CCM score
58 of 100
skills.sh installs
1.9K
GitHub stars
6
last updated
Aug 21, 2026
View on GitHub

Own this skill? Claim it

What it does

  • Covers four steps: resolving TODO/FIXME/HACK markers in critical paths, adding an error boundary, wrapping async calls, and adding loading, error, and empty states
  • Includes a react-error-boundary wrapper in App.tsx and Zod safeParse checks for JSON.parse, localStorage, and useSearchParams values
  • Enforces that every data-fetching component renders loading, error, and empty states in that order before the data render
  • Designed for Flows apps where CDF SDK calls, auth flows, and shared hooks need runtime guards beyond TypeScript types

Install

$ npx -y skills add cognitedata/builder-skills --skill correctness-and-error-handling -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

Files

Correctness & Error Handling Fix

Find and fix correctness issues and missing error handling in $ARGUMENTS (or the whole app if no argument is given). Work through every step below. Each step searches for problems and then fixes them in place. Only report issues that cannot be auto-fixed.


Step 1 — Map data flows and fix known defects

Read these files before checking anything:

  • src/main.tsx / src/App.tsx — top-level error boundaries and auth flow
  • All files matching **/hooks/*.ts, **/contexts/*.tsx — shared async state
  • All files matching **/api/*.ts, **/services/*.ts — CDF SDK call sites

For each async data source, note:

  • What happens when the request fails (network error, CDF 403, timeout)?
  • What does the UI show while loading?
  • What does the UI show if the result is empty?

Find and fix known defects in critical paths

# Find TODO/FIXME/HACK in critical code paths (not test files)
grep -rn --include="*.ts" --include="*.tsx" -E "(TODO|FIXME|HACK|XXX):" src/ | grep -v ".test." | grep -v ".spec."

Details

Repository
github.com/cognitedata/builder-skills
Categories
Frontend & UI Code, Code Review & Quality
First seen
Jun 3, 2026

Questions

What does the correctness-and-error-handling skill do?

The correctness-and-error-handling skill finds and fixes bugs, missing error states, unhandled rejections and edge-case failures in a Flows app, rather than only reporting them. It adds error boundaries, try/catch wrappers, loading, error and empty states, and type narrowing for external data.

How do I install the correctness-and-error-handling skill?

Run npx -y skills add cognitedata/builder-skills --skill correctness-and-error-handling -y in your project. Once installed, the skill lets your agent work through a Flows app and fix correctness and error handling issues in place.

Which Flows app problems does the correctness-and-error-handling skill fix?

The correctness-and-error-handling skill fixes unhandled async errors, null and undefined crashes, missing loading and empty states, useEffect cleanup gaps and unsafe JSON parsing. It searches the critical paths first and then edits the affected files directly.

Who should use the correctness-and-error-handling skill?

Developers building Flows apps who want the agent to harden data fetching, rendering and error paths. Its category on Claude Marketplaces is Frontend & UI Code.

More from cognitedata/builder-skills

All 25

Similar to Correctness And Error Handling

More Frontend & UI Code