diff --git a/src-tauri/resources/onboarding/.agents/skills/lian-jing/SKILL.md b/src-tauri/resources/onboarding/.agents/skills/lian-jing/SKILL.md index 87655d7..f0234aa 100644 --- a/src-tauri/resources/onboarding/.agents/skills/lian-jing/SKILL.md +++ b/src-tauri/resources/onboarding/.agents/skills/lian-jing/SKILL.md @@ -5,7 +5,7 @@ description: 读取炼境项目健康状态,并使用炼境 MCP 的项目管 # 炼境项目技能 -开始项目工作时,先读取根 `AGENTS.md` 与 `.claude/liangjing.json` 取得 `project_id`。 +开始项目工作时,先读取根 `AGENTS.md` 与 `.lian-jing/context.json` 取得 `project_id`。`.claude/liangjing.json` 仅为旧项目的 Claude 兼容投影,不能作为长期身份来源。 如果当前客户端已发现 `lian-jing` MCP: diff --git a/src-tauri/src/commands/onboarding.rs b/src-tauri/src/commands/onboarding.rs index fb36662..3e5eccc 100644 --- a/src-tauri/src/commands/onboarding.rs +++ b/src-tauri/src/commands/onboarding.rs @@ -547,10 +547,15 @@ fn check_codex_mcp(content: Option<&str>) -> (bool, String) { fn check_skill(content: Option<&str>) -> (bool, String) { match content { - Some(content) if content.contains("name: lian-jing") => (true, "炼境项目技能已分发".into()), + Some(content) + if content.contains("name: lian-jing") + && content.contains(".lian-jing/context.json") => + { + (true, "炼境项目技能已分发,并使用 canonical context".into()) + } _ => ( false, - "缺少 .agents/skills/lian-jing/SKILL.md——重跑接入包".into(), + "缺少炼境项目技能,或其未使用 .lian-jing/context.json——重跑接入包升级".into(), ), } } @@ -1099,6 +1104,19 @@ mod tests { ); } + #[test] + fn skill_check_requires_canonical_context() { + let legacy = "---\nname: lian-jing\n---\n读取 .claude/liangjing.json"; + assert!( + !check_skill(Some(legacy)).0, + "旧 Claude 身份来源不能被误报为已接入" + ); + assert!( + check_skill(Some(TMPL_LIANJING_SKILL)).0, + "当前接入包 skill 必须使用 canonical context" + ); + } + /// 回归:空路径登记曾把接入包写进炼境进程 cwd(src-tauri/,2026-07-15 批量实调实锤)。 #[test] fn apply_rejects_empty_or_missing_path() {