rilaykit
Best practices and patterns for RilayKit — a headless, type-safe React framework for building dynamic forms and multi-step workflows with builder pattern APIs, Standard Schema validation, and granular Zustand-powered hooks. Use this skill when working on projects that import @rilaykit/core, @rilaykit/forms, or @rilaykit/workflow packages, or when building forms, multi-step flows, component registries, or conditional field logic with RilayKit.
Best use case
rilaykit is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Best practices and patterns for RilayKit — a headless, type-safe React framework for building dynamic forms and multi-step workflows with builder pattern APIs, Standard Schema validation, and granular Zustand-powered hooks. Use this skill when working on projects that import @rilaykit/core, @rilaykit/forms, or @rilaykit/workflow packages, or when building forms, multi-step flows, component registries, or conditional field logic with RilayKit.
Teams using rilaykit should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/rilaykit/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How rilaykit Compares
| Feature / Agent | rilaykit | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Best practices and patterns for RilayKit — a headless, type-safe React framework for building dynamic forms and multi-step workflows with builder pattern APIs, Standard Schema validation, and granular Zustand-powered hooks. Use this skill when working on projects that import @rilaykit/core, @rilaykit/forms, or @rilaykit/workflow packages, or when building forms, multi-step flows, component registries, or conditional field logic with RilayKit.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
# RilayKit
RilayKit is a headless React framework for dynamic forms and multi-step workflows. It uses an immutable builder pattern, Standard Schema validation, and Zustand-powered granular state hooks.
## Architecture Overview
Three packages, layered dependency:
```
@rilaykit/core → Foundation: ril instance, component registry, validation, conditions
@rilaykit/forms → Form builder, components, hooks (depends on core)
@rilaykit/workflow → Flow builder, navigation, persistence, analytics (depends on core + forms)
```
## Core Workflow
### 1. Create a ril instance and register components
```typescript
import { ril } from "@rilaykit/core";
export const r = ril
.create()
.addComponent("input", {
name: "Text Input",
renderer: InputRenderer,
defaultProps: { placeholder: "Enter..." },
})
.addComponent("select", {
name: "Select",
renderer: SelectRenderer,
validation: { validate: z.string().optional() },
})
.configure({
rowRenderer: RowRenderer,
bodyRenderer: BodyRenderer,
fieldRenderer: FieldRenderer,
submitButtonRenderer: SubmitButtonRenderer,
stepperRenderer: StepperRenderer,
nextButtonRenderer: NextButtonRenderer,
previousButtonRenderer: PreviousButtonRenderer,
});
```
Every component renderer follows the same interface:
```typescript
import type { ComponentRenderProps } from "@rilaykit/core";
type ComponentRenderer<T = any> = (props: ComponentRenderProps<T>) => React.ReactElement;
// Props received by every renderer:
// id, value, onChange, onBlur, props, error, disabled, context
```
### 2. Build forms with the fluent builder
```typescript
import { form } from "@rilaykit/forms";
const loginForm = form
.create(r, "login")
.add(
{ id: "email", type: "input", props: { label: "Email" }, validation: { validate: [required(), email()] } },
{ id: "password", type: "input", props: { type: "password" }, validation: { validate: [required()] } },
);
```
- Fields passed to the same `.add()` call render on the **same row** (max 3 per row).
- Separate `.add()` calls create **separate rows**.
### 3. Render forms headlessly
```typescript
import { Form, FormBody, FormSubmitButton } from "@rilaykit/forms";
<Form formConfig={loginForm} onSubmit={handleSubmit} defaultValues={{ email: "" }}>
<FormBody />
<FormSubmitButton>Sign In</FormSubmitButton>
</Form>
```
### 4. Build multi-step workflows
```typescript
import { flow } from "@rilaykit/workflow";
const onboarding = flow
.create(r, "onboarding", "User Onboarding")
.step({ id: "personal", title: "Personal Info", formConfig: personalForm })
.step({
id: "company",
title: "Company",
formConfig: companyForm,
conditions: { visible: when("personal.userType").equals("business") },
onAfterValidation: async (stepData, helper) => {
const result = await fetchCompany(stepData.siren);
helper.setNextStepFields({ company: result.name });
},
})
.configure({ analytics: myAnalytics })
.build();
```
### 5. Render workflows
```typescript
import { Workflow, WorkflowStepper, WorkflowBody, WorkflowNextButton, WorkflowPreviousButton } from "@rilaykit/workflow";
<Workflow workflowConfig={onboarding} onWorkflowComplete={handleComplete} defaultValues={defaults}>
<WorkflowStepper />
<WorkflowBody />
<div className="flex justify-between">
<WorkflowPreviousButton />
<WorkflowNextButton>{(p) => p.isLastStep ? "Complete" : "Next"}</WorkflowNextButton>
</div>
</Workflow>
```
## Key Patterns
### Validation: Mix libraries freely via Standard Schema
```typescript
import { required, email, pattern, custom, async as asyncValidator } from "@rilaykit/core";
import { z } from "zod";
validation: {
validate: [
required("Required"), // RilayKit built-in
z.string().email("Invalid"), // Zod
asyncValidator(checkEmail, "Already exists"), // Async
],
validateOnBlur: true,
debounceMs: 200,
}
```
### Conditions: Fluent builder with logical operators
```typescript
import { when } from "@rilaykit/core";
// Field-level conditions
conditions: {
visible: when("accountType").equals("business"),
required: when("accountType").equals("business"),
disabled: when("status").equals("locked"),
}
// Combine with and/or
when("type").equals("premium")
.and(when("status").in(["active", "verified"]))
.or(when("age").greaterThan(65))
// Operators: equals, notEquals, greaterThan, lessThan, contains, notContains,
// matches, in, notIn, exists, notExists
```
### Granular hooks: Subscribe only to what you need
```typescript
// Field-level (only re-renders when that field changes)
const email = useFieldValue<string>("email");
const errors = useFieldErrors("email");
const { setValue } = useFieldActions("email");
// Form-level
const isSubmitting = useFormSubmitting();
const allValues = useFormValues();
const { reset } = useFormActions();
```
### Reusable step definitions
```typescript
import { form } from "@rilaykit/forms";
// Define once, use across multiple flows
export const personalInfoStep = (t: TranslationFn): StepDefinition => ({
id: "personalInfo",
title: t("steps.personalInfo.title"),
formConfig: form.create(r, "personalInfo").add(/* fields */),
});
// Conditionally add steps
if (!hasExistingClient) {
workflowFlow = workflowFlow.step(personalInfoStep(t));
}
```
## Critical Rules
- **Immutable builders**: Every `.add()`, `.step()`, `.configure()` returns a new instance. Chain calls.
- **Headless architecture**: You provide ALL renderers. RilayKit handles state, validation, conditions, navigation.
- **One ril instance per app**: Register all components and renderers once, reuse everywhere.
- **Granular hooks over useFormConfigContext**: Prefer `useFieldValue`, `useFormSubmitting` etc. to avoid unnecessary re-renders.
- **Form data is namespaced by step ID** in workflows: Access via `data.stepId.fieldId`.
- **Always call `.build()`** on workflow configs before passing to `<Workflow>`. Form configs auto-build.
## Detailed API References
- **Core (ril instance, validation, conditions)**: See [references/core.md](references/core.md)
- **Forms (builder, components, hooks)**: See [references/forms.md](references/forms.md)
- **Workflow (flow builder, navigation, persistence, analytics)**: See [references/workflow.md](references/workflow.md)Related Skills
swe-cli-skills
Senior engineer CLI expertise for AI agents — workflows, safety guardrails, gotchas, and anti-patterns across cloud, IaC, containers, databases, dev tools, and platforms
PicoClaw Fleet
Orchestrate a fleet of remote PicoClaw workers over SSH for fast, ephemeral one-shot tasks.
VibeCollab — Setup Instructions for AI Assistants
You are helping a user set up VibeCollab in their project.
raycast-extension-docs
Guidance for building, debugging, and publishing Raycast extensions using the Raycast documentation set. Use when Codex needs to create or modify Raycast extensions (React/TypeScript/Node), consult Raycast API reference or UI components, build AI extensions, handle manifest/lifecycle/preferences, troubleshoot issues, or prepare/publish extensions to the Raycast Store or Teams.
evomap
Connect to the EvoMap collaborative evolution marketplace. Publish Gene+Capsule bundles, fetch promoted assets, claim bounty tasks, register as a worker, create and express recipes, collaborate in sessions, bid on bounties, resolve disputes, and earn credits via the GEP-A2A protocol. Use when the user mentions EvoMap, evolution assets, A2A protocol, capsule publishing, agent marketplace, worker pool, recipe, organism, session collaboration, or service marketplace.
maestro
Intelligent skill knowledge gateway. Routes tasks to the right knowledge without loading all skills into context. MUST be consulted before any coding task — call the search_skills MCP tool to retrieve relevant expertise from 100+ indexed skills covering Swift, SwiftUI, concurrency, testing, architecture, performance, and security.
opentui
Comprehensive OpenTUI skill for building terminal user interfaces. Covers the core imperative API, React reconciler, and Solid reconciler. Use for any TUI development task including components, layout, keyboard handling, animations, and testing.
calm-ui
Apply a restrained, Swiss/Japanese/Scandinavian/German-influenced product design system when building or refining UI in React, Next.js, TypeScript, and shadcn/ui. Use when the user asks to build, refine, critique, redesign, or review a page, screen, component, form, table, dashboard, layout, or other frontend interface, especially in projects using shadcn/ui. Do not use for marketing sites, landing pages, non-UI work, or requests for bold, playful, maximalist, or otherwise expressive aesthetics.
solid
Apply SOLID principles to write flexible, maintainable, and testable code. Use when designing classes, interfaces, and module boundaries. Covers Single Responsibility, Open/Closed, Liskov Substitution, Interface Segregation, and Dependency Inversion with practical TypeScript examples and detection heuristics.
netops-asset-manager
Manage IT infrastructure assets (routers, switches, servers, GPU clusters) through a Go + Vue 3 platform with real-time health probing, SSH remote control, configuration backup, bulk import, network topology visualization, and PM2 process management. Supports H3C, Huawei, Cisco, MikroTik, Ruijie, DCN, and Linux. Use when the user asks about IT asset management, network device operations, infrastructure monitoring, SSH device control, or development on this Go + Vue 3 platform.
Goal: Build an LLM-based RAG App
Here is the MVP Implementation Plan.
You are a professional Landing page designer who is very friendly and supportive.
Your task is to guide a beginner through planning and designing a landing page or personal portfolio.