Skip to content

Commit b368cc6

Browse files
committed
test(mcp): skill-creator 真实素材闭环验证 + 设计文档收口(T6, #29)
用本仓真实知识走完整生命周期(非 fixture): - prepare:38 个真实候选(8 场景块 + 30 笔记),容量绿、无冲突 - submit:maintain-fork-pr-merge 技能从「发布与依赖治理方法」场景 + fork-PR lesson 编译落草稿区,2 条素材获得 compiled_into 回链 - lint 全绿 → install(生效区产物验证:仅 name/description/正文) - flag_issue(skill-ineffective:DRAFT 态 caveat 缺失)→ prepare 聚合 → 修订(revisions 2)→ drift warning 实测触发 → reinstall 生效区刷新 - 七处同步清单逐项核对通过;设计文档状态更新为已实施 CodeBuddy 真机技能发现验证留人工步骤(安装产物已就位于 .codebuddy/skills/maintain-fork-pr-merge/)。 Closes #29
1 parent 30a86b0 commit b368cc6

5 files changed

Lines changed: 233 additions & 2 deletions

File tree

‎docs/skill-creator需求与设计方案.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
> 把已确认知识编译成 SKILL.md 行为指令资产:MVP 单向编译器 + 回流接口设计。
44
>
5-
> 编制日期:2026-09-06 · 状态:设计定稿(grill 九问收敛完毕,代码未动)
5+
> 编制日期:2026-09-06 · 状态:**已实施**(T1-T5 落地于 issues #24-#28,commits b12e98c/3db4827/64fb95e/e08dae6/c1beee9;闭环验证 #29 完成——真实素材全链 prepare→submit→lint→install→flag→revise→drift→reinstall 实测通过。用户文档:`docs/skill-creator使用指南.md`)
66
>
77
> 前置文档(本方案的输入,本文不重复其论证):
88
> 1. `repowiki/wiki/comparisons/自动生成SKILL可行性-wikiskill闭环-vs-CodeWiki编译复用.md` — 三档方案定档(方案 C 半闭环,MVP = 单向编译器)

‎repowiki/.meta/issues.json‎

Lines changed: 173 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,179 @@
3535
"status": "open",
3636
"occurrences": 1,
3737
"updates": []
38+
},
39+
"5a846caf": {
40+
"id": "5a846caf",
41+
"issue_type": "custom",
42+
"page_path": "notes/2026-08-03-mcp-工具-schema-不声明-session-idhandler-隐式读取.md",
43+
"description": "test",
44+
"severity": "warning",
45+
"created_at": "2026-09-06T18:21:33.680536",
46+
"updated_at": "2026-09-06T18:21:56.131616",
47+
"status": "open",
48+
"occurrences": 2,
49+
"updates": [
50+
{
51+
"timestamp": "2026-09-06T18:21:56.131616",
52+
"description": "low_adoption: recalled 200 times / adopted 0 -> rewrite with concrete steps, commands and expected results, or fold into a scenario block."
53+
}
54+
]
55+
},
56+
"d2244c2f": {
57+
"id": "d2244c2f",
58+
"issue_type": "custom",
59+
"page_path": "notes/2026-08-25-doctrine-不会自动注入-agent-上下文唯一通道是-query-wikimodeoverview.md",
60+
"description": "low_adoption: recalled 88 times / adopted 0 -> rewrite with concrete steps, commands and expected results, or fold into a scenario block.",
61+
"severity": "warning",
62+
"created_at": "2026-09-06T18:21:56.602544",
63+
"updated_at": "2026-09-06T18:21:56.602544",
64+
"status": "open",
65+
"occurrences": 1,
66+
"updates": []
67+
},
68+
"f10c0a92": {
69+
"id": "f10c0a92",
70+
"issue_type": "custom",
71+
"page_path": "notes/2026-08-23-distill-worker-subagent-定义随包发布hook-启用时自动拷贝到项目-codebuddyagent.md",
72+
"description": "low_adoption: recalled 84 times / adopted 0 -> rewrite with concrete steps, commands and expected results, or fold into a scenario block.",
73+
"severity": "warning",
74+
"created_at": "2026-09-06T18:21:57.066236",
75+
"updated_at": "2026-09-06T18:21:57.066236",
76+
"status": "open",
77+
"occurrences": 1,
78+
"updates": []
79+
},
80+
"05be9a92": {
81+
"id": "05be9a92",
82+
"issue_type": "custom",
83+
"page_path": "notes/2026-08-26-handle-query-wiki-在-session-存在时每次查询都全量重建检索索引.md",
84+
"description": "low_adoption: recalled 74 times / adopted 0 -> rewrite with concrete steps, commands and expected results, or fold into a scenario block.",
85+
"severity": "warning",
86+
"created_at": "2026-09-06T18:21:57.530526",
87+
"updated_at": "2026-09-06T18:21:57.530526",
88+
"status": "open",
89+
"occurrences": 1,
90+
"updates": []
91+
},
92+
"a488df01": {
93+
"id": "a488df01",
94+
"issue_type": "custom",
95+
"page_path": "notes/2026-08-25-mcp-参数长度受限时蒸馏-submit-走文件侧通道python-脚本直接调-handle-distill-conve.md",
96+
"description": "low_adoption: recalled 58 times / adopted 0 -> rewrite with concrete steps, commands and expected results, or fold into a scenario block.",
97+
"severity": "warning",
98+
"created_at": "2026-09-06T18:21:58.098090",
99+
"updated_at": "2026-09-06T18:21:58.098090",
100+
"status": "open",
101+
"occurrences": 1,
102+
"updates": []
103+
},
104+
"0066c91f": {
105+
"id": "0066c91f",
106+
"issue_type": "custom",
107+
"page_path": "notes/2026-08-25-untracked-新文件不在分析图谱内review-changes-changed-sources-切片为空.md",
108+
"description": "low_adoption: recalled 50 times / adopted 0 -> rewrite with concrete steps, commands and expected results, or fold into a scenario block.",
109+
"severity": "warning",
110+
"created_at": "2026-09-06T18:21:58.557722",
111+
"updated_at": "2026-09-06T18:21:58.557722",
112+
"status": "open",
113+
"occurrences": 1,
114+
"updates": []
115+
},
116+
"18250574": {
117+
"id": "18250574",
118+
"issue_type": "custom",
119+
"page_path": "notes/2026-08-26-load-project-checklist-对-yaml-损坏静默回退-none-无日志难排查.md",
120+
"description": "low_adoption: recalled 43 times / adopted 0 -> rewrite with concrete steps, commands and expected results, or fold into a scenario block.",
121+
"severity": "warning",
122+
"created_at": "2026-09-06T18:21:59.010666",
123+
"updated_at": "2026-09-06T18:21:59.010666",
124+
"status": "open",
125+
"occurrences": 1,
126+
"updates": []
127+
},
128+
"3290e859": {
129+
"id": "3290e859",
130+
"issue_type": "custom",
131+
"page_path": "notes/2026-08-29-生成的-ps1-必须带-utf-8-bom否则-powershell-51-按-gbk-误读.md",
132+
"description": "low_adoption: recalled 41 times / adopted 0 -> rewrite with concrete steps, commands and expected results, or fold into a scenario block.",
133+
"severity": "warning",
134+
"created_at": "2026-09-06T18:21:59.465742",
135+
"updated_at": "2026-09-06T18:21:59.465742",
136+
"status": "open",
137+
"occurrences": 1,
138+
"updates": []
139+
},
140+
"c36a249c": {
141+
"id": "c36a249c",
142+
"issue_type": "custom",
143+
"page_path": "notes/2026-08-29-工作区痕迹齐备时跳过-init-workspace直接跑-bootstrap-脚本补-clone.md",
144+
"description": "low_adoption: recalled 39 times / adopted 0 -> rewrite with concrete steps, commands and expected results, or fold into a scenario block.",
145+
"severity": "warning",
146+
"created_at": "2026-09-06T18:21:59.901791",
147+
"updated_at": "2026-09-06T18:21:59.901791",
148+
"status": "open",
149+
"occurrences": 1,
150+
"updates": []
151+
},
152+
"60917120": {
153+
"id": "60917120",
154+
"issue_type": "custom",
155+
"page_path": "notes/2026-08-29-登记业务仓后不自动生成-wiki必须等用户显式要求.md",
156+
"description": "low_adoption: recalled 36 times / adopted 0 -> rewrite with concrete steps, commands and expected results, or fold into a scenario block.",
157+
"severity": "warning",
158+
"created_at": "2026-09-06T18:22:00.363329",
159+
"updated_at": "2026-09-06T18:22:00.363329",
160+
"status": "open",
161+
"occurrences": 1,
162+
"updates": []
163+
},
164+
"fad9fdf4": {
165+
"id": "fad9fdf4",
166+
"issue_type": "no_outlinks",
167+
"page_path": "notes/",
168+
"description": "BATCH: 153 note pages have no outgoing wikilinks (info). Adding cross-refs one-by-one is low value; decide on a bulk policy (auto-tag related notes or accept).",
169+
"severity": "info",
170+
"created_at": "2026-09-06T18:22:00.827939",
171+
"updated_at": "2026-09-06T18:22:00.827939",
172+
"status": "open",
173+
"occurrences": 1,
174+
"updates": []
175+
},
176+
"05d43ba8": {
177+
"id": "05d43ba8",
178+
"issue_type": "custom",
179+
"page_path": "notes/",
180+
"description": "BATCH: 76 note pages marked superseded (info). Archive/delete only after human review - retirement is a knowledge decision, not a lint fix.",
181+
"severity": "info",
182+
"created_at": "2026-09-06T18:22:01.366847",
183+
"updated_at": "2026-09-06T18:22:01.366847",
184+
"status": "open",
185+
"occurrences": 1,
186+
"updates": []
187+
},
188+
"d7c43aab": {
189+
"id": "d7c43aab",
190+
"issue_type": "custom",
191+
"page_path": "codewiki/cli/",
192+
"description": "BATCH: 127 isolated components (info), mostly CLI helpers with no dependency edges. Verify they are not dead code before documenting.",
193+
"severity": "info",
194+
"created_at": "2026-09-06T18:22:01.878474",
195+
"updated_at": "2026-09-06T18:22:01.878474",
196+
"status": "open",
197+
"occurrences": 1,
198+
"updates": []
199+
},
200+
"2ceafde2": {
201+
"id": "2ceafde2",
202+
"issue_type": "custom",
203+
"page_path": "skills/maintain-fork-pr-merge/SKILL.md",
204+
"description": "适用条件漏了 draft PR:mergeStateStatus=DRAFT 时探测冲突无意义,需先等 CI 出结果再判定",
205+
"severity": "warning",
206+
"created_at": "2026-09-06T19:45:11.933179",
207+
"updated_at": "2026-09-06T19:45:11.933179",
208+
"status": "open",
209+
"occurrences": 1,
210+
"updates": []
38211
}
39212
},
40213
"version": 1

