Skip to main content
ClaudeWave
Skill27.6k repo starsupdated 2d ago

desktop-brand-builder

Generate a branded Qwen Code desktop package from the Tauri desktop shell using a minimal brandId and logo. Use when the user wants a custom, white-label, or rebranded desktop client, installer, DMG/EXE/AppImage/deb, or one-click brand build on top of packages/desktop-shell.

Install in Claude Code
Copy
git clone --depth 1 https://github.com/QwenLM/qwen-code /tmp/desktop-brand-builder && cp -r /tmp/desktop-brand-builder/packages/desktop-shell/.agents/skills/desktop-brand-builder ~/.claude/skills/desktop-brand-builder
Then start a new Claude Code session; the skill loads automatically.

SKILL.md

# Desktop Brand Builder (Tauri shell)

## Goal

Create a branded desktop package from `packages/desktop-shell` with the least
user input possible. The user should usually provide only:

```text
brandId: acme-ai
logo: /absolute/path/to/logo.png
website: https://acme.ai
```

`website` is optional. Do not ask for app name, app id, artifact name,
copyright, or updater endpoints unless the user explicitly asks to override
them.

This skill replaces the Electron-era brand builder that lived in the removed
`packages/desktop`. The Tauri shell is the only desktop implementation now;
branding hooks are `src-tauri/tauri.conf.json`, `src-tauri/icons/`, and the
`bootstrap/` startup UI.

## Input Rules

Required fields:

- `brandId`: must match `^[a-z][a-z0-9-]*$`
- `logo`: local file path; must exist; `.png` recommended (square, >= 1024px)

Optional overrides:

- `website`
- `appName`
- `appId` (Tauri bundle identifier)
- `artifactPrefix`
- `updaterEndpoints` (JSON array; empty array disables in-app updates)
- `updaterPubkey` (base64 public key; **required** when `updaterEndpoints`
  is non-empty — must match the `TAURI_SIGNING_PRIVATE_KEY` used to sign
  your updater artifacts)
- `target`: `mac`, `win`, `linux`, or `all`

If required input is missing, ask once:

```text
请提供:
brandId: 例如 acme-ai,只能小写字母、数字、短横线
logo: 本地 logo 文件路径(建议 1024x1024 PNG)
website: 可选
```

Once the required fields are present, proceed without a confirmation step.

## Derived Defaults

Infer missing values deterministically:

- `appName`: title-case the hyphen-separated `brandId`; `acme-ai` becomes
  `Acme AI`
- `artifactPrefix`: title-case the hyphen-separated `brandId` and join with
  hyphens; `acme-ai` becomes `Acme-AI`
- `appId`: if `website` has a valid host, reverse the host labels and append
  `.desktop`; `https://acme.ai` becomes `ai.acme.desktop`
- fallback `appId`: `app.<brandId>.desktop`
- `updaterEndpoints`: empty by default. A branded build must never poll the
  official Qwen Code updater feed, and the official feed must never update a
  branded build. Only set endpoints when the user supplies their own feed.

## Workflow

Work in an isolated build clone so the working repository stays clean:

```bash
BUILD_ROOT="$PWD/brand-builds/<brandId>-<timestamp>"
mkdir -p "$BUILD_ROOT"
git clone --branch main --single-branch \
  https://github.com/QwenLM/qwen-code.git \
  "$BUILD_ROOT/qwen-code"
cd "$BUILD_ROOT/qwen-code"
git checkout -B brand-<brandId> origin/main
```

If the clone or checkout fails, stop and report the failure. Do not continue
as if `brand-<brandId>` was created.

Create a temporary `brand.json` in the build directory:

```json
{
  "brandId": "acme-ai",
  "logo": "/absolute/path/to/logo.png",
  "website": "https://acme.ai",
  "appName": "Acme AI",
  "appId": "ai.acme.desktop",
  "artifactPrefix": "Acme-AI",
  "updaterEndpoints": [],
  "updaterPubkey": ""
}
```

Install dependencies. The brand script itself only needs desktop-shell's
own `node_modules`, but `npm run build:runtime` shells out to the repo
root (which uses `cross-env` and other root devDependencies), so the
root install is also required before packaging:

```bash
# Root dependencies (needed by build:runtime → cross-env, esbuild, etc.)
npm install

# Desktop-shell dependencies
cd packages/desktop-shell
npm install --workspaces=false
cd ../..
```

