You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Massive PR, over 13k LOC updated, 128 commits to implement the first pass at the new Wave AI panel. Two backend adapters (OpenAI and Anthropic), layout changes to support the panel, keyboard shortcuts, and a huge focus/layout change to integrate the panel seamlessly into the UI.
Also fixes some small issues found during the Wave AI journey (zoom fixes, documentation, more scss removal, circular dependency issues, settings, etc)
Copy file name to clipboardExpand all lines: .roo/rules/rules.md
+69-1Lines changed: 69 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -39,11 +39,12 @@ It has a TypeScript/React frontend and a Go backend. They talk together over `ws
39
39
- NEVER use cursor-help (it looks terrible)
40
40
- useAtom() and useAtomValue() are react HOOKS, so they must be called at the component level not inline in JSX
41
41
- If you use React.memo(), make sure to add a displayName for the component
42
+
- In general, when writing functions, we prefer _early returns_ rather than putting the majority of a function inside of an if block.
42
43
43
44
### Styling
44
45
45
46
- We use **Tailwind v4** to style. Custom stuff is defined in frontend/tailwindsetup.css
46
-
-_never_ use cursor-help (it looks terrible)
47
+
-_never_ use cursor-help, or cursor-not-allowed (it looks terrible)
47
48
- We have custom CSS setup as well, so it is a hybrid system. For new code we prefer tailwind, and are working to migrate code to all use tailwind.
48
49
49
50
### Code Generation
@@ -78,6 +79,7 @@ These files provide step-by-step instructions, code examples, and best practices
78
79
- With React hooks, always complete all hook calls at the top level before any conditional returns (including jotai hook calls useAtom and useAtomValue); when a user explicitly tells you a function handles null inputs, trust them and stop trying to "protect" it with unnecessary checks or workarounds.
79
80
-**Match response length to question complexity** - For simple, direct questions in Ask mode (especially those that can be answered in 1-2 sentences), provide equally brief answers. Save detailed explanations for complex topics or when explicitly requested.
80
81
-**CRITICAL** - useAtomValue and useAtom are React HOOKS. They cannot be used inline in JSX code, they must appear at the top of a component in the hooks area of the react code.
82
+
- for simple functions, we prefer `if (!cond) { return }; functionality;` pattern overn `if (cond) { functionality }` because it produces less indentation and is easier to follow.
81
83
82
84
### Strict Comment Rules
83
85
@@ -98,6 +100,72 @@ These files provide step-by-step instructions, code examples, and best practices
98
100
-**When in doubt, leave it out**. No comment is better than a redundant comment.
99
101
-**Never add comments explaining code changes** - The code should speak for itself, and version control tracks changes. The one exception to this rule is if it is a very unobvious implementation. Something that someone would typically implement in a different (wrong) way. Then the comment helps us remember WHY we changed it to a less obvious implementation.
100
102
103
+
### Jotai Model Pattern (our rules)
104
+
105
+
-**Atoms live on the model.**
106
+
-**Simple atoms:** define as **field initializers**.
107
+
-**Atoms that depend on values/other atoms:** create in the **constructor**.
108
+
- Models **never use React hooks**; they use `globalStore.get/set`.
109
+
- It’s fine to call model methods from **event handlers** or **`useEffect`**.
**Remember:** atoms on the model, simple-as-fields, ctor for dependent/derived, updates via `globalStore.set/get`.
168
+
101
169
### Tool Use
102
170
103
171
Do NOT use write_to_file unless it is a new file or very short. Always prefer to use replace_in_file. Often your diffs fail when a file may be out of date in your cache vs the actual on-disk format. You should RE-READ the file and try to create diffs again if your diffs fail rather than fall back to write_to_file. If you feel like your ONLY option is to use write_to_file please ask first.
0 commit comments