/coleoni-states

Every state of a component. Not just the happy one.

A component is designed full of data. It spends a good part of its life waiting, empty, failing or half filled. The skill forces each of those states through the component’s real API calls, shows them side by side, finds the ones nobody designed, and builds them.

npx skills add c0le0ni/skills --skill coleoni-states
View on GitHub
Claude Code, Codex, Cursor, Gemini CLI and more 9 states Through the real API, no mocks Finds crashes and raw values
The Streak leaderboard with the API answering 500, enlarged: before, it said a connection was missing; after, it shows the code, says the server failed and the run wasn’t affected, and offers Try again Two before-and-after pairs: the empty leaderboard of a past day (“the top spot is open” became “no one made the ranking that day”) and the leaderboard offline (a dead-end sentence became a notice with Try again) The map of the leaderboard after the skill: the GET /challenge/board call, loading as a list, four ways to answer and three failures, each with its sentence, and the green Try again path back to loading
Example

Four failures, one sentence.

I ran the skill on the daily challenge leaderboard of Streak, my game, on a copy of the code reading the real production API. With data, it was fine. The script flagged 4 of the 9 states: loading gave no sign, and a server error, being offline and an ended session all said “The daily challenge needs a connection.” Reading the board found a fifth: a missing field said the same. After I built the states in the copy, none had problems.

states.md
# Component states: ?desafio
  .challenge__board

4 / 9 states with problems.
API: **/api/challenge/board*

- Ready: ok
- Loading: problem.
  gives no sign that it is loading
- Empty: ok
- One item: ok
- Many items: ok
- Missing fields: ok
- Server error: problem.
  looks exactly like “Missing fields”
- Offline: problem.
  looks exactly like “Missing fields”
- No permission: problem.
  looks exactly like “Missing fields”
5 → 0states with problems, of 9
4failures with the same sentence
1found by reading, not by the script
0mocks written
States

Nine states, from the real API.

The script loads the page once, records the JSON calls the component makes, and then answers them differently for each state.

StateHow it is forced
ReadyThe real response
LoadingThe response never arrives
EmptyEvery list in the real response emptied
One, manyEvery list with 1 item, and with 30
Missing fieldsHalf the values in each record set to null
Server errorThe API answers 500
OfflineThe request fails as with no connection
No permissionThe API answers 401: the session expired
How it works

Force, compare, build.

Some problems need no eyes: a crash, “undefined” on screen. Others need a person: an error message that says nothing. The skill separates them.

  1. Records the API

    Every JSON call the component makes on a normal load, or the ones you name.

  2. Forces each state

    Same page, same code, a different answer from the API each time.

  3. Flags the obvious

    Blank, crashes, raw values, a state identical to another, loading with no sign, empty and errors that say nothing.

  4. Shows them together

    Tabs for each state and a grid of all of them, so the gaps jump out.

  5. Judges the rest

    Does loading keep the layout? Does the error say nothing was lost? Is a 401 treated as a 401?

  6. Builds the missing ones

    In the project’s fetch layer and components, with aria-busy and aria-live. Then runs again.

Install

One command, any agent.

The only package is playwright-core, installed by the agent on first use. It drives the Chrome or Edge you already have.

AgentClaude Code, Codex, Cursor…
Node.js18 or newer
Chrome or Edgealready on the machine
01Install
npx skills add c0le0ni/skills --skill coleoni-states
02Use it in your agent
/coleoni-states http://localhost:3000/orders .orders
For your whole user, not just the project-g
Claude Code only-a claude-code
Codex only-a codex
Every Coleoni skillnpx skills add c0le0ni/skills
Examples

Anything that waits for data.

Lists, dashboards, carts, search results, feeds. It shows the board first.

Every state of a list.

/coleoni-states http://localhost:3000/orders .orders

Choose the API calls.

/coleoni-states the dashboard --api "**/api/stats*"

Build what is missing.

/coleoni-states the cart, build the empty and error states
Options

The engine, from the terminal.

scripts/states.mjs runs on its own too: node states.mjs http://localhost:3000 --select ".orders" --out states-report.

OptionWhat it does
--select ".orders"The component
--api "**/api/x*"API calls to control, repeatable; default: the JSON calls the page makes
--states a,bOnly some states
--wait 1200How long to wait in each state
--lang en|ptLanguage of the board

Design the wait, the empty and the failure too.

npx skills add c0le0ni/skills --skill coleoni-states