Skip to content

feat: add migrate-to-qwen skill for AI tool config migration#2288

Open
xuewenjie123 wants to merge 1 commit intoQwenLM:mainfrom
xuewenjie123:feat/migrate-to-qwen-skill
Open

feat: add migrate-to-qwen skill for AI tool config migration#2288
xuewenjie123 wants to merge 1 commit intoQwenLM:mainfrom
xuewenjie123:feat/migrate-to-qwen-skill

Conversation

@xuewenjie123
Copy link
Copy Markdown
Collaborator

feat: Add migrate-to-qwen skill for AI tool config migration

Summary

This PR adds a new skill migrate-to-qwen that helps users migrate their AI coding assistant configurations from other tools to Qwen-Code. The skill provides an automated, safe, and incremental migration workflow with comprehensive conflict resolution.

Motivation

Users switching to Qwen-Code from other AI coding assistants (Claude Code, Cursor, Gemini CLI, GitHub Copilot, Continue) often have existing configurations they want to preserve:

  • MCP server configurations
  • Custom skills and agents
  • Project-specific rules and instructions
  • Model provider settings

Manually migrating these configurations is tedious and error-prone. This skill automates the process while preserving existing Qwen-Code configurations.

Supported Migration Sources

Source Config Location What Gets Migrated
Claude Code ~/.claude/ Skills, MCP servers, custom rules
Cursor ~/.cursor/ Skills, rules, .cursorrules
Gemini CLI ~/.gemini/ Settings, MCP servers, GEMINI.md
GitHub Copilot ~/.config/github-copilot/ Settings
Continue ~/.continue/ Config, MCP servers, rules
Shared Agents ~/.agents/ Skills (via symlink)

Features

  • 🔍 Scan — Detect all AI tool configurations on the system without making changes
  • 📦 Migrate — Transfer MCP servers, skills, agents, and custom rules
  • ⚡ Conflict Resolution — Smart merging that preserves existing Qwen-Code configs
  • 🔄 Incremental — Safe to run multiple times; existing configs won't be overwritten
  • 🔗 Symlink Support — Shared skills from ~/.agents/ are symlinked to preserve cross-tool sharing
  • 💾 Backups — Automatic backup of settings.json before any merge operation

Usage

Trigger the Skill

The skill activates automatically when you ask:

  • "Migrate my Cursor settings to Qwen-Code"
  • "Import my Claude Code configuration"
  • "Transfer my AI tool configs"
  • "Move my skills from other tools to Qwen"

Or invoke explicitly with slash command:

/skills migrate-to-qwen

Migration Workflow

1. Scan Existing Configurations

Scan my system for AI tool configurations that can be migrated to Qwen-Code

The skill will report what it finds from each supported source.

2. Review Detected Configurations

The skill presents a summary of detected configurations:

  • Which tools have available configs
  • Counts of skills, rules, and servers found
  • Any special considerations (e.g., hooks that cannot be auto-migrated)

3. Execute Migration

Migrate all my AI configurations to Qwen-Code

Or specify a particular tool:

Migrate only my Cursor skills to Qwen-Code

4. Post-Migration Verification

Check if my configurations were migrated successfully

The skill will display:

  • Updated skill counts in Qwen-Code
  • MCP server configurations
  • Imported custom rules
  • Backup locations

Migration Behavior

Resource Conflict Handling
MCP Servers Merged — existing entries preserved, new ones added
Skills Skipped — if skill with same name exists
Agents Skipped — if agent with same name exists
Custom Rules (QWEN.md) Appended — with section header indicating source

Changes

  • Add .qwen/skills/migrate-to-qwen/SKILL.md — Skill definition and documentation
  • Add .qwen/skills/migrate-to-qwen/scripts/migrate.sh — Migration script (executable)
  • Update .gitignore — Allow tracking .qwen/commands/ and .qwen/skills/ directories

Requirements

  • Bash 4.0+
  • Python 3.x (for JSON merging operations)

Testing

Tested migration flows from:

  • Claude Code → Qwen-Code
  • Cursor → Qwen-Code
  • Gemini CLI → Qwen-Code
  • Continue → Qwen-Code

Add a new skill that helps users migrate their AI coding assistant
configurations (Claude Code, Cursor, Gemini CLI, GitHub Copilot, Continue)
to Qwen-Code. The skill provides:

- Detection of existing AI tool configurations
- Migration of MCP servers, skills, agents, and custom rules
- Conflict resolution with existing Qwen-Code configs
- Support for both user-level and project-level migrations

Also update .gitignore to allow tracking .qwen/commands/ and .qwen/skills/.

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
@github-actions
Copy link
Copy Markdown
Contributor

📋 Review Summary

This PR introduces a well-documented migrate-to-qwen skill that automates migration of AI coding assistant configurations (Claude Code, Cursor, Gemini CLI, GitHub Copilot, Continue) to Qwen-Code. The implementation is comprehensive with good conflict resolution strategies and backup mechanisms. Overall, the code is well-structured with clear documentation, though there are several areas that could benefit from improvement in security, error handling, and robustness.

🔍 General Feedback

  • Excellent documentation: The SKILL.md provides comprehensive usage examples, migration workflows, and clear explanations of conflict resolution strategies
  • Good modular design: The script is well-organized with clear separation of concerns (utility functions, scan, migrate, verify commands)
  • Thoughtful conflict resolution: The approach of merging MCP servers, skipping existing skills/agents, and appending rules is sensible
  • Backup mechanism: Creating backups before modifications is a good safety practice
  • Color-coded output: The logging system provides clear visual feedback
  • Symlink support: Preserving cross-tool sharing via symlinks is a nice touch

