Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Builds the data layer for one entity in domain/ with Zod schemas, types, slices, mocks, selectors and RTK Query endpoints.
23% 91%+68 ptsof test cases passed
Passed 20 of 22 test cases with the skill, and 5 of 22 without it.
This test ran on v1. v3 is the current version and hasn’t been tested on gemini-3.8-flash yet.
3 of 3 safety checks passed
Not used yet
One backend resource maps to one entity. Use data-layer-advanced
when one response hydrates several entities. Placement comes from
structure-flow, barrels from
package-public-api.
Source: Types, Initial State & Mocks
| Package | Owns | Never |
|---|---|---|
@domain/entity-<name> | schemas, inferred types, branded ids, slice, mocks, selectors | React, network calls, an app store type |
@domain/api-<name> | endpoints, wire schemas, transforms, cache tags, hooks | createApi, base URL, env reads |
Reference packages: @domain/entity-contact and
@domain/api-push-devices.
domain/entity/<name>/src/
├── schema.ts # Zod schemas (required)
├── types.ts # z.infer types and the state type
├── schema.mock.ts # mock factories, parsed by the schema (required)
├── slice.ts # createSlice with its selectors, initial state, default reducer
├── slice.mock.ts # mock slice state (required with a slice)
└── index.ts # export * only
Every source file has its *.test.ts. The slice and its mock are optional: an entity can be
schema-only.
Schema first. Write the Zod schema, then infer the type. Never hand-write a type the schema already describes, and never add Typia.
// schema.ts
export const ContactNameSchema = z.string().min(1).max(CONTACT_NAME_MAX_LENGTH).brand<"ContactName">();
// types.ts
Next to this one in the catalogue, plus more from the same author.