fix: align wiki path to ~/.teamai/wiki/ for push compatibility#15
Conversation
The wiki skill previously used a fallback chain (team repo → ~/.claude-internal/wiki/ → ./wiki/) that didn't match WikiHandler.getSharedWikiDir(). Now reads scope from <projectRoot>/.teamai/config.yaml: project scope → <projectRoot>/.teamai/wiki/, user scope → ~/.teamai/wiki/. Fixes #13
jeff-r2026
left a comment
There was a problem hiding this comment.
Code Review: PR #15
Summary
单文件变更,将 wiki skill 的路径解析逻辑从 fallback chain(~/.claude-internal/wiki/ → ~/.claude/wiki/ → ./wiki/)改为基于 scope 的确定性路径(project → <projectRoot>/.teamai/wiki/,user → ~/.teamai/wiki/)。
✅ Approve Points
- 与设计 spec 一致 —
docs/superpowers/specs/2026-04-06-teamai-wiki-layer-design.md明确定义了相同的 scope → path 映射逻辑。 - 消除歧义 — 旧的 fallback chain 在多 tool 共存时行为不确定(哪个 tool 的 wiki/ 先被找到?),新逻辑一 scope 一路径,不依赖 tool 安装情况。
- 改动最小 — 只改 SKILL.md prompt 文本,无代码逻辑变更,风险低。
⚠️ 需确认的问题
1. WikiHandler.getSharedWikiDir() 不存在
Commit message 提到 "与 teamai push/pull 的 WikiHandler.getSharedWikiDir() 逻辑对齐",但当前 src/resources/wiki.ts 中 没有 getSharedWikiDir 方法。
WikiHandler.scanLocalForPush() 当前扫描路径来自 teamConfig.toolPaths[*].wiki:
// src/resources/wiki.ts:87-89
for (const [__, toolPath] of Object.entries(teamConfig.toolPaths)) {
if (!toolPath.wiki) continue;
const wikiDir = path.join(resolveBaseDir(localConfig), toolPath.wiki);默认 toolPaths(src/types.ts:94-103)只有:
.claude/wiki.claude-internal/wiki
Question: 如果 skill 写入 ~/.teamai/wiki/,但 scanLocalForPush 不扫描这个路径,push 能正常工作吗?是否有对应的 code PR 添加 .teamai/wiki 到 toolPaths 或修改 scanLocalForPush?
2. Pull 后的数据一致性
WikiHandler.pullItem() 会把 wiki pages 拷贝到各 tool 的 wiki 目录(.claude/wiki、.claude-internal/wiki),但不会拷贝到 .teamai/wiki/。
如果 skill 只读 ~/.teamai/wiki/,pull 之后 skill 看到的可能是旧数据,而真正的最新数据在 .claude-internal/wiki/ 里。
💡 建议
- 如果有配套 code PR(添加
getSharedWikiDir或修改 toolPaths),建议在 PR description 中注明依赖关系。 - 考虑在 SKILL.md 中增加一个 fallback 说明:"如果
<scope-dir>/.teamai/wiki/不存在但~/.claude-internal/wiki/存在,提示用户先运行teamai pull"。
Verdict
逻辑正确,方向正确,与 spec 一致。唯一需要确认的是 code 侧是否有配套变更确保 push 能扫描到 .teamai/wiki/。如果有,LGTM 可合。
Summary
~/.teamai/wiki/instead of fallback chain that included~/.claude-internal/wiki/and~/.claude/wiki/teamai push'sWikiHandlerscan pathFixes #13
Test plan
/teamai-wiki init→ verify wiki created at~/.teamai/wiki/teamai push --dry-run→ verify wiki pages appear in push list