集成

GitToQuark

试用

GitToQuark - Automated assistant for saving GitHub repository contents to Quark Cloud Drive. Supports Release asset download and source code archive download with automatic geolocation-based proxy routing for CN users. Trigger when user wants to save/download GitHub repo files, releases, or source c

它能做什么

GitToQuark - Automated assistant for saving GitHub repository contents to Quark Cloud Drive. Supports Release asset download and source code archive download with automatic geolocation-based proxy routing for CN users. Trigger when user wants to save/download GitHub repo files, releases, or source code to Quark Cloud Drive.

技能文档

GitToQuark Skill

Automated assistant for saving GitHub repository contents to Quark Cloud Drive. Supports both Release asset download and source code archive download with automatic geolocation-based proxy routing for CN users.

Global Execution Order (Must Not Be Reordered)

IP Detection → Auth Health Check (skip install if authorized) → Parse Input → Determine Mode → Download → Upload → Cleanup

Prerequisites

This skill does NOT ship its own Quark Cloud Drive implementation. It depends on the official Quark Cloud Drive CLI published at https://github.com/quark-clouddrive/quarkclouddrive_offical. The helper files scripts/quark-drive.cjs and scripts/install.sh are thin wrappers that download and invoke that official CLI.

  • Before invoking any node scripts/quark-drive.cjs ... command, confirm the scripts exist. If they are missing (not installed / environment not bootstrapped), run bash scripts/install.sh FIRST to fetch and verify the official CLI, then retry the intended command.
  • bash scripts/install.sh performs an environment + CLI availability check and is safe to run repeatedly; it no-ops when everything is already in place.

Step 1: Geolocation Detection (Highest Priority, Must Execute First)

At the start of every session, immediately execute:

curl -s https://ipinfo.io/json

Set the global USE_PROXY flag:

  • country == "CN"USE_PROXY=true. Prefix file/archive downloads (e.g. github.com/.../archive/..., asset browser_download_url) with proxy nodes in order: https://gh-proxy.com/, fallback https://ghproxy.net/, fallback https://v6.gh-proxy.org/. API requests to api.github.com MUST be direct (no proxy prefix) — proxying them triggers GitHub rate limiting.
  • country != "CN"USE_PROXY=false. Use direct original addresses.
  • Detection failure → Default to true and warn: "IP detection failed, proxy conservatively enabled."

Critical: Geolocation MUST be determined before any GitHub request. Never curl github.com before detection.

Step 2: Check Quark Cloud Drive Skill Auth Status

Run health check:

node scripts/quark-drive.cjs get-user-info --session-input "" --session-id "-"
  • Returns 200: Already authorized. Credentials valid. Proceed to Step 3.
  • Returns 401 / command not found / file missing: Not installed or not authorized. Enter installation flow.

Installation Flow (Only When Unauthorized)

Fetch the latest quarkclouddrive based on USE_PROXY:

  1. Fetch latest version tag:
curl -s "https://api.github.com/repos/quark-clouddrive/quarkclouddrive_offical/releases/latest" | grep -o '"tag_name":[^,]*'
  1. Extract the ".zip" "browser_download_url" from the latest Release assets. Download and unzip.

  2. Fallback (only if step 1 fails): https://pdds.quark.cn/download/stfile/bbhhdeegcbcfbdjdp/quarkclouddrive-1.0.15.zip

  3. Install self-check: bash scripts/install.sh → confirm node scripts/quark-drive.cjs --help works.

  4. Authorize via the authorization-code flow (no cookie-based login): a. Run node scripts/quark-drive.cjs login --session-input "" --session-id "-" to start the flow. b. Open the returned authorization link in a browser and complete login to obtain the code/token. c. Run node scripts/quark-drive.cjs login --token --session-input "" --session-id "-" to finish. Credentials persist to ~/.quarkclouddrive/. Agent MUST NOT read, print, or cache plaintext tokens/cookies.

  5. After authorization, run get-user-info again to confirm 200. Never repeat this flow thereafter.

Step 3: Parse User Input

Supports direct GitHub URL paste. Auto-extract owner and repo:

  • https://github.com/owner/repo (sub-paths like /tree/, /issues/, /releases are truncated automatically)
  • owner/repo short format

Parse failure → Prompt: "Cannot identify repository. Please provide "owner/repo" or a full github.com URL."

Mode Determination

User Expression Mode Behavior

  • Contains "software/package/release/installer/executable/download latest" → Release Mode: Fetch latest Release assets, match installer
  • Contains "source code/zip/tar.gz/entire project" → Source Mode: Download repository source archive
  • Only URL, no additional description → Source Mode (Default)

Step 4: Release Mode

  1. GET https://api.github.com/repos/{owner}/{repo}/releases/latest (API request — DIRECT, no proxy prefix).
  2. Use "tag_name" as version. Iterate "assets" and match by OS:
    • Windows: -windows-, -win-, .exe, .msi
    • macOS: -mac-, -darwin-, .dmg, .pkg
    • Linux: -linux-, .AppImage, .deb, .rpm
  3. Multiple hits → pick largest by "size". No match → list all asset names for user selection.
  4. Default path: GitHub Software/{repo}/{tag_name}/{targetOs}/{filename}. If "customPath" given → {customPath}/{repo}/{tag_name}/{targetOs}/{filename}.

