$npx -y skills add agentscope-ai/QwenPaw --skill guidance-enAnswer user questions about QwenPaw installation and configuration: first locate and read local documentation, then distill the answer; if local information is insufficient, fall back to the official website documentation.
| 1 | # QwenPaw Installation and Configuration Q&A Guide |
| 2 | |
| 3 | Use this skill when the user asks about **QwenPaw installation, initialization, environment configuration, dependency requirements, or common configuration options**. |
| 4 | |
| 5 | Core principles: |
| 6 | |
| 7 | - Check local documentation first, then answer |
| 8 | - Base answers on what has actually been read, do not speculate |
| 9 | - Answer in the same language the user used to ask |
| 10 | |
| 11 | ## Standard Flow |
| 12 | |
| 13 | ### Step 1: Locate the Documentation Directory |
| 14 | |
| 15 | **Use built-in path resolution (works for all install methods)** |
| 16 | |
| 17 | ```bash |
| 18 | DOCS_DIR=$(python3 -c "from qwenpaw.constant import DOCS_DIR; print(DOCS_DIR or '')" 2>/dev/null) |
| 19 | ``` |
| 20 | |
| 21 | If the above returns a non-empty path and the directory exists, use it directly and skip to Step 2. |
| 22 | |
| 23 | If it fails (e.g., older version without DOCS_DIR), fall back in the following order: |
| 24 | |
| 25 | **Check for documentation directory in memory** |
| 26 | |
| 27 | First, check whether there is a documentation directory in memory. If found, use it directly; otherwise, proceed to the next step. |
| 28 | |
| 29 | ```bash |
| 30 | # Get the documentation directory from memory |
| 31 | DOCS_DIR=$(find ~/.qwenpaw/memory/ -type d -name "docs") |
| 32 | ``` |
| 33 | |
| 34 | If there is no documentation directory in memory, continue with the following logic. |
| 35 | |
| 36 | **Check the documentation directory in the project source code** |
| 37 | |
| 38 | Run the following script logic to obtain the variable $QWENPAW_ROOT: |
| 39 | |
| 40 | ```bash |
| 41 | # Get the absolute path of the binary |
| 42 | QWENPAW_PATH=$(which qwenpaw 2>/dev/null || whereis qwenpaw | awk '{print $2}') |
| 43 | |
| 44 | # Logical deduction: if the path contains .qwenpaw/bin/qwenpaw, the root is three levels up |
| 45 | # Example: /path/to/QwenPaw/.qwenpaw/bin/qwenpaw -> /path/to/QwenPaw |
| 46 | if [[ "$QWENPAW_PATH" == *".qwenpaw/bin/qwenpaw" ]]; then |
| 47 | QWENPAW_ROOT=$(echo "$QWENPAW_PATH" | sed 's/\/\.qwenpaw\/bin\/qwenpaw//') |
| 48 | else |
| 49 | # Fallback: try to get the parent of the parent directory |
| 50 | QWENPAW_ROOT=$(dirname $(dirname "$QWENPAW_PATH") 2>/dev/null || echo ".") |
| 51 | fi |
| 52 | |
| 53 | echo "Detected QwenPaw Root: $QWENPAW_ROOT" |
| 54 | ``` |
| 55 | |
| 56 | Verify and list the documentation directory: |
| 57 | Use the derived $QWENPAW_ROOT to locate the documentation: |
| 58 | |
| 59 | ```bash |
| 60 | # Construct the standard documentation path |
| 61 | DOCS_DIR="$QWENPAW_ROOT/website/public/docs/" |
| 62 | |
| 63 | # Check if the path exists and list files |
| 64 | if [ -d "$DOCS_DIR" ]; then |
| 65 | find "$DOCS_DIR" -type f -name "*.md" | head -n 100 |
| 66 | else |
| 67 | # If the derived path is incorrect, perform a global fuzzy search |
| 68 | find "$QWENPAW_ROOT" -type d -name "docs" | grep "website/public/docs" |
| 69 | fi |
| 70 | ``` |
| 71 | |
| 72 | **If project documentation does not exist, search the working directory** |
| 73 | |
| 74 | If documentation is still not found, search for available documentation content under the qwenpaw installation path: |
| 75 | |
| 76 | ```bash |
| 77 | # Look for characteristic files such as faq.en.md or config.zh.md |
| 78 | FILE_PATH=$(find . -type f -name "faq.en.md" -o -name "config.zh.md" | head -n 1) |
| 79 | if [ -n "$FILE_PATH" ]; then |
| 80 | # Use dirname to get the directory containing the file |
| 81 | DOCS_DIR=$(dirname "$FILE_PATH") |
| 82 | fi |
| 83 | ``` |
| 84 | |
| 85 | If a documentation directory is found, save it in memory in this format: |
| 86 | |
| 87 | ```markdown |
| 88 | # Documentation Directory |
| 89 | $DOCS_DIR = <doc_path> |
| 90 | ``` |
| 91 | |
| 92 | ### Step 2: Documentation Search and Matching |
| 93 | |
| 94 | Documentation files follow the naming format `<topic>.<lang>.md` (e.g., `config.zh.md`, `config.en.md`, `quickstart.zh.md`). |
| 95 | |
| 96 | Use the find command to list all matching documents in the target directory, and identify the target as <doc_path> based on filename keywords (e.g., install, env, setup). |
| 97 | |
| 98 | ```bash |
| 99 | # List all matching documents |
| 100 | find $DOCS_DIR -type f -name "*.md" |
| 101 | ``` |
| 102 | |
| 103 | If no suitable document is found, read all documentation contents in the next step. |
| 104 | |
| 105 | ### Step 3: Read the Documentation Content |
| 106 | |
| 107 | After finding candidate documents, read and identify the paragraphs relevant to the question. You can use: |
| 108 | |
| 109 | - `cat <doc_path>` |
| 110 | - `file_reader` skill (recommended for longer documents or paginated reading) |
| 111 | |
| 112 | If the documentation is long, prioritize reading the sections most relevant to the question (installation steps, configuration options, example commands, notes, version requirements). |
| 113 | |
| 114 | ### Step 4: Extract Information and Respond |
| 115 | |
| 116 | Extract key information from the documentation and organize it into an actionable answer: |
| 117 | |
| 118 | - Give the direct conclusion first |
| 119 | - Then provide steps / commands / configuration examples |
| 120 | - Include necessary prerequisites and common pitfalls |
| 121 | |
| 122 | Language requirement: the answer language must match the language of the user's question (answer in Chinese if asked in Chinese, answer in English if asked in English). |
| 123 | |
| 124 | ### Step 5 (Optional): Official Website Lookup |
| 125 | |
| 126 | If the previous steps cannot be completed (no local documentation, missing documentation, or insufficient information), use |