sumulige-claude 1.4.1 → 1.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/MEMORY.md +26 -0
- package/.claude/hooks/hook-registry.json +15 -0
- package/.claude/hooks/live-quality.cjs +286 -0
- package/.claude/hooks/plan-gate.cjs +173 -0
- package/.claude/hooks/pre-commit.cjs +15 -4
- package/.claude/quality-gate.json +19 -4
- package/.claude/rules/linus-style.md +54 -0
- package/.claude/rules/web-design-standard.md +207 -0
- package/.claude/settings.json +19 -1
- package/.claude/settings.local.json +13 -3
- package/.claude/skills/react-best-practices/SKILL.md +125 -0
- package/.claude/skills/threejs-fundamentals/SKILL.md +488 -0
- package/.claude/skills/web-design-guidelines/SKILL.md +39 -0
- package/AGENTS.md +0 -54
- package/CHANGELOG.md +107 -0
- package/demos/power-3d-scatter.html +683 -0
- package/package.json +1 -1
- package/prompts/linus-architect.md +71 -0
- package/prompts/software-architect.md +173 -0
- package/prompts/web-designer.md +249 -0
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
# Web 设计标准
|
|
2
|
+
|
|
3
|
+
> 定义什么是好的设计,而非仅提供资源
|
|
4
|
+
|
|
5
|
+
## 核心哲学
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
"Visual design is not about expressing yourself.
|
|
9
|
+
The key thing is the information you're trying to get across."
|
|
10
|
+
— Garry Tan (YC CEO)
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
**奥卡姆剃刀**:能删则删。文字、线条、边框——如果移除不影响含义,就移除它。
|
|
14
|
+
|
|
15
|
+
## 三大铁律
|
|
16
|
+
|
|
17
|
+
| 铁律 | 含义 | 检查方式 |
|
|
18
|
+
|------|------|----------|
|
|
19
|
+
| **对比 = 重要性** | 粗/大/色 = 重要 | 如果都粗,就都不粗 |
|
|
20
|
+
| **接近 = 相关性** | 靠近的被感知为一组 | 相关内容放一起 |
|
|
21
|
+
| **视觉层级** | 对比 + 接近 = 导航路标 | 眯眼测试:第一眼看哪? |
|
|
22
|
+
|
|
23
|
+
## 设计决策流程
|
|
24
|
+
|
|
25
|
+
```
|
|
26
|
+
需求 → 信息层级 → 排版 → 颜色 → 间距 → 交互 → 验证
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
### Step 1: 信息层级
|
|
30
|
+
|
|
31
|
+
```
|
|
32
|
+
问自己:
|
|
33
|
+
1. 用户必须看到什么?(主标题)
|
|
34
|
+
2. 用户应该看到什么?(副标题、CTA)
|
|
35
|
+
3. 用户可能看到什么?(详情、辅助)
|
|
36
|
+
4. 什么可以删除?(装饰、冗余)
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
### Step 2: 排版系统
|
|
40
|
+
|
|
41
|
+
| 元素 | 规则 |
|
|
42
|
+
|------|------|
|
|
43
|
+
| **字号** | 使用模块化标度 (1.25 / 1.333 / 1.414) |
|
|
44
|
+
| **行高** | 正文 1.4-1.6,标题 1.1-1.3 |
|
|
45
|
+
| **行长** | 45-75 字符,max-width + padding |
|
|
46
|
+
| **单位** | rem/em,永不 px(除 1px 边框) |
|
|
47
|
+
|
|
48
|
+
```scss
|
|
49
|
+
// 模块化标度示例
|
|
50
|
+
$scale: 1.25;
|
|
51
|
+
$base: 1rem;
|
|
52
|
+
|
|
53
|
+
$text-sm: $base / $scale; // 0.8rem
|
|
54
|
+
$text-base: $base; // 1rem
|
|
55
|
+
$text-lg: $base * $scale; // 1.25rem
|
|
56
|
+
$text-xl: $base * $scale * $scale; // 1.5625rem
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
### Step 3: 颜色系统
|
|
60
|
+
|
|
61
|
+
| 原则 | 说明 |
|
|
62
|
+
|------|------|
|
|
63
|
+
| **克制** | 2-3 主色 + 中性色 |
|
|
64
|
+
| **深灰非纯黑** | 正文用 #333 而非 #000 |
|
|
65
|
+
| **对比度** | WCAG AA 最低 4.5:1 |
|
|
66
|
+
| **语义化** | 成功/警告/错误 一致 |
|
|
67
|
+
|
|
68
|
+
### Step 4: 间距系统
|
|
69
|
+
|
|
70
|
+
```scss
|
|
71
|
+
// 8px 基础单位
|
|
72
|
+
$space-1: 0.25rem; // 4px
|
|
73
|
+
$space-2: 0.5rem; // 8px
|
|
74
|
+
$space-3: 0.75rem; // 12px
|
|
75
|
+
$space-4: 1rem; // 16px
|
|
76
|
+
$space-6: 1.5rem; // 24px
|
|
77
|
+
$space-8: 2rem; // 32px
|
|
78
|
+
$space-12: 3rem; // 48px
|
|
79
|
+
$space-16: 4rem; // 64px
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
**90% 情况**:网格 + padding/margin + 好标题 + 对比 = 足够
|
|
83
|
+
|
|
84
|
+
### Step 5: 交互状态
|
|
85
|
+
|
|
86
|
+
| 状态 | 必须有 |
|
|
87
|
+
|------|--------|
|
|
88
|
+
| **默认** | 基础样式 |
|
|
89
|
+
| **悬停** | hover 反馈 |
|
|
90
|
+
| **焦点** | focus-visible:ring |
|
|
91
|
+
| **激活** | active 按下感 |
|
|
92
|
+
| **禁用** | disabled 视觉弱化 |
|
|
93
|
+
| **加载** | 骨架屏 / 进度 |
|
|
94
|
+
|
|
95
|
+
## 反模式检查
|
|
96
|
+
|
|
97
|
+
| 反模式 | 信号 | 正确做法 |
|
|
98
|
+
|--------|------|----------|
|
|
99
|
+
| **装饰过度** | 渐变+阴影+圆角+动画 | 每个元素只用一种强调 |
|
|
100
|
+
| **AI 审美** | Inter + 蓝紫渐变 + 16px 圆角 | 建立独特品牌 |
|
|
101
|
+
| **信息过载** | 首屏塞满内容 | 留白是设计元素 |
|
|
102
|
+
| **一致性缺失** | 3 种按钮样式 | 组件库 + 设计令牌 |
|
|
103
|
+
| **忽视移动端** | 桌面优先 | 移动优先 |
|
|
104
|
+
|
|
105
|
+
## 组件标准
|
|
106
|
+
|
|
107
|
+
### 导航栏 (Navbar)
|
|
108
|
+
|
|
109
|
+
```
|
|
110
|
+
✅ 固定高度 (56-64px)
|
|
111
|
+
✅ Logo 左侧
|
|
112
|
+
✅ 主导航居中或右侧
|
|
113
|
+
✅ CTA 按钮突出
|
|
114
|
+
✅ 移动端汉堡菜单
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
### 英雄区 (Hero)
|
|
118
|
+
|
|
119
|
+
```
|
|
120
|
+
✅ 一句话价值主张
|
|
121
|
+
✅ 副标题解释
|
|
122
|
+
✅ 明确 CTA
|
|
123
|
+
✅ 留白充足
|
|
124
|
+
❌ 轮播图 (用户不看)
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
### 表单 (Form)
|
|
128
|
+
|
|
129
|
+
```
|
|
130
|
+
✅ 标签在输入框上方
|
|
131
|
+
✅ 实时验证
|
|
132
|
+
✅ 错误信息在字段下方
|
|
133
|
+
✅ 移除不必要字段
|
|
134
|
+
❌ 占位符替代标签
|
|
135
|
+
❌ 冒号 (:) 后缀
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
### 卡片 (Card)
|
|
139
|
+
|
|
140
|
+
```
|
|
141
|
+
✅ 清晰边界 (边框或阴影)
|
|
142
|
+
✅ 内容层级 (标题 > 描述 > 操作)
|
|
143
|
+
✅ 一致间距
|
|
144
|
+
❌ 过多操作按钮
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
## 与现有 Skills 的关系
|
|
148
|
+
|
|
149
|
+
```
|
|
150
|
+
web-design-standard.md (本文件)
|
|
151
|
+
├── 定义原则和标准
|
|
152
|
+
└── 引用以下 Skills 执行具体任务:
|
|
153
|
+
|
|
154
|
+
/skills/web-design-guidelines
|
|
155
|
+
├── Vercel Web Interface Guidelines
|
|
156
|
+
├── 用于:UI 代码审查
|
|
157
|
+
└── 触发:"/review my UI"
|
|
158
|
+
|
|
159
|
+
/skills/react-best-practices
|
|
160
|
+
├── 45 条 React/Next.js 性能规则
|
|
161
|
+
├── 用于:组件代码优化
|
|
162
|
+
└── 触发:性能问题
|
|
163
|
+
|
|
164
|
+
/skills/threejs-fundamentals
|
|
165
|
+
├── 3D 场景/相机/渲染器
|
|
166
|
+
├── 用于:数据可视化
|
|
167
|
+
└── 触发:3D 图表需求
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
## 审查输出格式
|
|
171
|
+
|
|
172
|
+
```
|
|
173
|
+
【眯眼测试】
|
|
174
|
+
第一眼看到:[元素]
|
|
175
|
+
期望第一眼:[元素] → ✅匹配 / ❌不匹配
|
|
176
|
+
|
|
177
|
+
【层级检查】
|
|
178
|
+
- 主层级:[是否清晰]
|
|
179
|
+
- 次层级:[是否区分]
|
|
180
|
+
- 视觉噪音:[可删除项]
|
|
181
|
+
|
|
182
|
+
【对比度】
|
|
183
|
+
- 正文:[比值] → ✅ / ❌
|
|
184
|
+
- 链接:[比值] → ✅ / ❌
|
|
185
|
+
|
|
186
|
+
【一致性】
|
|
187
|
+
- 间距:[8px 倍数?]
|
|
188
|
+
- 字号:[模块化标度?]
|
|
189
|
+
- 颜色:[系统化?]
|
|
190
|
+
|
|
191
|
+
【移动端】
|
|
192
|
+
- 触摸目标:≥44px?
|
|
193
|
+
- 行长:合理?
|
|
194
|
+
- 可读性:字号?
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
## 资源索引
|
|
198
|
+
|
|
199
|
+
| 类型 | 推荐 |
|
|
200
|
+
|------|------|
|
|
201
|
+
| **导航栏** | bentogrids.com |
|
|
202
|
+
| **标题** | h1gallery.com |
|
|
203
|
+
| **CTA** | cta.gallery |
|
|
204
|
+
| **页脚** | footer.design |
|
|
205
|
+
| **404** | 404s.design |
|
|
206
|
+
| **图标** | icoon.co |
|
|
207
|
+
| **原型** | framer.com |
|
package/.claude/settings.json
CHANGED
|
@@ -51,7 +51,20 @@
|
|
|
51
51
|
]
|
|
52
52
|
}
|
|
53
53
|
],
|
|
54
|
-
"PreToolUse": [
|
|
54
|
+
"PreToolUse": [
|
|
55
|
+
{
|
|
56
|
+
"matcher": {
|
|
57
|
+
"tool_name": "^(Write|Edit)$"
|
|
58
|
+
},
|
|
59
|
+
"hooks": [
|
|
60
|
+
{
|
|
61
|
+
"type": "command",
|
|
62
|
+
"command": "node \"$CLAUDE_PROJECT_DIR\"/.claude/hooks/plan-gate.cjs",
|
|
63
|
+
"timeout": 2000
|
|
64
|
+
}
|
|
65
|
+
]
|
|
66
|
+
}
|
|
67
|
+
],
|
|
55
68
|
"PostToolUse": [
|
|
56
69
|
{
|
|
57
70
|
"matcher": {
|
|
@@ -62,6 +75,11 @@
|
|
|
62
75
|
"type": "command",
|
|
63
76
|
"command": "node \"$CLAUDE_PROJECT_DIR\"/.claude/hooks/code-formatter.cjs",
|
|
64
77
|
"timeout": 5000
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
"type": "command",
|
|
81
|
+
"command": "node \"$CLAUDE_PROJECT_DIR\"/.claude/hooks/live-quality.cjs",
|
|
82
|
+
"timeout": 3000
|
|
65
83
|
}
|
|
66
84
|
]
|
|
67
85
|
}
|
|
@@ -135,7 +135,17 @@
|
|
|
135
135
|
"Bash(CLAUDE_PROJECT_DIR=\"/Users/sumulige/Documents/Antigravity/sumulige-claude\" /opt/homebrew/Cellar/node/25.3.0/bin/node .claude/hooks/memory-saver.cjs)",
|
|
136
136
|
"Bash(du:*)",
|
|
137
137
|
"Bash(wc:*)",
|
|
138
|
-
"Bash(/Users/sumulige/.local/share/fnm/node-versions/v24.3.0/installation/bin/node /Users/sumulige/.local/share/fnm/node-versions/v24.3.0/installation/lib/node_modules/npm/bin/npm-cli.js test)"
|
|
138
|
+
"Bash(/Users/sumulige/.local/share/fnm/node-versions/v24.3.0/installation/bin/node /Users/sumulige/.local/share/fnm/node-versions/v24.3.0/installation/lib/node_modules/npm/bin/npm-cli.js test)",
|
|
139
|
+
"Bash(npx skills add:*)",
|
|
140
|
+
"Bash(npx --version)",
|
|
141
|
+
"WebFetch(domain:api.github.com)",
|
|
142
|
+
"Bash(xargs:*)",
|
|
143
|
+
"Bash(CLAUDE_PROJECT_DIR=\"/Users/sumulige/Documents/Antigravity/sumulige-claude\" CLAUDE_TOOL_NAME=\"Write\" CLAUDE_TOOL_INPUT='{\"\"file_path\"\":\"\"/tmp/test.js\"\"}' /opt/homebrew/Cellar/node/25.3.0/bin/node:*)",
|
|
144
|
+
"Bash(CLAUDE_PROJECT_DIR=\"/Users/sumulige/Documents/Antigravity/sumulige-claude\" CLAUDE_TOOL_NAME=\"Write\" CLAUDE_TOOL_INPUT='{\"\"file_path\"\":\"\"/Users/sumulige/Documents/Antigravity/sumulige-claude/lib/commands.js\"\"}' /opt/homebrew/Cellar/node/25.3.0/bin/node /Users/sumulige/Documents/Antigravity/sumulige-claude/.claude/hooks/live-quality.cjs)",
|
|
145
|
+
"Bash(CLAUDE_PROJECT_DIR=\"/Users/sumulige/Documents/Antigravity/sumulige-claude\" CLAUDE_TOOL_NAME=\"Write\" CLAUDE_TOOL_INPUT='{\"\"file_path\"\":\"\"/tmp/test-flow.js\"\"}' /opt/homebrew/Cellar/node/25.3.0/bin/node:*)",
|
|
146
|
+
"Bash(CLAUDE_PROJECT_DIR=\"/Users/sumulige/Documents/Antigravity/sumulige-claude\" CLAUDE_TOOL_NAME=\"Edit\" CLAUDE_TOOL_INPUT='{\"\"file_path\"\":\"\"/Users/sumulige/Documents/Antigravity/sumulige-claude/.claude/hooks/plan-gate.cjs\"\"}' /opt/homebrew/Cellar/node/25.3.0/bin/node:*)",
|
|
147
|
+
"Bash(/opt/homebrew/Cellar/node/25.3.0/bin/npm version 1.5.0 --no-git-tag-version)",
|
|
148
|
+
"Bash(/opt/homebrew/Cellar/node/25.3.0/bin/npm version 1.5.1 --no-git-tag-version)"
|
|
139
149
|
]
|
|
140
150
|
},
|
|
141
151
|
"hooks": {
|
|
@@ -145,7 +155,7 @@
|
|
|
145
155
|
"hooks": [
|
|
146
156
|
{
|
|
147
157
|
"type": "command",
|
|
148
|
-
"command": "node .claude/hooks/conversation-recorder.cjs user \"$ARGUMENTS\""
|
|
158
|
+
"command": "cd \"$CLAUDE_PROJECT_DIR\" && node .claude/hooks/conversation-recorder.cjs user \"$ARGUMENTS\""
|
|
149
159
|
}
|
|
150
160
|
]
|
|
151
161
|
}
|
|
@@ -156,7 +166,7 @@
|
|
|
156
166
|
"hooks": [
|
|
157
167
|
{
|
|
158
168
|
"type": "command",
|
|
159
|
-
"command": "node .claude/hooks/conversation-recorder.cjs today"
|
|
169
|
+
"command": "cd \"$CLAUDE_PROJECT_DIR\" && node .claude/hooks/conversation-recorder.cjs today"
|
|
160
170
|
}
|
|
161
171
|
]
|
|
162
172
|
}
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: vercel-react-best-practices
|
|
3
|
+
description: React and Next.js performance optimization guidelines from Vercel Engineering. This skill should be used when writing, reviewing, or refactoring React/Next.js code to ensure optimal performance patterns. Triggers on tasks involving React components, Next.js pages, data fetching, bundle optimization, or performance improvements.
|
|
4
|
+
license: MIT
|
|
5
|
+
metadata:
|
|
6
|
+
author: vercel
|
|
7
|
+
version: "1.0.0"
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# Vercel React Best Practices
|
|
11
|
+
|
|
12
|
+
Comprehensive performance optimization guide for React and Next.js applications, maintained by Vercel. Contains 45 rules across 8 categories, prioritized by impact to guide automated refactoring and code generation.
|
|
13
|
+
|
|
14
|
+
## When to Apply
|
|
15
|
+
|
|
16
|
+
Reference these guidelines when:
|
|
17
|
+
- Writing new React components or Next.js pages
|
|
18
|
+
- Implementing data fetching (client or server-side)
|
|
19
|
+
- Reviewing code for performance issues
|
|
20
|
+
- Refactoring existing React/Next.js code
|
|
21
|
+
- Optimizing bundle size or load times
|
|
22
|
+
|
|
23
|
+
## Rule Categories by Priority
|
|
24
|
+
|
|
25
|
+
| Priority | Category | Impact | Prefix |
|
|
26
|
+
|----------|----------|--------|--------|
|
|
27
|
+
| 1 | Eliminating Waterfalls | CRITICAL | `async-` |
|
|
28
|
+
| 2 | Bundle Size Optimization | CRITICAL | `bundle-` |
|
|
29
|
+
| 3 | Server-Side Performance | HIGH | `server-` |
|
|
30
|
+
| 4 | Client-Side Data Fetching | MEDIUM-HIGH | `client-` |
|
|
31
|
+
| 5 | Re-render Optimization | MEDIUM | `rerender-` |
|
|
32
|
+
| 6 | Rendering Performance | MEDIUM | `rendering-` |
|
|
33
|
+
| 7 | JavaScript Performance | LOW-MEDIUM | `js-` |
|
|
34
|
+
| 8 | Advanced Patterns | LOW | `advanced-` |
|
|
35
|
+
|
|
36
|
+
## Quick Reference
|
|
37
|
+
|
|
38
|
+
### 1. Eliminating Waterfalls (CRITICAL)
|
|
39
|
+
|
|
40
|
+
- `async-defer-await` - Move await into branches where actually used
|
|
41
|
+
- `async-parallel` - Use Promise.all() for independent operations
|
|
42
|
+
- `async-dependencies` - Use better-all for partial dependencies
|
|
43
|
+
- `async-api-routes` - Start promises early, await late in API routes
|
|
44
|
+
- `async-suspense-boundaries` - Use Suspense to stream content
|
|
45
|
+
|
|
46
|
+
### 2. Bundle Size Optimization (CRITICAL)
|
|
47
|
+
|
|
48
|
+
- `bundle-barrel-imports` - Import directly, avoid barrel files
|
|
49
|
+
- `bundle-dynamic-imports` - Use next/dynamic for heavy components
|
|
50
|
+
- `bundle-defer-third-party` - Load analytics/logging after hydration
|
|
51
|
+
- `bundle-conditional` - Load modules only when feature is activated
|
|
52
|
+
- `bundle-preload` - Preload on hover/focus for perceived speed
|
|
53
|
+
|
|
54
|
+
### 3. Server-Side Performance (HIGH)
|
|
55
|
+
|
|
56
|
+
- `server-cache-react` - Use React.cache() for per-request deduplication
|
|
57
|
+
- `server-cache-lru` - Use LRU cache for cross-request caching
|
|
58
|
+
- `server-serialization` - Minimize data passed to client components
|
|
59
|
+
- `server-parallel-fetching` - Restructure components to parallelize fetches
|
|
60
|
+
- `server-after-nonblocking` - Use after() for non-blocking operations
|
|
61
|
+
|
|
62
|
+
### 4. Client-Side Data Fetching (MEDIUM-HIGH)
|
|
63
|
+
|
|
64
|
+
- `client-swr-dedup` - Use SWR for automatic request deduplication
|
|
65
|
+
- `client-event-listeners` - Deduplicate global event listeners
|
|
66
|
+
|
|
67
|
+
### 5. Re-render Optimization (MEDIUM)
|
|
68
|
+
|
|
69
|
+
- `rerender-defer-reads` - Don't subscribe to state only used in callbacks
|
|
70
|
+
- `rerender-memo` - Extract expensive work into memoized components
|
|
71
|
+
- `rerender-dependencies` - Use primitive dependencies in effects
|
|
72
|
+
- `rerender-derived-state` - Subscribe to derived booleans, not raw values
|
|
73
|
+
- `rerender-functional-setstate` - Use functional setState for stable callbacks
|
|
74
|
+
- `rerender-lazy-state-init` - Pass function to useState for expensive values
|
|
75
|
+
- `rerender-transitions` - Use startTransition for non-urgent updates
|
|
76
|
+
|
|
77
|
+
### 6. Rendering Performance (MEDIUM)
|
|
78
|
+
|
|
79
|
+
- `rendering-animate-svg-wrapper` - Animate div wrapper, not SVG element
|
|
80
|
+
- `rendering-content-visibility` - Use content-visibility for long lists
|
|
81
|
+
- `rendering-hoist-jsx` - Extract static JSX outside components
|
|
82
|
+
- `rendering-svg-precision` - Reduce SVG coordinate precision
|
|
83
|
+
- `rendering-hydration-no-flicker` - Use inline script for client-only data
|
|
84
|
+
- `rendering-activity` - Use Activity component for show/hide
|
|
85
|
+
- `rendering-conditional-render` - Use ternary, not && for conditionals
|
|
86
|
+
|
|
87
|
+
### 7. JavaScript Performance (LOW-MEDIUM)
|
|
88
|
+
|
|
89
|
+
- `js-batch-dom-css` - Group CSS changes via classes or cssText
|
|
90
|
+
- `js-index-maps` - Build Map for repeated lookups
|
|
91
|
+
- `js-cache-property-access` - Cache object properties in loops
|
|
92
|
+
- `js-cache-function-results` - Cache function results in module-level Map
|
|
93
|
+
- `js-cache-storage` - Cache localStorage/sessionStorage reads
|
|
94
|
+
- `js-combine-iterations` - Combine multiple filter/map into one loop
|
|
95
|
+
- `js-length-check-first` - Check array length before expensive comparison
|
|
96
|
+
- `js-early-exit` - Return early from functions
|
|
97
|
+
- `js-hoist-regexp` - Hoist RegExp creation outside loops
|
|
98
|
+
- `js-min-max-loop` - Use loop for min/max instead of sort
|
|
99
|
+
- `js-set-map-lookups` - Use Set/Map for O(1) lookups
|
|
100
|
+
- `js-tosorted-immutable` - Use toSorted() for immutability
|
|
101
|
+
|
|
102
|
+
### 8. Advanced Patterns (LOW)
|
|
103
|
+
|
|
104
|
+
- `advanced-event-handler-refs` - Store event handlers in refs
|
|
105
|
+
- `advanced-use-latest` - useLatest for stable callback refs
|
|
106
|
+
|
|
107
|
+
## How to Use
|
|
108
|
+
|
|
109
|
+
Read individual rule files for detailed explanations and code examples:
|
|
110
|
+
|
|
111
|
+
```
|
|
112
|
+
rules/async-parallel.md
|
|
113
|
+
rules/bundle-barrel-imports.md
|
|
114
|
+
rules/_sections.md
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
Each rule file contains:
|
|
118
|
+
- Brief explanation of why it matters
|
|
119
|
+
- Incorrect code example with explanation
|
|
120
|
+
- Correct code example with explanation
|
|
121
|
+
- Additional context and references
|
|
122
|
+
|
|
123
|
+
## Full Compiled Document
|
|
124
|
+
|
|
125
|
+
For the complete guide with all rules expanded: `AGENTS.md`
|