# Error States

> Design the non-happy-path UI in Next.js — loading, error, not-found, and empty states with Suspense, error boundaries, and user-facing feedback. Use when a page fetches data, can fail, or can be empty.

- **Type:** Skill
- **Install:** `agentstack add skill-m-binimran-dev-pack-error-states`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [m-binimran](https://agentstack.voostack.com/s/m-binimran)
- **Installs:** 0
- **Category:** [Databases](https://agentstack.voostack.com/c/databases)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [m-binimran](https://github.com/m-binimran)
- **Source:** https://github.com/m-binimran/dev-pack/tree/main/skills/error-states

## Install

```sh
agentstack add skill-m-binimran-dev-pack-error-states
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# error-states

Most apps ship the happy path and forget the other three. A surface isn't done until loading, empty, and
error are all handled.

## The four states for every data surface
1. **Loading** — `loading.tsx` or ``. Use skeletons that match the final layout (no CLS),
   not a bare spinner where possible.
2. **Empty** — designed empty state with a next action ("No projects yet — create one"), not a blank box.
3. **Error** — `error.tsx` (client error boundary) with a human message + a retry (`reset()`); log the real
   error server-side. Never show a raw stack trace to users.
4. **Not found** — `not-found.tsx` + `notFound()` for missing resources (real 404, not a 200 with "nothing here").

## Feedback for actions
- Mutations show pending state (disabled + spinner) and a success/error toast (`aria-live` for errors).
- Optimistic updates roll back visibly on failure (see `state-architect`).

## Output
- The loading/empty/error/not-found treatments for the surface, and the action feedback.
- State which of the four are implemented and which are N/A.

## Guardrails
- No surface ships with only the happy path.
- Error UI must not leak internal details; log them server-side instead.
- Skeletons must reserve the real layout's space to avoid layout shift.

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [m-binimran](https://github.com/m-binimran)
- **Source:** [m-binimran/dev-pack](https://github.com/m-binimran/dev-pack)
- **License:** MIT

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-m-binimran-dev-pack-error-states
- Seller: https://agentstack.voostack.com/s/m-binimran
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
