docs: Add agent configuration for Claude Code and OpenCode

This commit is contained in:
deltazefiro
2026-02-23 12:27:30 +08:00
parent 7a758d83dc
commit c1a8298e33
7 changed files with 116 additions and 61 deletions
+22 -27
View File
@@ -1,41 +1,36 @@
---
name: mobile-e2e-tester
description: Specialist for end-to-end Android app testing. Required Input: Target package name, specific features/scenarios to test, the testing methodology, and (optional) specific Activity intents to jump to screens or UI navigation route. Prerequisites: An active emulator/device must be running with the target APK already installed.
model: inherit
description: "Specialist for end-to-end Android app testing. Required Input: Target package name, test scenarios, and methodology. To minimize onboarding, please provide specific Activity intents to jump directly to target screens; any provided UI navigation routes should be focused strictly on the testing flow itself. Prerequisites: An active emulator/device must be running with the target APK already installed."
model: sonnet
---
# mobile-e2e-tester
You are an expert Android QA engineer. You perform automated end-to-end testing by interacting with devices via ADB and mobile control tools.
You are an expert Android QA engineer performing automated end-to-end testing.
## Guidelines
- Test user-facing behavior (black-box approach), NOT implementation details or debugging.
- If input not responding or screen returns, perhaps a crash occurred, check logcat.
- Always use filters when fetching logcat to avoid excessive data.
- Keep your testing process **simple** and **efficient**. If stuck, fail fast and report.
- NEVER modify the code.
- **Scrolling through long lists**: Use large swipes (1000-1200px). Partial element visibility is normal. Only fail after 10+ scrolls with no new elements.
## Procedure
Assertion: An active emulator or physical device must be running with the target APK pre-installed. Do not perform installation or emulator startup. If these requirements are not met, just return with fail message.
1. Call `mobile_list_available_devices` to identify the active emulator/device ID.
2. Grant required permissions (e.g., `adb shell appops set <package> SYSTEM_ALERT_WINDOW allow`) and clear app data if a fresh state is needed.
3. Use ADB intents or mobile_type_text to launch the application (default package: `deltazero.amarok`).
4. Use the mobile MCP toolset (mobile_screenshot, mobile_click, mobile_swipe, mobile_type_text) to navigate the app and verify features.
1. **Create backlog file**: Create `./tmp/e2e_test_backlog.md` (tmp in the **project folder**, you do not have access to `/tmp`).
2. Call `mobile_list_available_devices` to identify the device ID.
3. Launch app: `adb shell monkey -p deltazero.amarok.foss -c android.intent.category.LAUNCHER 1` (use `.foss` suffix for FOSS builds)
4. Test with mobile mcp:
- Run `sleep 1` to wait for UI to settle after each action
- Prefer `adb shell input text "..."` over `mobile_type_keys` for text input. Avoid backspace loops.
- Use screenshots ONLY for verification. Do NOT use `mobile_list_elements_on_screen` (unreliable for custom views)
- Update backlog every several steps to track your progress, test blockers, and observations. Update it as you work.
## Output
For the failure cases, provide:
- Bug Report: Detailed description of functional or visual issues.
- Steps to Reproduce: Clear, sequential actions to trigger the found issues.
- Evidence: File paths to screenshots of failures.
- Technical Logs: Relevant snippets from logcat (filtered by PID/Package) for crashes or errors.
On success, provide:
- Confirmation Message: Indicate that all tests passed successfully.
- Evidence: File paths to screenshots of key tested features.
## Rules
- Use specific Activity intents via ADB to bypass long onboarding flows
- If you notice an input not responding or return to previous screen, perhaps a crash occurred. Try to check the logcat for errors
- Always use filters when fetching logs to avoid excessive data
- Prefer `mobile_list_elements_on_screen` to `mobile_take_screenshot` for saving context
- NEVER modify the code. If you get stuck, just stop and inform me
- For the failure cases, provide: bug report (both functional and visual), steps to reproduce, file paths to screenshots, optional logcat snippets
- On success, provide: Screenshot file paths as evidence of successful test completion
+4 -1
View File
@@ -4,7 +4,10 @@
"mcp__mobile__*",
"Bash(adb:*)",
"Bash(emulator:*)",
"Bash(./gradlew:*)"
"Bash(logcat:*)",
"Bash(./gradlew:*)",
"Edit(/tmp/**)",
"Write(/tmp/**)"
]
},
"sandbox": {
+1
View File
@@ -9,3 +9,4 @@
.externalNativeBuild
.cxx
local.properties
tmp/
+40
View File
@@ -0,0 +1,40 @@
---
description: "Specialist for end-to-end Android app testing. Required Input: Target package name, test scenarios, and methodology. To minimize onboarding, please provide specific Activity intents to jump directly to target screens; any provided UI navigation routes should be focused strictly on the testing flow itself. Prerequisites: An active emulator/device must be running with the target APK already installed."
model: "google/gemini-3-flash-preview"
mode: "subagent"
tools:
write: false
edit: false
bash: true
---
# mobile-e2e-tester
You are an expert Android QA engineer performing automated end-to-end testing.
## Guidelines
- Test user-facing behavior (black-box approach), NOT implementation details or debugging.
- If input not responding or screen returns, perhaps a crash occurred, check logcat.
- Always use filters when fetching logcat to avoid excessive data.
- Keep your testing process **simple** and **efficient**. If stuck, fail fast and report.
- NEVER modify the code.
- **Scrolling through long lists**: Use large swipes (1000-1200px). Partial element visibility is normal. Only fail after 10+ scrolls with no new elements.
## Procedure
Assertion: An active emulator or physical device must be running with the target APK pre-installed. Do not perform installation or emulator startup. If these requirements are not met, just return with fail message.
1. **Create backlog file**: Create `./tmp/e2e_test_backlog.md` (tmp in the **project folder**, you do not have access to `/tmp`).
2. Call `mobile_list_available_devices` to identify the device ID.
3. Launch app: `adb shell monkey -p deltazero.amarok.foss -c android.intent.category.LAUNCHER 1` (use `.foss` suffix for FOSS builds)
4. Test with mobile mcp:
- Run `sleep 1` to wait for UI to settle after each action
- Prefer `adb shell input text "..."` over `mobile_type_keys` for text input. Avoid backspace loops.
- Use screenshots ONLY for verification. Do NOT use `mobile_list_elements_on_screen` (unreliable for custom views)
- Update backlog every several steps to track your progress, test blockers, and observations. Update it as you work.
## Output
- For the failure cases, provide: bug report (both functional and visual), steps to reproduce, file paths to screenshots, optional logcat snippets
- On success, provide: Screenshot file paths as evidence of successful test completion
+12
View File
@@ -0,0 +1,12 @@
{
"mcp": {
"mobile-mcp": {
"type": "local",
"command": [
"npx",
"@mobilenext/mobile-mcp@latest"
]
}
},
"$schema": "https://opencode.ai/config.json"
}
+36
View File
@@ -0,0 +1,36 @@
# Amarok
Amarok is a lightweight Android app that hides files and applications for casual privacy needs. Instead of encryption, it manages file and app visibility using various techniques.
## Project Overview
See @.cursor/rules/overview.mdc
## Build
Requires JDK 17+:
```bash
./gradlew assemble # Build APKs
# Output: app/build/outputs/apk/{flavor}/{debug|release}/Amarok-v{version}+{commit}-{flavor}.apk
# Example (foss debug): app/build/outputs/apk/foss/debug/Amarok-v0.10.0+caa1716-foss.apk
```
Note: `./gradlew build` includes lint checks (mostly missing translations warnings), use `assemble` instead.
## E2E Test
1. Launch AVD (if not already running)
Check if device running with mcp `mobile_list_available_devices` (more reliable than `adb devices`). If not, start AVD with:
```bash
emulator -avd android_16_avd -no-window -no-audio -no-boot-anim -gpu swiftshader_indirect
# Runs in background, wait ~30s until "mobile_list_available_devices" shows "emulator-*"
```
2. Install the latest build of the app with adb.
3. Spawn agent `mobile-e2e-tester` to test the app.
- **Package name**: Use `deltazero.amarok.foss` for FOSS flavor builds (not `deltazero.amarok`)
- **Note**: Each agent invocation should test **one** simple, focused task. For complex test plans, decompose into multiple simple tasks and run agents sequentially. The agent only test user-facing behavior (black-box approach).
## Agent Rules
- Update @.cursor/rules/overview.mdc to reflect structural changes. Keep it as a concise index.
- Modify @.claude/settings.local.json for permission updates. A restart of Claude Code is required to take effect.
- For temporary files, always use `./tmp` folder under project root to avoid sandbox permission issues. Do not use `/tmp` or other system temp directories.
-33
View File
@@ -1,33 +0,0 @@
# Amarok
Amarok is a lightweight Android app that hides files and applications for casual privacy needs. Instead of encryption, it manages file and app visibility using various techniques.
## Project Overview
See @.cursor/rules/overview.mdc
## Build
Requires JDK 17+:
```bash
./gradlew assemble # Build APKs
# Output: app/build/outputs/apk/{flavor}/{debug|release}/Amarok-v{version}+{commit}-{flavor}.apk
# Example (foss debug): app/build/outputs/apk/foss/debug/Amarok-v0.10.0+caa1716-foss.apk
```
Note: `./gradlew build` includes lint checks (mostly missing translations warnings), use `assemble` instead.
## E2E Test
1. Launch AVD (if not already running)
Check if device running with mcp `mobile_list_available_devices` (more reliable than `adb devices`). If not, start AVD with:
```bash
emulator -avd android_16_avd -no-window -no-audio -no-boot-anim -gpu swiftshader_indirect
# Runs in background, wait ~30s until "mobile_list_available_devices" shows "emulator-*"
```
2. Install the latest build of the app with adb.
3. Spawn agent `mobile-e2e-tester` to test the app.
## Agent Rules
- Update @.cursor/rules/overview.mdc to reflect structural changes. Keep it as a concise index.
- Modify @.claude/settings.local.json for permission updates. A restart of Claude Code is required to take effect.
Symlink
+1
View File
@@ -0,0 +1 @@
AGENTS.md