🎯 Specific Feedback

🔴 Critical

  • File: .qwen/skills/migrate-to-qwen/scripts/migrate.sh:108-155 - Security vulnerability in Python code injection: The merge_mcp_servers function passes user-controlled file paths directly to Python via command-line arguments without sanitization. A malicious source file with a crafted path could execute arbitrary Python code. The heredoc approach with python3 - is safer, but the file paths should be validated before use.

  • File: .qwen/skills/migrate-to-qwen/scripts/migrate.sh:226-230 - Symlink vulnerability: When creating symlinks, the script doesn't validate that the target is within expected directories. This could potentially create symlinks to sensitive system files. Add validation to ensure source paths are within the expected AI tool directories.

  • File: .qwen/skills/migrate-to-qwen/scripts/migrate.sh:267-277 - Unvalidated file append: The append_rules function appends arbitrary file content to QWEN.md without any validation. A malicious source file could inject harmful instructions. Consider adding file size limits and content validation.

🟡 High

  • File: .qwen/skills/migrate-to-qwen/scripts/migrate.sh:1 - Missing shellcheck directives: The script uses bash-specific features but lacks shellcheck validation. Add # shellcheck disable= directives where needed and ensure the script passes shellcheck validation for security and correctness.

  • File: .qwen/skills/migrate-to-qwen/scripts/migrate.sh:43-52 - Backup directory race condition: The backup directory uses $(date +%Y%m%d-%H%M%S) which could collide if migrations run within the same second. Add a random suffix or use mktemp -d for guaranteed uniqueness.

  • File: .qwen/skills/migrate-to-qwen/scripts/migrate.sh:108-155 - No JSON validation before merge: The Python code silently ignores JSON parsing errors. This could lead to silent failures. Add proper error reporting to the user when source files cannot be parsed.

  • File: .qwen/skills/migrate-to-qwen/scripts/migrate.sh:189-192 - Silent failure on missing directories: The copy_skills and copy_agents functions return silently if source directories don't exist. This is inconsistent with other functions that log warnings. Add warning messages for better user feedback.

  • File: .qwen/skills/migrate-to-qwen/scripts/migrate.sh:704-720 - Python dependency for verification: The cmd_verify function requires Python 3 for detailed verification but provides limited fallback. Consider implementing JSON parsing in pure bash or using jq as an alternative.

🟢 Medium

  • File: .qwen/skills/migrate-to-qwen/scripts/migrate.sh:26-31 - Hardcoded color codes: Consider using tput for better terminal compatibility and accessibility (respects NO_COLOR environment variable).

  • File: .qwen/skills/migrate-to-qwen/scripts/migrate.sh:267-277 - Content duplication check is fragile: Using grep -qF to check for existing sections could fail if section headers are slightly modified. Consider using a more robust tracking mechanism (e.g., migration metadata file).

  • File: .qwen/skills/migrate-to-qwen/scripts/migrate.sh:334-340 - Inconsistent skill counting: The skill count logic adds symlink and directory counts separately, which could double-count if symlinks point to directories. Simplify the counting logic.

  • File: .qwen/skills/migrate-to-qwen/scripts/migrate.sh:577-584 - MCP server path duplication: Continue MCP servers are checked in two different paths (.mcpServers and .experimental.modelContextProtocol.servers). This logic should be consolidated into a helper function to avoid duplication.

  • File: .qwen/skills/migrate-to-qwen/SKILL.md:179 - Missing test documentation: The skill documentation doesn't mention how to test the migration functionality. Add a testing section with example scenarios.

🔵 Low

  • File: .qwen/skills/migrate-to-qwen/scripts/migrate.sh:1 - Consider adding metadata: Add script metadata (version, author, license) at the top of the script for better maintainability.

  • File: .qwen/skills/migrate-to-qwen/SKILL.md - Add troubleshooting section: Include common issues and solutions (e.g., "What if migration fails?", "How to rollback?").

  • File: .qwen/skills/migrate-to-qwen/scripts/migrate.sh:68-73 - Backup notification could be clearer: The backup message says "Backup created at..." but doesn't explain when backups are cleaned up or how to restore from them.

  • File: .qwen/skills/migrate-to-qwen/scripts/migrate.sh:850-870 - Usage examples could include more scenarios: Add examples for common use cases like "migrate only MCP servers" or "migrate from multiple sources".

  • File: .gitignore - Consider more specific patterns: The change from .qwen/ to .qwen/* with exclusions is good, but consider being more explicit about what's tracked (e.g., !.qwen/skills/**/SKILL.md, !.qwen/commands/**/*.md).

✅ Highlights

  • Comprehensive migration support: Covers all major AI coding assistants (Claude Code, Cursor, Gemini CLI, GitHub Copilot, Continue) with appropriate handling for each tool's configuration format
  • Well-documented SKILL.md: The skill documentation is thorough with clear usage examples, migration workflows, and conflict resolution explanations
  • Smart conflict resolution: The strategy of merging MCP servers, skipping duplicates, and appending rules with section headers is well thought out
  • Incremental migration support: Users can safely run migration multiple times without overwriting existing configurations
  • Good user feedback: Color-coded logging with clear success/warning/error messages throughout the migration process
  • Verification command: The verify command provides useful post-migration validation
  • Symlink preservation: Using symlinks for shared agents maintains cross-tool compatibility

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant