Skip to content

fix: align wiki path to ~/.teamai/wiki/ for push compatibility#15

Merged
jeff-r2026 merged 1 commit into
mainfrom
fix/wiki-path
May 19, 2026
Merged

fix: align wiki path to ~/.teamai/wiki/ for push compatibility#15
jeff-r2026 merged 1 commit into
mainfrom
fix/wiki-path

Conversation

@jeff-r2026
Copy link
Copy Markdown
Collaborator

@jeff-r2026 jeff-r2026 commented May 19, 2026

Summary

  • Fix wiki skill path resolution: use fixed ~/.teamai/wiki/ instead of fallback chain that included ~/.claude-internal/wiki/ and ~/.claude/wiki/
  • This aligns the wiki skill's output path with teamai push's WikiHandler scan path

Fixes #13

Test plan

  • Run /teamai-wiki init → verify wiki created at ~/.teamai/wiki/
  • Run teamai push --dry-run → verify wiki pages appear in push list

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
Copy link
Copy Markdown
Collaborator Author

@jeff-r2026 jeff-r2026 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

  1. 与设计 spec 一致docs/superpowers/specs/2026-04-06-teamai-wiki-layer-design.md 明确定义了相同的 scope → path 映射逻辑。
  2. 消除歧义 — 旧的 fallback chain 在多 tool 共存时行为不确定(哪个 tool 的 wiki/ 先被找到?),新逻辑一 scope 一路径,不依赖 tool 安装情况。
  3. 改动最小 — 只改 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/ 里。


💡 建议

  1. 如果有配套 code PR(添加 getSharedWikiDir 或修改 toolPaths),建议在 PR description 中注明依赖关系。
  2. 考虑在 SKILL.md 中增加一个 fallback 说明:"如果 <scope-dir>/.teamai/wiki/ 不存在但 ~/.claude-internal/wiki/ 存在,提示用户先运行 teamai pull"。

Verdict

逻辑正确,方向正确,与 spec 一致。唯一需要确认的是 code 侧是否有配套变更确保 push 能扫描到 .teamai/wiki/。如果有,LGTM 可合。

@jeff-r2026 jeff-r2026 merged commit 5dd8255 into main May 19, 2026
7 checks passed
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.

[bug] teamai push cannot recognize wiki files

1 participant