Skip to content

Commit c8341b9

Browse files
improvement(platform): wire the organization view into the Platform app
Builds on the design system already on staging: the Platform zone at /org, live data through platform/lib/data, a shared chat runtime, and the Settings, Home, Integrations, Links and People views, behind the platform-org-ui flag. The commit-by-commit history is on backup/platform-core-chat-2026-11-05. Co-authored-by: Emir Karabeg <emirkarabeg@berkeley.edu>
1 parent 7625929 commit c8341b9

806 files changed

Lines changed: 89387 additions & 8648 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.agents/skills/add-settings-page/SKILL.md‎

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
---
22
name: add-settings-page
3-
description: Add a new Sim settings page, or audit existing settings pages for design-system compliance with the shared SettingsPanel layout. Use when creating a settings tab, or when asked to check/clean up settings pages so they match the design system (consistent title, header, search, spacing).
3+
description: Add or audit settings pages that use SettingsPanel in the existing Sim app. Use implement-platform for isolated Platform settings.
44
---
55

66
# Settings Page (add / audit)
77

8+
For `apps/sim/platform/**`, use [implement-platform](../implement-platform/SKILL.md). In a mixed request, apply the steps below only to the existing app's settings.
9+
810
Settings page chrome (header bar, scroll region, content column, nav-driven
911
title + description) is owned by the `settings/[section]/layout.tsx` shell. Each
1012
page renders through **`SettingsPanel`**, which registers the page's header data
@@ -45,28 +47,28 @@ For each page component, confirm the checklist in `.claude/rules/sim-settings-pa
4547
Each grep lists candidates; review every match against the expected ones named below.
4648

4749
1. Find hand-rolled shells that should be `SettingsPanel`:
48-
`git grep -n "flex h-full flex-col bg-\[var(--bg)\]" -- 'apps/sim/**/settings/**' 'apps/sim/ee/'`
50+
`git grep -n "flex h-full flex-col bg-\[var(--bg)\]" -- 'apps/sim/**/settings/**' 'apps/sim/ee/' ':(exclude)apps/sim/platform/**'`
4951
— expected matches: the workspace and organization `settings/layout.tsx` shells and the
5052
shared header shell (`components/settings/settings-header.tsx`); an entitlement/loading gate
5153
is also fine. `CredentialDetailLayout` (the `settings/secrets/[credentialId]` exception) is
5254
an exempt hand-rolled shell outside these pathspecs. A detail sub-view is never a match: it
5355
passes `back={{ text, icon: ArrowLeft, onSelect }}` to `SettingsPanel`. Anything else is a
5456
violation: render it through `SettingsPanel`.
5557
2. Find hand-rolled title blocks:
56-
`git grep -n "text-\[var(--text-body)\] text-lg" -- 'apps/sim/**/settings/**' 'apps/sim/ee/'`
58+
`git grep -n "text-\[var(--text-body)\] text-lg" -- 'apps/sim/**/settings/**' 'apps/sim/ee/' ':(exclude)apps/sim/platform/**'`
5759
— the only title is the `<h1>` in `settings-header.tsx`; a non-heading value at that size
5860
(e.g. the credit balance in `ee/organization-usage/components/usage-credits.tsx`) is fine.
5961
3. Find literal pixel text sizes (should be 0 — see "Text Scale" in
6062
`.claude/rules/sim-styling.md`):
61-
`git grep -nE "text-\[1[0-8]px\]" -- 'apps/sim/**/settings/**' 'apps/sim/ee/'`.
63+
`git grep -nE "text-\[1[0-8]px\]" -- 'apps/sim/**/settings/**' 'apps/sim/ee/' ':(exclude)apps/sim/platform/**'`.
6264
Display type above the scale (`text-[40px]` hero headings) is deliberate and out of
6365
scope.
6466
4. Confirm each page imports `SettingsPanel` and that its registry entry has an
6567
accurate `description` of consistent length with its peers.
6668
- Editable pages: confirm Save/Discard go through `saveDiscardActions()` and
6769
dirty is wired via `useSettingsUnsavedGuard` (called before early-return
6870
gates) — flag any hand-rolled Save button, `beforeunload`, or unsaved modal.
69-
`git grep -n "beforeunload" -- 'apps/sim/**/settings/**' 'apps/sim/ee/' 'apps/sim/components/settings/' ':(exclude,glob)**/*.test.*'`
71+
`git grep -n "beforeunload" -- 'apps/sim/**/settings/**' 'apps/sim/ee/' 'apps/sim/components/settings/' ':(exclude)apps/sim/platform/**' 'apps/sim/hooks/use-settings-browser-navigation.ts' ':(exclude,glob)**/*.test.*'`
7072
should only hit the centralized `use-settings-browser-navigation.ts`.
7173
5. Fix each finding with the smallest structural change that satisfies the checklist;
7274
do not touch handlers, state, queries, or gate returns. A pixel-size fix swaps

‎.agents/skills/cleanup/SKILL.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Run these in parallel on the parsed `scope`:
2525
3. `/you-might-not-need-a-callback <scope> fix=false`
2626
4. `/you-might-not-need-state <scope> fix=false`
2727
5. `/react-query-best-practices <scope> fix=false`
28-
6. `/emcn-design-review <scope> fix=false`
28+
6. Design review: route `apps/sim/platform/**` to [implement-platform](../implement-platform/SKILL.md) and existing app EMCN paths to [emcn-design-review](../emcn-design-review/SKILL.md). For a mixed diff, the same pass reviews each subset with its own contract. Both reviews are read-only and return proposals for Step 2.
2929
7. `/you-might-not-need-url-state <scope> fix=false`
3030
8. `/you-might-not-need-a-comment <scope> fix=false`
3131
9. `/test-audit audit <test paths>` — read-only; only when the scope adds or changes test files (`*.test.ts(x)`, `*.integration.ts`, `**/e2e/**`, `apps/sim/scripts/test-*-e2e.ts`). First resolve a free-form scope to the concrete list of added or changed test paths (`git diff --name-only` against the scope's base) and pass those paths. It applies the authoring gate to every new or changed test and proposes deleting the ones that fail it.

‎.agents/skills/emcn-design-review/SKILL.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
name: emcn-design-review
3-
description: Review UI code for alignment with the emcn design system — components, tokens, patterns, and conventions
3+
description: Review the existing Sim app against packages/emcn. Route isolated Platform UI in apps/sim/platform to implement-platform.
44
argument-hint: "[scope] [fix=true|false]"
55
---
66

@@ -14,7 +14,7 @@ User arguments: $ARGUMENTS
1414

1515
## Context
1616

17-
This codebase uses **emcn**, a custom component library built on Radix UI primitives with CVA variants and CSS variable design tokens. All UI must use emcn components and tokens.
17+
The existing Sim app uses `packages/emcn`, its Radix primitives, CVA variants, and CSS tokens. For `apps/sim/platform/**`, use [implement-platform](../implement-platform/SKILL.md). For mixed scopes, review each file under its owning system and preserve the requested `fix` mode for both.
1818

1919
## Steps
2020

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
name: implement-platform
3+
description: Build, change, consolidate, remove, or review Sim Platform UI in apps/sim/platform. Use for code-first product routes, EMCN components, Paper handoff and design drift in the isolated Next app.
4+
---
5+
6+
# Implement Sim Platform
7+
8+
Start in the Sim checkout containing the requested product work. Read the [Platform contract](../../../apps/sim/platform/AGENTS.md) and [component ownership map](../../../apps/sim/platform/docs/component-ownership.md). These versioned files carry the current rules into a fresh chat. Use the [Platform README](../../../apps/sim/platform/README.md) for the local routes, fixture states, generators, and verification commands.
9+
10+
1. **Establish scope on the real route.** Identify the product entry, interaction, phase, and affected consumers. When rebuilding an existing workflow, trace the old navigation target, its access gate, and the actions reachable by that viewer. Use that evidence to decide which controls belong on the new page before consulting the broader API or provider catalog. Phase 1 owns foundations and the library. Phase 2 owns working UI and transient interaction state, with examples supplied through the server fixture flag. Phase 3 connects real data and operations. Reuse the same renderer in the browser and Sim Desktop. Read the installed Next guides for the file structure or framework behavior you are changing.
11+
For organization Settings, inventory the old sidebar in order, its viewer/deployment gates and every action reachable from each section. Map old header buttons to the row or section they act on. Verify the same destination and drilldown on the fixture and authenticated routes; keep real writes outside fixture sessions.
12+
2. **Resolve design intent.** For Paper-backed work, use `$sim-paper-design` to locate the live Shared or Platform master and the product states that use it. Exclude Marcus. Preserve the key and theme roles. Treat artboard sizes as reference measurements. For code-first changes, follow the latest explicit product direction and inspect the rendered route. Identify any source you could not verify. Update the Paper canvas when the request includes Paper changes.
13+
3. **Choose or change the owner.** Start with the behavior. An action, navigation row, value picker, or disclosure has an existing keyboard and pointer contract. Different interactions may share visual roles while retaining different semantics. Use the existing family and named props for a change in size, intent, icon, or content. Put unique anatomy and its CSS beside the route component. Keep page files free of styling. Only EMCN owns the appearance of its controls. Use Base UI there for complex keyboard, floating, and dismissal behavior.
14+
4. **Trace the full change.** On a second independent feature use, promote the original implementation and migrate both callers. For consolidation, compare semantics, map every consumer to its replacement, then remove the obsolete implementation, export, variant styles, and unused registrations. For deletion, also check menus, preferences, fixture data, workbench references, and tests that existed only for the removed feature. Preserve unrelated consumers and historical Paper evidence. A new variant needs a reachable product use. Edit the source or compiler for generated foundations and recipes.
15+
5. **Verify where people use it.** Run the design audit and applicable checks from the README. Render the changed product route with empty, full, stress, and fixture-off data as relevant. Check both themes, widths between artboards, long content, text scaling, keyboard, and pointer states. Compare shared controls in their actual consumers. Check the actual scroll edge and the open popup when space is tight. For shell, panel, or desktop work, exercise the real Electron renderer. For substantial implementations and consolidations, use an independent agent during design or implementation and for a final review of the changed owners and routes. Provide the working localhost route for visual review.
16+
6. **Keep decisions durable.** Follow the contract’s maintenance guidance when an approved correction changes a shared rule. Record feature-specific decisions with their feature. For sustained work, keep a task checkpoint with the code revision, verified states, evidence, and outstanding work. Include the branch or PR, checkpoint path, and localhost route in a handoff. On resumption, compare the checkpoint with the current branch, working tree, and relevant live sources before acting.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
interface:
2+
display_name: "Implement Sim Platform"
3+
short_description: "Build and review the code-first Sim Platform"
4+
default_prompt: "Use $implement-platform to implement the next Platform product change in Sim."

‎.claude/rules/emcn-components.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ paths:
66

77
# EMCN Components
88

9+
This guide applies to the existing app. For `apps/sim/platform/**`, use `apps/sim/platform/AGENTS.md`.
10+
911
Import components, `cn`, and tokens from the `@sim/emcn` barrel; icons come from the `@sim/emcn/icons` subpath, and CSS modules from their file path. Never deep-import other component subpaths. The **chip family** is the platform's primary chrome — always reach for it over the legacy primitives it is progressively replacing (`Input`→`ChipInput`, `Textarea`→`ChipTextarea`, `Modal`→`ChipModal`, `Select`/`Combobox`→`ChipSelect`/`ChipCombobox`/`ChipDropdown`, date field→`ChipDatePicker`). `ChipSwitch` is a segmented choice between options, not a replacement for `Switch`: a boolean on/off toggle stays `Switch`. For context/action menus the canonical control is `DropdownMenu` — the standard menu (not a chip, and never a hand-rolled popover).
1012

1113
## Chip chrome — single source of truth

‎.claude/rules/platform-design.md‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
description: Sim Platform implementation from Paper
3+
paths:
4+
- "apps/sim/platform/**"
5+
---
6+
7+
Use the canonical contract in `apps/sim/platform/AGENTS.md` and the `implement-platform` skill. Legacy EMCN and app styling rules do not govern this separate project.

‎.claude/rules/sim-architecture.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ paths:
66

77
# Sim App Architecture
88

9+
This guide applies to the existing app. For `apps/sim/platform/**`, use `apps/sim/platform/AGENTS.md`.
10+
911
Repository layout, package boundaries, the application operation boundary, naming, and utils placement are in the root `CLAUDE.md`. This file holds the app-internal boundaries.
1012

1113
## The `'use client'` server boundary

‎.claude/rules/sim-settings-pages.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,7 @@ rendered through `<SettingsActionChips actions={…} />` from
344344
is what keeps tone/icon/variant/tooltip handling from drifting between the two
345345
shells. Reach for it before hand-rolling a `Chip`.
346346
- **`useSettingsUnsavedGuard({ isDirty, navigationBlocked, onDiscard })`** from
347-
`@/components/settings/use-settings-unsaved-guard` registers one editor with the
347+
`@/hooks/use-settings-unsaved-guard` registers one editor with the
348348
shared settings store. Register every full-page draft, including inline creation
349349
forms. Dirty computation stays local and derived; fetched defaults stay clean.
350350
- **`onDiscard` resets the registered draft.** The root `SettingsNavigationGuard`

‎.claude/rules/sim-styling.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ paths:
77

88
# Styling Rules
99

10+
This guide applies to the existing app. For `apps/sim/platform/**`, use `apps/sim/platform/AGENTS.md`.
11+
1012
## Tailwind
1113

1214
1. **No inline styles** - Use Tailwind classes. Exception: a genuinely dynamic

0 commit comments

Comments
 (0)