Skip to content

feat(skills): add repository knowledge lifecycle - #9999

Draft
HiWhaleW wants to merge 2 commits into
QwenLM:mainfrom
HiWhaleW:feat/knowledge-lifecycle-9781
Draft

feat(skills): add repository knowledge lifecycle#9999
HiWhaleW wants to merge 2 commits into
QwenLM:mainfrom
HiWhaleW:feat/knowledge-lifecycle-9781

Conversation

@HiWhaleW

@HiWhaleW HiWhaleW commented Aug 25, 2026

Copy link
Copy Markdown

What this PR does

This PR adds a project-level knowledge lifecycle skill that routes repository knowledge to the artifact matching its lifecycle, keeps one canonical source per fact, and distinguishes analyze-only behavior from authorized writes. It also adds a bounded knowledge-closeout step to the existing feature and bug-fix workflows, plus a short design record for the accepted v1 decisions and scope.

Why it's needed

Qwen Code already has instructions, current documentation, design records, GitHub state, executable constraints, and temporary work artifacts, but its development workflows do not share a decision process for choosing which source should own newly learned information. The new skill reduces duplicated facts, stale handoffs, and temporary status leaking into durable documentation without introducing a new store or index.

Reviewer Test Plan

How to verify

  1. Run npm run preflight in the full source tree.
  2. Start Qwen Code 0.22.0 with local Ollama qwen3:8b, then test both plan mode and explicit /knowledge-lifecycle invocation against the four-file fixture.
  3. Compare fixture hashes before and after each run.

Results

  • Preflight: not fully green. format, lint, build, and typecheck passed. CLI tests finished with 24 files passed and 1 failed: AuthDialog.test.tsx has a stable MiniMax navigation assertion failure unrelated to this documentation-only diff. Core tests initially had 10 failures because the source tree lacked .git; after restoring Git metadata, the targeted gitUtils.test.ts rerun passed 12/12.
  • Plan mode / read-only boundary: passed. skill and read_file were registered; write tools were not registered; fixture hashes did not change.
  • Automatic Skill routing: not passed. The model read 3/4 fixture files, did not invoke knowledge-lifecycle, and the session ended before the fourth file. This is not claimed as a successful end-to-end routing verification.
  • Explicit invocation / write boundary: passed. With /knowledge-lifecycle plus auto-edit, the first edit was rejected because the file had not yet been read. After reading, Qwen Code changed only current-behavior.md (--dry-run--preview), reread it successfully, and all other fixture hashes remained unchanged.
  • Fixture files were restored after the test; the local qwen3:8b model was removed.

Evidence (Before & After)

N/A — project workflow documentation only; no user-facing UI or runtime behavior changes.

Tested on

OS Status
🍏 macOS
🪟 Windows ⚠️
🐧 Linux ⚠️

Environment (optional)

macOS, Qwen Code 0.22.0, and a temporary local Ollama qwen3:8b model. The model was deleted after verification.

Risk & Scope

  • Main risk or tradeoff: Agents could over-persist task-specific information; the skill mitigates this with analyze-only default behavior, one canonical source per fact, explicit retirement rules, and an allowed no-persistence result.
  • Not fully validated / out of scope: Automatic Skill routing remains unverified in the tested local-model session; migration of existing design documents and plans, generated indexes, storage systems, automatic journaling, and automatic GitHub writes remain out of scope.
  • Breaking changes / migration notes: None. This changes project development guidance only.

Linked Issues

Fixes #9781

中文说明

本 PR 做了什么

本 PR 新增一个项目级知识生命周期 Skill,根据信息生命周期将仓库知识路由到正确工件,确保一条事实只有一个权威来源,并区分只读分析与已授权写入。同时,它在现有 Feature 与 Bug 修复流程中加入一个有边界的知识收尾步骤,并用一份简短设计记录保存第一版已接受的决策和范围。

为什么需要它

Qwen Code 已有工作指令、当前文档、设计记录、GitHub 状态、可执行约束和临时工作工件,但开发流程之间缺少一套共同的判断机制,用于决定新获得的信息应该由哪个来源负责。新 Skill 在不引入新存储或新索引的前提下,减少重复事实、过期交接以及临时状态进入长期文档的问题。

Reviewer Test Plan

如何验证

  1. 在完整源码树中运行 npm run preflight
  2. 使用 Qwen Code 0.22.0 与本地 Ollama qwen3:8b,针对四文件 fixture 分别测试 plan 模式和显式 /knowledge-lifecycle 调用。
  3. 对比每次运行前后的 fixture 哈希。

结果

  • Preflight:未全绿。 formatlintbuildtypecheck 通过。CLI 测试为 24 个文件通过、1 个失败:AuthDialog.test.tsx 存在稳定的 MiniMax 导航断言失败,与本次纯文档 diff 无关。Core 测试最初因源码树缺少 .git 出现 10 个失败;恢复 Git 元数据后,定向复跑 gitUtils.test.ts 为 12/12 通过。
  • Plan 模式/只读边界:通过。 已注册 skillread_file,未注册写工具;fixture 哈希未变化。
  • 自动 Skill 路由:未通过。 模型读取了 3/4 个 fixture 文件,没有调用 knowledge-lifecycle,并在读取第 4 个文件前结束。本 PR 不把它表述为端到端路由验证成功。
  • 显式调用/写入边界:通过。 使用 /knowledge-lifecycle 加 auto-edit 时,首次编辑因尚未读取文件被拒绝;读取后,Qwen Code 只修改了 current-behavior.md--dry-run--preview),复读成功,其他 fixture 哈希均未变化。
  • 测试后已恢复 fixture 文件,并删除本地 qwen3:8b 模型。

前后证据

N/A——仅修改项目工作流文档,没有用户可见 UI 或运行时行为变化。

已测试系统

系统 状态
macOS
Windows ⚠️
Linux ⚠️

环境

macOS、Qwen Code 0.22.0,以及临时使用的本地 Ollama qwen3:8b 模型。验证完成后已删除该模型。

风险与范围

  • 主要风险或权衡:Agent 可能过度持久化任务特定信息;Skill 通过默认只读分析、一条事实一个权威来源、明确退休规则和允许“不持久化”结果来降低风险。
  • 未完全验证或不在范围内:在本地模型会话中,自动 Skill 路由仍未验证通过;迁移已有设计文档与计划、生成索引、存储系统、自动日志及自动 GitHub 写入仍不在本 PR 范围内。
  • 破坏性变更或迁移说明:无。该 PR 只修改项目开发指导。

关联 Issue

Fixes #9781

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): add a repository knowledge routing and lifecycle skill

1 participant