claude-pangu 2.2.21 → 2.3.0
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-plugin/plugin.json +1 -1
- package/README.md +2 -0
- package/agents/huoshen.md +220 -424
- package/agents/librarian.md +113 -276
- package/agents/lilou.md +56 -293
- package/agents/liubowen.md +103 -324
- package/agents/metis.md +178 -152
- package/agents/oracle.md +102 -260
- package/agents/wukong.md +101 -164
- package/agents/yugong.md +384 -231
- package/agents/zhuge.md +276 -200
- package/commands/handoff.md +178 -0
- package/commands/init-deep.md +160 -112
- package/commands/refactor.md +196 -194
- package/commands/start-work.md +88 -73
- package/commands/stop-continuation.md +57 -0
- package/hooks/agent-collaboration.sh +14 -1
- package/hooks/agent-handoff-prompt.sh +15 -4
- package/hooks/agent-ready-notification.sh +13 -2
- package/hooks/agent-usage-reminder.sh +12 -2
- package/hooks/anthropic-context-window-limit-recovery.sh +14 -2
- package/hooks/ast-grep.sh +14 -1
- package/hooks/atlas.sh +13 -4
- package/hooks/auto-update-checker.sh +20 -1
- package/hooks/background-compaction.sh +15 -2
- package/hooks/background-notification.sh +1 -1
- package/hooks/category-skill-reminder.sh +92 -0
- package/hooks/code-quality-checker.sh +14 -1
- package/hooks/comment-checker.sh +119 -0
- package/hooks/compaction-context-injector.sh +218 -0
- package/hooks/context-compression.sh +14 -1
- package/hooks/context-smart-alert.sh +15 -3
- package/hooks/context-window-monitor.sh +15 -3
- package/hooks/delegate-task-retry.sh +4 -4
- package/hooks/directory-agents-injector.sh +14 -1
- package/hooks/directory-readme-injector.sh +16 -2
- package/hooks/edit-error-recovery.sh +17 -3
- package/hooks/empty-message-sanitizer.sh +150 -0
- package/hooks/empty-task-response-detector.sh +14 -3
- package/hooks/error-friendly-display.sh +17 -7
- package/hooks/error-recovery.sh +14 -1
- package/hooks/first-use-onboarding.sh +1 -4
- package/hooks/hook-performance-monitor.sh +1 -1
- package/hooks/hooks.json +84 -1
- package/hooks/interactive-bash-session.sh +12 -2
- package/hooks/json-error-recovery.sh +176 -0
- package/hooks/lsp-tools.sh +14 -1
- package/hooks/non-interactive-env.sh +186 -0
- package/hooks/output-truncator.sh +14 -1
- package/hooks/preemptive-compaction.sh +14 -1
- package/hooks/rules-injector.sh +14 -1
- package/hooks/session-notification.sh +17 -3
- package/hooks/session-recovery.sh +12 -2
- package/hooks/stop-continuation-guard.sh +37 -0
- package/hooks/task-checkpointing.sh +14 -1
- package/hooks/think-mode.sh +14 -1
- package/hooks/thinking-block-validator.sh +14 -3
- package/hooks/tmux-agent-visualizer.sh +17 -2
- package/hooks/todo-continuation-enforcer.sh +105 -0
- package/hooks/write-existing-file-guard.sh +100 -0
- package/package.json +1 -1
- package/skills/agent-browser/SKILL.md +385 -146
- package/skills/dev-browser/SKILL.md +136 -0
- package/skills/frontend-ui-ux/SKILL.md +95 -3
- package/skills/git-master/SKILL.md +561 -386
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: dev-browser
|
|
3
|
+
description: |
|
|
4
|
+
Browser automation with persistent page state. Use when users ask to navigate websites,
|
|
5
|
+
fill forms, take screenshots, extract web data, test web apps, or automate browser workflows.
|
|
6
|
+
Trigger phrases include 'go to [url]', 'click on', 'fill out the form', 'take a screenshot',
|
|
7
|
+
'scrape', 'automate', 'test the website', 'log into', or any browser interaction request.
|
|
8
|
+
triggers:
|
|
9
|
+
keywords: [dev-browser, browser automation, persistent page, scrape, navigate, screenshot]
|
|
10
|
+
commands: [/dev-browser, /browser-dev]
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
# Dev Browser 技能 - 持久化页面状态的浏览器自动化
|
|
14
|
+
|
|
15
|
+
持久化页面状态的浏览器自动化。在用户要求导航网站、填写表单、截图、提取网页数据、测试网页应用或自动化浏览器工作流时使用。
|
|
16
|
+
|
|
17
|
+
## 方法选择
|
|
18
|
+
|
|
19
|
+
- **本地/源代码可用的网站**: 阅读源代码获取选择器
|
|
20
|
+
- **未知布局**: 使用 `getAISnapshot()` + `selectSnapshotRef()` 进行元素发现
|
|
21
|
+
- **视觉反馈**: 截图验证页面状态
|
|
22
|
+
|
|
23
|
+
## 安装与启动
|
|
24
|
+
|
|
25
|
+
### 独立模式(默认)
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
./skills/dev-browser/server.sh &
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
等待 Ready 消息。如需无头模式,添加 `--headless` 参数。
|
|
32
|
+
|
|
33
|
+
### 扩展模式
|
|
34
|
+
|
|
35
|
+
连接到用户现有的 Chrome 浏览器以支持已认证的会话。
|
|
36
|
+
|
|
37
|
+
## 编写脚本
|
|
38
|
+
|
|
39
|
+
从 `skills/dev-browser/` 目录运行所有脚本。使用 heredoc 内联执行:
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
cd skills/dev-browser && npx tsx <<'EOF'
|
|
43
|
+
import { connect, waitForPageLoad } from "@/client.js";
|
|
44
|
+
const client = await connect();
|
|
45
|
+
const page = await client.page("example", { viewport: { width: 1920, height: 1080 } });
|
|
46
|
+
await page.goto("https://example.com");
|
|
47
|
+
await waitForPageLoad(page);
|
|
48
|
+
console.log({ title: await page.title(), url: page.url() });
|
|
49
|
+
await client.disconnect();
|
|
50
|
+
EOF
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
### 核心原则
|
|
54
|
+
|
|
55
|
+
1. **小脚本**: 每个脚本只做一件事
|
|
56
|
+
2. **评估状态**: 记录/返回状态以决定后续步骤
|
|
57
|
+
3. **描述性页面名称**: 使用有意义的页面标识符
|
|
58
|
+
4. **断开连接退出**: 页面在服务器上持久化
|
|
59
|
+
5. **浏览器上下文中使用纯 JavaScript**: 不在 `page.evaluate()` 中使用 TypeScript 语法
|
|
60
|
+
|
|
61
|
+
## 工作循环
|
|
62
|
+
|
|
63
|
+
1. 编写脚本 → 2. 运行 → 3. 评估 → 4. 决策 → 5. 重复
|
|
64
|
+
|
|
65
|
+
## 客户端 API
|
|
66
|
+
|
|
67
|
+
```typescript
|
|
68
|
+
const client = await connect();
|
|
69
|
+
const page = await client.page("name");
|
|
70
|
+
const pageWithSize = await client.page("name", { viewport: { width: 1920, height: 1080 } });
|
|
71
|
+
const pages = await client.list();
|
|
72
|
+
await client.close("name");
|
|
73
|
+
await client.disconnect();
|
|
74
|
+
const snapshot = await client.getAISnapshot("name");
|
|
75
|
+
const element = await client.selectSnapshotRef("name", "e5");
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
## 等待机制
|
|
79
|
+
|
|
80
|
+
```typescript
|
|
81
|
+
import { waitForPageLoad } from "@/client.js";
|
|
82
|
+
await waitForPageLoad(page);
|
|
83
|
+
await page.waitForSelector(".results");
|
|
84
|
+
await page.waitForURL("**/success");
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
## 页面检查
|
|
88
|
+
|
|
89
|
+
### 截图
|
|
90
|
+
|
|
91
|
+
```typescript
|
|
92
|
+
await page.screenshot({ path: "tmp/screenshot.png" });
|
|
93
|
+
await page.screenshot({ path: "tmp/full.png", fullPage: true });
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
### ARIA 快照(元素发现)
|
|
97
|
+
|
|
98
|
+
`getAISnapshot()` 返回 YAML 格式的无障碍树,包含 `[ref=eN]` 元素标记。使用 `selectSnapshotRef()` 与这些引用交互:
|
|
99
|
+
|
|
100
|
+
```yaml
|
|
101
|
+
# 快照示例
|
|
102
|
+
- role: main
|
|
103
|
+
children:
|
|
104
|
+
- role: heading
|
|
105
|
+
text: "Search Results"
|
|
106
|
+
[ref=e1]
|
|
107
|
+
- role: list
|
|
108
|
+
children:
|
|
109
|
+
- role: listitem
|
|
110
|
+
text: "Result 1"
|
|
111
|
+
[ref=e2]
|
|
112
|
+
- role: listitem
|
|
113
|
+
text: "Result 2"
|
|
114
|
+
[ref=e3]
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
使用引用与元素交互:
|
|
118
|
+
|
|
119
|
+
```typescript
|
|
120
|
+
const element = await client.selectSnapshotRef("pageName", "e2");
|
|
121
|
+
await element.click();
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
## 数据抓取
|
|
125
|
+
|
|
126
|
+
对于大型数据集,拦截并重放网络请求,而不是滚动 DOM。
|
|
127
|
+
|
|
128
|
+
## 错误恢复
|
|
129
|
+
|
|
130
|
+
页面状态在失败后持久化。使用截图 + 状态检查脚本进行调试。
|
|
131
|
+
|
|
132
|
+
## 注意事项
|
|
133
|
+
|
|
134
|
+
- 浏览器上下文中不支持 TypeScript(`page.evaluate()` 在浏览器中运行)
|
|
135
|
+
- 仅在脚本需要重用时写入 `tmp/` 文件
|
|
136
|
+
- 断开连接后页面在服务器上持久化
|
|
@@ -25,6 +25,16 @@ You are a designer who learned to code. You don't just implement - you **craft**
|
|
|
25
25
|
|
|
26
26
|
You bring the same obsessive attention to detail that a designer would, but you can actually ship it.
|
|
27
27
|
|
|
28
|
+
## Work Principles
|
|
29
|
+
|
|
30
|
+
Five core principles guide every decision:
|
|
31
|
+
|
|
32
|
+
1. **Complete what's asked** - Deliver the full vision, not a half-baked version
|
|
33
|
+
2. **Leave it better** - Each component should improve the codebase, not just solve the immediate problem
|
|
34
|
+
3. **Study before acting** - Understand the context, constraints, and existing patterns before coding
|
|
35
|
+
4. **Blend seamlessly** - New work should feel native to the existing design system
|
|
36
|
+
5. **Be transparent** - Explain your choices; let others learn from your decisions
|
|
37
|
+
|
|
28
38
|
## Design Process
|
|
29
39
|
|
|
30
40
|
Before writing any code, think through:
|
|
@@ -35,9 +45,21 @@ Before writing any code, think through:
|
|
|
35
45
|
- What action should users take?
|
|
36
46
|
|
|
37
47
|
### 2. Tone
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
48
|
+
Choose one dominant aesthetic direction:
|
|
49
|
+
|
|
50
|
+
| Direction | Characteristics | When to Use |
|
|
51
|
+
|-----------|-----------------|-------------|
|
|
52
|
+
| **Brutally Minimal** | Extreme restraint, negative space, single accent | SaaS, productivity tools |
|
|
53
|
+
| **Maximalist Chaos** | Rich layers, expressive, dense, overwhelming | Creative portfolios, art |
|
|
54
|
+
| **Retro-Futuristic** | Nostalgic + futuristic blend, neon, chrome | Gaming, entertainment |
|
|
55
|
+
| **Organic/Natural** | Soft curves, earth tones, flowing layouts | Wellness, nature brands |
|
|
56
|
+
| **Luxury/Refined** | Premium materials, subtle elegance, restraint | High-end products, finance |
|
|
57
|
+
| **Playful/Toy-like** | Animated, colorful, surprising, joyful | Consumer apps, kids |
|
|
58
|
+
| **Editorial/Magazine** | Strong typography, image-driven, narrative | Content-heavy sites, news |
|
|
59
|
+
| **Brutalist/Raw** | Honest, intentionally "ugly", bold, industrial | Dev tools, edgy brands |
|
|
60
|
+
| **Art Deco/Geometric** | Symmetry, geometric patterns, gold accents | Luxury, fashion, events |
|
|
61
|
+
| **Soft/Pastel** | Gentle colors, rounded forms, approachable | Lifestyle, wellness |
|
|
62
|
+
| **Industrial/Utilitarian** | Functional, technical, no-nonsense | Engineering, manufacturing |
|
|
41
63
|
|
|
42
64
|
### 3. Constraints
|
|
43
65
|
- What are the brand guidelines (if any)?
|
|
@@ -72,6 +94,7 @@ Before writing any code, think through:
|
|
|
72
94
|
- Arial/Helvetica (unless intentional)
|
|
73
95
|
- Open Sans
|
|
74
96
|
- Lato
|
|
97
|
+
- Space Grotesk
|
|
75
98
|
|
|
76
99
|
### PREFER (Distinctive Choices)
|
|
77
100
|
| Type | Fonts | Use Case |
|
|
@@ -156,6 +179,11 @@ Before writing any code, think through:
|
|
|
156
179
|
| **Page transitions** | Route changes | 200-400ms |
|
|
157
180
|
| **Loading states** | Skeleton, spinners | Infinite |
|
|
158
181
|
|
|
182
|
+
### Motion Libraries
|
|
183
|
+
- **For React**: Use Framer Motion when available for complex orchestration
|
|
184
|
+
- **Prioritize CSS-only**: For simple animations, CSS is faster and more maintainable
|
|
185
|
+
- **Fallback gracefully**: Provide non-animated versions for reduced-motion preferences
|
|
186
|
+
|
|
159
187
|
### CSS Animation Defaults
|
|
160
188
|
```css
|
|
161
189
|
/* Smooth entrance */
|
|
@@ -173,6 +201,57 @@ Before writing any code, think through:
|
|
|
173
201
|
--stagger-delay: 50ms;
|
|
174
202
|
```
|
|
175
203
|
|
|
204
|
+
## Spatial Composition
|
|
205
|
+
|
|
206
|
+
**Break the grid. Embrace asymmetry.**
|
|
207
|
+
|
|
208
|
+
### Techniques
|
|
209
|
+
- **Unexpected layouts**: Diagonal flows, overlapping elements, asymmetric grids
|
|
210
|
+
- **Asymmetry**: Unequal spacing creates visual interest and hierarchy
|
|
211
|
+
- **Overlap**: Layered elements with z-index create depth and sophistication
|
|
212
|
+
- **Diagonal flow**: 45° angles and diagonal lines guide the eye
|
|
213
|
+
- **Grid-breaking**: Strategic elements that escape the grid feel intentional
|
|
214
|
+
- **Generous negative space**: Breathing room emphasizes importance
|
|
215
|
+
- **Controlled density**: Dense sections contrasted with open areas
|
|
216
|
+
|
|
217
|
+
### Anti-Pattern
|
|
218
|
+
- Perfectly centered, symmetrical layouts (unless intentional)
|
|
219
|
+
- Uniform spacing everywhere
|
|
220
|
+
- Predictable grid adherence
|
|
221
|
+
|
|
222
|
+
## Visual Details
|
|
223
|
+
|
|
224
|
+
**Never default to solid colors. Add texture and depth.**
|
|
225
|
+
|
|
226
|
+
### Techniques
|
|
227
|
+
- **Gradient meshes**: Subtle, multi-directional gradients for depth
|
|
228
|
+
- **Noise textures**: Film grain, paper texture, subtle noise overlays
|
|
229
|
+
- **Geometric patterns**: Repeating shapes, tessellations, SVG patterns
|
|
230
|
+
- **Layered transparencies**: Multiple semi-transparent layers create richness
|
|
231
|
+
- **Dramatic shadows**: Depth shadows, color-tinted shadows, multiple shadow layers
|
|
232
|
+
- **Decorative borders**: Gradient borders, dashed patterns, custom SVG strokes
|
|
233
|
+
- **Custom cursors**: Branded cursor shapes for personality
|
|
234
|
+
- **Grain overlays**: Subtle film grain for analog warmth
|
|
235
|
+
|
|
236
|
+
### Implementation
|
|
237
|
+
```css
|
|
238
|
+
/* Gradient mesh example */
|
|
239
|
+
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
|
240
|
+
background-image:
|
|
241
|
+
radial-gradient(circle at 20% 50%, rgba(255,0,0,0.1) 0%, transparent 50%),
|
|
242
|
+
radial-gradient(circle at 80% 80%, rgba(0,0,255,0.1) 0%, transparent 50%);
|
|
243
|
+
|
|
244
|
+
/* Grain overlay */
|
|
245
|
+
background-image:
|
|
246
|
+
url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100"><filter id="noise"><feTurbulence type="fractalNoise" baseFrequency="0.9" numOctaves="4" /></filter><rect width="100" height="100" filter="url(%23noise)" opacity="0.05"/></svg>');
|
|
247
|
+
|
|
248
|
+
/* Dramatic shadow */
|
|
249
|
+
box-shadow:
|
|
250
|
+
0 20px 25px -5px rgba(0, 0, 0, 0.1),
|
|
251
|
+
0 10px 10px -5px rgba(0, 0, 0, 0.04),
|
|
252
|
+
inset 0 1px 0 rgba(255, 255, 255, 0.1);
|
|
253
|
+
```
|
|
254
|
+
|
|
176
255
|
## Layout Patterns
|
|
177
256
|
|
|
178
257
|
### Grid Systems
|
|
@@ -217,6 +296,9 @@ Before writing any code, think through:
|
|
|
217
296
|
- Boring blue buttons
|
|
218
297
|
- Stock photo aesthetics
|
|
219
298
|
- Cookie-cutter layouts
|
|
299
|
+
- Converging on common choices across generations
|
|
300
|
+
- Predictable layouts and component patterns
|
|
301
|
+
- Cookie-cutter design lacking context-specific character
|
|
220
302
|
|
|
221
303
|
### Structural
|
|
222
304
|
- Inconsistent spacing
|
|
@@ -232,6 +314,16 @@ Before writing any code, think through:
|
|
|
232
314
|
- Missing loading states
|
|
233
315
|
- No error states
|
|
234
316
|
|
|
317
|
+
## Execution
|
|
318
|
+
|
|
319
|
+
**Match implementation complexity to aesthetic vision.**
|
|
320
|
+
|
|
321
|
+
- **Maximalist** → Elaborate code, rich layers, complex animations
|
|
322
|
+
- **Minimalist** → Restraint and precision, every line intentional
|
|
323
|
+
- **Interpret creatively** → Make unexpected choices
|
|
324
|
+
- **No design should be the same** → Vary between light/dark themes, different fonts, different aesthetics
|
|
325
|
+
- **Context matters** → Adapt to brand, audience, and purpose
|
|
326
|
+
|
|
235
327
|
## Component Checklist
|
|
236
328
|
|
|
237
329
|
Before shipping any component:
|