staff-mcp 1.0.8 → 1.0.10
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/README.md +7 -7
- package/README_zh.md +7 -7
- package/builtin-profiles/android-reverse/skills/adb-workflow/SKILL.md +66 -0
- package/builtin-profiles/android-reverse/skills/android-reversing/SKILL.md +60 -0
- package/builtin-profiles/android-reverse/skills/ida-workflow/SKILL.md +55 -0
- package/builtin-profiles/android-reverse/skills/jadx-workflow/SKILL.md +53 -0
- package/builtin-profiles/common/skill-manager/SKILL.md +54 -0
- package/dist/bundle.js +558 -0
- package/dist/src/index.js +10 -1
- package/dist/src/index.js.map +1 -1
- package/dist/src/skills/resolver.js +3 -2
- package/dist/src/skills/resolver.js.map +1 -1
- package/dist/src/tools/file-tools.js +7 -1
- package/dist/src/tools/file-tools.js.map +1 -1
- package/dist/src/tools/mcp-client-tools.js +65 -17
- package/dist/src/tools/mcp-client-tools.js.map +1 -1
- package/dist/src/utils/tool-utils.d.ts +4 -2
- package/dist/src/utils/tool-utils.js +19 -4
- package/dist/src/utils/tool-utils.js.map +1 -1
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -24,7 +24,7 @@ Seamlessly spawn the AI assistant **inside any Docker container** while keeping
|
|
|
24
24
|
npx -y staff-mcp@latest --docker node:20-alpine
|
|
25
25
|
|
|
26
26
|
# Perform security analysis inside a custom reverse-engineering image
|
|
27
|
-
npx -y staff-mcp@latest --docker
|
|
27
|
+
npx -y staff-mcp@latest --docker chineseastar/security:latest --profile android-reverse
|
|
28
28
|
```
|
|
29
29
|
|
|
30
30
|
### 3. Claude Desktop Configuration
|
|
@@ -66,8 +66,8 @@ Never pollute your host machine again. By simply appending `--docker <image>`, `
|
|
|
66
66
|
|
|
67
67
|
Switch roles on the fly:
|
|
68
68
|
```bash
|
|
69
|
-
npx -y staff-mcp@latest --profile
|
|
70
|
-
npx -y staff-mcp@latest --profile reverse
|
|
69
|
+
npx -y staff-mcp@latest --profile default
|
|
70
|
+
npx -y staff-mcp@latest --profile android-reverse
|
|
71
71
|
```
|
|
72
72
|
|
|
73
73
|
### 3. Built-in `skill-manager`
|
|
@@ -88,7 +88,7 @@ It will securely download, configure, and reload the skill without you lifting a
|
|
|
88
88
|
| :--- | :--- | :--- |
|
|
89
89
|
| `-w, --working-dir` | Root directory for the sandbox | `process.cwd()` |
|
|
90
90
|
| `-d, --allowed-dir` | Extra directories allowed for access | `[]` |
|
|
91
|
-
| `-r, --profile` | The active profile for skills (e.g.,
|
|
91
|
+
| `-r, --profile` | The active profile for skills (e.g., android-reverse) | `default` |
|
|
92
92
|
| `--docker` | Run inside a Docker container using this image | `undefined` |
|
|
93
93
|
| `-D, --docker-args` | Extra args for `docker run` (e.g., `-e FOO=BAR`) | `[]` |
|
|
94
94
|
| `-t, --transport` | Transport type (`stdio` or `http`) | `stdio` |
|
|
@@ -104,13 +104,13 @@ If you need the AI to interact with an Android device connected via USB while ru
|
|
|
104
104
|
|
|
105
105
|
# 2. Start staff-mcp with the ADB_SERVER_SOCKET environment variable injected
|
|
106
106
|
# On Mac/Windows:
|
|
107
|
-
npx -y staff-mcp@latest --docker
|
|
107
|
+
npx -y staff-mcp@latest --docker chineseastar/security:latest -D "-e ADB_SERVER_SOCKET=tcp:host.docker.internal:5037"
|
|
108
108
|
|
|
109
109
|
# On Native Linux (If not using --network host, point to the docker bridge IP):
|
|
110
|
-
npx -y staff-mcp@latest --docker
|
|
110
|
+
npx -y staff-mcp@latest --docker chineseastar/security:latest -D "-e ADB_SERVER_SOCKET=tcp:172.17.0.1:5037"
|
|
111
111
|
|
|
112
112
|
# Alternative for Native Linux (Share host network stack completely):
|
|
113
|
-
npx -y staff-mcp@latest --docker
|
|
113
|
+
npx -y staff-mcp@latest --docker chineseastar/security:latest -D "--network host"
|
|
114
114
|
```
|
|
115
115
|
|
|
116
116
|
---
|
package/README_zh.md
CHANGED
|
@@ -24,7 +24,7 @@ npx -y staff-mcp@latest --working-dir /path/to/your/project
|
|
|
24
24
|
npx -y staff-mcp@latest --docker node:20-alpine
|
|
25
25
|
|
|
26
26
|
# 在自带逆向工程工具链的镜像里执行安全分析
|
|
27
|
-
npx -y staff-mcp@latest --docker
|
|
27
|
+
npx -y staff-mcp@latest --docker chineseastar/security:latest --profile android-reverse
|
|
28
28
|
```
|
|
29
29
|
|
|
30
30
|
### 3. Claude Desktop 配置
|
|
@@ -66,8 +66,8 @@ npx -y staff-mcp@latest --docker reverse-engineer:v3 --profile reverse-engineer
|
|
|
66
66
|
|
|
67
67
|
在不同角色中自由切换:
|
|
68
68
|
```bash
|
|
69
|
-
npx -y staff-mcp@latest --profile
|
|
70
|
-
npx -y staff-mcp@latest --profile reverse
|
|
69
|
+
npx -y staff-mcp@latest --profile default
|
|
70
|
+
npx -y staff-mcp@latest --profile android-reverse
|
|
71
71
|
```
|
|
72
72
|
|
|
73
73
|
### 3. 聪明的“技能管家” (`skill-manager`)
|
|
@@ -88,7 +88,7 @@ npx -y staff-mcp@latest --profile reverse-engineer
|
|
|
88
88
|
| :--- | :--- | :--- |
|
|
89
89
|
| `-w, --working-dir` | 沙盒的根目录 (工作区) | `process.cwd()` |
|
|
90
90
|
| `-d, --allowed-dir` | 额外允许 AI 访问的宿主机目录 | `[]` |
|
|
91
|
-
| `-r, --profile` | 当前激活的技能档案/工种 (如
|
|
91
|
+
| `-r, --profile` | 当前激活的技能档案/工种 (如 android-reverse) | `default` |
|
|
92
92
|
| `--docker` | 在指定的 Docker 镜像内运行 AI | `undefined` |
|
|
93
93
|
| `-D, --docker-args` | 传递给 `docker run` 的自定义底层参数 | `[]` |
|
|
94
94
|
| `-t, --transport` | 传输协议 (`stdio` 或 `http`) | `stdio` |
|
|
@@ -104,13 +104,13 @@ npx -y staff-mcp@latest --profile reverse-engineer
|
|
|
104
104
|
|
|
105
105
|
# 2. 启动 staff-mcp 并注入 ADB_SERVER_SOCKET 环境变量
|
|
106
106
|
# Mac/Win 环境下:
|
|
107
|
-
npx -y staff-mcp@latest --docker
|
|
107
|
+
npx -y staff-mcp@latest --docker chineseastar/security:latest -D "-e ADB_SERVER_SOCKET=tcp:host.docker.internal:5037"
|
|
108
108
|
|
|
109
109
|
# 原生 Linux 环境下(若不使用 host 网络,可指向虚拟桥接 IP):
|
|
110
|
-
npx -y staff-mcp@latest --docker
|
|
110
|
+
npx -y staff-mcp@latest --docker chineseastar/security:latest -D "-e ADB_SERVER_SOCKET=tcp:172.17.0.1:5037"
|
|
111
111
|
|
|
112
112
|
# 原生 Linux 的极简方案(直接与物理机共享网络栈):
|
|
113
|
-
npx -y staff-mcp@latest --docker
|
|
113
|
+
npx -y staff-mcp@latest --docker chineseastar/security:latest -D "--network host"
|
|
114
114
|
```
|
|
115
115
|
|
|
116
116
|
---
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: adb-workflow
|
|
3
|
+
description: Android Debug Bridge (ADB) operations for Android Reverse Engineering. Use this when you need to pull APKs from a phone, inspect installed packages, or push/pull files.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# ADB Workflow
|
|
7
|
+
|
|
8
|
+
You are an expert in interacting with Android devices via `adb`. Your role is to acquire targets from real or emulated Android devices connected to your workspace.
|
|
9
|
+
|
|
10
|
+
## 🛠 Prerequisites
|
|
11
|
+
You have direct access to the `adb` binary through `execute_command`. Before running complex commands, check if a device is connected:
|
|
12
|
+
```bash
|
|
13
|
+
adb devices
|
|
14
|
+
```
|
|
15
|
+
If no device is connected, inform the user to plug in a device or start an emulator.
|
|
16
|
+
|
|
17
|
+
## 📦 Pulling an Installed Application (APK)
|
|
18
|
+
When the user asks you to analyze an installed application (e.g., `com.tencent.mm` or `WeChat`):
|
|
19
|
+
|
|
20
|
+
### 1. Find the Package Name
|
|
21
|
+
Use `adb shell pm list packages` to search for the exact package name:
|
|
22
|
+
```bash
|
|
23
|
+
adb shell pm list packages | grep -i "tencent"
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
### 2. Find the APK Path on the Device
|
|
27
|
+
Once you have the package name (e.g., `com.example.app`), find its installation path:
|
|
28
|
+
```bash
|
|
29
|
+
adb shell pm path com.example.app
|
|
30
|
+
```
|
|
31
|
+
*Output will look like: `package:/data/app/~~xxxxx==/com.example.app-yyyy==/base.apk`*
|
|
32
|
+
|
|
33
|
+
### 3. Pull the APK to the Workspace
|
|
34
|
+
Pull the `base.apk` (and any split APKs if requested) to your local analysis directory:
|
|
35
|
+
```bash
|
|
36
|
+
adb pull /data/app/~~xxxxx==/com.example.app-yyyy==/base.apk /workspace/com.example.app.apk
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## 🔍 Pulling App Data (Non-Root vs Root)
|
|
40
|
+
Sometimes you need to analyze an application's private databases, SharedPreferences, or cached files.
|
|
41
|
+
- **If the device is rooted (`su` access):**
|
|
42
|
+
```bash
|
|
43
|
+
adb shell "su -c cp /data/data/com.example.app/databases/app.db /sdcard/"
|
|
44
|
+
adb pull /sdcard/app.db /workspace/
|
|
45
|
+
```
|
|
46
|
+
- **If the device is non-rooted (Debuggable app):**
|
|
47
|
+
```bash
|
|
48
|
+
adb shell run-as com.example.app cat /data/data/com.example.app/databases/app.db > /workspace/app.db
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## 🚀 Pushing Scripts and Binaries
|
|
52
|
+
When deploying tools like `frida-server` or standalone native executables:
|
|
53
|
+
1. Push the binary to a temporary, executable directory on the Android device (usually `/data/local/tmp/`):
|
|
54
|
+
```bash
|
|
55
|
+
adb push frida-server /data/local/tmp/
|
|
56
|
+
```
|
|
57
|
+
2. Make it executable:
|
|
58
|
+
```bash
|
|
59
|
+
adb shell chmod +x /data/local/tmp/frida-server
|
|
60
|
+
```
|
|
61
|
+
3. Run it in the background:
|
|
62
|
+
```bash
|
|
63
|
+
adb shell "/data/local/tmp/frida-server &"
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
Always verify commands with `execute_command` and parse the output before proceeding to the next steps. Do not guess paths; query the device interactively.
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: android-reversing
|
|
3
|
+
description: Master skill for Android Reverse Engineering. Use this when starting any Android analysis task to understand the overall workflow (ADB, JADX, IDA).
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Android Reverse Engineering Master Workflow
|
|
7
|
+
|
|
8
|
+
You are operating as an Expert Android Reverse Engineer. Your environment has access to powerful tools like `adb`, `jadx-mcp`, and `ida-pro-mcp`.
|
|
9
|
+
|
|
10
|
+
**CRITICAL:** You do NOT have direct access to JADX or IDA tools via standard CLI or pre-loaded MCP schemas. Instead, you MUST use the proxy MCP tools built into your environment: `manage_mcp_session`, `explore_mcp_session`, and `call_mcp_session_tool`.
|
|
11
|
+
|
|
12
|
+
## 🔄 The Standard Reverse Engineering Pipeline
|
|
13
|
+
|
|
14
|
+
Whenever the user asks to analyze an Android application, follow these phases systematically:
|
|
15
|
+
|
|
16
|
+
### Phase 1: Acquisition (ADB)
|
|
17
|
+
If the user provides an installed package name but not the APK file, you must extract it from the connected device using ADB.
|
|
18
|
+
- Load the `adb-workflow` skill for detailed instructions on listing packages, finding paths, and pulling the APK.
|
|
19
|
+
- If the APK is already provided, skip to Phase 2.
|
|
20
|
+
|
|
21
|
+
### Phase 2: Static Java Analysis (JADX)
|
|
22
|
+
Once you have the `.apk` or `.dex` file, you must start a JADX MCP session to perform static analysis.
|
|
23
|
+
1. Start the JADX session using `manage_mcp_session`:
|
|
24
|
+
```json
|
|
25
|
+
{
|
|
26
|
+
"action": "start",
|
|
27
|
+
"sessionId": "jadx_main",
|
|
28
|
+
"command": "npx",
|
|
29
|
+
"args": ["-y", "jadx-mcp@latest", "--file", "/absolute/path/to/app.apk"]
|
|
30
|
+
}
|
|
31
|
+
```
|
|
32
|
+
2. Wait for it to become ready, then use `explore_mcp_session` to discover tools (e.g., `get_manifest`, `search_code`, `get_class_source`).
|
|
33
|
+
3. **Always start by analyzing the Manifest** to find the package name, Main Activity, and declared permissions.
|
|
34
|
+
4. Load the `jadx-workflow` skill if you need deeper guidance on traversing Java/Dalvik code.
|
|
35
|
+
|
|
36
|
+
### Phase 3: Native Binary Analysis (IDA Pro)
|
|
37
|
+
If during your Java analysis you discover `System.loadLibrary("foo")` or `native` methods, you must transition to native analysis.
|
|
38
|
+
1. Extract the `.so` files from the APK using `unzip` (e.g., `unzip app.apk lib/* -d /workspace/extracted/`).
|
|
39
|
+
2. Identify the correct architecture (usually `arm64-v8a`).
|
|
40
|
+
3. Start the IDA Pro MCP session using `manage_mcp_session`:
|
|
41
|
+
```json
|
|
42
|
+
{
|
|
43
|
+
"action": "start",
|
|
44
|
+
"sessionId": "ida_foo",
|
|
45
|
+
"command": "idalib-mcp",
|
|
46
|
+
"args": ["--port", "8745", "--unsafe", "/absolute/path/to/libfoo.so"], "transportType": "http",
|
|
47
|
+
"port": 8745
|
|
48
|
+
}
|
|
49
|
+
```
|
|
50
|
+
4. **Notice on `--unsafe`**: Use the `--unsafe` flag when starting `idalib-mcp`. This safely enables advanced capabilities (like `dbg_get_registers` or arbitrary IDAPython execution) because this environment is securely sandboxed in Docker.
|
|
51
|
+
5. Load the `ida-workflow` skill for detailed instructions on decompiling, identifying JNI structures, and renaming variables.
|
|
52
|
+
|
|
53
|
+
### Phase 4: Cleanup
|
|
54
|
+
Once the analysis is completely finished and you have answered the user's questions, you MUST clean up your environment.
|
|
55
|
+
- Call `stop_mcp_session` for every session ID you created.
|
|
56
|
+
|
|
57
|
+
## ⚠️ Important Rules for Proxy Tools
|
|
58
|
+
- **Never guess parameters:** Before calling a tool on an MCP session (like JADX), use `explore_mcp_session` with the `toolName` parameter to read the exact JSON schema required.
|
|
59
|
+
- **Do not restart active sessions:** Use `list_mcp_sessions` to check if a session for your target file is already running. If it is, reuse it!
|
|
60
|
+
- **Pass correct arguments:** When using `call_mcp_session_tool`, ensure your `params` string is a valid JSON object string matching the schema you discovered.
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ida-workflow
|
|
3
|
+
description: Native Native/SO Binary Analysis (IDA Pro). Use this when you have extracted a `.so` (Shared Object) or C/C++ executable and need to perform native decompilation and analysis via the IDA MCP proxy.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# IDA Pro MCP Proxy Workflow
|
|
7
|
+
|
|
8
|
+
You are an expert Native Reverse Engineer, capable of reading C/C++ pseudo-code, ARM assembly, and analyzing JNI (Java Native Interface) structures. You use the `ida-pro-mcp` backend through the `staff-mcp` proxy tools.
|
|
9
|
+
|
|
10
|
+
## 🛠 Initialization
|
|
11
|
+
When you receive a `.so` file (e.g., `libnative-lib.so`) or an ELF binary to analyze:
|
|
12
|
+
1. **Verify Session:** Check if an IDA session is already running using `manage_mcp_session` with `action: "list"`.
|
|
13
|
+
2. **Start Session:** If not, use `manage_mcp_session` with `action: "start"`.
|
|
14
|
+
- **Command:** `idalib-mcp`
|
|
15
|
+
- **Args:** `["--port", "8745", "--unsafe", "/absolute/path/to/libnative-lib.so"]`
|
|
16
|
+
- **Notice on `--unsafe`**: Use the `--unsafe` flag when starting `idalib-mcp`. This safely enables advanced capabilities (like `dbg_get_registers` or arbitrary IDAPython execution) because this environment is securely sandboxed in Docker.
|
|
17
|
+
- **Transport Configuration:** You MUST set `"transportType": "http"` and `"port": 8745`.
|
|
18
|
+
- **Session ID:** Choose a meaningful name, e.g., `ida_native_lib` or `ida_crypto`.
|
|
19
|
+
|
|
20
|
+
## 🧭 Discovery and Schema Fetching
|
|
21
|
+
You MUST NEVER guess the parameters for IDA's tools. The IDA MCP server provides powerful but complex tools for binary analysis.
|
|
22
|
+
1. Call `explore_mcp_session(sessionId="ida_native_lib")` to see available tools (e.g., `decompile`, `rename`, `set_type`, `search_bytes`).
|
|
23
|
+
2. Before calling a tool like `decompile`, retrieve its exact JSON schema: `explore_mcp_session(sessionId="ida_native_lib", toolName="decompile")`.
|
|
24
|
+
3. Once you have the schema, invoke the tool with `call_mcp_session_tool`.
|
|
25
|
+
|
|
26
|
+
## 🗺 Standard Native Analysis Path
|
|
27
|
+
|
|
28
|
+
Follow this path to comprehensively understand a Native Library (`.so`):
|
|
29
|
+
|
|
30
|
+
### Step 1: Identify JNI Interface (Exports / Symbols)
|
|
31
|
+
Native Android libraries usually expose functions to Java via JNI. You need to find them.
|
|
32
|
+
- Look for tools like `list_exports`, `list_functions`, or `search_names`.
|
|
33
|
+
- Focus on exported functions starting with `Java_` (Static JNI linking) or the `JNI_OnLoad` function (Dynamic JNI linking).
|
|
34
|
+
|
|
35
|
+
### Step 2: Decompile JNI Entry Points (`decompile`)
|
|
36
|
+
Once you find a target function (e.g., `Java_com_example_app_MainActivity_stringFromJNI`):
|
|
37
|
+
- Call the decompile tool, passing the function name or address.
|
|
38
|
+
- Carefully read the returned C pseudo-code.
|
|
39
|
+
- Remember that the first two arguments of a static JNI function are always `JNIEnv* env` and `jobject thiz` (or `jclass clazz`).
|
|
40
|
+
|
|
41
|
+
### Step 3: Analyze Dynamic JNI Registration (`JNI_OnLoad`)
|
|
42
|
+
If `JNI_OnLoad` is present, the app dynamically registers its native methods:
|
|
43
|
+
- Decompile `JNI_OnLoad`.
|
|
44
|
+
- Look for calls to `RegisterNatives`.
|
|
45
|
+
- Identify the `JNINativeMethod` array to find the mappings between Java method names and native C function pointers.
|
|
46
|
+
|
|
47
|
+
### Step 4: Iterative Refactoring (`rename`, `set_type`)
|
|
48
|
+
Raw decompiled C code is often hard to read (e.g., `v1`, `a3`, `sub_12345`). You must improve it iteratively:
|
|
49
|
+
- Use tools like `rename` to change variable and function names to meaningful ones (e.g., `a1` -> `env`, `sub_12345` -> `decrypt_payload`).
|
|
50
|
+
- Use tools like `set_type` to define struct types (e.g., `JNIEnv*`) so IDA can automatically resolve offsets to function names (like `env->NewStringUTF`).
|
|
51
|
+
- Re-run `decompile` after refactoring to get cleaner code.
|
|
52
|
+
|
|
53
|
+
## ⚠️ Notes
|
|
54
|
+
- Always work with the appropriate architecture for the target device (usually `arm64-v8a`). Do not analyze `x86` or `armeabi-v7a` libraries unless necessary.
|
|
55
|
+
- IDA Pro analysis is stateful. Your renaming operations persist in the IDA database (`.idb`/`.i64`). Make sure you only rename variables when you are highly confident.
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: jadx-workflow
|
|
3
|
+
description: Android Static Java Analysis (JADX). Use this when you have an APK or DEX file and need to analyze its Java/Dalvik source code using the JADX MCP proxy.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# JADX MCP Proxy Workflow
|
|
7
|
+
|
|
8
|
+
You are an expert Dalvik bytecode and Android Java static analyst. You use the `jadx-mcp` backend through the `staff-mcp` proxy tools to explore Android applications without relying on GUI decompilers.
|
|
9
|
+
|
|
10
|
+
## 🛠 Initialization
|
|
11
|
+
To start analyzing an Android application (`.apk` or `.dex`):
|
|
12
|
+
1. **Verify Session:** Check if a JADX session is already running using `manage_mcp_session` with `action: "list"`.
|
|
13
|
+
2. **Start Session:** If not, you MUST use `manage_mcp_session` with `action: "start"`.
|
|
14
|
+
- **Command:** `npx`
|
|
15
|
+
- **Args:** `["-y", "jadx-mcp@latest", "--file", "/workspace/target.apk"]`
|
|
16
|
+
- **Session ID:** Choose a distinct, readable name, e.g., `jadx_whatsapp` or `jadx_malware`.
|
|
17
|
+
|
|
18
|
+
## 🧭 Discovery and Schema Fetching
|
|
19
|
+
You MUST NEVER assume the exact JSON parameters for a JADX tool. JADX's tools change across versions.
|
|
20
|
+
1. Use `explore_mcp_session(sessionId="jadx_malware")` to see available tools.
|
|
21
|
+
2. When you want to use a tool, call `explore_mcp_session(sessionId="jadx_malware", toolName="search_code")` to get its precise JSON schema.
|
|
22
|
+
3. Once you have the schema, invoke the tool with `call_mcp_session_tool`.
|
|
23
|
+
|
|
24
|
+
## 🗺 Standard Java Analysis Path
|
|
25
|
+
|
|
26
|
+
Follow this path to comprehensively understand an unknown APK:
|
|
27
|
+
|
|
28
|
+
### Step 1: The Manifest (`get_manifest`)
|
|
29
|
+
You must always start by retrieving the `AndroidManifest.xml` summary or full text.
|
|
30
|
+
- Find the **Package Name** (e.g., `com.example.app`).
|
|
31
|
+
- Find the **Application Class** (e.g., `android:name=".MyApplication"`).
|
|
32
|
+
- Identify the **Main/Launcher Activity** (the entry point).
|
|
33
|
+
- Note down critical **Permissions** (e.g., `READ_SMS`, `INTERNET`).
|
|
34
|
+
|
|
35
|
+
### Step 2: High-Level Exploration (`list_packages` / `list_classes`)
|
|
36
|
+
If you need to understand the project structure (e.g., separating third-party SDKs from the main business logic):
|
|
37
|
+
- Explore the root packages. Ignore standard libraries (`android.*`, `androidx.*`, `kotlin.*`, `com.google.*`) unless explicitly instructed.
|
|
38
|
+
- Focus on the package matching the app's `package_name` from Step 1.
|
|
39
|
+
|
|
40
|
+
### Step 3: Targeted Search (`search_code`)
|
|
41
|
+
If you have a specific goal (e.g., finding where an encryption key is generated, or a specific API endpoint):
|
|
42
|
+
- Search for constants: `"http://"`, `"https://"`, `"AES/CBC/PKCS5Padding"`, `"password"`.
|
|
43
|
+
- You can often use regex (if the schema allows) to find method signatures like `private native .*`.
|
|
44
|
+
|
|
45
|
+
### Step 4: Deep Decompilation (`get_class_source` or similar)
|
|
46
|
+
Once you locate an interesting class via `search_code` or `list_classes`, decompile it:
|
|
47
|
+
- Call the appropriate tool to retrieve the decompiled Java source of the class.
|
|
48
|
+
- Read the code carefully.
|
|
49
|
+
- If it loads a native library (`System.loadLibrary("crypto")`), extract the `.so` file and transition to the `ida-workflow` skill.
|
|
50
|
+
|
|
51
|
+
## ⚠️ Notes
|
|
52
|
+
- If an operation fails or times out, check if the APK is extremely large. The JADX backend might still be loading classes.
|
|
53
|
+
- JADX does not execute the code. It is a static analysis tool. For dynamic tracing, consider `frida`.
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: skill-manager
|
|
3
|
+
description: Manage staff-mcp skills and profiles (install, uninstall, search). Use this when the user wants to add, remove, or find skills or configure a profile.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Skill & Profile Manager
|
|
7
|
+
|
|
8
|
+
This core skill enables the assistant to manage skills and configure profiles for the `staff-mcp` ecosystem.
|
|
9
|
+
|
|
10
|
+
## Knowledge
|
|
11
|
+
Skills are stored as directories containing a `SKILL.md` file. They can be installed at different levels with the following priority (highest to lowest):
|
|
12
|
+
1. **Project Level**: `<cwd>/.staff/skills/<skill-name>/SKILL.md` (Primary target for assistant operations)
|
|
13
|
+
2. **Project Profile Level**: `<cwd>/.staff/profiles/<profile-name>/skills/<skill-name>/SKILL.md`
|
|
14
|
+
3. **Global Profile Level**: `~/.staff/profiles/<profile-name>/skills/<skill-name>/SKILL.md`
|
|
15
|
+
4. **Global Level**: `~/.staff/skills/<skill-name>/SKILL.md`
|
|
16
|
+
5. **Built-in Infrastructures**: `staff-mcp/builtin-profiles/...`
|
|
17
|
+
|
|
18
|
+
**Profiles** are specific context configurations (e.g. `default`, `android-reverse`). They act as complete environments that can contain not only skills but also future configurations like `agent.md` (for MCP instructions overrides).
|
|
19
|
+
|
|
20
|
+
### ⚠️ Security Boundaries & Default Scope
|
|
21
|
+
- **Default to Workspace ONLY**: Unless the user explicitly says otherwise, you MUST assume all requests (install, uninstall, clear) apply ONLY to the standard project workspace (`<cwd>/.staff/skills/`).
|
|
22
|
+
- **Profiles are User-Managed**: DO NOT attempt to write, modify, or delete skills inside `<cwd>/.staff/profiles/` or `~/.staff/profiles/` unless explicitly instructed to modify a profile. Profiles are generally managed by the user.
|
|
23
|
+
- **DO NOT Locate Global/Built-in Skills**: Do not use tools (`list_dir`, `execute_command`, etc.) to search for or verify global or built-in skills when deleting or modifying. Ignore their existence to avoid wasting time and access denied errors.
|
|
24
|
+
- **Global & Built-in are Read-Only**: You are strictly prohibited from modifying user-level (`~/.staff/`) or built-in (`staff-mcp/builtin-profiles/`) directories.
|
|
25
|
+
- **Provide Instructions for Global**: If the user EXPLICITLY asks to modify a global skill or profile, DO NOT try to locate or execute it. Simply provide the exact shell commands in a markdown code block and politely instruct the user to run them manually.
|
|
26
|
+
|
|
27
|
+
## Workflows
|
|
28
|
+
|
|
29
|
+
### 🔍 Search/Discover Skills
|
|
30
|
+
To find skills to install:
|
|
31
|
+
1. **Analyze the source**: A skill can come from anywhere: a local directory path, a GitHub URL, an npm package, a zip file, or another public repository.
|
|
32
|
+
2. **If the user provides an exact path or URL**: Use that directly to fetch the skill.
|
|
33
|
+
3. **If the user does not provide enough information**: Do NOT assume it is from Anthropic or GitHub. Ask the user politely for the exact URL, Git repository, or local folder path where the skill is located.
|
|
34
|
+
4. **Example searches (Optional)**: If the user explicitly asks for "Anthropic official skills", you can use `curl -s "https://api.github.com/orgs/anthropics/repos?per_page=100" | grep '"name"'` as an example, but NEVER restrict yourself to this organization unless requested.
|
|
35
|
+
|
|
36
|
+
### ⬇️ Install a Skill
|
|
37
|
+
When the user asks to install a skill:
|
|
38
|
+
1. **Determine the source**: Ensure you know exactly where to get the skill from. If unsure, ask the user.
|
|
39
|
+
2. **Assume Project environment** (`<cwd>/.staff/skills/`) by default.
|
|
40
|
+
3. **If Project-level**:
|
|
41
|
+
- Use `execute_command` to fetch the skill (e.g., `git clone <url> <cwd>/.staff/skills/<skill-name>` or `cp -r <local-path> <cwd>/.staff/skills/<skill-name>`).
|
|
42
|
+
- Ensure the directory contains a `SKILL.md` file.
|
|
43
|
+
4. **If Global-level or Profile-level**: DO NOT execute anything. Output the corresponding commands (e.g., `mkdir -p ~/.staff/skills && cd ~/.staff/skills && git clone <url> <name>`) and ask the user to execute them manually.
|
|
44
|
+
|
|
45
|
+
### 🗑️ Uninstall / Clear Skills
|
|
46
|
+
When the user asks to remove, uninstall, or clear skills:
|
|
47
|
+
1. **Assume Workspace Only**: ONLY look in and modify the standard project directory (`<cwd>/.staff/skills/`). Do NOT touch `.staff/profiles/` unless specifically told to do so.
|
|
48
|
+
2. Use `execute_command` (e.g., `rm -rf .staff/skills/*`) to delete them directly.
|
|
49
|
+
3. **Do NOT** try to find, list, or touch `~/.staff` or built-in skills. Ignore them entirely.
|
|
50
|
+
4. If the user EXPLICITLY asks to remove a **global** or **profile** skill, DO NOT look for it. Just output the command and tell the user to run it themselves.
|
|
51
|
+
|
|
52
|
+
### 📝 Create a Custom Skill
|
|
53
|
+
1. Assume **Project-level** by default. Use `write_file` to create `<cwd>/.staff/skills/<skill-name>/SKILL.md`.
|
|
54
|
+
2. If the user explicitly asks for a **Global-level** skill, provide the file content in a code block and instruct the user to save it to `~/.staff/skills/<skill-name>/SKILL.md` manually.
|