open-claude-ui
AGENTS.md1.7k starsChanged 26 days agoMITView on GitHub
Welcome, AI Agent! This repository (open-claude-ui) contains the production-grade, clean-room reverse-engineered implementation of Anthropic's Claude Design System (CDS) and its interaction physics. When assisting users with building, modifying, or reviewing frontend components, interfaces, or animations based on this repository, you MUST strictly follow the design tokens, physics laws, component guidelines, and quality gates detailed below. All tokens are defined in code-examples/cds-theme.css and exposed through Tailwind classes via code-examples/tailwind.config.js.
- Commits and pushes
Trending
More talk lately.thin dataabout the whole repository
Who's talking about Caho1/open-claude-ui
- inbn/component-gallery“Suggestion: Open Claude UI (community analysis of Claude Desktop's design system)”GitHub · Nov 4, 2026
- pahadiji/star-catcher“Promo kit — week of 26 Oct 2026”GitHub · Oct 26, 2026
- victorzhong0110/sand-table“前端整体翻新:安静的创作桌面、自由外观与连续导航”GitHub · Oct 21, 2026
- Yuzhwe/big-academy“design: add radius rules and interim Open Claude spring presets”GitHub · Oct 19, 2026
- xabierlameiro/the-last-dance“Trending radar 2026-W43”GitHub · Oct 19, 2026
The biggest 5 of 10 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 10
Talked about on GitHub (10 times).
On GitHub · 10
- Nov 4, 2026Suggestion: Open Claude UI (community analysis of Claude Desktop's design system) — inbn/component-gallery0 reactions
- Oct 26, 2026Promo kit — week of 26 Oct 2026 — pahadiji/star-catcher0 reactions
- Oct 21, 2026前端整体翻新:安静的创作桌面、自由外观与连续导航 — victorzhong0110/sand-table0 reactions · 3 comments
- Oct 19, 2026design: add radius rules and interim Open Claude spring presets — Yuzhwe/big-academy0 reactions
- Oct 19, 2026Trending radar 2026-W43 — xabierlameiro/the-last-dance0 reactions · 1 comment
5 more on GitHub
- Oct 16, 2026Caho1 'open-claude-ui' — Claude 데스크톱 앱 UI 고해상도 리버스엔지니어링, React 컴포넌트 30개 복원 (10/14, GitHub) — roomedia/ax-trend0 reactions
- Oct 16, 2026[Studio feedback] 是否可以借鉴https://github.com/Caho1/open-claude-ui所分析得到的Claude Code桌面端特征对Reasonix Stu — esengine/DeepSeek-Reasonix0 reactions
- Oct 16, 2026[Project]: open-claude-ui — Claude desktop UI reconstruction · REA / React — kaixinbaba/awesome-rea0 reactions · 1 comment
- Oct 15, 2026docs(mixture): PR1 GPL baseline, architecture, model API, design tokens — GaiQi-NJUST/Mixture0 reactions
- Oct 15, 2026WebUI 视觉语言与交互手感:新拟态(Neumorphism)与 open-claude-ui 的交互参数 — 334456777/WeFlow0 reactions · 1 comment
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.
Of the AGENTS.md files we read, the 31,774 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository2 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- .github/copilot-instructions.mdCopilot instructions
The file
Show its rules and text
We split this AGENTS.md into the rules it gives an agent
22 rules. About 0 are common, 4 are distinctive, and 18 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
18
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 5
When assisting users with building, modifying, or reviewing frontend components, interfaces, or animations based on this repository, you …
- Distinctive: line 14
Never use neon blues, magenta, or cold purple gradients.
- Very specific: line 19
Never use generic linear or exaggerated bouncy CSS transitions.
- Very specific: line 20
Use the 4 calibrated Framer Motion spring presets from code-examples/ClaudeMotionPresets.ts.
- Distinctive: line 23
Use the calibrated system fallback font stacks and procedural Web Audio API oscillator synthesis.
- Very specific: line 25
Always guard chat/composer inputs against CJK IME composition accidents (!(e.nativeEvent.isComposing || e.keyCode === 229)).
- Very specific: line 28
Every Claude Desktop version gets its own docs/v<version>/ volume — never a date-, topic- or workflow-named directory.
- Very specific: line 34
All tokens are defined in code-examples/cds-theme.css and exposed through Tailwind classes via code-examples/tailwind.config.js.
- Very specific: line 85
Always import canonical spring presets from code-examples/ClaudeMotionPresets.ts instead of hardcoding random transition parameters.
- Very specific: line 120
Not an entrance animation.
- Very specific: line 164
Never use a linear gradient for scroll fading.
- Very specific: line 233
Always use semantic tokens: Use var(--cds-bg-surface-0) or Tailwind classes (bg-surface-0, text-primary, bg-clay-500) instead of arbitrary …
- Very specific: line 234
Apply
tabular-numsfor dynamic numbers: Every timer, countdown, token counter, audio frequency indicator, and line number MUST use … - Very specific: line 245
Support Dark Mode: Always test that UI looks correct under both light (:root) and dark mode (.dark).
- Very specific: line 246
Enforce Single-Stroke Borders: If a container has a border, its internal action buttons or chips should have border-none.
- Very specific: line 249
Never introduce raw linear jumps: Do not write transition: all 0.3s linear or transition: all 0.5s ease.
- Very specific: line 250
Never commit binary assets: Never introduce .ttf, .otf, .mp3, or .wav files into the repository.
- Very specific: line 251
Never bypass Sandbox Security: Never add allow-same-origin to an iframe bridge running arbitrary LLM-generated HTML.
- Very specific: line 252
Never hijack scroll during streaming: Do not force-scroll to bottom if Date.now() - lastUserScrollTime < 150ms.
- Very specific: line 286
If your host application uses a custom design token prefix (e.g., --app-* or --dsw-*), bridge to CDS by defining aliases in your host …
- Distinctive: line 330
When adding a volume, update all four entry points and mark the previous volume as historical:
- Very specific: line 348
Before committing a new volume, run npm run typecheck, npm run check:tokens and npm run build.
≈ “Common” is an estimate: at least 1 in 5 of the 40,246 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Agent Guidelines for Claude Design System (CDS)
Welcome, AI Agent! This repository (open-claude-ui) contains the production-grade, clean-room reverse-engineered implementation of Anthropic's Claude Design System (CDS) and its interaction physics.
When assisting users with building, modifying, or reviewing frontend components, interfaces, or animations based on this repository, you MUST strictly follow the design tokens, physics laws, component guidelines, and quality gates detailed below.
🧭 Quick Reference: Core Philosophy & Rules
- Editorial Warmth, Not Cyberpunk:
- Main brand accent is warm Clay / Terracotta (
#d97757in light mode,#cc6b49in dark mode). - Surfaces use subtle warm grays (
#fcfcfb,#f7f7f5,#1b1b19), never stark pure black#000(except code blocks#0d0d0c) or harsh pure white#fff. - Never use neon blues, magenta, or cold purple gradients.
- Main brand accent is warm Clay / Terracotta (
- Low-Contrast Surface Layering:
- Differentiate layers using micro-luminance contrast (
Surface 0 ~ 3) and hairline borders (border-subtle:rgba(0,0,0,0.06)/rgba(255,255,255,0.08)). - Single-stroke border discipline: inside bordered containers (such as cards or the chat composer), secondary buttons and chips must NOT have redundant borders (
border-none).
- Differentiate layers using micro-luminance contrast (
- Organic Motion Physics:
- Never use generic
linearor exaggerated bouncy CSS transitions. - Use the 4 calibrated Framer Motion spring presets from
code-examples/ClaudeMotionPresets.ts.
- Never use generic
- Pure Code & Zero Copyright Violations:
- Zero proprietary binary fonts (
.otf/.ttf) or audio files (.mp3/.wav). - Use the calibrated system fallback font stacks and procedural Web Audio API oscillator synthesis.
- Zero proprietary binary fonts (
- Strict Edge-Case Guards:
- Always guard chat/composer inputs against CJK IME composition accidents (
!(e.nativeEvent.isComposing || e.keyCode === 229)). - Latch scroll pinning with a 150ms cooldown timestamp to prevent LLM streaming from hijacking manual user scrolling.
- Always guard chat/composer inputs against CJK IME composition accidents (
- Version-Named Documentation Volumes:
- Every Claude Desktop version gets its own
docs/v<version>/volume — never a date-, topic- or workflow-named directory. See §7.
- Every Claude Desktop version gets its own
🎨 1. Design Tokens & Styling Architecture
All tokens are defined in code-examples/cds-theme.css and exposed through Tailwind classes via code-examples/tailwind.config.js.
Surface & Background Tokens
| Token | Light Mode Value | Dark Mode Value | Usage |
--cds-surface-0 | #f9f9f7 | #0b0b0b | Base application background, page canvas (alias: --cds-bg-surface-0, --cds-bg-primary) |
--cds-surface-1 | #fcfcfb | #151515 | Sidebar panels, secondary cards (alias: --cds-bg-surface-1, --cds-bg-secondary) |
--cds-surface-2 | #ffffff | #1a1a19 | Input bars, dialog backdrops, floating popovers (alias: --cds-bg-surface-2, --cds-bg-surface) |
--cds-surface-3 | #ffffff | #20201f | Active states, hover fills, elevated tags (alias: --cds-bg-surface-3, --cds-bg-surface-elevated) |
--cds-surface-popover | #ffffff | #262624 | Floating popovers, dropdown menus |
--cds-bg-input | var(--cds-surface-3) | var(--cds-surface-3) | Text fields, chat input background |
Text & Border Tokens
| Token | Light Mode Value | Dark Mode Value | Usage |
--cds-text-primary | var(--cds-neutral-900) → #0b0b0b | #f0efec (gray-50) | Headings, primary body text, active labels (v3 运行时实证) |
--cds-text-secondary | var(--cds-neutral-600) → #52514e | #c3c2b7 (gray-200) | Timestamps, subtitles, secondary actions (v3) |
--cds-text-muted | var(--cds-neutral-400) → #898781 | #898781 (双模同值) | Placeholders, disabled text, hotkey hints (alias: --cds-text-tertiary) (v3) |
--cds-text-accent | var(--cds-role-accent-600) → #184f95 | #6da7ec | Accent role is blue, not clay (v3 运行时实证) |
--cds-border | var(--cds-alpha-2) | var(--cds-alpha-2) | Dividers, subtle list borders (alias: --cds-border-subtle, --cds-border-card) |
--cds-border-strong | var(--cds-alpha-3) | var(--cds-alpha-3) | Emphasized component borders |
--cds-border-subtle | var(--cds-alpha-2) | var(--cds-alpha-2) | Fine hairline dividers |
--cds-border-accent | var(--cds-clay) | var(--cds-clay) | Focus and active borders |
Skeleton & Motion Tokens
| Token | Light Mode Value | Dark Mode Value | Usage |
--cds-skel-i | 0 | 0 | Cascading index for skeleton wave delay (calc(var(--cds-skel-i, 0) * 90ms)) |
--cds-skeleton-base | var(--cds-alpha-1) → hsl(from neutral-900 / 5%) | hsl(from neutral-900 / 7.5%) (白) | Base skeleton placeholder container surface (v3 运行时实证:base 与 sheen 同值) |
--cds-skeleton-sheen | var(--cds-alpha-1)(同 base) | 同 base(白 7.5%) | 105° linear sweep band highlight (2s linear) |
Brand Clay Palette
--brand:#c6613f(Official desktop brand primary color)--cds-clay:#d97757(Light / pulse indicator) /#cc6b49(Dark)- 官方佐证 (v3 取证):Claude 桌面端 3.6556.2 内置的官方
frontend-designskill 原文确认 #D97757 为 "Anthropic's own Claude-interaction accent"(见docs/v4.29.0-4.4212.0/06§6.10.4),与 REA 运行时实测一致 - 角色区分 (运行时实证 3.6556.2):
brand=陶土(Claude 发起的动作,如发送/生成);accent=蓝色(--cds-text-accent: #184f95、--cds-border-accent: #86b6ef)——二者是不同角色,不可互换 - Focus shadow:
var(--cds-focus-shadow)(inset 0 0 0 1px var(--cds-page-bg), 0 0 0 1px var(--cds-fill-accent), 0 0 6px 1px var(--cds-bg-accent), 即蓝色 ring + 蓝色 glow,运行时实证)
Geometric Corner Radii
var(--cds-radius):8px(Base component radius)var(--radius-card)/--cds-card-radius:calc(var(--cds-radius, 8px) + calc(.25rem * var(--cds-rem-scale, 1)))(12px standard / concentric card radius, alias:--cds-radius-card)--cds-radius-composer:20px(Main chat composer terminal)--cds-panel-radius:10px(Panels, attachment cards)--df-radius-pill/--cds-radius-pill:999px/9999px(Pill buttons, segmented control tracks)--cds-message-bubble-radius:calc(var(--cds-radius, 8px) + calc(.25rem * var(--cds-rem-scale, 1)))(User message bubble radius, alias:--cds-radius-message-bubble)- Precision scale:
--radius-xs(2px),--radius-sm(4px),--radius-md(6px, alias:--cds-radius-btn-xs),--radius-lg(8px, alias:--cds-radius-btn-md),--radius-xl(12px, alias:--cds-radius-code),--radius-2xl(16px, alias:--cds-radius-dialog),--radius-3xl(24px)
⚡ 2. Motion Physics & Spring Presets
Always import canonical spring presets from code-examples/ClaudeMotionPresets.ts instead of hardcoding random transition parameters.
import {
SPRING_BOUNCY,
SPRING_SNAPPY,
SPRING_GENTLE,
SPRING_HEAVY_SNAP,
} from './ClaudeMotionPresets';The 4 Canonical Spring Presets
Presets 1, 2 and 4 are observed values extracted from Claude.app ion-dist.
Preset 3 (SPRING_GENTLE) is a project-local addition, not a CDS observation —
no client release checked here contains stiffness:380 or damping:18. Values
below are recomputed from the exported constants, not copied from prose.
Observed use lines record call sites found in the shipped bundle, not inferred intent.
Provenance and version scope.
Observed useand the client inventory in this section were verified against/Applications/Claude.app2.42304.2. Thedocs/v1chapters describe v1.28 and are deliberately left as the historical record of that release; thedocs/v2chapters describe v2.37337.1 but do not carry a spring table. Constant values are stable across these releases; call sites are not.
SPRING_BOUNCY(stiffness: 600, damping: 30, mass: 1.0, $\zeta = 0.612$):- Overshoot:
+8.8%. - Observed use: Microphone button mount/unmount
scale+opacity, voice-barwidth: 0 → 32expansion, button padding morphs, andpopLayouticon swaps. - Source:
ion-dist/assets/v1/shared-8-PHXy9B6B.js.
- Overshoot:
SPRING_SNAPPY(stiffness: 320, damping: 28, mass: 1.0, $\zeta = 0.783$):- Overshoot:
+1.9%. - Observed use: Drag-release rebound — paired
animate(dx|dy, target, {...preset, velocity})calls that settle a dragged element onto its slot using the release velocity. Not an entrance animation. Guarded byprefers-reduced-motion, which snaps instead. - Source:
ion-dist/assets/v1/c427176b2-DuM09fKk.js.
- Overshoot:
SPRING_GENTLE(stiffness: 380, damping: 18, mass: 1.0, $\zeta = 0.462$):- Overshoot:
+19.5%. - Observed use: none — this preset has no client call site.
- Source: none. Project-local preset filling the gap between the near-critically-damped pair and the high-frequency pop; do not present it as a Claude reading.
- Do not equate it with
duration .32 / bounce .15. That real client config (shared-9-Co0ph6Xn.js, dictation↔rest state swap) resolves through framer-motiontn()tostiffness ≈ 244, damping ≈ 26.6, ζ ≈ 0.85—+0.6%overshoot, not+19.5%.
- Overshoot:
SPRING_HEAVY_SNAP(stiffness: 1200, damping: 80, mass: 0.1, $\zeta = 3.652$, overdamped):- Overshoot:
0%(Zero overshoot). - Observed use:
file_viewerpanel width animation —animate(width, 384, preset)on open and back to the computed initial width on close. In the same modulekt = 320is the minimum width andAt = 480the default width. - Source:
ion-dist/assets/v1/c8ad300b7-07P9B-v4.js.
- Overshoot:
Other spring presets observed in the client
The four names above are a project convention, not a complete client inventory. The shipped bundle contains 14 distinct spring configs; these three are missing from the preset file and are worth knowing about:
| Config | ζ | Overshoot | Observed use | Source |
420 / 28 | 0.683 | +5.3% | Draggable capture popover, scale .25 → 1 entrance with dragElastic: .05 | c0447db9a-KKfDTbDr.js |
260 / 16 | 0.496 | +16.6% | Capture-selection handle rotation, -90° arrow marker; exit scale .6 | c0447db9a-KKfDTbDr.js |
300 / 35 / mass 1 | 1.01 | 0% | Staggered list entrance, translateY 32 → 0 with staggerChildren: .15 and a separate opacity ease-out | ccd647019-DrnyijvI.js |
Two more appear as timing variants rather than reusable presets: 320 / 30
(delay: 1, credits controls row) and 500 / 30 / mass .7.
Version caveat
docs/v1 records the matrix as it appeared in client v1.28, labelling
600 / 30 as "buttons" and 1200 / 80 / .1 as "sidebar drag damping". That
mapping was correct for that release. In 2.42304.2 both constants survive
unchanged but their call sites moved: 600 / 30 now drives the microphone and
voice bar, and 1200 / 80 / .1 drives the file_viewer panel width. Neither
docs/v1 nor docs/v2 covers 2.42304.2, so the table above is the only
current-version record in this repo. When a scenario label matters, re-derive it
from the bundle rather than trusting either volume.
7-Stop Non-Linear Fade Mask
Never use a linear gradient for scroll fading. Use the calibrated 7-stop non-linear mask
(v3 forensic note: the 3.6556.2 client drives scroll fading through @property variables +
animation-timeline: scroll() with no hardcoded multi-stop mask; keep the stops below only as a
static fallback for engines without scroll-driven animation):
mask-image: linear-gradient(
to bottom,
transparent 0%,
rgba(0, 0, 0, 0.05) 15%,
rgba(0, 0, 0, 0.18) 32%,
rgba(0, 0, 0, 0.38) 50%,
rgba(0, 0, 0, 0.64) 68%,
rgba(0, 0, 0, 0.88) 85%,
black 100%
);See code-examples/ScrollFadeContainer.tsx for dynamic top/bottom edge zeroing logic.
🧩 3. Component Directory: 30 Production Modules
Refer to or import from code-examples/ when composing UI:
Atomic Controls (5)
CdsButton.tsx: 4-tier ladder (XS: 24/6px, SM: 28/8px, MD: 32/8px, LG: 40/12px), 5 variants (Primary, Secondary, Ghost, Outline, Danger).SegmentedControl.tsx: 9999px rounded pill track, 2px geometric padding, CSS & Framer Motion dual-mode.StatusIndicators.tsx: Clay 2.4s breathing light, 1.2s active run pulse, 3-dot wave, skeleton sweep.ConfirmationDialog.tsx: 16px corner radius, dual-ring popover shadow, focus trap.AttachmentCard.tsx: 10px panel radius, desktop card grid (128×96px) and inline composer pill dual-mode.
Conversation Stream & Input (6)
ChatComposer.tsx: 20px core input terminal, dual-ring focus shadow,field-sizing: contentauto-resize.ChatMessageBubbles.tsx: User 18px radius with soft tint vs Assistant zero-border transparent layout.ThinkingAccordion.tsx: Framer Motion height spring expansion, single clay breathing pulse dot, active generation mutex.RichComposerWithMentions.tsx: CJK IME composition guard,/command &@context dual triggers, token budget estimator.ModelSwitcherWithTokenGauge.tsx: 3-tier model switcher, Extended Thinking toggle, Prompt Caching 4-color memory SVG gauge.McpToolDecisionCard.tsx: 3-state authorization lifecycle (pending_approval→running→success/error), 3-tier action array.
Atmosphere & Motion (3)
ClaudeMotionPresets.ts: 4 calibrated physics presets.ReasoningAmbientGlow.tsx: Warm Clay diffuse light field,cds-shimmer-text-shineasymmetric sweep, caustic canvas.ScrollFadeContainer.tsx: 7-stop non-linear mask with edge sensors.
Audiovisual & Media (8)
ClaudeAudioPlayer.ts: Procedural Web Audio API oscillator synthesis, 30% gentle volume standard, anti-pop gain ramp smoothing.LiveMicActivityBars.tsx: 6-band speech spectrum visualizer (85Hz-4.8kHz), 8% noise floor gate,Math.pow(energy, 0.7)non-linear Gamma power compression.MediaLightboxViewer.tsx: 75vw runway viewport, cursor-anchored affine pan/zoom equation, 4px drag deadzone, Ctrl + wheel zooming.useClaudeSharedElementTransition.ts:startViewTransitionwrapper with dynamic corner radius detection andobject-fit: containclip calculation.ArtifactsSplitPaneResizer.tsx: Iframe pointer shield, 4px deadzone, double-click 50/50 spring snap, collapse thresholds.EpitaxyIframeBridge.tsx: Strict Origin validation & channel-isolated postMessage RPC, user-gesture gating (navigator.userActivation).StreamingDiffViewer.tsx: Table line-number alignment withtabular-nums, incremental streaming pipeline, unified/split view, 2.5s copy cooldown.CodeBlock.tsx: 12px radius,#0d0d0csolid black background, inline optical alignment for language tags.
Desktop & System Architecture (8)
createClaudeMainWindow.ts: Electron host window factory:hiddenInsettitlebar, macOS Vibrancy (under-window) glass blending, 1200×800 default, 600×400 min.ClaudeDesktopHeader.tsx: macOS traffic light 74px inverse zoom compensation slot (ew = 74), 45px global drag band.DraggableSessionList.tsx:pinnedOrderoptimistic topological reordering, 4px deadzone, tilted ghost shadow.CoworkAgentCanvas.tsx: Multi-agent task delegation state machine, team-shared artifact asset pool, cross-windowBroadcastChannelsync.useClaudeScrollPinning.ts: 150ms cooldown latch against scroll hijacking, 40px bottom-tolerance scroll pin, GPU subpixel blur elimination.ContainerResponsiveBar.tsx:@container-driven 4-tier fluid compression matrix (>=576px / <480px / <384px / <320px), preventing glyph breaks.useClaudeRovingFocus.ts: W3C WAI-ARIA compliance: 1D & 2D arrow key grid navigation, Home/End boundary jumps.useRateLimitBackoff.ts: 429/503 truncated exponential backoff (t = min(t_max, t_base * 2^a) * (1 ± J)), full jitter, circuit breaker.
🛡️ 4. Agent Coding Invariants (Do's and Don'ts)
✅ DO
- Always use semantic tokens: Use
var(--cds-bg-surface-0)or Tailwind classes (bg-surface-0,text-primary,bg-clay-500) instead of arbitrary hardcoded HEX values. - Apply
tabular-numsfor dynamic numbers: Every timer, countdown, token counter, audio frequency indicator, and line number MUST usetabular-nums(orfont-mono) to prevent layout jitter. - Guard CJK IME inputs:
const handleKeyDown = (e: React.KeyboardEvent<HTMLTextAreaElement>) => { if (e.nativeEvent.isComposing || e.keyCode === 229) return; if (e.key === 'Enter' && !e.shiftKey) { e.preventDefault(); handleSendMessage(); } }; - Support Dark Mode: Always test that UI looks correct under both light (
:root) and dark mode (.dark). - Enforce Single-Stroke Borders: If a container has a border, its internal action buttons or chips should have
border-none.
❌ DON'T
- Never introduce raw linear jumps: Do not write
transition: all 0.3s linearortransition: all 0.5s ease. Use Framer Motion springs or the calibrated cubic-bezier curves ([0.16, 1, 0.3, 1]). - Never commit binary assets: Never introduce
.ttf,.otf,.mp3, or.wavfiles into the repository. - Never bypass Sandbox Security: Never add
allow-same-originto an iframe bridge running arbitrary LLM-generated HTML. - Never hijack scroll during streaming: Do not force-scroll to bottom if
Date.now() - lastUserScrollTime < 150ms. - Never open or update a Pull Request without explicit user approval: Local edits, commits and branch pushes are fine on their own, but creating a PR, editing an existing PR's title/body, or pushing commits to a branch that already has an open PR requires the user to say so first. When the work is done, report the local state and wait; do not call
gh pr create/gh pr edit/gh pr commentunprompted.
🧪 5. Verification & Quality Gates
Whenever you write or modify code in this repository, you MUST run the following verification commands to ensure zero regressions:
# 1. Typecheck the entire project
npm run typecheck
# 2. Verify design token consistency
npm run check:tokens
# 3. Build library output
npm run buildBoth commands must exit with code 0 and output 0 errors.
🔌 6. Runtime Portability & Host Bridging (运行时分层与宿主桥接)
To maximize consumption surface across different host environments (e.g. non-React web apps, Electron desktop harnesses like DSH, or custom plugin shells), the repository assets are structured into 3 portability tiers:
1. The Three Portability Tiers
- 🎨 Pure CSS (Tokens & Shaders): Zero JavaScript runtime dependency. Includes
code-examples/cds-theme.css, CSS-driven scroll fade (.cds-scroll-fade), breathing lights (.cds-dot-breathe), and skeleton sweeps. Can be consumed by any HTML/CSS project directly. - ⚡ Pure Logic / Headless: Pure math and browser APIs without React UI bindings. Includes
code-examples/ClaudeMotionPresets.ts(spring formulas),code-examples/ClaudeAudioPlayer.ts(Web Audio synthesis),code-examples/useClaudeScrollPinning.ts, andcode-examples/useRateLimitBackoff.ts. - ⚛️ React Components: Stateful, interactive UI controls relying on React hooks/refs. Includes
MediaLightboxViewer.tsx,DraggableSessionList.tsx,McpToolDecisionCard.tsx,ChatComposer.tsx, etc.
2. Host Bridge Mapping Pattern (宿主别名桥接)
If your host application uses a custom design token prefix (e.g., --app-* or --dsw-*), bridge to CDS by defining aliases in your host stylesheet:
/* Host application stylesheet */
:root {
--app-brand-primary: var(--brand); /* #c6613f */
--app-brand-accent: var(--cds-clay); /* #d97757 */
--app-bg-canvas: var(--cds-surface-0); /* #f9f9f7 / #0b0b0b */
--app-bg-card: var(--cds-surface-2); /* #ffffff / #1a1a19 */
--app-border-base: var(--cds-border); /* hairline divider */
--app-radius-card: var(--radius-card); /* concentric card radius */
--app-shadow-composer: var(--cds-shadow-composer); /* composer diffuse shadow */
}📐 7. Documentation Versioning Convention (文档版本卷约定)
Every Claude Desktop release gets its own version-named documentation volume. This is a repository invariant, not a suggestion.
7.1 Naming
- New forensics go into
docs/v<CFBundleShortVersionString>/— e.g.docs/v4.16336.0/. - A volume may cover a range when it re-checks earlier baselines:
docs/v4.29.0-4.4212.0/means primary forensics on 4.29.0 with incremental re-checks through 4.4212.0. docs/v1/anddocs/v2/keep their names as historical snapshots; their token values are superseded.- Never name a volume after a date, a topic, an investigation phase, or a workflow step ("audit", "remaining items", "live observation", "round 2").
7.2 Structure — chapters by feature, not by investigation flow
Each volume follows the docs/v1/ format:
| Requirement | Detail |
| Frontmatter | title, part, category, domain per chapter |
| Navigation | top/bottom <p align="center"> with previous / index / next links |
| Chapters | organised by feature point (architecture & tokens, navigation, preview, security, element inspect, annotation, motion physics, host & engineering) — never by chronological discovery order |
| Sections | numbered X.Y, each with > **技术领域与英文指代** and evidence tables |
| Index | volume README.md with anchors for every section |
| Merged edition | one <Volume>.full.md for offline reading |
| Reproducibility | every claim carries an ASAR path + byte offset or a REA Evidence ID; distinguish observed / inferred / unknown |
7.3 Registration
When adding a volume, update all four entry points and mark the previous volume as historical:
README.md(Chinese) — current-volume section + naming conventionREADME-en.md— forensic baseline / convention linesdocs/README.md— volume indexAGENTS.md— this section stays the authoritative rule; the current version is recorded in §7.4
7.4 Current volume
| Volume | Version | Status |
docs/v4.16336.0/ | @ant/desktop 4.16336.0 | current (verified by Info.plist, app.asar/package.json, process args and live app.getVersion()) |
docs/v4.29.0-4.4212.0/ | 4.29.0 → 4.4212.0 | historical baseline |
docs/v2/ | 2.37337.1 | historical snapshot |
docs/v1/ | 1.x | historical snapshot |
7.5 Gates
Before committing a new volume, run npm run typecheck, npm run check:tokens and npm run build; all three must exit 0. check:tokens scans AGENTS.md and every file under docs/, so any backticked --cds-* reference must be defined in code-examples/cds-theme.css.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

