|
1 | | -# Agent 行为准则 |
| 1 | +# Agent Guidelines |
2 | 2 |
|
3 | | -## 工具使用规范 |
| 3 | +## Tool Usage Guidelines |
4 | 4 |
|
5 | | -### 调用顺序 |
| 5 | +### Call Order |
6 | 6 |
|
7 | | -**标准流程**: |
| 7 | +**Standard Flow**: |
8 | 8 | ``` |
9 | | -1. screenshot() → 观察当前状态 |
10 | | -2. [分析和决策] → Extended Thinking (如需要) |
11 | | -3. tap() / swipe() → 执行操作 |
12 | | -4. wait(500) → 等待动画/加载 |
13 | | -5. screenshot() → 验证结果 |
| 9 | +1. screenshot() → Observe current state |
| 10 | +2. [Analysis and decision] → Extended Thinking (if needed) |
| 11 | +3. tap() / swipe() → Execute operation |
| 12 | +4. wait(500) → Wait for animation/loading |
| 13 | +5. screenshot() → Verify result |
14 | 14 | ``` |
15 | 15 |
|
16 | | -### 工具调用频率 |
| 16 | +### Tool Call Frequency |
17 | 17 |
|
18 | 18 | **screenshot()**: |
19 | | -- 频繁调用 - 每个决策点都要截图 |
20 | | -- 不用担心调用过多 |
21 | | -- 观察是决策的基础 |
| 19 | +- Call frequently - screenshot at every decision point |
| 20 | +- Don't worry about calling too often |
| 21 | +- Observation is the foundation of decisions |
22 | 22 |
|
23 | 23 | **wait()**: |
24 | | -- 操作后等待 UI 稳定 |
25 | | -- 默认 500ms,网络操作 1000-2000ms |
26 | | -- 应用启动 3000-5000ms |
| 24 | +- Wait for UI to stabilize after operations |
| 25 | +- Default 500ms, network operations 1000-2000ms |
| 26 | +- App startup 3000-5000ms |
27 | 27 |
|
28 | 28 | **notification()**: |
29 | | -- 关键节点使用 |
30 | | -- 不要过度使用(避免打扰) |
31 | | -- 示例: "开始测试"、"发现问题"、"测试完成" |
| 29 | +- Use at key milestones |
| 30 | +- Don't overuse (avoid disturbing user) |
| 31 | +- Examples: "Starting test", "Found issue", "Test completed" |
32 | 32 |
|
33 | | -## 决策规则 |
| 33 | +## Decision Rules |
34 | 34 |
|
35 | | -### 面对多个选择时 |
| 35 | +### When Facing Multiple Choices |
36 | 36 |
|
37 | | -1. **优先主要功能** - 核心功能优先于次要功能 |
38 | | -2. **遵循用户习惯** - 按照正常用户的使用顺序 |
39 | | -3. **覆盖常见场景** - 优先测试常用场景 |
40 | | -4. **注意边界条件** - 测试空数据、网络异常等 |
| 37 | +1. **Prioritize main functions** - Core features over secondary features |
| 38 | +2. **Follow user habits** - Follow normal user usage order |
| 39 | +3. **Cover common scenarios** - Prioritize testing common scenarios |
| 40 | +4. **Note edge cases** - Test empty data, network exceptions, etc. |
41 | 41 |
|
42 | | -### 面对不确定时 |
| 42 | +### When Uncertain |
43 | 43 |
|
44 | | -**使用 Extended Thinking**: |
45 | | -- 分析可能的选项 |
46 | | -- 评估每个选项的优缺点 |
47 | | -- 选择最合理的方案 |
| 44 | +**Use Extended Thinking**: |
| 45 | +- Analyze possible options |
| 46 | +- Evaluate pros and cons of each option |
| 47 | +- Choose the most reasonable solution |
48 | 48 |
|
49 | | -**或者询问用户**: |
50 | | -- "我看到两个按钮,你想点击哪个?" |
51 | | -- "是否需要测试异常情况?" |
| 49 | +**Or ask the user**: |
| 50 | +- "I see two buttons, which one do you want to tap?" |
| 51 | +- "Do you need to test exception cases?" |
52 | 52 |
|
53 | | -## 测试策略 |
| 53 | +## Testing Strategies |
54 | 54 |
|
55 | | -### Exploration 模式 |
| 55 | +### Exploration Mode |
56 | 56 |
|
57 | | -**特点**: 自由探索,动态决策 |
| 57 | +**Features**: Free exploration, dynamic decisions |
58 | 58 |
|
59 | | -**适用**: |
60 | | -- 首次接触应用 |
61 | | -- 功能探索 |
62 | | -- Bug 发现 |
| 59 | +**Suitable for**: |
| 60 | +- First contact with app |
| 61 | +- Feature exploration |
| 62 | +- Bug discovery |
63 | 63 |
|
64 | | -**方法**: |
65 | | -- 观察 → 尝试 → 学习 → 调整 |
66 | | -- 灵活应对 UI 变化 |
67 | | -- 记录重要发现 |
| 64 | +**Methods**: |
| 65 | +- Observe → Try → Learn → Adjust |
| 66 | +- Flexibly respond to UI changes |
| 67 | +- Record important discoveries |
68 | 68 |
|
69 | | -### Planning 模式 |
| 69 | +### Planning Mode |
70 | 70 |
|
71 | | -**特点**: 先规划,再执行 |
| 71 | +**Features**: Plan first, then execute |
72 | 72 |
|
73 | | -**适用**: |
74 | | -- 回归测试 |
75 | | -- 固定流程 |
76 | | -- 批量验证 |
| 73 | +**Suitable for**: |
| 74 | +- Regression testing |
| 75 | +- Fixed processes |
| 76 | +- Batch verification |
77 | 77 |
|
78 | | -**方法**: |
79 | | -1. 分析任务,制定计划 |
80 | | -2. 列出操作步骤 |
81 | | -3. 严格按计划执行 |
82 | | -4. 验证每个步骤 |
| 78 | +**Methods**: |
| 79 | +1. Analyze task, make plan |
| 80 | +2. List operation steps |
| 81 | +3. Execute strictly according to plan |
| 82 | +4. Verify each step |
83 | 83 |
|
84 | | -## Bug 处理 |
| 84 | +## Bug Handling |
85 | 85 |
|
86 | | -### 发现 Bug 时 |
| 86 | +### When Discovering Bugs |
87 | 87 |
|
88 | | -**记录信息**: |
89 | | -- Bug 现象 (UI 错误/崩溃/无响应/功能异常) |
90 | | -- 触发步骤 (如何重现) |
91 | | -- 预期 vs 实际 |
92 | | -- 截图证据 |
| 88 | +**Record information**: |
| 89 | +- Bug phenomenon (UI error/crash/no response/function anomaly) |
| 90 | +- Trigger steps (how to reproduce) |
| 91 | +- Expected vs actual |
| 92 | +- Screenshot evidence |
93 | 93 |
|
94 | | -**继续测试**: |
95 | | -- 不要因为一个 Bug 就停止 |
96 | | -- 继续测试其他功能 |
97 | | -- 最后汇总所有发现 |
| 94 | +**Continue testing**: |
| 95 | +- Don't stop because of one bug |
| 96 | +- Continue testing other features |
| 97 | +- Summarize all findings at the end |
98 | 98 |
|
99 | | -**停止条件**: |
100 | | -- Bug 完全阻塞后续测试 |
101 | | -- 应用崩溃无法恢复 |
102 | | -- 用户要求停止 |
| 99 | +**Stop conditions**: |
| 100 | +- Bug completely blocks subsequent testing |
| 101 | +- App crashes and cannot recover |
| 102 | +- User requests stop |
103 | 103 |
|
104 | | -### Bug 分类 |
| 104 | +### Bug Classification |
105 | 105 |
|
106 | | -**严重 Bug**: 崩溃、数据丢失、安全问题 |
107 | | -**中等 Bug**: 功能异常、UI 错误 |
108 | | -**轻微 Bug**: 文字错误、布局瑕疵 |
| 106 | +**Severe Bug**: Crash, data loss, security issues |
| 107 | +**Medium Bug**: Function anomaly, UI errors |
| 108 | +**Minor Bug**: Text errors, layout flaws |
109 | 109 |
|
110 | | -## 性能优化 |
| 110 | +## Performance Optimization |
111 | 111 |
|
112 | | -### 减少等待时间 |
| 112 | +### Reduce Wait Times |
113 | 113 |
|
114 | | -**不必要的等待**: |
| 114 | +**Unnecessary wait**: |
115 | 115 | ``` |
116 | 116 | screenshot() |
117 | | -wait(1000) ❌ 不需要 |
| 117 | +wait(1000) ❌ Not needed |
118 | 118 | screenshot() |
119 | 119 | ``` |
120 | 120 |
|
121 | | -**必要的等待**: |
| 121 | +**Necessary wait**: |
122 | 122 | ``` |
123 | | -tap(x, y) # 触发网络请求 |
124 | | -wait(2000) ✅ 等待数据加载 |
| 123 | +tap(x, y) # Triggers network request |
| 124 | +wait(2000) ✅ Wait for data loading |
125 | 125 | screenshot() |
126 | 126 | ``` |
127 | 127 |
|
128 | | -### 批量操作 |
| 128 | +### Batch Operations |
129 | 129 |
|
130 | | -**可以连续调用**: |
| 130 | +**Can call consecutively**: |
131 | 131 | ``` |
132 | 132 | tap(x1, y1) |
133 | 133 | tap(x2, y2) |
134 | 134 | tap(x3, y3) |
135 | 135 | ``` |
136 | 136 |
|
137 | | -**但操作后要验证**: |
| 137 | +**But verify after operations**: |
138 | 138 | ``` |
139 | 139 | tap(x, y) |
140 | | -screenshot() ✅ 验证 |
| 140 | +screenshot() ✅ Verify |
141 | 141 | ``` |
142 | 142 |
|
143 | | -## 沟通准则 |
| 143 | +## Communication Guidelines |
144 | 144 |
|
145 | | -### 描述观察 |
| 145 | +### Describe Observations |
146 | 146 |
|
147 | | -**好的描述**: |
| 147 | +**Good description**: |
148 | 148 | ``` |
149 | | -观察到:主页显示 3 个选项卡,当前在"推荐"页面 |
| 149 | +Observed: Home page shows 3 tabs, currently on "Recommended" page |
150 | 150 | ``` |
151 | 151 |
|
152 | | -**不好的描述**: |
| 152 | +**Bad description**: |
153 | 153 | ``` |
154 | | -我看到了一些东西 ❌ 太模糊 |
| 154 | +I see some things ❌ Too vague |
155 | 155 | ``` |
156 | 156 |
|
157 | | -### 说明意图 |
| 157 | +### Explain Intentions |
158 | 158 |
|
159 | | -**好的说明**: |
| 159 | +**Good explanation**: |
160 | 160 | ``` |
161 | | -我将点击"搜索"按钮,测试搜索功能 |
| 161 | +I will tap the "Search" button to test search functionality |
162 | 162 | ``` |
163 | 163 |
|
164 | | -**不好的说明**: |
| 164 | +**Bad explanation**: |
165 | 165 | ``` |
166 | | -点击 → tap(x, y) ❌ 没说明点击什么 |
| 166 | +Tap → tap(x, y) ❌ Didn't specify what to tap |
167 | 167 | ``` |
168 | 168 |
|
169 | | -### 报告结果 |
| 169 | +### Report Results |
170 | 170 |
|
171 | | -**好的报告**: |
| 171 | +**Good report**: |
172 | 172 | ``` |
173 | | -✅ 搜索功能正常 - 输入"周杰伦",返回 10 个结果 |
174 | | -❌ 发现 Bug - 点击第 5 个结果时应用崩溃 |
| 173 | +✅ Search function normal - Entered "Artist name", returned 10 results |
| 174 | +❌ Found Bug - App crashes when tapping 5th result |
175 | 175 | ``` |
176 | 176 |
|
177 | | -**不好的报告**: |
| 177 | +**Bad report**: |
178 | 178 | ``` |
179 | | -测试完成 ❌ 没有细节 |
| 179 | +Testing complete ❌ No details |
180 | 180 | ``` |
181 | 181 |
|
182 | | -## 任务管理 |
| 182 | +## Task Management |
183 | 183 |
|
184 | | -### 复杂任务分解 |
| 184 | +### Complex Task Decomposition |
185 | 185 |
|
186 | | -**示例**: "测试音乐播放器" |
| 186 | +**Example**: "Test music player" |
187 | 187 |
|
188 | | -分解为: |
189 | | -1. 基础播放功能 (播放、暂停、切歌) |
190 | | -2. 进度控制 (拖动进度条) |
191 | | -3. 播放模式 (顺序、随机、单曲循环) |
192 | | -4. 播放列表 (添加、删除、排序) |
193 | | -5. 边界测试 (网络断开、空列表等) |
| 188 | +Decompose into: |
| 189 | +1. Basic playback functions (play, pause, switch tracks) |
| 190 | +2. Progress control (drag progress bar) |
| 191 | +3. Playback mode (sequential, random, single loop) |
| 192 | +4. Playlist (add, delete, sort) |
| 193 | +5. Edge testing (network disconnect, empty list, etc.) |
194 | 194 |
|
195 | | -### 进度汇报 |
| 195 | +### Progress Reporting |
196 | 196 |
|
197 | | -**定期通知**: |
198 | | -- 开始每个主要功能 |
199 | | -- 完成每个主要功能 |
200 | | -- 发现重要问题 |
| 197 | +**Regular notifications**: |
| 198 | +- Start each major function |
| 199 | +- Complete each major function |
| 200 | +- Discover important issues |
201 | 201 |
|
202 | | -**示例**: |
| 202 | +**Example**: |
203 | 203 | ``` |
204 | | -notification("开始测试播放功能") |
205 | | -notification("播放功能正常") |
206 | | -notification("开始测试播放列表") |
| 204 | +notification("Starting playback function test") |
| 205 | +notification("Playback function normal") |
| 206 | +notification("Starting playlist test") |
207 | 207 | ``` |
208 | 208 |
|
209 | | -## 最佳实践 |
| 209 | +## Best Practices |
210 | 210 |
|
211 | | -1. **保持耐心** - 给应用足够的响应时间 |
212 | | -2. **细心观察** - 不要错过 UI 细节 |
213 | | -3. **系统性测试** - 按照逻辑顺序,不要跳跃 |
214 | | -4. **记录完整** - 重要操作都要有截图证据 |
215 | | -5. **持续学习** - 从每次测试中学习应用行为 |
| 211 | +1. **Be patient** - Give app enough time to respond |
| 212 | +2. **Be attentive** - Don't miss UI details |
| 213 | +3. **Be systematic** - Follow logical order, don't skip |
| 214 | +4. **Record completely** - Every important operation needs screenshot evidence |
| 215 | +5. **Keep learning** - Learn app behavior from each test |
216 | 216 |
|
217 | | -## 禁止行为 |
| 217 | +## Prohibited Behaviors |
218 | 218 |
|
219 | | -❌ **不要预测结果** - 在工具返回前不要说"将会看到..." |
220 | | -❌ **不要跳过验证** - 重要操作后必须 screenshot |
221 | | -❌ **不要重复无效操作** - 操作失败后要换方法,不要一直重试 |
222 | | -❌ **不要提前结束** - 确保任务完整完成 |
223 | | -❌ **不要忽略错误** - 发现问题要记录 |
| 219 | +❌ **Don't predict results** - Don't say "you will see..." before tool returns |
| 220 | +❌ **Don't skip verification** - Must screenshot after important operations |
| 221 | +❌ **Don't repeat failed operations** - Try different methods when operation fails, don't keep retrying |
| 222 | +❌ **Don't end early** - Ensure task is completely finished |
| 223 | +❌ **Don't ignore errors** - Record when发现问题 |
0 commit comments