unhappy

unhappy is a command for coding agents from educlopez/ui-craft. It costs 84 tokens per session (737 once invoked), scanned A, original, MIT.

A design review that covers UI states beyond the normal successful case, such as loading, no data, errors, conflicts, and offline use.

In plain words
What is it for?
It helps inventory states for data and interactive elements, fill missing designs, improve recovery messages, handle offline changes, and replace contradictory boolean flags with explicit states.
Why use it?
It prevents screens from being designed only for ideal conditions and leaving users without clear next steps when something goes wrong.

Command

Part of the ui-craft plugin — 30 skills, 25 commands, 2 agents, 1 MCP server shipped together

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/educlopez/ui-craft/unhappy
Clone the repo
git clone --depth 1 https://github.com/educlopez/ui-craft

Or install ui-craft, the plugin that ships this one along with the rest of its 30 skills, 25 commands, 2 agents, 1 MCP server.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for unhappy

README.md
[![agentmods](https://agentmods.dev/badge/commands/educlopez/ui-craft/unhappy.svg)](https://agentmods.dev/commands/educlopez/ui-craft/unhappy)
Your own site
<a href="https://agentmods.dev/commands/educlopez/ui-craft/unhappy"><img src="https://agentmods.dev/badge/commands/educlopez/ui-craft/unhappy.svg" alt="Measured on agentmods" height="20"></a>
Per session 84 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 737 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00084 $0.00737
Opus 5 $0.00042 $0.00368
Sonnet 5 $0.00017 $0.00147
Haiku 4.5 $0.00008 $0.00074

Measured 5d ago against content hash 06b2b747ba9c, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

unhappy scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 5d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

cli/assets/claude/commands/unhappy.md · 47 lines

What it actually says

Design every non-happy state for the UI at $ARGUMENTS. Load the ui-craft skill and read references/state-design.md.

Step 1 — Inventory. List every data source and interactive surface in the target. For each, enumerate its states:

Surface idle loading empty error partial conflict offline

Mark each cell as designed (exists in code), missing (must add), or N/A (not applicable — e.g., a read-only view has no conflict state).

Step 2 — Fill the missing states. For each missing state, either stub it inline or add a follow-up task comment. Use references/state-design.md for:

  • Skeleton sizing (match final layout, 200ms delay, 5s upper bound)
  • Empty-state copy (why empty + next action + visual)
  • Error-state contract (specific cause + one-click recovery + support ID)
  • Offline handling (queue writes + reconcile on reconnect)

Step 3 — Audit the happy path. Flag every spot where the happy path assumes resource presence without checking. Fix with early-returns, state guards, or discriminated-union state handling. Booleans like isLoading && !error && data that allow impossible states are findings — refactor to a proper state machine or reducer.

Step 4 — Optimistic UI + reconciliation. For offline-likely actions (saves, sends, edits, toggles), implement optimistic UI with reconciliation on reconnect. Queue writes locally. Surface any rejected writes — never swallow them.

Knob gating (CRAFT_LEVEL):

CRAFT_LEVEL Required states to stub
≤ 4 idle, loading, error
5-7 idle, loading, empty, error, success
8+ all six — add partial, conflict, offline

If CRAFT_LEVEL is unknown, default to 7.

Convergence note: To iterate until all required states are present, load skills/ui-craft/references/loops.md and run preset state-coverage (budget = the default loop budget defined in loops.md): after stubbing the highest-priority missing required state, re-inventory until all knob-required states are present or budget exhausted. Emit the pre-flight cost notice before iteration 1.

Output: edit the code directly. After each file, print the Review Format table from SKILL.md:

Before After Why
no loading state on <ProjectList> skeleton rows matching final layout, 200ms delay prevents "is it broken?" perception; avoids CLS
generic "Error" toast inline error with specific cause + retry + support ID recoverability (heuristic 9)

One row per state added. No full diffs.

Next step: /harden — implement the states you just designed (rung 1).

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 5d ago First seen · 47 lines · 84 tokens per session scan A 06b2b747ba9c

Subscribe to this mod's changes

unhappy is a command published in the GitHub repository educlopez/ui-craft (313 stars, last pushed yesterday), licensed MIT. It adds 84 tokens to every session and 737 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.