teamai-cli 0.16.2 → 0.16.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,140 +1,141 @@
1
- # TeamAI — 基于 Git 的团队 AI 经验共享工具
1
+ # TeamAI — The team harness for AI agents
2
2
 
3
- > [English](README.en.md) | [简体中文](README.md)
3
+ > [English](README.md) | [简体中文](README.zh-CN.md)
4
4
 
5
5
  [![CI](https://github.com/Tencent/teamai-cli/actions/workflows/ci.yml/badge.svg)](https://github.com/Tencent/teamai-cli/actions/workflows/ci.yml)
6
6
  [![npm version](https://img.shields.io/npm/v/teamai-cli.svg)](https://www.npmjs.com/package/teamai-cli)
7
7
  [![npm downloads](https://img.shields.io/npm/dm/teamai-cli.svg)](https://www.npmjs.com/package/teamai-cli)
8
- [![Node.js](https://img.shields.io/node/v/teamai-cli.svg)](https://nodejs.org)
9
8
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
10
9
 
11
- 基于 Git 的团队 AI 经验共享工具。自动在团队成员之间同步 skills、rules、docs AI 工具配置。
10
+ Make every AI coding agent work by the same harness.
12
11
 
13
- 支持的 AI 工具:Claude Code、Codex、Cursor、CodeBuddy IDE(及各自的 Internal 版本),以及 Gemini CLI、Windsurf、Trae、Aider、Amp、OpenClaw 等 20+ AI 编程工具(Skills 同步)。
14
- 支持的 git 托管平台:**GitHub**、腾讯工蜂 TGit(`git.woa.com`),根据 repo URL 或安装来源自动识别。
12
+ Git-native management of skills, rules, and docs across 20+ AI tools — for you or your whole team.
15
13
 
16
- > 📖 **完整使用指南**:[docs/usage-guide.md](docs/usage-guide.md) — 涵盖从团队创建到日常使用的全流程。
17
- > 📚 **Provider 说明**:[docs/providers.md](docs/providers.md) — GitHub / TGit 差异与认证配置。
14
+ **Supports:** Claude Code, Codex, Cursor, CodeBuddy IDE, as well as Gemini CLI, Windsurf, Trae, Aider, Amp, OpenClaw, and 20+ other AI coding tools (skills sync).
18
15
 
19
- 如有问题或建议,欢迎提交 PR Issue,一起共建这个项目。
16
+ > 📖 **Full usage guide:** [docs/usage-guide.md](docs/usage-guide.md) — covers everything from team creation to day-to-day use.
20
17
 
21
- ## 安装
18
+ > 📚 **Provider notes:** [docs/providers.md](docs/providers.md) — GitHub / TGit differences and auth setup.
19
+
20
+ Questions or suggestions are welcome — please open a PR or an Issue and help build this project together.
21
+
22
+ ## Install
22
23
 
23
24
  ```bash
24
25
  npm install -g teamai-cli
25
26
  ```
26
27
 
27
28
  <details>
28
- <summary>腾讯内部用户:通过 tnpm 安装 <code>@tencent/teamai-cli</code></summary>
29
+ <summary>Tencent internal users: install <code>@tencent/teamai-cli</code> via tnpm</summary>
29
30
 
30
31
  ```bash
31
32
  npm install -g @tencent/teamai-cli --registry=http://r.tnpm.oa.com
32
33
  ```
33
34
 
34
- 两个包的代码内容一致,`@tencent/teamai-cli` 只是公网 `teamai-cli` 的内网镜像。
35
+ The two packages share identical source code; `@tencent/teamai-cli` is just the internal mirror of the public `teamai-cli`.
35
36
  </details>
36
37
 
37
- ## 快速开始
38
+ ## Quick Start
38
39
 
39
- ### 团队成员
40
+ ### Team members
40
41
 
41
42
  ```bash
42
- # 用户级初始化(默认,资源安装到 ~/)
43
+ # User-scope init (default, resources installed under ~/)
43
44
  teamai init --repo yourteam/yourproject
44
45
 
45
- # 项目级初始化(资源安装到项目目录下)
46
+ # Project-scope init (resources installed under the project directory)
46
47
  cd /path/to/my-project
47
48
  teamai init --repo yourteam/yourproject --scope project
48
49
 
49
- # 非交互模式(适合 CI/CD AI agent 自动化)
50
+ # Non-interactive mode (for CI/CD or AI-agent automation)
50
51
  teamai init --repo yourteam/yourproject --scope user --role hai_dev --force
51
52
  ```
52
53
 
53
- ### 管理员
54
+ ### Admins
54
55
 
55
- 先在 git 托管平台上创建好团队共享经验的仓库(默认 GitHubTGit 也支持),并把所有团队成员加入到该仓库的 write 权限。
56
+ First create the shared-experience repo on your git host (GitHub by default; TGit also supported) and grant write access to every team member.
56
57
 
57
- - **GitHub**:用 `gh repo create yourorg/yourproject --private` 创建,或在 UI 上建。然后用 Settings → Collaborators 把成员加进来,并把 master/main 设置为默认分支。
58
- - **TGit(腾讯工蜂)**:在 [git.woa.com](https://git.woa.com/) 上创建,通过 user group 批量添加 master 权限。
58
+ - **GitHub:** create with `gh repo create yourorg/yourproject --private` or via the UI. Then use Settings → Collaborators to add members, and set `master`/`main` as the default branch.
59
+ - **TGit (Tencent Gongfeng):** create on [git.woa.com](https://git.woa.com/) and grant master permissions in bulk via user groups.
59
60
 
60
- CLI 会根据用户传入的 repo URL 自动选择 provider:
61
+ The CLI picks a provider automatically from the repo URL:
61
62
 
62
- - `yourorg/yourrepo` `https://github.com/yourorg/yourrepo` → GitHub
63
+ - `yourorg/yourrepo` or `https://github.com/yourorg/yourrepo` → GitHub
63
64
  - `https://git.woa.com/yourteam/yourrepo` → TGit
64
65
 
65
- ## 命令
66
-
67
- | 命令 | 说明 |
68
- |------|------|
69
- | `teamai init [--scope <user\|project>] [--role <id>] [--force]` | 初始化(自动安装 gf CLIOAuth 登录、关联仓库、注册成员、配置 reviewers、注入 hooks |
70
- | `teamai push [--all] [--role <id>]` | 推送本地新资源到独立分支并创建 Merge Request;新 skill 交互式选择目标命名空间,可用 `--role` 覆盖 |
71
- | `teamai pull [--silent]` | 拉取团队资源并注入到本地 AI 工具(支持双 scope 依次拉取) |
72
- | `teamai status` | 查看本地 vs 团队仓库差异 |
73
- | `teamai list [type] [--source repo\|local\|all] [--agent <id>]` | 列出资源(skills\|rules\|docs\|env\|wiki);`--source local` `all` 时会扫描已安装 AI agent 下的 skills 目录,并标注每个 skill 的来源 (`[team]` / `[builtin]` / `[source:<name>]` / `[local-only]`) |
74
- | `teamai skill [list\|show <name>]` | 默认列出全部 skill;`show <name>` 输出指定 skill 的来源、贡献者、已安装的 agent 列表与描述摘要 |
75
- | `teamai members` | 列出已注册的团队成员 |
76
- | `teamai remove <type> <name>` | 从团队仓库和本地删除资源并创建 MRskills\|rules\|wiki |
77
- | `teamai roles` | 管理团队角色(`init`/`list`/`set`/`add`/`remove`/`update`) |
78
- | `teamai source` | 管理跨团队 skill 订阅源(`add`/`remove`/`list`/`browse`) |
79
- | `teamai contribute --file <path> [--scope <user\|project>]` | AI 生成的经验文档推送到团队仓库 |
80
- | `teamai recall <query>` | 搜索团队知识库,自动合并 user + project scope 结果 |
81
- | `teamai digest` | 生成团队 AI 使用周报(skill 排行、新增/更新 skill、session 摘要) |
82
- | `teamai hooks` | 管理 AI 工具 hooks(list / inject / remove |
83
- | `teamai uninstall [--force]` | 卸载 teamai:移除 hooksrulesskillsenvdocs、~/.teamai/ |
84
- | `teamai doctor` | 诊断配置问题 |
85
-
86
- 全局选项:
87
- - `--dry-run` — 预览模式,不做实际变更
88
- - `--verbose, -v` — 详细输出
89
-
90
- ## 工作原理
66
+ ## Commands
67
+
68
+ | Command | Description |
69
+ |---------|-------------|
70
+ | `teamai init [--scope <user\|project>] [--role <id>] [--force]` | Initialize (auto-installs gf CLI, OAuth login, links repo, registers member, configures reviewers, injects hooks) |
71
+ | `teamai push [--all] [--role <id>]` | Push local new resources to a dedicated branch and open a Merge Request; new skills prompt interactively for a target namespace (override with `--role`) |
72
+ | `teamai pull [--silent]` | Pull team resources and inject them into local AI tools (both scopes pulled sequentially) |
73
+ | `teamai status` | Show the diff between local and the team repo |
74
+ | `teamai list [type] [--source repo\|local\|all] [--agent <id>]` | List resources (skills\|rules\|docs\|env\|wiki). With `--source local` or `all`, scans skills directories of installed AI agents and tags each skill's origin (`[team]` / `[builtin]` / `[source:<name>]` / `[local-only]`) |
75
+ | `teamai skill [list\|show <name>]` | List all skills by default; `show <name>` prints the skill's origin, contributors, installed-agent list, and description summary |
76
+ | `teamai members` | List registered team members |
77
+ | `teamai remove <type> <name>` | Remove a resource from both the team repo and local, then open an MR (skills\|rules\|wiki) |
78
+ | `teamai roles` | Manage team roles (`init`/`list`/`set`/`add`/`remove`/`update`) |
79
+ | `teamai source` | Manage cross-team skill subscription sources (`add`/`remove`/`list`/`browse`) |
80
+ | `teamai contribute --file <path> [--scope <user\|project>]` | Push an AI-generated experience document to the team repo |
81
+ | `teamai recall <query>` | Search the team knowledge base, automatically merging user + project scope results |
82
+ | `teamai digest` | Generate a team AI usage weekly digest (skill leaderboard, new/updated skills, session summaries) |
83
+ | `teamai hooks` | Manage AI-tool hooks (list / inject / remove) |
84
+ | `teamai uninstall [--force]` | Uninstall teamai: remove hooks, rules, skills, env, docs, and `~/.teamai/` |
85
+ | `teamai doctor` | Diagnose configuration problems |
86
+
87
+ Global options:
88
+ - `--dry-run` — preview mode, no real changes
89
+ - `--verbose, -v` — verbose output
90
+
91
+ ## How It Works
91
92
 
92
93
  ```
93
- 成员 A 成员 B
94
- 创建 skill / 写规则 同上
94
+ Member A Member B
95
+ create skill / write rules same
95
96
  │ │
96
97
  ▼ ▼
97
98
  teamai push teamai push
98
99
  │ │
99
100
  ▼ ▼
100
- 创建分支 + MR 创建分支 + MR
101
+ create branch + MR create branch + MR
101
102
  │ │
102
- └──────► 团队git仓库 ◄──────────────┘
103
+ └──────► team git repo ◄─────────────┘
103
104
  │ ▲
104
- │ │ reviewer 审批合并 MR
105
+ │ │ reviewer approves + merges MR
105
106
 
106
107
  SessionStart hook → teamai pull
107
- 自动拉取到所有成员本地
108
+ auto-synced to every member's local
108
109
  ```
109
110
 
110
- - `teamai push` 会创建独立分支(`teamai/push/<user>/<timestamp>`),推送后自动创建 Merge Request 并指派 reviewers
111
- - `teamai init` 初始化时可配置默认 reviewers(记录在 `teamai.yaml` `reviewers` 字段)
112
- - `teamai init` 会自动注入与各工具格式对齐的 hooks(含 `SessionStart`、`Stop`、`PostToolUse`、`UserPromptSubmit` 等),会话中会执行 `teamai pull`、`teamai update`、追踪与仪表盘等(支持 Claude CodeCodexClaude Code InternalCodex InternalCursorCodeBuddy IDEOpenClawWorkBuddy
113
- - Skills 同步到 `~/.claude/skills/`、`~/.codex/skills/`、`~/.codex-internal/skills/`、`~/.claude-internal/skills/`、`~/.cursor/skills/`、`~/.codebuddy/skills/`
114
- - Rules 同步到各工具的 rules 目录,并通过标记注释合并到 `CLAUDE.md`(支持 claudeclaude-internalcodebuddy
115
- - Knowledge 同步到 `~/.teamai/docs/`
116
- - Learnings 同步到 `~/.teamai/learnings/`,并基于该目录构建 recall 索引(全团队共享,不按角色拆分)
117
- - Culture 同步团队文化文件(`culture.md`),编译 frontmatter body 后注入到各 AI 工具的 `CLAUDE.md`
111
+ - `teamai push` creates a dedicated branch (`teamai/push/<user>/<timestamp>`), pushes it, then opens a Merge Request and assigns reviewers automatically.
112
+ - `teamai init` lets you configure default reviewers (stored in the `reviewers` field of `teamai.yaml`).
113
+ - `teamai init` injects hooks tailored to each tool's format (`SessionStart`, `Stop`, `PostToolUse`, `UserPromptSubmit`, etc.). During sessions the hooks run `teamai pull`, `teamai update`, tracking, dashboard updates, and so on (supports Claude Code, Codex, Claude Code Internal, Codex Internal, Cursor, CodeBuddy IDE, OpenClaw, WorkBuddy).
114
+ - Skills sync to `~/.claude/skills/`, `~/.codex/skills/`, `~/.codex-internal/skills/`, `~/.claude-internal/skills/`, `~/.cursor/skills/`, `~/.codebuddy/skills/`.
115
+ - Rules sync to each tool's rules directory and are merged into `CLAUDE.md` via marker comments (supported for claude, claude-internal, codebuddy).
116
+ - Knowledge syncs to `~/.teamai/docs/`.
117
+ - Learnings sync to `~/.teamai/learnings/` and back the recall index (shared team-wide, not partitioned by role).
118
+ - Culture syncs the team culture file (`culture.md`): its frontmatter and body are compiled and injected into every AI tool's `CLAUDE.md`.
118
119
 
119
- ## 角色化 Skills
120
+ ## Role-scoped Skills
120
121
 
121
- 当团队资源仓库启用角色化目录后,Skills 按角色 namespace 组织,CLI `teamai init` 时要求选择 `primaryRole` 和可选的 `additionalRoles`,并写入本地 `config.yaml`。
122
+ When the team resource repo enables role-scoped directories, skills are organized under role namespaces. During `teamai init`, the CLI asks you to pick a `primaryRole` and optional `additionalRoles` and writes them to your local `config.yaml`.
122
123
 
123
- 远端仓库目录约定:
124
+ Remote repo layout convention:
124
125
 
125
126
  ```text
126
- manifest/roles.yaml # 角色定义
127
- skills/<namespace>/<skill>/ # namespace 组织的 skills
128
- rules/ # 全局,不做角色拆分
127
+ manifest/roles.yaml # role definitions
128
+ skills/<namespace>/<skill>/ # skills organized by namespace
129
+ rules/ # global, not role-scoped
129
130
  ```
130
131
 
131
- - `teamai pull` 读取 `manifest/roles.yaml`,只同步 `primaryRole + additionalRoles` 对应 namespace 中的 skills(同时保留 tag 过滤的并集)。
132
- - Skills `skills/<namespace>/<skill-name>/` 拍平安装到本地 `<tool>/skills/<skill-name>/`,用户无感知 namespace 结构。
133
- - 如果激活 namespace 中出现同名 skill,`pull` 会直接失败,避免隐式覆盖。
134
- - 不在激活 namespace 中、也不在 tag 过滤结果中的 skills 会被自动清理。
135
- - `rules/`、`docs/`、`learnings/` 仍然保持原有逻辑,不做角色拆分(learnings 全团队共享)。
132
+ - `teamai pull` reads `manifest/roles.yaml` and only syncs skills under `primaryRole + additionalRoles` namespaces (unioned with tag-filter results).
133
+ - Skills install flat from `skills/<namespace>/<skill-name>/` into `<tool>/skills/<skill-name>/` — the namespace layout is invisible to users.
134
+ - If two activated namespaces contain a skill with the same name, `pull` fails outright to prevent silent overrides.
135
+ - Skills outside both activated namespaces and tag-filter results are cleaned up automatically.
136
+ - `rules/`, `docs/`, `learnings/` keep their original behavior and are not role-scoped (learnings are shared team-wide).
136
137
 
137
- 配置示例:
138
+ Example config:
138
139
 
139
140
  ```yaml
140
141
  primaryRole: hai
@@ -143,37 +144,37 @@ additionalRoles:
143
144
  resourceProfileVersion: 1
144
145
  ```
145
146
 
146
- 这会同步 `skills/common/`、`skills/hai/`、`skills/pm/` 三个 namespace 中的所有 skills。
147
+ This syncs every skill from `skills/common/`, `skills/hai/`, and `skills/pm/`.
147
148
 
148
- ## 角色化推送
149
+ ## Role-scoped Pushing
149
150
 
150
- 角色化仓库下,推送新 skill CLI 会自动检测可用的命名空间并提供交互式选择:
151
+ In a role-scoped repo, when you push a new skill the CLI auto-detects available namespaces and prompts:
151
152
 
152
153
  ```bash
153
- # 交互式选择命名空间(推荐)
154
+ # Interactive namespace selection (recommended)
154
155
  teamai push
155
- # 输出:
156
+ # Output:
156
157
  # Which namespace should new skills be pushed to?
157
158
  # 1. common
158
159
  # 2. hai
159
160
  # 3. pm
160
161
  # Choose namespace [1-3] (default: 1 = common):
161
162
 
162
- # 显式指定目标 namespace
163
+ # Explicit target namespace
163
164
  teamai push --role pm
164
165
  ```
165
166
 
166
- - `primaryRole` 时,从 `manifest/roles.yaml` 展开可用 namespace 列表
167
- - `primaryRole` 时,自动扫描团队仓库目录结构中的 namespace
168
- - 单一命名空间时自动选中,无需交互
169
- - `--role <id>` 可临时覆盖目标 namespace
170
- - 修改已有 skill 时自动保持原 namespace,无需重新选择
167
+ - With a `primaryRole`, the list expands from `manifest/roles.yaml`.
168
+ - Without a `primaryRole`, namespaces are discovered by scanning the team repo's directory structure.
169
+ - When only one namespace exists, it's selected automatically — no prompt.
170
+ - `--role <id>` temporarily overrides the target namespace.
171
+ - Modifying an existing skill keeps its original namespace — no reselection needed.
171
172
 
172
- 推送时 CLI 会自动检查 `SKILL.md` YAML frontmatter(`name`/`description`),缺失则自动补全,无需手动维护。
173
+ On push, the CLI checks `SKILL.md`'s YAML frontmatter (`name`/`description`) and auto-fills anything missing, so you don't have to maintain it by hand.
173
174
 
174
- ## 团队文化(Culture
175
+ ## Team Culture
175
176
 
176
- 在团队仓库根目录创建 `culture.md`,用 YAML frontmatter 定义公司和团队信息,body 部分写团队文化指引:
177
+ Create `culture.md` at the root of the team repo. Use YAML frontmatter for company/team info and the body for cultural guidelines:
177
178
 
178
179
  ```markdown
179
180
  ---
@@ -191,135 +192,135 @@ team:
191
192
  - Improve test coverage
192
193
  ---
193
194
 
194
- ## 编码准则
195
+ ## Coding Guidelines
195
196
 
196
- - 所有 PR 必须有至少一个 reviewer 审批
197
- - 禁止直接 push master
198
- - 测试覆盖率不低于 80%
197
+ - Every PR needs at least one reviewer approval
198
+ - Direct pushes to master are forbidden
199
+ - Test coverage must stay above 80%
199
200
  ```
200
201
 
201
- `teamai pull` 时会自动将 culture.md 编译为结构化内容,注入到各 AI 工具的 `CLAUDE.md` 中(`<!-- [teamai:culture:start] -->` / `<!-- [teamai:culture:end] -->` 标记之间)。AI 编码助手在每次会话中都能感知团队文化。
202
+ `teamai pull` compiles `culture.md` into structured content and injects it into every AI tool's `CLAUDE.md` (between `<!-- [teamai:culture:start] -->` and `<!-- [teamai:culture:end] -->`). AI coding assistants pick up the team culture on every session.
202
203
 
203
- ## 跨团队 Skill 订阅
204
+ ## Cross-team Skill Subscription
204
205
 
205
- 通过 `teamai source` 订阅其他团队的公共 skill 仓库,pull 时自动同步订阅源的 skills
206
+ Use `teamai source` to subscribe to other teams' public skill repos. Their skills sync automatically on `pull`:
206
207
 
207
208
  ```bash
208
- # 添加订阅源
209
- teamai source add https://git.woa.com/other-team/teamai-public.git --name other-team
209
+ # Add a subscription source
210
+ teamai source add https://github.com/other-team/teamai-public.git --name other-team
210
211
 
211
- # 查看已订阅的源
212
+ # List subscribed sources
212
213
  teamai source list
213
214
 
214
- # 浏览订阅源的 skills
215
+ # Browse skills from a source
215
216
  teamai source browse other-team
216
217
 
217
- # 移除订阅(同时清理其 skills
218
+ # Remove a subscription (and clean up its skills)
218
219
  teamai source remove other-team
219
220
  ```
220
221
 
221
- 订阅源的 skills `teamai pull` 时自动同步到本地,与团队自有 skills 共存。
222
+ Subscribed skills sync to your local machine on `teamai pull` and coexist with your own team's skills.
222
223
 
223
- ## Scope(作用域)
224
+ ## Scope
224
225
 
225
- TeamAI 支持两种 scope,可以共存:
226
+ TeamAI supports two scopes that can coexist:
226
227
 
227
- | 维度 | User Scope(默认) | Project Scope |
228
- |------|-------------------|---------------|
229
- | **资源安装位置** | `~/` 下(如 `~/.claude/skills/`) | 项目目录下(如 `<project>/.claude/skills/`) |
230
- | **配置文件** | `~/.teamai/config.yaml` | `<project>/.teamai/config.yaml` |
231
- | **适用场景** | 通用团队规范、跨项目技能 | 项目特定的技能和规则 |
232
- | **初始化** | `teamai init --repo <group>/<repo>` | `cd <project> && teamai init --repo <group>/<repo> --scope project` |
228
+ | Dimension | User Scope (default) | Project Scope |
229
+ |-----------|---------------------|---------------|
230
+ | **Install location** | under `~/` (e.g. `~/.claude/skills/`) | under the project (e.g. `<project>/.claude/skills/`) |
231
+ | **Config file** | `~/.teamai/config.yaml` | `<project>/.teamai/config.yaml` |
232
+ | **Use case** | general team norms, cross-project skills | project-specific skills and rules |
233
+ | **Init** | `teamai init --repo <group>/<repo>` | `cd <project> && teamai init --repo <group>/<repo> --scope project` |
233
234
 
234
- **双 scope 协同:**
235
- - `teamai pull` 会依次拉取 user + project 两个 scope 的资源,互不冲突
236
- - `teamai contribute --scope user/project` 可显式选择推送到哪个仓库
237
- - `teamai recall` 自动合并两个 scope 的知识库,统一搜索排序,结果标注来源 `[user]`/`[project]`
238
- - 远端 `teamai.yaml` `scope` 字段锁定仓库类型,成员 init 时必须匹配
235
+ **Dual-scope cooperation:**
236
+ - `teamai pull` pulls user and project scopes sequentially; they don't conflict.
237
+ - `teamai contribute --scope user/project` lets you pick which repo to push to.
238
+ - `teamai recall` merges knowledge bases from both scopes into a single ranking and tags each result with its origin `[user]` / `[project]`.
239
+ - The `scope` field in the remote `teamai.yaml` locks the repo's type; member init must match.
239
240
 
240
- ## 经验自动分享
241
+ ## Automatic Experience Sharing
241
242
 
242
- 当一次 AI coding session 结束时,系统会通过 Stop hook 智能评估 session 价值并提示分享:
243
+ When an AI coding session ends, the Stop hook evaluates session value and prompts you to share:
243
244
 
244
245
  ```
245
- AI coding session (持续工作中...)
246
+ AI coding session (ongoing...)
246
247
 
247
- ▼ PostToolUse hook 持续追踪工具调用和 skill 使用
248
+ ▼ PostToolUse hook continuously tracks tool calls and skill usage
248
249
 
249
- 会话结束(Stop hook 触发)
250
+ session ends (Stop hook fires)
250
251
 
251
- ├─ 智能评分:工具调用数量 + 工具多样性 + skill 使用 + 错误重试 + session 时长
252
- (从 dashboard events.jsonl 提取,一次性评估,满分 100
252
+ ├─ Smart scoring: tool-call count + tool diversity + skill usage + error retries + session duration
253
+ (extracted from dashboard events.jsonl, one-shot, out of 100)
253
254
 
254
- ├─ 分数 < 35 → 不打扰(工具调用少或缺乏多样性,没有总结价值)
255
+ ├─ Score < 35 → stay silent (too few or too uniform calls, not worth summarizing)
255
256
 
256
- 分数 ≥ 35
257
+ Score ≥ 35
257
258
 
258
- AI 提示:"本次 session 内容丰富,建议运行 /teamai-share-learnings 分享经验"
259
+ AI: "This session was productive — consider running /teamai-share-learnings to share."
259
260
 
260
- 用户同意
261
+ user accepts
261
262
 
262
263
  /teamai-share-learnings (AI sub-agent)
263
- ├─ AI 总结本次 session 的经验
264
- ├─ 生成 Markdown 文档
265
- └─ teamai contribute --file <path> → 直接 push 到团队仓库 learnings/
264
+ ├─ AI summarizes the session's lessons
265
+ ├─ Generates a Markdown document
266
+ └─ teamai contribute --file <path> → pushes directly to the team repo's learnings/
266
267
  ```
267
268
 
268
- - `/teamai-share-learnings` CLI 内置 skill,随 `teamai pull/init` 自动部署到本地
269
- - 每个 session 最多提示一次(去重),用户可以忽略
270
- - 文档直接 push `learnings/` 目录,团队成员下次 pull 时可见
269
+ - `/teamai-share-learnings` is a built-in CLI skill, deployed locally by `teamai pull/init`.
270
+ - Each session is prompted at most once (de-duplicated); you can always ignore it.
271
+ - The document lands directly in `learnings/` and is visible to teammates on their next `pull`.
271
272
 
272
- ## 团队知识回忆
273
+ ## Team Knowledge Recall
273
274
 
274
- `teamai recall` 实现知识飞轮的"读出路径"——AI 可以自动搜索团队积累的经验文档:
275
+ `teamai recall` implements the "read" side of the knowledge flywheel — the AI can search across accumulated team experience docs:
275
276
 
276
277
  ```
277
- contribute(写入) → pull(同步+索引) → recall(搜索) → upvote(投票) → 排序优化
278
+ contribute (write) → pull (sync + index) → recall (search) → upvote (vote) → better ranking
278
279
  ```
279
280
 
280
281
  ```bash
281
- $ teamai recall "fuse 端口"
282
- [1/2] MR 审查发现 FUSE 端口冲突 Bug ★1 [user]
282
+ $ teamai recall "fuse port"
283
+ [1/2] MR review caught a FUSE port-conflict bug ★1 [user]
283
284
  Author: jeffyxu | Score: 18.5 | Tags: troubleshooting, fuse, k8s
284
285
 
285
- [2/2] FUSE 部署配置最佳实践 [project]
286
+ [2/2] FUSE deployment configuration best practices [project]
286
287
  Author: alice | Score: 12.0 | Tags: fuse, deploy
287
288
  ```
288
289
 
289
- - **双 scope 合并搜索**:自动合并 user project scope 的知识库,结果标注来源
290
- - Hybrid 中英文搜索(Intl.Segmenter + CJK bigrams
291
- - 搜索自动投票,好文档自然浮到顶部
292
- - 投票按 scope 分别写入各自的 repo,归属正确
290
+ - **Dual-scope merged search:** automatically merges user and project scope knowledge bases, each result tagged with its origin.
291
+ - Hybrid CJK + English search (Intl.Segmenter + CJK bigrams).
292
+ - Searches implicitly upvote matched docs; good docs naturally float up over time.
293
+ - Votes are written to each scope's own repo, so attribution stays correct.
293
294
 
294
- ## 更新
295
+ ## Update
295
296
 
296
297
  ```bash
297
- teamai update # 自动检测并升级到最新版
298
- npm update -g teamai-cli # 或手动触发 npm 升级
298
+ teamai update # auto-detect and upgrade to latest
299
+ npm update -g teamai-cli # or trigger an npm upgrade manually
299
300
  ```
300
301
 
301
- `teamai update` 会根据当前安装的包名自动选择 registry
302
+ `teamai update` picks the registry based on the installed package name:
302
303
 
303
- - `teamai-cli` → 公网 npm (`https://registry.npmjs.org`)
304
- - `@tencent/teamai-cli` → 内网 tnpm (`http://r.tnpm.oa.com`)
304
+ - `teamai-cli` → public npm (`https://registry.npmjs.org`)
305
+ - `@tencent/teamai-cli` → internal tnpm (`http://r.tnpm.oa.com`)
305
306
 
306
- 如需手动覆盖 registry,可以设置环境变量 `TEAMAI_NPM_REGISTRY=<url>`。
307
+ To override the registry manually, set `TEAMAI_NPM_REGISTRY=<url>`.
307
308
 
308
- ### 自动更新控制
309
+ ### Auto-update Control
309
310
 
310
- 自动更新通过 Stop hook 在会话结束时执行,可在两个层级控制:
311
+ Auto-update runs on the Stop hook at the end of a session. It can be controlled at two layers:
311
312
 
312
- | 配置层级 | 文件 | 字段 | 可选值 |
313
- |---------|------|------|-------|
314
- | 团队默认 | `teamai.yaml` | `autoUpdate` | `true`(默认)/ `false` |
315
- | 用户覆盖 | `~/.teamai/config.yaml` | `updatePolicy` | `auto` / `prompt` / `skip` |
313
+ | Layer | File | Field | Allowed values |
314
+ |-------|------|-------|----------------|
315
+ | Team default | `teamai.yaml` | `autoUpdate` | `true` (default) / `false` |
316
+ | User override | `~/.teamai/config.yaml` | `updatePolicy` | `auto` / `prompt` / `skip` |
316
317
 
317
- 用户级 `updatePolicy` 始终优先于团队级 `autoUpdate`。
318
+ The user-level `updatePolicy` always wins over the team-level `autoUpdate`.
318
319
 
319
- ## 许可证
320
+ ## License
320
321
 
321
322
  [MIT](LICENSE)
322
323
 
323
- ## 贡献
324
+ ## Contributing
324
325
 
325
- 欢迎 PR!请先阅读 [CONTRIBUTING.md](.github/CONTRIBUTING.md)
326
+ PRs are welcome! Please read [CONTRIBUTING.md](.github/CONTRIBUTING.md) first.