Then run this skill's bundled brand creation script with plain Node (the
script has no dependencies beyond Node >= 18):

```bash
node packages/desktop-shell/.agents/skills/desktop-brand-builder/scripts/brand-create.mjs \
  --shell-root /absolute/path/to/qwen-code/packages/desktop-shell \
  --config /absolute/path/to/brand.json
```

The agent should not hand-edit `tauri.conf.json`, icon files, or bootstrap
brand strings when this bundled script is available. The bundled script is the
source of truth for patching config and generating resources.

What the script does:

1. Patches `src-tauri/tauri.conf.json`: `productName`, `identifier`,
   `bundle.shortDescription`, and `plugins.updater.endpoints`. When
   `updaterEndpoints` is empty it also clears `bundle.createUpdaterArtifacts`
   and blanks the official `plugins.updater.pubkey` (set to empty string
   rather than deleted, because the updater plugin requires the field);
   a brand supplying its own feed must supply its own pubkey.
2. Regenerates the full icon set from the logo via
   `npx --yes @tauri-apps/cli icon <logo>` (falls back to a warning if the
   CLI cannot run; in that case copy the logo over `src-tauri/icons/icon.png`
   manually and tell the user the remaining sizes are stale).
3. Patches the bootstrap UI: page title, brand heading, startup strings in
   `bootstrap/index.html` and `bootstrap/bootstrap.js`, and replaces
   `bootstrap/qwen-code-logo.svg` usage with the brand logo.

Package with the current host target unless the user requested a target:

```bash
cd packages/desktop-shell
npm run build:runtime --workspaces=false
npx tauri build            # current platform
```

**Cross-compile:** `build:runtime` bundles the Node runtime for the platform
indicated by `QWEN_DESKTOP_TARGET` (defaults to the host). When targeting a
different platform you **must** re-run `build:runtime` with the env var set
before each `tauri build --target`, otherwise the packaged artifact contains
a wrong-arch Node binary and fails at launch with an exec format error:

```bash
# Cross-compile: set QWEN_DESKTOP_TARGET and re-run build:runtime per target
QWEN_DESKTOP_TARGET=aarch64-apple-darwin npm run build:runtime --workspaces=false
npx tauri build --target aarch64-apple-darwin   # explicit macOS arm64
```

For `target: all`, iterate `build:runtime` → `tauri build` per target; run
only targets supported by the current machine or CI environment. Do not
claim cross-platform artifacts were produced unless the files exist.
Artifacts land under `packages/desktop-shell/src-tauri/target/release/bundle/`
for the host target, or `src-tauri/target/<triple>/release/bundl
agent-reproduce-alignSkill

Use after a Codex or Claude Code feature has been implemented in Qwen Code to run the selected reference agent and Qwen Code under the same scenario, capture HTTP and terminal traces, compare request bodies, tool/function schemas, outputs, and iterate until the reproduced behavior is close enough.

agent-reproduce-featureSkill

Use when reproducing an existing Codex or Claude Code feature in Qwen Code or another agent CLI by choosing a reference agent, capturing HTTP request bodies, prompts, tool/function schemas, terminal output, and then implementing the matching behavior in the target repo.

autofixSkill

Review and repair current local changes until they converge, or run Qwen Code Autofix issue and review workflows from GitHub Actions.

bugfixSkill

Fix a bug from a GitHub issue, following the reproduce-first

ci-flaky-patrolSkill

Classify a bounded batch of stale PR CI failures and choose the safest response.

codegraphSkill

Analyze indexed codebases via graph database (neug) and vector index (zvec). Covers call graphs, dependencies, dead code, hotspots, module coupling, architecture reports, semantic search, impact analysis, bug root cause from GitHub issues, class diagrams (UML), and PR review (risk scoring, conflict detection, auto-merge candidates, labeling). Also covers creating, inspecting, and repairing a CodeScope index. Use for: code structure, who calls what, why something changed, similar functions, module boundaries, bug tracing, class relationships, PR risk/conflicts, or any question benefiting from a code knowledge graph. Applies when a `.codegraph` index exists in the workspace, or when the user wants to create one.

create-issueSkill

Draft and submit a GitHub issue from a user idea or bug description, with bilingual body and correct labels.

deflakeSkill

Stabilize a flaky test with a minimal, assertion-preserving fix — never by weakening or deleting the check.