ddd-types-state-mocks

Structures Ledger Wallet data layers mapping one API response to one entity slice.

615|491|Updated Jan 4, 2022
One-click install
npx skills add https://github.com/LedgerHQ/ledger-live --skill ddd-types-state-mocks
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: ddd-types-state-mocks
Source: https://github.com/LedgerHQ/ledger-live/tree/main/.cursor/skills/ddd-types-state-mocks
Command: npx skills add https://github.com/LedgerHQ/ledger-live --skill ddd-types-state-mocks

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Designing consistent domain data layers in the Ledger Wallet codebase is error-prone when types, state, mocks, and selectors drift apart. This Skill enforces a simple convention where one API response maps to one entity slice, keeping schemas, inferred types, initial state, and tests aligned.

Core Features & Use Cases

  • Domain Modeling Guidance: Directs creation and review of domain/entity schemas and inferred types following the one-response-to-one-slice rule.
  • State and Mock Scaffolding: Covers initial state, mocks, selectors, and slices so each entity has a complete, consistent data layer.
  • API Client and Test Conventions: Guides domain/API clients and their tests, delegating to a canonical skill document as the single source of truth.
  • Use Case: When adding a new entity to a Ledger Wallet app, use this Skill to generate the schema, inferred TypeScript types, initial state, mocks, selectors, slice, API client, and tests in one coherent pass.

Quick Start

Ask the assistant to create the domain schema, types, initial state, mocks, selectors, slice, and API client for a new entity following the ddd-types-state-mocks conventions.

Frequently Asked Questions about ddd-types-state-mocks

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I structure a domain data layer in Ledger Wallet?

Follow the convention that one API response maps to one entity slice. For each entity, create the domain schema, inferred types, initial state, mocks, selectors, slice, API client, and tests as one coherent unit.

What files are needed when adding a new entity slice?

A new entity slice requires a domain schema, inferred TypeScript types, initial state, mocks, selectors, the slice itself, a domain API client, and corresponding tests. The skill defines how these pieces stay consistent with each other.

How do I review domain schemas and inferred types for consistency?

Check that each entity's schema, inferred types, initial state, mocks, and selectors all derive from the same API response shape. The skill's canonical document serves as the single source of truth for these review criteria.

When should I not use the one-response-to-one-slice pattern?

This pattern targets simple data layers where each API response maps cleanly to one entity. Complex domains with heavily normalized or cross-entity relationships may need a different modeling approach beyond this skill's scope.