Skip to content

feat(skills): support extends: bundled in SKILL.md#2502

Open
Br1an67 wants to merge 1 commit intoQwenLM:mainfrom
Br1an67:feat/skill-extends-bundled
Open

feat(skills): support extends: bundled in SKILL.md#2502
Br1an67 wants to merge 1 commit intoQwenLM:mainfrom
Br1an67:feat/skill-extends-bundled

Conversation

@Br1an67
Copy link
Contributor

@Br1an67 Br1an67 commented Mar 19, 2026

TLDR

Closes #2379.

Adds an extends: bundled mechanism to the skill system, allowing users to append content to a bundled skill without replacing it entirely.

Dive Deeper

Problem

Users who want to add custom review dimensions (e.g., Accessibility, API Compatibility) currently have to copy the entire bundled SKILL.md into .qwen/skills/review/SKILL.md and maintain it — a full override with no composition. Future updates to the bundled skill are lost.

Solution

A new optional extends: bundled field in SKILL.md frontmatter. When set, the extending skill's body is appended to the bundled skill's body during loading.

Example (.qwen/skills/review/SKILL.md):

---
name: review
description: Extended code review
extends: bundled
---

### Agent 5: Accessibility
Focus areas: ARIA attributes, keyboard navigation, screen reader compatibility

When /review is invoked, the user sees the bundled content plus the custom dimensions.

Changes

  • types.ts: Added optional extends?: 'bundled' field to SkillConfig
  • skill-manager.ts:
    • Parse extends from YAML frontmatter (with validation — only 'bundled' is accepted)
    • Added resolveExtends() that loads the bundled base skill and concatenates bodies
    • All loadSkill paths call resolveExtends() before returning
  • skill-manager.test.ts: 4 new tests covering parsing, merging, error handling

What this does NOT change

  • Directory conventions
  • settings.json schema
  • Bundled skill loading logic
  • Existing skill precedence (project > user > extension > bundled)

Testing Matrix

Scenario Expected Status
Parse extends: bundled from frontmatter config.extends === 'bundled'
Reject extends: user (invalid value) Throws descriptive error
Project skill with extends: bundled Bodies merged, extends cleared
extends: bundled referencing non-existent bundled skill Throws SkillError NOT_FOUND
Existing tests (40) All pass unchanged

Closes QwenLM#2379

Add an 'extends: bundled' mechanism to the skill system, allowing users to
append content to a bundled skill without replacing it entirely. This enables
teams to add custom review dimensions (e.g., Accessibility, API Compatibility)
while automatically inheriting future updates to the bundled skill.

Usage in .qwen/skills/review/SKILL.md:

  ---
  name: review
  description: Extended code review
  extends: bundled
  ---

  ### Agent 5: Accessibility
  Focus areas: ARIA attributes, keyboard navigation, screen reader compat

Changes:
- types.ts: Add optional 'extends' field to SkillConfig
- skill-manager.ts: Parse 'extends' from frontmatter, add resolveExtends()
  that merges extending skill body with bundled base
- skill-manager.test.ts: Add 4 new tests for extends parsing, merging,
  invalid value rejection, and missing bundled skill error
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.

feat(skills): support extends: bundled in SKILL.md to allow extending bundled skills

1 participant