Skill: shaojun0/nginx-explorer (version 1.0.0)

--- name: nginx-explorer description: "Explore nginx-proxied directories to discover tools and utilities. Use when: user asks to explore available tools, find utilities for specific tasks, or when OpenClaw needs to discover executable projects in a directory structure served by nginx. Configuration requires nginx URL. Each directory contains README.md explaining contents and execution instructions." metadata: openclaw: emoji: "🔍" requires: bins: ["curl"] primaryEnv: "NGINX_URL" env: NGINX_URL: description: "The base URL of the nginx server (e.g., http://192.168.1.100:8080 or http://internal-tools.local)" required: true type: "string" example: "http://192.168.1.100:8080" NGINX_SKIP_SSL_VERIFY: description: "Skip SSL certificate verification (useful for internal networks with self-signed certificates)" required: false type: "boolean" default: true --- # Nginx Explorer Skill Explore directories served by nginx to discover tools, utilities, and executable projects. Each main directory contains a README.md file that explains what's available and how to use it. ## Configuration This skill requires one environment variable: - `NGINX_URL`: The base URL of the nginx server (e.g., `http://192.168.1.100:8080` or `http://internal-tools.local`) Optional environment variable: - `NGINX_SKIP_SSL_VERIFY`: Set to `true` to skip SSL certificate verification (useful for internal networks with self-signed certificates). Default is `true`. Configure in `~/.openclaw/openclaw.json`: ```json5 { skills: { entries: { "nginx-explorer": { enabled: true, env: { NGINX_URL: "http://your-nginx-server:port", NGINX_SKIP_SSL_VERIFY: "true" // Optional: skip SSL verification for internal networks } } } } } ``` ## When to Use ✅ **USE this skill when:** - User asks "what tools are available?" or "explore the nginx directory" - OpenClaw needs to find utilities for specific tasks - User wants to discover executable projects in the nginx-proxied structure - When conventional approaches fail and exploring available tools might help ❌ **DON'T use this skill when:** - Direct file access is available (use normal file operations instead) - The nginx URL is not configured - Simple file downloads are needed (use curl/wget directly) ## Configuration The skill requires one configuration item: - `NGINX_URL`: The base URL of the nginx server (e.g., `http://192.168.1.100:8080` or `http://internal-tools.local`) ## How It Works 1. **Directory Discovery**: Fetches the nginx directory listing (HTML) 2. **README Reading**: For each directory, reads the README.md file to understand contents 3. **Tool Identification**: Identifies executable projects and their usage instructions 4. **Download & Execution**: Can download tools locally and run them as needed ## Basic Usage ### 1. Configure the nginx URL First, set the nginx URL in your environment or workspace: ```bash # Set as environment variable export NGINX_URL="http://192.168.1.100:8080" # Or store in workspace config echo '{"nginx_url": "http://192.168.1.100:8080"}' > /home/node/.openclaw/workspace/nginx-config.json ``` ### 2. Explore the Directory Structure ```bash # Fetch directory listing curl -s "$NGINX_URL/" | grep -o 'href="[^"]*"' | grep -v '^href="\.' | cut -d'"' -f2 ``` ### 3. Read README Files For each discovered directory: ```bash # Check if README.md exists curl -s -I "$NGINX_URL/tool-directory/README.md" | head -1 | grep "200" # Read the README curl -s "$NGINX_URL/tool-directory/README.md" ``` ### 4. Download and Execute Tools When a useful tool is found: ```bash # Download the tool (assuming it's a script or archive) curl -o /tmp/tool.sh "$NGINX_URL/tool-directory/tool.sh" # Make executable if needed chmod +x /tmp/tool.sh # Run according to README instructions /tmp/tool.sh --help ``` ## Workflow Examples ### Example 1: Discovering Available Tools ```bash #!/bin/bash NGINX_URL="http://192.168.1.100:8080" # Get all directories echo "Exploring $NGINX_URL..." DIRS=$(curl -s "$NGINX_URL/" | grep -o 'href="[^"]*/"' | grep -v '^href="\.' | cut -d'"' -f2 | sed 's|/$||') for dir in $DIRS; do echo "=== $dir ===" # Try to read README README=$(curl -s "$NGINX_URL/$dir/README.md" 2>/dev/null) if [ -n "$README" ]; then echo "$README" | head -5 else echo "No README found" fi echo done ``` ### Example 2: Finding a Specific Type of Tool ```bash #!/bin/bash NGINX_URL="http://192.168.1.100:8080" # Search for tools related to "data processing" echo "Searching for data processing tools..." DIRS=$(curl -s "$NGINX_URL/" | grep -o 'href="[^"]*/"' | grep -v '^href="\.' | cut -d'"' -f2 | sed 's|/$||') for dir in $DIRS; do README=$(curl -s "$NGINX_URL/$dir/README.md" 2>/dev/null) if echo "$README" | grep -qi "data.*process\|csv\|json\|transform"; then echo "Found in $dir:" echo "$README" | grep -i "data.*process\|csv\|json\|transform" | head -3 echo "---" fi done ``` ### Example 3: Downloading and Running a Tool ```bash #!/bin/bash NGINX_URL="http://192.168.1.100:8080" TOOL_DIR="data-processor" # Read instructions README=$(curl -s "$NGINX_URL/$TOOL_DIR/README.md") echo "Tool instructions:" echo "$README" # Download main script curl -o /tmp/processor.py "$NGINX_URL/$TOOL_DIR/processor.py" # Download dependencies if mentioned if echo "$README" | grep -q "requirements.txt"; then curl -o /tmp/requirements.txt "$NGINX_URL/$TOOL_DIR/requirements.txt" pip install -r /tmp/requirements.txt fi # Run the tool python /tmp/processor.py --help ``` ## Integration with OpenClaw Decision Making This skill is designed to be used when OpenClaw encounters difficult problems. The workflow: 1. **Problem Assessment**: Determine if conventional approaches are failing 2. **Tool Exploration**: Use this skill to explore available utilities 3. **Tool Selection**: Identify tools that might help with the specific problem 4. **Tool Application**: Download and use the selected tool ### Decision Flow ``` User Request → Can OpenClaw solve it directly? → Yes → Solve directly ↓ No ↓ Explore nginx directory ↓ Read README files ↓ Find relevant tools/utilities ↓ Download and apply tool to problem ``` ## Error Handling - **Connection Issues**: Check if nginx URL is correct and accessible - **Missing README**: Some directories may not have README.md files - **Broken Links**: Verify tool files exist before downloading - **Execution Failures**: Check dependencies and permissions ## Best Practices 1. **Cache Discoveries**: Store directory listings to avoid repeated requests 2. **Validate Tools**: Test tools in isolated environment before use 3. **Clean Up**: Remove downloaded files after use 4. **Document Findings**: Update workspace notes with useful tools discovered ## Example README Structure Tools in the nginx directory should follow this README format: ```markdown # Tool Name ## Purpose Brief description of what this tool does. ## Usage ```bash ./tool.sh [options] ``` ## Dependencies - Python 3.8+ - Required packages: requests, pandas ## Examples ```bash # Basic usage ./tool.sh --input data.csv --output results.json # Advanced usage ./tool.sh --config config.yaml --verbose ``` ## Notes Any additional information or warnings. ``` ## Security Considerations - Only download from trusted nginx servers - Validate scripts before execution - Run in sandboxed environment when possible - Check for malicious code in downloaded files

