Add Qwen Code support to convert.sh and install.sh

- Add convert_qwen() to scripts/convert.sh for generating Qwen SubAgent .md files
- Add install_qwen() to scripts/install.sh for installing to .qwen/agents/ (project-scoped)
- Add qwen detection, tool label, and install cases
- Update README.md with Qwen in supported tools table + usage section
- Add integrations/qwen/agents/ to .gitignore + create .gitkeep
- Add Qwen Code compatibility note to CONTRIBUTING.md
- Preserve tools: field in Qwen output when present in source agents
- Fix interactive installer to show dynamic [1-N] toggle range
- Update README roadmap checklist to include Qwen Code

Qwen SubAgents use minimal YAML frontmatter (name, description) with optional tools: field preserved from source. Body content passes through unchanged.
Tested with 120 agents — all convert and install successfully.
This commit is contained in:
Prasad Muley
2026-03-11 23:02:10 -04:00
parent 5e59a20bbf
commit 1a0d029e1b
5 changed files with 94 additions and 5 deletions

View File

@@ -19,6 +19,7 @@
# aider -- Copy CONVENTIONS.md to current directory
# windsurf -- Copy .windsurfrules to current directory
# openclaw -- Copy workspaces to ~/.openclaw/agency-agents/
# qwen -- Copy SubAgents to ~/.qwen/agents/ (user-wide) or .qwen/agents/ (project)
# all -- Install for all detected tools (default)
#
# Flags:
@@ -81,7 +82,7 @@ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
REPO_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
INTEGRATIONS="$REPO_ROOT/integrations"
ALL_TOOLS=(claude-code copilot antigravity gemini-cli opencode openclaw cursor aider windsurf)
ALL_TOOLS=(claude-code copilot antigravity gemini-cli opencode openclaw cursor aider windsurf qwen)
# ---------------------------------------------------------------------------
# Usage
@@ -113,6 +114,7 @@ detect_opencode() { command -v opencode >/dev/null 2>&1 || [[ -d "${HOME}/.c
detect_aider() { command -v aider >/dev/null 2>&1; }
detect_openclaw() { command -v openclaw >/dev/null 2>&1 || [[ -d "${HOME}/.openclaw" ]]; }
detect_windsurf() { command -v windsurf >/dev/null 2>&1 || [[ -d "${HOME}/.codeium" ]]; }
detect_qwen() { command -v qwen >/dev/null 2>&1 || [[ -d "${HOME}/.qwen" ]]; }
is_detected() {
case "$1" in
@@ -125,6 +127,7 @@ is_detected() {
cursor) detect_cursor ;;
aider) detect_aider ;;
windsurf) detect_windsurf ;;
qwen) detect_qwen ;;
*) return 1 ;;
esac
}
@@ -141,6 +144,7 @@ tool_label() {
cursor) printf "%-14s %s" "Cursor" "(.cursor/rules)" ;;
aider) printf "%-14s %s" "Aider" "(CONVENTIONS.md)" ;;
windsurf) printf "%-14s %s" "Windsurf" "(.windsurfrules)" ;;
qwen) printf "%-14s %s" "Qwen Code" "(~/.qwen/agents)" ;;
esac
}
@@ -196,7 +200,7 @@ interactive_select() {
# --- controls ---
printf "\n"
printf " ------------------------------------------------\n"
printf " ${C_CYAN}[1-9]${C_RESET} toggle ${C_CYAN}[a]${C_RESET} all ${C_CYAN}[n]${C_RESET} none ${C_CYAN}[d]${C_RESET} detected\n"
printf " ${C_CYAN}[1-%s]${C_RESET} toggle ${C_CYAN}[a]${C_RESET} all ${C_CYAN}[n]${C_RESET} none ${C_CYAN}[d]${C_RESET} detected\n" "${#ALL_TOOLS[@]}"
printf " ${C_GREEN}[Enter]${C_RESET} install ${C_RED}[q]${C_RESET} quit\n"
printf "\n"
printf " >> "
@@ -410,6 +414,26 @@ install_windsurf() {
warn "Windsurf: project-scoped. Run from your project root to install there."
}
install_qwen() {
local src="$INTEGRATIONS/qwen/agents"
local dest="${PWD}/.qwen/agents"
local count=0
[[ -d "$src" ]] || { err "integrations/qwen missing. Run convert.sh first."; return 1; }
mkdir -p "$dest"
local f
while IFS= read -r -d '' f; do
cp "$f" "$dest/"
(( count++ )) || true
done < <(find "$src" -maxdepth 1 -name "*.md" -print0)
ok "Qwen Code: installed $count agents to $dest"
warn "Qwen Code: project-scoped. Run from your project root to install there."
warn "Tip: Run '/agents manage' in Qwen Code to refresh, or restart session"
}
install_tool() {
case "$1" in
claude-code) install_claude_code ;;
@@ -421,6 +445,7 @@ install_tool() {
cursor) install_cursor ;;
aider) install_aider ;;
windsurf) install_windsurf ;;
qwen) install_qwen ;;
esac
}