Skill: xzl01/radxa-docs (version 1.0.1)

--- name: radxa-local-docs description: "Use when one Radxa skill should cover the full offline documentation workflow: detect the current board model, map it to the correct product series, deploy or update the local MDMaker documentation mirror under ~/.openclaw/MDMaker, and query board-specific offline docs before coding, debugging, or hardware operations." --- # Radxa Local Docs ## Purpose Combine the previous `device-info`, `mdmaker-deploy`, and `radxa-doc` capabilities into one publishable skill. ## Use Bundled Resources - Run `scripts/detect_device.sh` to detect the current device model with Device Tree, DMI, hostname, and `/proc/cpuinfo` fallbacks. - Read `references/device-series-map.md` when a detected or user-provided model must be mapped to a Radxa product series. ## Workflow 1. Detect the current board model first. 2. If detection fails or the host is not a Radxa board, fall back to the user-provided model name instead of guessing. 3. Map the board model to a Radxa series with `references/device-series-map.md`. 4. Check whether the local documentation mirror already exists under `~/.openclaw/MDMaker/dist/zh/` or `~/.openclaw/MDMaker/dist/en/`. 5. If the user asks to deploy or update docs, use the MDMaker workflow below. 6. If the user asks a documentation question, locate the right language directory, product series, model directory, and topic-specific markdown file before answering. ## MDMaker Workflow ### Deploy ```bash cd ~/.openclaw git clone -b agent https://github.com/ZIFENG278/MDMaker.git cd ~/.openclaw/MDMaker python3 -m venv venv source venv/bin/activate pip install requests tqdm python build_md_docs.py ``` ### Raw Docs Source Prefer the upstream GitHub source first. Only fall back to the domestic GitCode mirror if GitHub clone or pull fails. Primary source: ```bash git clone https://github.com/radxa-docs/docs.git ~/.openclaw/MDMaker/radxa-docs ``` Fallback source: ```bash git clone https://gitcode.com/radxa-docs/docs.git ~/.openclaw/MDMaker/radxa-docs ``` If `~/.openclaw/MDMaker/radxa-docs/` already exists and GitHub access fails, switch the existing repo to GitCode and retry: ```bash cd ~/.openclaw/MDMaker/radxa-docs git remote set-url origin https://gitcode.com/radxa-docs/docs.git git pull ``` ### Update ```bash cd ~/.openclaw/MDMaker source venv/bin/activate python update_md_docs.py ``` ### Expected Paths - Project root: `~/.openclaw/MDMaker/` - Source repo: `~/.openclaw/MDMaker/radxa-docs/` - Primary upstream: `https://github.com/radxa-docs/docs.git` - Domestic upstream mirror: `https://gitcode.com/radxa-docs/docs.git` - Chinese docs: `~/.openclaw/MDMaker/dist/zh/` - English docs: `~/.openclaw/MDMaker/dist/en/` If the mirror is missing and the user did not ask to deploy it, report that the prerequisite is missing instead of fabricating documentation answers. ## Offline Query Workflow ### Directory Selection - Choose `zh/` or `en/` first. - Then enter `dist/<lang>/<series>/<model>/`. - Common sections include `getting-started`, `hardware-design`, `low-level-dev`, `os-config`, `radxa-os`, `other-os`, `app-development`, and `apps-deployment`. ### Search Strategy Prefer targeted file discovery over broad scans: ```bash find ~/.openclaw/MDMaker/dist/<lang>/<series>/<model> -name "*<keyword>*.md" rg -n "<keyword>" ~/.openclaw/MDMaker/dist/<lang>/<series>/<model> ``` Use `hardware-design` for pinouts, interfaces, power, and schematic-adjacent questions. Use `getting-started` and `os-config` for installation, boot, networking, and system setup. Use `low-level-dev` for bootloader, Device Tree, and low-level platform details. Use `app-development` and `apps-deployment` for software stacks and deployment topics. ## Relative Link Handling When a document contains relative `.md` links with `../`, normalize the link against the current document path, then open the resolved file under the same `dist/<lang>/` tree. ## Output Rules - Quote concrete file paths when citing local documentation. - State clearly when the answer is confirmed from local docs versus inferred from model mapping. - If multiple boards fit the same series, ask or infer only from explicit evidence such as detection output or the user’s board name. ## Safety - Do not assume a board model without evidence. - Do not perform flashing, partitioning, bootloader overwrite, or EEPROM changes as part of this skill. - Keep commands low-risk unless the user explicitly asks for deployment or update actions.

path: scripts/detect_device.sh
content: #!/bin/bash

set -euo pipefail

if [ -f /proc/device-tree/model ]; then
  tr -d '\0' < /proc/device-tree/model
  exit 0
fi

if [ -f /sys/firmware/devicetree/base/model ]; then
  tr -d '\0' < /sys/firmware/devicetree/base/model
  exit 0
fi

if [ -f /sys/class/dmi/id/product_name ]; then
  cat /sys/class/dmi/id/product_name
  exit 0
fi

if command -v hostname >/dev/null 2>&1; then
  hostname
  exit 0
fi

grep "Model" /proc/cpuinfo || true


path: agents/openai.yaml
content: version: 1
display_name: Radxa Local Docs
short_description: 检测板型、管理本地文档镜像并查询离线 Radxa 技术资料。
default_prompt: 检测当前 Radxa 设备，必要时部署或更新本地文档，然后查询相关硬件、接口或系统文档并给出结论。


path: references/device-series-map.md
content: # Device Series Map

Use this table to map a detected device string or a user-provided board name to a Radxa product series.

| Device keyword | Series | Example boards |
| --- | --- | --- |
| `ROCK 5`, `rock5`, `rock5a`, `rock5b`, `rock5c`, `RK3588` | `rock5` | ROCK 5A, ROCK 5B, ROCK 5C |
| `ROCK 4`, `rock4`, `rock4a`, `rock4b`, `rock4c`, `RK3399` | `rock4` | ROCK 4A, ROCK 4B, ROCK 4C+ |
| `ROCK 3`, `rock3`, `rock3a`, `rock3b`, `rock3c`, `RK3568` | `rock3` | ROCK 3A, ROCK 3B, ROCK 3C |
| `ROCK 2`, `rock2`, `rock2a`, `rock2f`, `RK3328` | `rock2` | ROCK 2A, ROCK 2F |
| `Zero`, `zero`, `zero2`, `zero3`, `RK3528` | `zero` | Zero, Zero 2, Zero 3 |
| `X15`, `X2L`, `Intel` | `x` | X15, X2L |
| `E20C`, `E24C`, `E52C`, `E54C` | `e` | E20C, E24C, E52C, E54C |
| `CM3`, `CM3I`, `CM3J`, `CM4`, `CM5`, `NX5` | `som` | CM3, CM4, CM5, NX5 |
| `Orion`, `orion`, `O6`, `O6N` | `orion` | Orion O6, Orion O6N |
| `Cubie`, `cubie`, `A5E`, `A7A` | `cubie` | Cubie A5E, Cubie A7A |
| `Dragon`, `dragon`, `Q6A` | `dragon` | Dragon Q6A |
| `SiRider`, `sirider`, `S1` | `sirider` | SiRider S1 |
| `AIRbox`, `AICore`, `aicore` | `aicore` | AIRbox, AICore |
| `FogWise`, `fogwise` | `fogwise` | FogWise devices |
| `NIO`, `nio`, `NIO12L` | `nio` | NIO12L |

If the detected string does not match a known Radxa family, treat the host as non-Radxa until the user provides a specific board model.


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