path: INSTALLATION.md
content: # Nginx Explorer Skill 安装指南

## 安装方法

### 方法1：使用 ClawHub（推荐）
```bash
# 安装到当前工作区
clawhub install nginx-explorer

# 或指定目录
clawhub install nginx-explorer --dir ~/.openclaw/skills
```

### 方法2：手动安装
```bash
# 1. 复制技能目录到 OpenClaw 技能目录
cp -r nginx-explorer ~/.openclaw/skills/

# 或复制到工作区技能目录
cp -r nginx-explorer /path/to/your/workspace/skills/
```

### 方法3：通过 extraDirs 加载
```json5
// 在 ~/.openclaw/openclaw.json 中添加
{
  skills: {
    load: {
      extraDirs: ["/path/to/nginx-explorer"],
      watch: true,
      watchDebounceMs: 250,
    }
  }
}
```

## 配置步骤

### 1. 编辑 OpenClaw 配置文件
```bash
# 如果配置文件不存在，先创建
touch ~/.openclaw/openclaw.json
```

### 2. 添加 nginx-explorer 配置
编辑 `~/.openclaw/openclaw.json`，添加以下内容：

```json5
{
  skills: {
    entries: {
      "nginx-explorer": {
        enabled: true,
        env: {
          NGINX_URL: "http://apt_nginx"  // 你的 nginx 服务器地址
        }
      }
    }
  }
}
```

