Skip to content

Conversation

@kfxmvp
Copy link

@kfxmvp kfxmvp commented Dec 23, 2025

TLDR

This PR introduces the Skills system to Qwen Code, enabling users to create, manage, and utilize reusable expert instructions (skills). Skills empower the agent to reliably execute specific tasks by following structured workflows defined in SKILL.md files.

Note: This feature is disabled by default. You must explicitly enable skills.enabled in your configuration to access the /skill command and functionality.

Key changes:

  • Core Logic: Added SkillManager in packages/core to handle skill discovery, validation, loading, creation, updating, and deletion.
  • CLI Commands: Introduced /skill create and /skill manage commands for interactive skill management via a new UI wizard.
  • Configuration: Added skills.enabled setting (default: false).
  • Documentation: Added comprehensive user documentation for Skills (docs/users/features/skills.md) and updated related docs.
  • UI Components: Implemented React components for the skill creation wizard and management dialog in packages/cli.

Dive Deeper

The Skills system is designed to transform the agent from a general-purpose assistant into a specialized partner.

  • Architecture: A skill is a directory containing a SKILL.md (metadata + instructions) and supporting files. To conserve context window usage, a lazy-loading mechanism is used—metadata is scanned first, and full content is loaded only upon activation.
  • Storage: Skills can be stored at the Project level (.qwen/skills/ for team sharing) or User level (~/.qwen/skills/ for personal use), with project skills overriding global ones.
  • Management: The SkillManager class acts as the Single Source of Truth for skill data, centralizing lifecycle management and persistence. It abstracts away filesystem complexities (directory scanning, Frontmatter parsing, Schema validation) and ensures consistency between disk state and memory, providing a unified data service for UI interactions and runtime agent calls.
  • UI Flow:
    • The /skill create command launches a step-by-step wizard supporting two modes:
      • Generate with Qwen Code: Uses the LLM to automatically generate the skill's name, description, and instructions based on a natural language description (implemented via skillGenerator).
      • Manual Creation: Allows users to manually input skill metadata and instructions.
    • The /skill manage command provides a dashboard to view and maintain existing skills.

Reviewer Test Plan

Steps to validate this PR:

  1. Checkout branch: git checkout feat/skill
  2. Install dependencies: npm install
  3. Build: npm run build
  4. Run CLI: Start the CLI with npm run start (or equivalent for your setup).
  5. Enable Feature: Since skills are disabled by default, you must set "skills": { "enabled": true } in your settings.json or pass the configuration to enable the feature.
  6. Test Creation:
    • Run /skill create.
    • Test Automatic Generation:
      • Select "Generate with Qwen Code".
      • Enter description: "Create a skill to help me write git commit messages following the angular convention".
      • Verify the wizard generates a reasonable Name (e.g., git-commit-msg-generator), Description, and Instructions.
      • Confirm the file is created under .qwen/skills/ after saving.
    • Test Manual Creation:
      • Select "Manual Creation".
      • Manually enter Name (manual-test-skill), Description, and Instructions.
      • Verify successful creation.
  7. Test Listing/Management:
    • Run /skill manage.
    • Verify new skills appear in the list and attempt edit or delete operations.
  8. Test Skill Usage (End-to-End Interaction):
    • Scenario A: Explicit Trigger
      • Prompt: "Please use the manual-test-skill skill..."
      • Verify: Confirm the LLM recognizes the instruction, loads the skill content, and executes steps as defined.
    • Scenario B: Implicit Trigger (Semantic Matching)
      • Prompt: "Help me generate a commit message..."
      • Verify:
        • Skill Selection: Observe if the LLM correctly evaluates and automatically selects the skill based on its auto-generated description (e.g., "Use this skill when...").
        • On-Demand Loading: Confirm that the detailed skill content (SKILL.md body) is loaded only after the LLM decides to use it.
        • Execution Consistency: Check if the generated commit message strictly follows the angular convention defined in the skill.

Testing Matrix

🍏 🪟 🐧
npm run
npx
Docker
Podman - -
Seatbelt - -

Linked issues / bugs

Resolves #965

Introduces the **Skills** system to Qwen Code, enabling users to create, manage, and utilize reusable expert instructions. Skills empower the agent to reliably execute specific tasks by following structured workflows defined in `SKILL.md` files.

Key changes:
- **Core Logic**: Added `SkillManager` in `packages/core` to handle skill discovery, validation, loading, creation, updating, and deletion.
- **CLI Commands**: Introduced `/skill create` and `/skill manage` commands for interactive skill management via a new UI wizard.
- **Documentation**: Added comprehensive user documentation for Skills (`docs/users/features/skills.md`) and updated related docs.
- **UI Components**: Implemented React components for the skill creation wizard and management dialog in `packages/cli`.
@tanzhenxin
Copy link
Collaborator

@kfxmvp Thank you very much for your excellent work on this PR — we really appreciate the time and effort you put into it. Overall, the implementation looks solid and well thought out.

After reviewing it in detail, we found that the core design and implementation are largely aligned with an approach we have already implemented internally in this PR:
#1314

Because of this overlap, and in order to avoid maintaining multiple parallel implementations of essentially the same solution, we’ve decided not to merge this PR at the moment.

That said, this is genuinely good work, and your contribution is highly appreciated. Your implementation helped validate the design direction we chose, and we’re very grateful for your support and engagement with the project. We definitely hope to collaborate more with you in the future — please keep the contributions coming!

🙏

@kfxmvp
Copy link
Author

kfxmvp commented Dec 25, 2025

@kfxmvp Thank you very much for your excellent work on this PR — we really appreciate the time and effort you put into it. Overall, the implementation looks solid and well thought out.

After reviewing it in detail, we found that the core design and implementation are largely aligned with an approach we have already implemented internally in this PR: #1314

Because of this overlap, and in order to avoid maintaining multiple parallel implementations of essentially the same solution, we’ve decided not to merge this PR at the moment.

That said, this is genuinely good work, and your contribution is highly appreciated. Your implementation helped validate the design direction we chose, and we’re very grateful for your support and engagement with the project. We definitely hope to collaborate more with you in the future — please keep the contributions coming!

🙏

@tanzhenxin Thanks so much for your thorough review and valuable feedback! Just to clarify: this PR is primarily intended to share my concept for the Skills system and open it up for a collaborative discussion with the team—it’s not being submitted for a merge to the main branch at this stage.

@tanzhenxin tanzhenxin self-assigned this Dec 26, 2025
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.

claude agent skills

2 participants