components-architecture

Guides placement and migration of UI components between TurboUI and the Operately app bridge.

553|70|Updated Feb 28, 2023
One-click install
npx skills add https://github.com/operately/operately --skill components-architecture-operately
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: components-architecture
Source: https://github.com/operately/operately/tree/main/.agents/skills/components-architecture
Command: npx skills add https://github.com/operately/operately --skill components-architecture-operately

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Deciding where new UI code belongs in the Operately codebase is ambiguous: TurboUI holds pure components, the app bridge handles data and APIs, and legacy folders are deprecated. This Skill removes that ambiguity by defining the architecture, reuse rules, and migration scenarios. ## Core Features & Use Cases - Architecture rules: Defines the three-layer model (TurboUI pure components, app bridge pages, Elixir/GraphQL backend) with data flowing down as props and actions up as callbacks. - Component reuse gate: Requires an inventory of existing TurboUI primitives (Forms, buttons, modals, selectors) before writing JSX, with a component selection map. - Legacy migration scenarios: Provides Scenario 2a (full migration for few call sites) and 2b (new pure TurboUI version for new features only) for deprecated app UI. - Use Case: When adding a new feature page, follow the app bridge pattern: prefetch with TanStack Query loaders, pass ApiTypes-shaped data as props, wire mutations through callbacks, and build the UI as a pure TurboUI component with Storybook stories. ## Quick Start Ask the agent to create a new UI component for an Operately feature following the components-architecture rules, placing it in turboui/src with an app bridge page.

Frequently Asked Questions about components-architecture

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

FAQPage Schema
Where should new UI components go in the Operately codebase?▼

New UI components always go in turboui/src/ComponentName/ as pure components. The deprecated folders app/assets/js/components/ and UI under app/assets/js/features/ must not receive new UI code.

How do I migrate a legacy app component to TurboUI?▼

Use Scenario 2a when the component has few call sites: migrate it to TurboUI and update all usages in one PR. Use Scenario 2b for many usages: create a visually identical pure TurboUI version used only in the new feature, leaving legacy call sites for a dedicated migration.

Can TurboUI components call APIs or use React Router?▼

No. TurboUI components must not call Api.*, use React Router hooks, or read app contexts like timezone or current user. The app bridge page fetches data with TanStack Query and passes data and callbacks as props.

How should TurboUI component props be typed?▼

Props should use types from turboui/src/ApiTypes, which mirror app/assets/js/api types. When the UI needs a different shape, define a component-specific type in the component's types.ts, re-exporting from ApiTypes where possible.

What form components should I use for new UI in TurboUI?▼

Use Forms.Form, Forms.FieldGroup, Forms.TextInput, and Forms.Submit as the default stack for conventional forms. Use TextField for inline editing. FormElements/Textfield is legacy and must not be selected for new UI.