### 3. 重启 OpenClaw
```bash
# 重启 Gateway 服务
openclaw gateway restart

# 或重启整个 OpenClaw
# （取决于你的安装方式）
```

## 验证安装

### 1. 检查技能是否加载
```bash
# 查看技能状态
openclaw skills list

# 或通过 OpenClaw UI 查看
```

### 2. 测试技能功能
在 OpenClaw 会话中测试：
```
用户：探索 nginx 目录
OpenClaw：应该使用 nginx-explorer 技能来探索 http://apt_nginx/
```

### 3. 检查环境变量
```bash
# 在 OpenClaw 会话中检查环境变量
echo $NGINX_URL
```

## 配置选项

### 必需配置
- `NGINX_URL`: nginx 服务器的基础 URL

### 可选配置
```json5
{
  skills: {
    entries: {
      "nginx-explorer": {
        enabled: true,
        env: {
          NGINX_URL: "http://apt_nginx"
        },
        config: {
          // 启用缓存（默认：true）
          cacheEnabled: true,
          
          // 下载目录（默认：/tmp/nginx-tools）
          downloadDir: "/tmp/nginx-tools",
          
          // 自动清理（默认：true）
          autoCleanup: true,
          
          // 缓存时间（秒，默认：3600）
          cacheTTL: 3600,
          
          // 最大并发请求数（默认：3）
          maxConcurrent: 3
        }
      }
    }
  }
}
```

## 故障排除

### 1. 技能未加载
- 检查 `~/.openclaw/openclaw.json` 语法
- 确认技能目录位置正确
- 查看 OpenClaw 日志：`openclaw gateway logs`

### 2. 环境变量未设置
- 确认配置中的 `env` 部分正确
- 检查技能是否启用（`enabled: true`）
- 重启 OpenClaw 服务

### 3. 无法访问 nginx
- 验证 `NGINX_URL` 是否正确
- 测试网络连接：`curl -I $NGINX_URL`
- 检查防火墙和网络配置

### 4. 权限问题
- 确保 OpenClaw 有权限访问 nginx
- 检查下载目录的写入权限
- 验证 curl 命令可用

## 更新技能

### 通过 ClawHub 更新
```bash
clawhub update nginx-explorer
```

### 手动更新
```bash
# 备份旧版本
cp -r ~/.openclaw/skills/nginx-explorer ~/.openclaw/skills/nginx-explorer.backup

# 复制新版本
cp -r /path/to/new/nginx-explorer ~/.openclaw/skills/
```

## 卸载

### 通过 ClawHub 卸载
```bash
clawhub uninstall nginx-explorer
```

### 手动卸载
```bash
# 移除技能目录
rm -rf ~/.openclaw/skills/nginx-explorer

# 或从工作区移除
rm -rf /path/to/workspace/skills/nginx-explorer

# 从配置中移除
# 编辑 ~/.openclaw/openclaw.json，删除 nginx-explorer 条目
```

