Skip to content

feat(skills): enforce 'auto-skill-' directory prefix for auto-generated skills + gitignore exclusion #4837

@pomelo-nwu

Description

@pomelo-nwu

What would you like to be added?

Auto-generated skills (created by the managed-skill-extractor forked agent) should use a mandatory auto-skill- directory prefix, and the project .gitignore should exclude .qwen/skills/auto-skill-*/ so these directories don't appear as untracked files.

Specifically:

  1. .gitignore: Add .qwen/skills/auto-skill-*/ after the existing !.qwen/skills/** unignore rule. Git's "last rule wins" semantics will re-ignore only auto-skill--prefixed directories while keeping hand-authored project skills tracked.

  2. skillReviewAgentPlanner.ts — prompt layer: Update SKILL_REVIEW_SYSTEM_PROMPT and buildTaskPrompt() to require the auto-skill- prefix on new skill directory names (e.g., .qwen/skills/auto-skill-<name>/SKILL.md).

  3. Tests: Add a test verifying buildTaskPrompt output includes the auto-skill- prefix instruction.

Why is this needed?

When auto-skill generation creates skills under .qwen/skills/, they show up as untracked files in git status because the current .gitignore explicitly unignores the entire .qwen/skills/ directory. This causes noise for developers and risks accidental commits of transient, session-specific skills.

The .qwen/skills/ directory contains two types of skills:

  • Project skills (hand-authored, should be version-controlled) — e.g., bugfix, triage, feat-dev
  • Auto-generated skills (extracted from conversations by the skill-review agent) — e.g., qwen-code-session-data-extraction, qwen-code-token-bridge-server

Currently there is no naming convention to distinguish them at the directory level. The source: auto-skill frontmatter marker exists but is only useful at file-read time — it doesn't help .gitignore or directory listing.

A directory prefix solves this cleanly: hand-authored skills keep their natural names (tracked by git), auto-generated skills get a predictable prefix (ignored by git).

Additional context

  • Existing auto-generated skills (qwen-code-session-data-extraction, qwen-code-token-bridge-server) will NOT be renamed — only new skills going forward.
  • The skill loading/discovery mechanism (SkillManager) does not care about directory prefixes, so no changes needed there.
  • The source: auto-skill frontmatter marker remains unchanged as the file-level signal for edit protection.

中文

希望添加什么功能?

自动生成 skill(由 managed-skill-extractor forked agent 创建)应使用强制的 auto-skill- 目录前缀,项目 .gitignore 中排除 .qwen/skills/auto-skill-*/,使这些目录不会出现在 untracked files 中。

具体改动:

  1. .gitignore:在现有的 !.qwen/skills/** unignore 规则后追加 .qwen/skills/auto-skill-*/。Git 的"后规则优先"语义会重新 ignore 仅 auto-skill- 前缀的目录,手写的项目 skill 保持 track。

  2. skillReviewAgentPlanner.ts — prompt 层:更新 SKILL_REVIEW_SYSTEM_PROMPTbuildTaskPrompt(),要求新 skill 目录名带 auto-skill- 前缀(如 .qwen/skills/auto-skill-<name>/SKILL.md)。

  3. 测试:添加测试验证 buildTaskPrompt 输出包含 auto-skill- 前缀指令。

为什么需要?

auto-skill 在 .qwen/skills/ 下创建后,由于 .gitignore 显式 unignore 了整个 .qwen/skills/ 目录,这些目录会出现在 git status 的 untracked files 中,造成噪音并有误提交风险。

.qwen/skills/ 下有两类 skill:

  • 项目 skill(手写,应版本控制)——如 bugfixtriagefeat-dev
  • 自动生成 skill(从会话中提取)——如 qwen-code-session-data-extractionqwen-code-token-bridge-server

目前目录层面没有区分命名规范。source: auto-skill frontmatter 标记存在但只在读文件时有效,对 .gitignore 和目录列表无帮助。

目录前缀可干净解决:手写 skill 保持自然名(git 跟踪),自动生成 skill 获得可预测前缀(git 忽略)。

补充信息

  • 已有的自动生成 skill 不重命名,仅对新创建的生效。
  • Skill 加载/发现机制(SkillManager)不关心目录前缀,无需改动。
  • source: auto-skill frontmatter 标记保持不变,继续作为文件级的编辑保护信号。

Metadata

Metadata

Assignees

Labels

priority/P3Low - Minor, cosmetic, nice-to-fix issuesscope/extensionsExtension configurationscope/gitGit integration featuresstatus/in-reviewThis issue is currently in review.type/feature-requestNew feature or enhancement request

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions