translate-spec-to-craft-ts

Translate functional specifications into @craft-ts/core primitives, insertions, and store compositions.

3|Updated Jan 9, 2026
One-click install
npx skills add https://github.com/craft-ts/craft-ts --skill translate-spec-to-craft-ts-craft-ts
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: translate-spec-to-craft-ts
Source: https://github.com/craft-ts/craft-ts/tree/main/.cursor/skills/translate-spec-to-craft-ts
Command: npx skills add https://github.com/craft-ts/craft-ts --skill translate-spec-to-craft-ts-craft-ts

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Choosing the right @craft-ts/core API for a product requirement is hard when specs are written in business language. This Skill maps functional specifications, user stories, and page requirements (including French wording like "afficher", "liste", "supprimer") directly to concrete craft-ts primitives, insertions, store utilities, and entity helpers. ## Core Features & Use Cases - Lexical mapping: Converts spec wording into query, mutation, state, queryParams, asyncProcess, source$, and craft* store utilities using a documented lexical map. - Default compositions: Applies pattern recipes for list pages, detail pages, bulk delete with optimistic updates, URL-filtered search, forms, and feature stores, including craftPipe composition rules and optimistic-update defaults. - Architecture alignment: Points each mapping to existing baseline architecture-test helpers instead of inventing new rules. - Use Case: Given a spec like "display a user list with single and bulk delete", the Skill returns a mapping of query + two mutations + selection state + insertReactOnMutation with removeOne/removeMany and reload.onMutationError: true. ## Quick Start Use the translate-spec-to-craft-ts skill to map this functional spec to @craft-ts/core primitives, insertions, and craft utilities.

Frequently Asked Questions about translate-spec-to-craft-ts

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

FAQPage Schema
How do I map a functional spec to craft-ts primitives?▼

Decompose the spec into remote reads, remote writes, local UI state, URL state, events, and forms, then match each part: server reads to query, writes to mutation, UI-only state to state, and URL-backed state to queryParams. The lexical map in references/lexical-map.md gives the exact wording-to-API correspondences.

Which craft-ts utility should I use for a list page with delete actions?▼

Use one query for the list, one mutation per delete intent (single and bulk), a selection state for selected ids, and insertReactOnMutation on the query with optimisticUpdate using removeOne or removeMany. Enable reload.onMutationError by default for optimistic deletes.

How do I combine multiple insertions on one craft-ts primitive?▼

A primitive accepts only one insertion, so compose several with the universal craftPipe: primitive(config, (context) => craftPipe(context, insertion1, insertion2)). The variadic form no longer exists, except for the form-tree helpers which stay variadic.

When should I use craftInputs instead of queryParams in craft-ts?▼

Use craftInputs when a value comes from a parent component, route, or context and does not belong in the URL. Use queryParams only for shareable, URL-backed state such as page, sort, search, and filters.

Does the skill cover optimistic updates and pagination in craft-ts?▼

Yes. It defaults to optimisticPatch for shallow field edits and optimisticUpdate for structural changes, with reload.onMutationError enabled. For pagination it recommends identifier on the query plus insertPaginationPlaceholderData to avoid flicker.

When should I avoid advanced craft-ts exports like toSource or resourceById?▼

Treat toSource, computedSource, signalSource, linkedSource, resourceById, and toInject as infrastructure-level choices. Only select them when the request is explicitly about source pipelines or custom resource plumbing, not ordinary product wording.