## 支持

- 查看技能文档：`cat ~/.openclaw/skills/nginx-explorer/SKILL.md`
- 访问 OpenClaw 文档：https://docs.openclaw.ai
- 加入社区：https://discord.com/invite/clawd

path: README.md
content: # Nginx Explorer Skill for OpenClaw

A skill that enables OpenClaw to explore nginx-proxied directories containing tools and utilities, read their README.md files, and download/execute them when needed.

## Purpose

When OpenClaw encounters difficult problems that conventional approaches can't solve, this skill allows it to explore a pre-configured nginx server hosting various tools and utilities. Each tool directory contains a README.md explaining its purpose and usage.

## Key Features

1. **Directory Exploration**: Automatically discovers available tools in nginx directory
2. **README Parsing**: Reads and understands tool documentation
3. **Tool Discovery**: Identifies relevant tools for specific problems
4. **Download & Execution**: Downloads tools locally and runs them as needed
5. **Decision Integration**: Helps OpenClaw decide when to use external tools

## Directory Structure

```
nginx-explorer/
├── SKILL.md                    # Main skill documentation
├── scripts/
│   ├── explore-directory.sh    # Explore nginx directory structure
│   ├── download-tool.sh        # Download and prepare tools
│   └── test-mock-nginx.sh      # Test with mock nginx server
├── references/
│   ├── decision-workflow.md    # When to use this skill
│   └── configuration-examples.md # Configuration examples
└── README.md                   # This file
```

## Quick Start

### 1. Configure nginx URL

```bash
export NGINX_URL="http://your-nginx-server:port"
```

### 2. Explore Available Tools

```bash
./scripts/explore-directory.sh
```

### 3. Download and Use a Tool

```bash
./scripts/download-tool.sh "http://your-nginx-server:port" "tool-name"
```

### 4. Test with Mock Server

```bash
./scripts/test-mock-nginx.sh
```

## How It Works

### Discovery Phase
1. Fetches directory listing from nginx
2. Identifies directories with README.md files
3. Reads and parses README content
4. Categorizes tools by functionality

### Decision Phase
1. Assesses problem complexity
2. Determines if conventional approaches are insufficient
3. Identifies relevant tools from discovery
4. Selects the most appropriate tool

### Execution Phase
1. Downloads selected tool and dependencies
2. Configures tool for specific problem
3. Executes tool and monitors results
4. Cleans up temporary files

## Integration with OpenClaw

This skill is designed to be triggered when:
- Conventional problem-solving approaches fail
- Specialized tools are needed
- User explicitly asks for tool exploration
- Complex data processing is required

## Example Use Cases

1. **Data Processing**: CSV/JSON transformation, data cleaning
2. **Media Operations**: Image/video processing, format conversion
3. **System Utilities**: File management, backup, monitoring
4. **Development Tools**: Code generation, testing, documentation
5. **Network Tools**: API testing, network analysis

## Security Considerations

- Tools are downloaded from trusted nginx servers only
- Scripts can be reviewed before execution
- Tools run in appropriate security context
- User confirmation for unknown tools

## Testing

A mock nginx server is included for testing:

```bash
# Start test environment
./scripts/test-mock-nginx.sh

# Test exploration
export NGINX_URL="http://localhost:9999"
./scripts/explore-directory.sh

# Test tool download
./scripts/download-tool.sh "http://localhost:9999" "data-cleaner"
```

## Requirements

- `curl` for HTTP requests
- `grep`, `sed`, `awk` for text processing
- Python 3.x for some tools
- Network access to nginx server

## License

This skill is provided as-is for use with OpenClaw. Modify as needed for your environment.

Security scan verdicts — ClawScan: suspicious | static analysis: suspicious | VirusTotal: clean | SkillSpector: suspicious (CRITICAL)