Repository navigation
Description
Problem
team-wiki-codebase 是 teamai 的 builtin skill(见 src/builtin-skills.ts 的 BUILTIN_SKILL_NAMES)。teamai pull / teamai init 会通过 deployBuiltinSkills() 自动把它下发到纯 IDE 用户的 .claude/skills/、.cursor/skills/、.codebuddy/skills/ 等目录。
但该 skill 的 SKILL.md 全程 hard-code 依赖一个独立的、需额外安装的 team-wiki CLI(compile code / compile docs / reconcile / refresh / evaluate),而 team-wiki 既不在 teamai 的 bin,也不在依赖里。
后果:一个只安装了 teamai 的纯 IDE 用户,激活 /team-wiki-codebase 后,会在 Phase 0 的第一条命令
team-wiki compile code <repo> <wiki> --extract ast,heuristic --write
直接 command not found: team-wiki。这个由 teamai 主动分发的 builtin skill,对纯 IDE 用户实际不可用——除非用户再去装一个外部插件,而这正是本 issue 希望消除的接入负担。
关键点:底层能力 teamai 大多已经实现,只是没有以 IDE 用户可直接调用的命令面暴露:
| team-wiki 命令 | teamai 现状 | 证据 |
|---|---|---|
compile code ... --write |
等价逻辑已实现,接口不同(codebase --extract 无 <wiki-root> / --dry-run,且不触发 enrich) |
src/codebase-extract.ts, src/codebase-cmd.ts |
reconcile <wiki> --write |
已实现但未暴露 CLI | src/wiki-engine/knowledge-reconciler.ts:189 |
| 深度知识生成(K2/K3、G1–G9) | deepEnrich() 已实现,但注册为 hidden 命令,只在 import --from-repo 内部跑 |
src/deep-enrich.ts, src/index.ts:903 |
evaluate <wiki> |
缺失(codebase --lint 是一致性检查,非 structuralEdgeRatio 等图谱质量度量) |
src/codebase-wiki-lint.ts |
compile docs <docs> <wiki> |
缺失(仅 import --from-iwiki 对接在线 iWiki,无本地文档目录编译) |
— |
此外,SKILL.md:18 引用的 ../GRAPH-CAPABILITIES.md 在仓库中不存在(死链),会随 skill 一起下发给 IDE 用户。
Proposed Solution
目标:让 teamai 原生支撑 IDE 用户跑通 team-wiki-codebase,不再依赖任何外部 team-wiki 插件。
按性价比排序:
- 暴露已实现但隐藏/内部的能力(改动最小、收益最大,直接消除 IDE 用户的外部依赖):
- 将
reconcileKnowledge()(wiki-engine/knowledge-reconciler.ts)暴露为teamai codebase --reconcile。 - 将
deepEnrich()从 hidden 提升为公开子命令(如teamai codebase --deep-enrich --project <slug>)。
- 将
- 对齐
compile code接口:给teamai codebase --extract增加显式--wiki-root <path>与--dry-run,使其可直接替代team-wiki compile code。 - 改写
SKILL.md:让 skill 全程调用teamai codebase ...(及其它 teamai 子命令)而非team-wiki ...,使这个 builtin skill 自洽——装了 teamai 即可用,无需外部插件。 - 修复死链
GRAPH-CAPABILITIES.md:补齐文档,或在 skill 内移除引用。 - 缺口能力作为后续增量:本地文档编译(对应
compile docs)、图谱质量指标(对应evaluate的structuralEdgeRatio等)。
验收标准:一个只安装了 teamai、未安装 team-wiki 的 IDE 用户,teamai pull 后激活 /team-wiki-codebase,能端到端跑完而不出现 command not found 或死链。
Alternatives Considered
- 过渡兜底(非目标,仅作短期缓解):在 skill 顶部显式声明"需额外安装 team-wiki 插件"并加前置检测,缺失时优雅报错而非
command not found。但这与本 issue 的目标(teamai 自我完备、零外部插件)相悖,仅作为方案 1–3 落地前的临时保护。 - 与 Proposal: codebase graph 生产侧改为可插拔(GraphProvider),停止自研多语言抽取 #352 的关系:Proposal: codebase graph 生产侧改为可插拔(GraphProvider),停止自研多语言抽取 #352 提议把 codebase graph 生产侧改为可插拔 GraphProvider(SCIP/MCP),关注的是抽取质量;本 issue 关注的是IDE 用户可达性 / 命令面暴露。两者正交但相关——若 Proposal: codebase graph 生产侧改为可插拔(GraphProvider),停止自研多语言抽取 #352 落地,本 issue 中 skill 应改为面向新的 provider 命令面。
Additional Context
- 相关文件:
src/builtin-skills.ts、src/codebase-cmd.ts、src/wiki-engine/knowledge-reconciler.ts、src/deep-enrich.ts、src/index.ts、skills/team-wiki-codebase/SKILL.md - 相关 issue:Proposal: codebase graph 生产侧改为可插拔(GraphProvider),停止自研多语言抽取 #352
Activity
opsnull commentedon Sep 8, 2026
作为一个外部用户,请问如何安装 team-wiki CLI 呢?缺少这个工具,block 整个 codebase wiki 和召回等 teamai 核心特性的使用。
jimpablo commentedon Sep 8, 2026
I'd like to take a narrow first slice of this, not the full command-surface rewrite.
Plan:
skills/team-wiki-codebaseat existingteamai codebase --extractinstead ofteam-wiki compile codefor Phase 0.GRAPH-CAPABILITIES.mdlink.--extractinteamai codebase --help.team-wikisteps are still missing, skip/stop with an English message that teamai is the CLI — no extra plugin.Out of scope for this PR: exposing
--reconcile/--deep-enrich, and adding--wiki-root/--dry-run.fix(codebase): point builtin wiki skill at teamai extract
feat(codebase): expose wiki deep-enrich
fix(codebase): point builtin wiki skill at teamai extract
feat(codebase): expose wiki deep-enrich