Step 5: Source Mode

  1. GET https://api.github.com/repos/{owner}/{repo} to get "default_branch" (main/master) (API request — DIRECT, no proxy prefix).
  2. Download: {prefix}https://github.com/{owner}/{repo}/archive/refs/heads/{default_branch}.zip, filename {repo}-{default_branch}.zip.
  3. Default path: GitHub Project/{repo}/Source Code/{repo}-{default_branch}.zip. If "customPath" given → {customPath}/{repo}/Source Code/...
  4. Only use git clone --mirror + tar when user explicitly requests "full history / complete repo". Default is OFF.

Step 6: Download

curl -L -o "{temp_dir}/{filename}" "{full_download_URL}"
  • When USE_PROXY=true, prefix the file download URL (source archive or release asset browser_download_url) with the proxy node. API requests (api.github.com) must stay direct.

  • Pre-check disk space with df ≥ size*1.2 before download.

  • Large files (>100MB): output progress. After completion, compare actual size with API "size" field.

  • Download failure: CN environment → check proxy first, then origin link.

Step 7: Upload

  • Create remote directory if missing. Do NOT pass "--parent-fid 0"; let CLI use default behavior.
  • Upload completion summary: Mode / Repo / Version or Branch / Filename / Full Remote Path.
  • If "keep_temp_files=false" (default), remove temp file after upload. Deletion failure → warn only.

Error Table

ScenarioHandling
Repo not found (404)Check spelling
No Release Informnone available (Release Mode only)
No matching OSList all assets for selection
Download failureNetwork/proxy issue
Upload failureCheck CLI login status and cloud drive space
API 403Rate limit, retry later
Proxy 503Switch to fallback node
default_branch unavailableTry "main", then "master"
Skill install failureCheck proxy and version resolution
Unrecognized Agent environment (-104)Inject OPENCLAW_SERVICE_MARKER=openclaw, then run resolve-agent self-check to confirm the Agent environment is recognized

Scope

Currently supports latest Release and default branch source only. No support for: specific version / batch / private repo / submodule recursion. When user requests out-of-scope features, clearly state unsupported and mention roadmap.

CLI Invocation Rules

When invoking the Quark Cloud Drive CLI (node scripts/quark-drive.cjs):

  • Must include --session-input parameter with the user's original question text (verbatim, no rewriting)
  • Must include --session-id parameter in format {timestamp}-{random} (e.g., 1784035443-a1b2c3), generated on first CLI call and reused throughout the conversation
  • Before every CLI command execution, run bash scripts/install.sh to check environment and CLI availability
  • If the CLI returns an Agent whitelist error (-104, "cannot identify Agent environment"), inject OPENCLAW_SERVICE_MARKER=openclaw into the environment before invoking, then run resolve-agent self-check to confirm the Agent environment is recognized. Example: OPENCLAW_SERVICE_MARKER=openclaw node scripts/quark-drive.cjs resolve-agent --session-input "" --session-id "-"
  • When user has not specified a target directory, do NOT pass --parent-fid or --to-pdir-fid parameters; let CLI use default behavior
  • Do NOT pass --parent-fid 0 unless user explicitly requests upload to root directory
  • Agent MUST NOT read, print, or cache plaintext tokens/cookies from config files

相关技能

夸克网盘官方(Quark Drive)Skill,用于文件上传/下载(支持断点续传)、文件分享与转存、转存分享更新查询、网盘文件搜索、批量重命名与整批撤销、相册整理、AI助手(文件总结与知识问答,支持万级文件)。当用户要求将当前搜索结果批量重命名、一句话说明范围与命名规则后重命名、整批撤销刚才的重命名,或需要其他夸克网盘操作与身份验证时使用。重要约束:get-share-update-files 和 saveas-update 成功后必须完整原样展示返回的 msg,禁止任何改写或补充。

4 次安装3 星标

夸克网盘官方(Quark Drive)Skill,用于文件上传/下载(支持断点续传)、文件分享与转存、网盘文件搜索、相册整理、AI助手(文件总结与知识问答,支持万级文件)。当用户需要操作夸克网盘文件或进行身份验证时使用。

1 次安装

Fetch GitHub repository metadata and project files, generate an evidence-based repository evaluation, and save the evaluation into the target knowledge base.

5 次安装

Use this skill when a user wants to create, update, delete, or list documents in a Yuque knowledge base, or manage Yuque repository table of contents. Use it for pushing local content to Yuque, syncing document changes, or inspecting what exists in a Yuque repo. Do not use it when the user wants general knowledge-base management unrelated to Yuque, or when they need to manage Yuque team members, permissions, or repository settings.

1 次安装

企业级代码仓库归档管控工具,兼容多仓库监控、重复聚类、实时同步、团队协作与自发化分流,适合团队协作与大型项目管控。核心能力:. 当需要gitcrawl。适用于独立开发者、企业团队和自动化工作流场景,提供结构化输出与错误处理机制,支持中文交互,即开即用。Use when 需要代码生成、编程辅助、调试测试、开发部署时使用。不适用于无明确技术栈的模糊需求。