‎repowiki/notes/2026-08-26-fork-来源的-pr-与目标分支冲突时的维护者合入流程merge-tree-探测-worktree-push-fork.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ metadata:
1111
severity: medium
1212
consolidated_into:
1313
- wiki/scenarios/发布与依赖治理方法.md
14+
compiled_into:
15+
- skills/maintain-fork-pr-merge/SKILL.md
1416
status: stable
1517
generated:
1618
by: codewiki/5.4.3
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
---
2+
name: maintain-fork-pr-merge
3+
description: 当合入 fork 来源的 PR 且 mergeStateStatus=CONFLICTING/DIRTY 时——先 git merge-tree 探测冲突清单,查 maintainer_can_modify,再在 worktree 隔离目录解冲突后 push fork 分支,勿因 CI 绿直接 merge
4+
type: Skill
5+
status: draft
6+
generated:
7+
by: codewiki/5.6.1
8+
at: "2026-09-06T11:43:46Z"
9+
stale_after: 2026-12-05
10+
metadata:
11+
summary: fork PR 冲突时的维护者合入 SOP:merge-tree 探测 + worktree 隔离 + push fork
12+
source_refs: ["wiki/scenarios/发布与依赖治理方法.md", "notes/2026-08-26-fork-来源的-pr-与目标分支冲突时的维护者合入流程merge-tree-探测-worktree-push-fork.md"]
13+
revisions: ["at: \"2026-09-06T11:43:46Z\"", {"at": "2026-09-06T11:45:12Z", "reason": "试用反馈:适用条件补 DRAFT 态 caveat(flag_issue skill-ineffective)", "source": "skill_creator"}, {"at": "2026-09-06T11:46:06Z", "reason": "drift 验证轮", "source": "skill_creator"}, {"at": "2026-09-06T11:50:16Z", "reason": "移除 drift 验证临时段,恢复正式正文", "source": "skill_creator"}]
14+
reason: created from candidate materials
15+
source: skill_creator
16+
installed_at: "2026-09-06T11:50:20Z"
17+
installed_to: .codebuddy/skills/maintain-fork-pr-merge/
18+
installed_hash: "sha256:3aa4f3725ce83a7c9c83531a737828dd674039eb7734fbaf1fc5d23f15db670e"
19+
---
20+
21+
22+
## 工作场景
23+
24+
维护者合入外部贡献者从 fork 发起的 PR,且 PR 分支与目标分支存在冲突(mergeStateStatus=CONFLICTING/DIRTY)。本仓的典型情境:评审期间 develop 又合入了新提交,导致 fork PR 的改动与主线重叠。
25+
26+
## 适用条件
27+
28+
- PR 的 head 分支在贡献者 fork 仓库中(isCrossRepository=true),本地 `git fetch <pr-branch>` 会 404
29+
- `gh pr view --json mergeable,mergeStateStatus` 显示 CONFLICTING 或 DIRTY
30+
- 注意:此时 CI 检查可能是全绿——CI 通过不等于可合并,以 mergeStateStatus 为准
31+
- mergeStateStatus=DRAFT(CI 未跑完)时先等结果再探测冲突,勿提前判定
32+
33+
## 核心 SOP
34+
35+
1. 探测冲突清单:`git merge-tree --write-tree --name-only <base> <head>`——无需真实 checkout/merge 即可拿到冲突文件列表
36+
2. 确认可否代改:`gh pr view --json isCrossRepository,headRepository`;fork PR 合入前查 `gh api repos/<owner>/<repo>/pulls/<n> --jq .maintainer_can_modify`——为 false 时只能请作者解决或换合并策略
37+
3. 隔离解冲突:工作区有未提交改动时,用 `git worktree add <tmp> <head> -b <branch>` 在独立目录解决冲突,不污染主工作区
38+
4. 更新 PR 分支:冲突解决后 `git push https://github.com/<fork-owner>/<repo>.git <local-branch>:<pr-branch>`(maintainer_can_modify=true 时 GitHub 允许维护者推 fork 的 PR head)
39+
5. 收尾清理:`git worktree remove --force` + `git branch -D`,再 `gh pr merge --merge`
40+
41+
## 判断逻辑
42+
43+
- mergeStateStatus=DIRTY ≠ CI 失败:先看冲突字段,不要先怪 CI
44+
- 主工作区是否常驻未提交改动决定是否必须走 worktree:常驻则必须隔离
45+
- maintainer_can_modify 是代改的前提闸门:false 时一切 push fork 方案不可行
46+
47+
## 禁忌与反模式
48+
49+
- 不要直接在主工作区 checkout PR 分支解冲突(污染未提交改动)
50+
- 不要因 CI 绿就点 merge(mergeStateStatus 会拒绝,但先探测可省一轮)
51+
- 不要试图 fetch fork 的分支名到本地远程(不在主仓库,fetch 404 是预期行为)
52+
- maintainer_can_modify=false 时不要尝试 push fork(无权限,会失败)
53+

‎repowiki/wiki/scenarios/发布与依赖治理方法.md‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,10 @@ metadata:
1717
heat: 2
1818
source_notes:
1919
- notes/2026-08-26-build-后端-setuptoolshatchling-迁移后-wheel-内容会变化需对比文件清单而非只看能否安装.md
20-
- notes/2026-08-26-uv-工具链两坑--no-dev-已移除须用---no-group-devpython-version-补丁固定与-uv.md
20+
- notes/2026-08-26-uv-工具链两坑--no-dev-已移除须用
21+
compiled_into:
22+
- skills/maintain-fork-pr-merge/SKILL.md
23+
---no-group-devpython-version-补丁固定与-uv.md
2124
- notes/2026-08-26-ruff-format-panic-的根因是误提交的一次性诊断脚本检查步骤勿因工具崩溃轻率移除.md
2225
- notes/2026-08-26-fork-来源的-pr-与目标分支冲突时的维护者合入流程merge-tree-探测-worktree-push-fork.md
2326
- notes/2026-08-29-生成的-ps1-必须带-utf-8-bom否则-powershell-51-按-gbk-误读.md

0 commit comments

Comments
 (0)