@team-ai/teamai-cli 0.40.9 → 0.50.0
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/CHANGELOG.md +167 -11
- package/README.ja.md +32 -29
- package/README.ko.md +32 -29
- package/README.md +32 -29
- package/README.th.md +32 -29
- package/README.zh-CN.md +32 -29
- package/agents/README.md +68 -0
- package/agents/README.zh-CN.md +68 -0
- package/agents/teamai-recall.md +10 -9
- package/dist/cli.js +210551 -136899
- package/dist/index.js +291 -0
- package/dist/runtime-paseo.js +27562 -0
- package/dist/runtime-sandbox.js +94740 -0
- package/dist/runtime-t3.js +41891 -0
- package/drivers/teamai-claude.yaml +6 -0
- package/drivers/teamai-codex.yaml +6 -0
- package/drivers/teamai-local.yaml +5 -0
- package/drivers/teamai-opencode.yaml +6 -0
- package/drivers/teamai-paseo.yaml +6 -0
- package/drivers/teamai-sandbox.yaml +7 -0
- package/drivers/teamai-t3.yaml +8 -0
- package/hooks/teamai-env-hint/HOOK.yaml +1 -0
- package/hooks/teamai-env-hint/README.md +80 -0
- package/hooks/teamai-env-hint/README.zh-CN.md +80 -0
- package/hooks/teamai-env-hint/exec.md +1 -0
- package/hooks/teamai-env-hint/secrets-rule.md +1 -0
- package/hooks/teamai-env-hint/secrets.md +1 -0
- package/hooks/teamai-env-hint/variables.md +1 -0
- package/hooks/teamai-friction-reminder/HOOK.yaml +1 -0
- package/hooks/teamai-friction-reminder/README.md +117 -0
- package/hooks/teamai-friction-reminder/README.zh-CN.md +117 -0
- package/hooks/teamai-friction-reminder/action-gap.md +1 -0
- package/hooks/teamai-friction-reminder/action-gap.zh.md +1 -0
- package/hooks/teamai-friction-reminder/action-share-learnings.md +1 -0
- package/hooks/teamai-friction-reminder/action-share-learnings.zh.md +1 -0
- package/hooks/teamai-friction-reminder/action.md +1 -0
- package/hooks/teamai-friction-reminder/action.zh.md +1 -0
- package/hooks/teamai-friction-reminder/gap-reasons.md +1 -0
- package/hooks/teamai-friction-reminder/gap-reasons.zh.md +1 -0
- package/hooks/teamai-friction-reminder/gap.md +1 -0
- package/hooks/teamai-friction-reminder/gap.zh.md +1 -0
- package/hooks/teamai-friction-reminder/params.yaml +12 -0
- package/hooks/teamai-friction-reminder/problem-reasons.md +1 -0
- package/hooks/teamai-friction-reminder/problem-reasons.zh.md +1 -0
- package/hooks/teamai-friction-reminder/problem.md +1 -0
- package/hooks/teamai-friction-reminder/problem.zh.md +1 -0
- package/hooks/teamai-friction-reminder/reason-correction.md +1 -0
- package/hooks/teamai-friction-reminder/reason-correction.zh.md +1 -0
- package/hooks/teamai-friction-reminder/reason-interrupt.md +1 -0
- package/hooks/teamai-friction-reminder/reason-interrupt.zh.md +1 -0
- package/hooks/teamai-friction-reminder/reason-tool-error.md +1 -0
- package/hooks/teamai-friction-reminder/reason-tool-error.zh.md +1 -0
- package/hooks/teamai-friction-reminder/reason-tool-reject.md +1 -0
- package/hooks/teamai-friction-reminder/reason-tool-reject.zh.md +1 -0
- package/hooks/teamai-friction-reminder/task.md +1 -0
- package/hooks/teamai-friction-reminder/task.zh.md +1 -0
- package/hooks/teamai-mr-hint/HOOK.yaml +1 -0
- package/hooks/teamai-mr-hint/README.md +81 -0
- package/hooks/teamai-mr-hint/README.zh-CN.md +81 -0
- package/hooks/teamai-mr-hint/offer-command.en.md +7 -0
- package/hooks/teamai-mr-hint/offer-command.md +10 -0
- package/hooks/teamai-mr-hint/offer-workflow.en.md +7 -0
- package/hooks/teamai-mr-hint/offer-workflow.md +10 -0
- package/hooks/teamai-mr-hint/params.yaml +2 -0
- package/hooks/teamai-package-hint/HOOK.yaml +1 -0
- package/hooks/teamai-package-hint/README.md +64 -0
- package/hooks/teamai-package-hint/README.zh-CN.md +64 -0
- package/hooks/teamai-package-hint/message.md +3 -0
- package/hooks/teamai-todowrite-hint/HOOK.yaml +1 -0
- package/hooks/teamai-todowrite-hint/README.md +68 -0
- package/hooks/teamai-todowrite-hint/README.zh-CN.md +68 -0
- package/hooks/teamai-todowrite-hint/message.en.md +6 -0
- package/hooks/teamai-todowrite-hint/message.md +9 -0
- package/package.json +41 -14
- package/rules/teamai-recall/README.md +78 -0
- package/rules/teamai-recall/README.zh-CN.md +78 -0
- package/rules/teamai-recall/RULE.en.md +36 -0
- package/rules/teamai-recall/RULE.md +43 -0
- package/rules/teamai-recall/block-direct.md +27 -0
- package/rules/teamai-recall/block.en.md +42 -0
- package/rules/teamai-recall/block.md +44 -0
- package/runtimes/teamai-paseo.yaml +5 -0
- package/runtimes/teamai-sandbox.yaml +3 -0
- package/runtimes/teamai-t3.yaml +5 -0
- package/sandboxes/teamai-bwrap.yaml +2 -0
- package/sandboxes/teamai-default.yaml +4 -0
- package/sandboxes/teamai-docker.yaml +5 -0
- package/sandboxes/teamai-podman.yaml +4 -0
- package/sandboxes/teamai-sbx.yaml +4 -0
- package/sandboxes/teamai-seatbelt.yaml +2 -0
- package/sandboxes/teamai-vercel.yaml +4 -0
- package/scorers/README.md +103 -0
- package/scorers/README.zh-CN.md +103 -0
- package/scorers/teamai-adoption.md +11 -0
- package/scorers/teamai-correctness.md +17 -0
- package/scorers/teamai-routing.md +11 -0
- package/skill-data/core/SKILL.md +4 -3
- package/skill-data/core/references/commands.md +300 -67
- package/skill-data/core/references/contribute-member.md +4 -4
- package/skill-data/core/references/troubleshooting.md +128 -18
- package/skill-data/setup/references/join-member.md +13 -9
- package/skill-data/setup/references/manage-admin.md +41 -17
- package/skill-data/setup/references/setup-admin.md +2 -2
- package/skill-data/setup/references/uninstall.md +30 -9
- package/skill-data/share/SKILL.md +17 -12
- package/skill-data/share/references/doc-template.md +3 -4
- package/skill-data/wiki/SKILL.md +1 -1
- package/skill-data/wiki/references/agents/graph-rag-agent.md +5 -1
- package/skill-data/workflow/SKILL.md +39 -16
- package/skill-data/workflow/references/fleet.md +13 -0
- package/skill-data/workflow/references/judging.md +17 -10
- package/skill-data/workflow/references/places.md +64 -7
- package/skill-data/workflow/references/sandbox.md +3 -3
- package/skill-data/workflow/references/session-hosts.md +27 -0
- package/skill-data/workflow-local/SKILL.md +4 -3
- package/skill-data/workflow-local/references/ci.md +1 -1
- package/skills/teamai/SKILL.md +4 -3
- package/workflows/README.md +103 -0
- package/workflows/README.zh-CN.md +103 -0
- package/workflows/teamai-benchmark.yaml +78 -0
- package/workflows/teamai-ci-extract-mr.yaml +66 -0
- package/workflows/teamai-codebase-deep-enrich/README.md +123 -0
- package/workflows/teamai-codebase-deep-enrich/README.zh-CN.md +123 -0
- package/workflows/teamai-codebase-deep-enrich/WORKFLOW.yaml +119 -0
- package/workflows/teamai-codebase-deep-enrich/architecture.md +30 -0
- package/workflows/teamai-codebase-deep-enrich/component.md +30 -0
- package/workflows/teamai-codebase-deep-enrich/params.yaml +1 -0
- package/workflows/teamai-codebase-deep-enrich/scenarios.md +32 -0
- package/workflows/teamai-codebase-enrich.yaml +98 -0
- package/workflows/teamai-draft-learning-updates/README.md +116 -0
- package/workflows/teamai-draft-learning-updates/README.zh-CN.md +116 -0
- package/workflows/teamai-draft-learning-updates/WORKFLOW.yaml +61 -0
- package/workflows/teamai-draft-learning-updates/params.yaml +4 -0
- package/workflows/teamai-finished-sessions/README.md +101 -0
- package/workflows/teamai-finished-sessions/README.zh-CN.md +101 -0
- package/workflows/teamai-finished-sessions/WORKFLOW.yaml +43 -0
- package/workflows/teamai-finished-sessions/params.yaml +1 -0
- package/workflows/teamai-import-from-iwiki.yaml +90 -0
- package/workflows/teamai-import-from-mr/README.md +104 -0
- package/workflows/teamai-import-from-mr/README.zh-CN.md +104 -0
- package/workflows/teamai-import-from-mr/WORKFLOW.yaml +94 -0
- package/workflows/teamai-import-from-mr/draft.en.md +48 -0
- package/workflows/teamai-import-from-mr/draft.zh.md +48 -0
- package/workflows/teamai-import-from-repo/README.md +106 -0
- package/workflows/teamai-import-from-repo/README.zh-CN.md +106 -0
- package/workflows/teamai-import-from-repo/WORKFLOW.yaml +109 -0
- package/workflows/teamai-import-from-repo/narrative.md +83 -0
- package/workflows/teamai-import-learnings.yaml +83 -0
- package/workflows/teamai-import-rules.yaml +34 -0
- package/workflows/teamai-new-scorer.yaml +54 -0
- package/workflows/teamai-promote-learning/README.md +122 -0
- package/workflows/teamai-promote-learning/README.zh-CN.md +122 -0
- package/workflows/teamai-promote-learning/WORKFLOW.yaml +102 -0
- package/workflows/teamai-promote-learning/params.yaml +4 -0
- package/workflows/teamai-score.yaml +121 -0
- package/workflows/teamai-self-improvement.yaml +37 -0
- package/workflows/teamai-session-to-task.yaml +69 -0
- package/workflows/teamai-sessions-to-tasks.yaml +62 -0
- package/workflows/teamai-share-learnings-from-sessions.yaml +36 -0
- package/workflows/teamai-share-learnings.yaml +25 -0
- package/workflows/teamai-share-session.yaml +21 -0
- package/workflows/teamai-try-scorer.yaml +32 -0
- package/skill-data/workflow/references/hosts.md +0 -27
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
# teamai-recall
|
|
2
|
+
|
|
3
|
+
English | [中文](README.zh-CN.md)
|
|
4
|
+
|
|
5
|
+
The rule and the instruction blocks that tell an AI tool to search the team knowledge base before a task.
|
|
6
|
+
|
|
7
|
+
## Where pull writes each file
|
|
8
|
+
|
|
9
|
+
```mermaid
|
|
10
|
+
flowchart TD
|
|
11
|
+
pull([teamai pull, for each tool]) --> on{Recall on?}
|
|
12
|
+
on -- no --> gone([Writes nothing, and removes the copies it wrote])
|
|
13
|
+
on -- yes --> src["The team's files when pull accepts the team repo's rules/teamai-recall/, else teamai's"]
|
|
14
|
+
src --> rule{language: en?}
|
|
15
|
+
rule -- yes --> r1["RULE.en.md, as the tool's rules/teamai-recall"]
|
|
16
|
+
rule -- no --> r2["RULE.md, as the tool's rules/teamai-recall"]
|
|
17
|
+
src --> sub{The tool has the teamai-recall subagent?}
|
|
18
|
+
sub -- yes --> b1["block.md, or block.en.md with language: en"]
|
|
19
|
+
sub -- no --> b2["block-direct.md, or block-direct.en.md with language: en when it exists"]
|
|
20
|
+
b1 & b2 --> hook{The tool takes instructions from a session-start hook?}
|
|
21
|
+
hook -- yes --> h1([The session-start hook adds the block])
|
|
22
|
+
hook -- no --> h2([The block goes in the tool's instruction file])
|
|
23
|
+
classDef file fill:#3b6ea5,stroke:#2b5079,color:#fff;
|
|
24
|
+
classDef out fill:#2f8f4f,stroke:#1f6b39,color:#fff;
|
|
25
|
+
classDef skip fill:#6b6b6b,stroke:#4a4a4a,color:#fff;
|
|
26
|
+
class r1,r2,b1,b2 file;
|
|
27
|
+
class h1,h2 out;
|
|
28
|
+
class gone skip;
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
| File | Pull writes it |
|
|
32
|
+
|---|---|
|
|
33
|
+
| `RULE*.md` | To each tool's rules directory, as `teamai-recall<ext>` |
|
|
34
|
+
| `block*.md` | Into the instruction file, between the block markers and a `DO NOT EDIT` line |
|
|
35
|
+
| `README*.md` | Never |
|
|
36
|
+
|
|
37
|
+
Pull turns CRLF into LF and drops one trailing newline. The files hold no template variables.
|
|
38
|
+
|
|
39
|
+
## Replace it
|
|
40
|
+
|
|
41
|
+
Put only the files you change in `rules/teamai-recall/` at the root of the team repo. Every other file stays teamai's and keeps getting teamai's updates:
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
mkdir -p rules/teamai-recall
|
|
45
|
+
cp "$(npm root -g)/teamai-cli/rules/teamai-recall/RULE.md" rules/teamai-recall/
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
Then add your own text to it, such as a skip condition:
|
|
49
|
+
|
|
50
|
+
```markdown
|
|
51
|
+
## Skip for generated code
|
|
52
|
+
|
|
53
|
+
A change under `gen/` needs no team knowledge.
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
Your `RULE.md` replaces every language of the rule: with `language: en`, members read it instead of teamai's `RULE.en.md`. Copy `RULE.en.md` too, and change it the same way, to keep an English rule of your own.
|
|
57
|
+
|
|
58
|
+
Push the folder. The next `teamai pull` gives every member the team's files over teamai's. `teamai push` never publishes the rule.
|
|
59
|
+
|
|
60
|
+
## What a replacement keeps
|
|
61
|
+
|
|
62
|
+
| File | Must | Why |
|
|
63
|
+
|---|---|---|
|
|
64
|
+
| `RULE.md`, `block.md`, `block-direct.md` | Exist when the folder has a language of it | A language you write replaces teamai's base file too, and a missing language file falls back to the team's base file, never to teamai's |
|
|
65
|
+
| Every `RULE*.md` | Contain `Nothing was searched:` and `Recall skips the older index` | Recall prints those lines, and the rule tells the agent what to do with them |
|
|
66
|
+
| Every `block-direct*.md` | Contain `Nothing was searched:` | The same |
|
|
67
|
+
| Every file | Name no `${TEAMAI_RULE_DIR}` | Pull delivers only the files above, as text. Put an example in the file itself |
|
|
68
|
+
|
|
69
|
+
Pull checks the folder your files and teamai's make together. When it breaks one of these, pull names the file and keeps teamai's folder. A file teamai's folder does not have replaces nothing: pull warns, names it, and leaves it out, and `teamai review --branch` fails it.
|
|
70
|
+
|
|
71
|
+
## Settings that change it
|
|
72
|
+
|
|
73
|
+
| Setting | Team `teamai.yaml` | Member config | Environment | Effect |
|
|
74
|
+
|---|---|---|---|---|
|
|
75
|
+
| Recall | `sharing.recall.enabled` | `recallEnabled`, which `teamai recall enable` sets | `TEAMAI_RECALL_DISABLED=1` | When off, pull writes neither the rule nor the blocks |
|
|
76
|
+
| Language | `language` | | | `en` picks the `.en.md` files |
|
|
77
|
+
|
|
78
|
+
The member config is `~/.teamai/projects/<slug>/config.yaml` in a workspace, then `~/.teamai/config.yaml`. The environment wins over the member config, and the member config wins over the team. See [member settings](https://github.com/Tencent/teamai-cli/blob/main/docs/guide/reference.md#member-settings) for the defaults.
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
# teamai-recall
|
|
2
|
+
|
|
3
|
+
[English](README.md) | 中文
|
|
4
|
+
|
|
5
|
+
让 AI 工具在任务开始前检索团队知识库的 rule 和指令块。
|
|
6
|
+
|
|
7
|
+
## pull 把每个文件写到哪里
|
|
8
|
+
|
|
9
|
+
```mermaid
|
|
10
|
+
flowchart TD
|
|
11
|
+
pull(["teamai pull,对每个工具"]) --> on{"recall 开启?"}
|
|
12
|
+
on -- 否 --> gone(["什么都不写,并删除它写过的副本"])
|
|
13
|
+
on -- 是 --> src["pull 接受团队仓库的 rules/teamai-recall/ 时用团队的文件,否则用 teamai 的"]
|
|
14
|
+
src --> rule{"language: en?"}
|
|
15
|
+
rule -- 是 --> r1["RULE.en.md,作为该工具的 rules/teamai-recall"]
|
|
16
|
+
rule -- 否 --> r2["RULE.md,作为该工具的 rules/teamai-recall"]
|
|
17
|
+
src --> sub{"该工具有 teamai-recall subagent?"}
|
|
18
|
+
sub -- 是 --> b1["block.md,language: en 时用 block.en.md"]
|
|
19
|
+
sub -- 否 --> b2["block-direct.md,language: en 且 block-direct.en.md 存在时用它"]
|
|
20
|
+
b1 & b2 --> hook{"该工具从会话开始时的 hook 获取指令?"}
|
|
21
|
+
hook -- 是 --> h1(["会话开始时的 hook 加上这个块"])
|
|
22
|
+
hook -- 否 --> h2(["这个块写进该工具的指令文件"])
|
|
23
|
+
classDef file fill:#3b6ea5,stroke:#2b5079,color:#fff;
|
|
24
|
+
classDef out fill:#2f8f4f,stroke:#1f6b39,color:#fff;
|
|
25
|
+
classDef skip fill:#6b6b6b,stroke:#4a4a4a,color:#fff;
|
|
26
|
+
class r1,r2,b1,b2 file;
|
|
27
|
+
class h1,h2 out;
|
|
28
|
+
class gone skip;
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
| 文件 | pull 把它写到 |
|
|
32
|
+
|---|---|
|
|
33
|
+
| `RULE*.md` | 每个工具的 rules 目录,文件名为 `teamai-recall<ext>` |
|
|
34
|
+
| `block*.md` | 指令文件里,放在块标记和一行 `DO NOT EDIT` 之间 |
|
|
35
|
+
| `README*.md` | 从不写入 |
|
|
36
|
+
|
|
37
|
+
pull 会把 CRLF 换成 LF,并去掉末尾的一个换行。这些文件里没有模板变量。
|
|
38
|
+
|
|
39
|
+
## 替换它
|
|
40
|
+
|
|
41
|
+
在团队仓库根目录的 `rules/teamai-recall/` 里只放你要改的文件。其他文件仍用 teamai 的,并继续获得 teamai 的更新:
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
mkdir -p rules/teamai-recall
|
|
45
|
+
cp "$(npm root -g)/teamai-cli/rules/teamai-recall/RULE.md" rules/teamai-recall/
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
然后在里面加上你自己的文字,例如一个跳过条件:
|
|
49
|
+
|
|
50
|
+
```markdown
|
|
51
|
+
## Skip for generated code
|
|
52
|
+
|
|
53
|
+
A change under `gen/` needs no team knowledge.
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
你的 `RULE.md` 会替换这条 rule 的所有语言版本:设了 `language: en` 时,成员读到的是它,而不是 teamai 的 `RULE.en.md`。想保留自己的英文 rule,把 `RULE.en.md` 也复制过来,并同样修改。
|
|
57
|
+
|
|
58
|
+
推送这个文件夹。下一次 `teamai pull` 会让每个成员拿到团队的文件,其余文件仍用 teamai 的。`teamai push` 从不发布这条 rule。
|
|
59
|
+
|
|
60
|
+
## 替换要保留什么
|
|
61
|
+
|
|
62
|
+
| 文件 | 必须 | 原因 |
|
|
63
|
+
|---|---|---|
|
|
64
|
+
| `RULE.md`、`block.md`、`block-direct.md` | 目录里有它的某个语言版本时存在 | 你写的语言版本也会替换 teamai 的基础文件;缺少某个语言文件时,回退到团队自己的基础文件,不会回退到 teamai 的 |
|
|
65
|
+
| 每个 `RULE*.md` | 包含 `Nothing was searched:` 和 `Recall skips the older index` | recall 会打印这些行,rule 告诉 agent 遇到它们时该怎么做 |
|
|
66
|
+
| 每个 `block-direct*.md` | 包含 `Nothing was searched:` | 同上 |
|
|
67
|
+
| 每个文件 | 不写 `${TEAMAI_RULE_DIR}` | pull 只以文本形式交付上面这些文件。示例请直接写进文件里 |
|
|
68
|
+
|
|
69
|
+
pull 检查你的文件和 teamai 的文件合起来的目录。违反其中任何一条时,pull 会指出是哪个文件,并继续使用 teamai 的文件夹。teamai 目录里没有的文件不替换任何东西:pull 会警告、点出文件名并忽略它,`teamai review --branch` 会把它判为失败。
|
|
70
|
+
|
|
71
|
+
## 影响它的设置
|
|
72
|
+
|
|
73
|
+
| 设置 | 团队 `teamai.yaml` | 成员配置 | 环境变量 | 作用 |
|
|
74
|
+
|---|---|---|---|---|
|
|
75
|
+
| Recall | `sharing.recall.enabled` | `recallEnabled`,由 `teamai recall enable` 设置 | `TEAMAI_RECALL_DISABLED=1` | 关闭时,pull 既不写 rule,也不写指令块 |
|
|
76
|
+
| 语言 | `language` | | | `en` 选用 `.en.md` 文件 |
|
|
77
|
+
|
|
78
|
+
成员配置在工作区里是 `~/.teamai/projects/<slug>/config.yaml`,其次是 `~/.teamai/config.yaml`。环境变量优先于成员配置,成员配置优先于团队。默认值见[成员设置](https://github.com/Tencent/teamai-cli/blob/main/docs/guide/zh-CN/reference.md#成员设置)。
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# Team Knowledge Recall (teamai)
|
|
2
|
+
|
|
3
|
+
> **Self-exemption (must read first):** If you ARE the `teamai-recall` subagent yourself, this rule does NOT apply to you — do not invoke `teamai-recall` (or any recall) again. Proceed directly to performing the knowledge search that is your task. This prevents infinite subagent recursion in tools (e.g. Cursor) whose always-apply rules leak into subagent sessions.
|
|
4
|
+
|
|
5
|
+
## Rule: search the team knowledge base before a task (recommended)
|
|
6
|
+
|
|
7
|
+
**Before** starting a task that involves code changes, debugging,
|
|
8
|
+
or design decisions, you **SHOULD** search the team knowledge base
|
|
9
|
+
— unless one of the skip conditions below applies.
|
|
10
|
+
|
|
11
|
+
### Skip conditions (any one is enough to skip the search)
|
|
12
|
+
|
|
13
|
+
1. **The user already provided context** — the message names files, gives a solution, or says the answer is in the current directory or this file
|
|
14
|
+
2. **The local files already have the answer** — the task can be done from the current workspace (for example, an obvious bug in the file being edited)
|
|
15
|
+
3. **A small or local change** — a narrow edit to a known file (a typo, a parameter value, formatting) that needs no extra background
|
|
16
|
+
|
|
17
|
+
### Option 1: Subagent (preferred when the tool has an Agent tool)
|
|
18
|
+
|
|
19
|
+
Call the `teamai-recall` subagent (in the agents/ directory) with a natural-language description of the task.
|
|
20
|
+
It returns a structured summary of team knowledge (skills, learnings, docs, rules, codebase).
|
|
21
|
+
|
|
22
|
+
### Option 2: Bash command (works in every tool)
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
teamai recall "<keyword1> <keyword2> ..."
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Extract 3-6 high-signal keywords from the task description.
|
|
29
|
+
|
|
30
|
+
If the output contains `Nothing was searched:`, this project's teamai config cannot be
|
|
31
|
+
read and no team knowledge was searched: show that line to the user rather than
|
|
32
|
+
concluding the team has no knowledge, and do not move the file or run `teamai init`
|
|
33
|
+
without their consent. If it contains `Recall skips the older index`, that scope was not
|
|
34
|
+
searched: relay that warning rather than conclude the team has no knowledge there.
|
|
35
|
+
|
|
36
|
+
**Search in both languages (cross-language recall):** the knowledge base mixes English and Chinese, and search is lexical, so a query in one language misses documents written only in the other. Give each domain term in both languages in the same query. Translate only terms whose English and Chinese forms actually differ. Leave every language-independent token unchanged — proper nouns, brand and product names, abbreviations, code identifiers and symbols, error codes, versions, file paths, commands, and API names (`AppID`, `Kubernetes`, `GPU`, `RuntimeError`, `v2.1.3`, `oauth`). Translating those only hurts matching.
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# Team Knowledge Recall (teamai)
|
|
2
|
+
|
|
3
|
+
> **Self-exemption (must read first):** If you ARE the `teamai-recall` subagent yourself, this rule does NOT apply to you — do not invoke `teamai-recall` (or any recall) again. Proceed directly to performing the knowledge search that is your task. This prevents infinite subagent recursion in tools (e.g. Cursor) whose always-apply rules leak into subagent sessions.
|
|
4
|
+
>
|
|
5
|
+
> **自豁免(务必先读):** 如果你自己就是 `teamai-recall` subagent,本规则对你不适用——不要再调用 `teamai-recall`(或任何 recall),直接执行你本职的知识检索任务。此举防止在(如 Cursor 等)会把 always-apply 规则泄漏进 subagent 会话的工具中发生无限递归。
|
|
6
|
+
|
|
7
|
+
## 规则:任务开始前检索团队知识库(推荐)
|
|
8
|
+
|
|
9
|
+
**Before** starting a task that involves code changes, debugging,
|
|
10
|
+
or design decisions, you **SHOULD** search the team knowledge base
|
|
11
|
+
— unless one of the skip conditions below applies.
|
|
12
|
+
|
|
13
|
+
### 跳过条件(满足任一即可跳过检索)
|
|
14
|
+
|
|
15
|
+
1. **用户已提供上下文** — 用户在消息中明确引用了文件、给出了解决方案、或说明"答案在当前目录/这个文件里"
|
|
16
|
+
2. **本地文件已有答案** — 任务信息可直接从当前工作区文件获得(如修复当前文件中明显的 bug)
|
|
17
|
+
3. **简单/局部改动** — 对已知文件做小范围修改(修 typo、调整参数值、改格式),无需额外知识背景
|
|
18
|
+
|
|
19
|
+
### 方式一:通过 Subagent(推荐,适用于支持 Agent tool 的工具)
|
|
20
|
+
|
|
21
|
+
调用 `teamai-recall` subagent(位于 agents/ 目录),传入任务的自然语言描述。
|
|
22
|
+
Subagent 会返回结构化的团队知识摘要(skills、learnings、docs、rules、codebase)。
|
|
23
|
+
|
|
24
|
+
### 方式二:通过 Bash 命令(适用于所有工具)
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
teamai recall "<关键词1> <关键词2> ..."
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
从任务描述中提取 3-6 个高信号关键词进行检索。
|
|
31
|
+
|
|
32
|
+
If the output contains `Nothing was searched:`, this project's teamai config cannot be
|
|
33
|
+
read and no team knowledge was searched: show that line to the user rather than
|
|
34
|
+
concluding the team has no knowledge, and do not move the file or run `teamai init`
|
|
35
|
+
without their consent. If it contains `Recall skips the older index`, that scope was not
|
|
36
|
+
searched: relay that warning rather than conclude the team has no knowledge there.
|
|
37
|
+
|
|
38
|
+
**务必中英双语检索(跨语言召回)**:知识库中英文混杂,检索是纯词法匹配,
|
|
39
|
+
中文 query 无法命中纯英文文档,反之亦然。因此每个领域术语都应**同时给出中英两种写法**
|
|
40
|
+
一起检索,例如「重启推理集群」应扩展为 `重启 推理 集群 restart inference cluster`;
|
|
41
|
+
只翻译中英确实不同的术语;任何**语言无关的 token**(中英写法相同、或无实际译法者)一律保持原样,
|
|
42
|
+
例如专有名词、品牌与产品名、缩写、代码标识符与符号、错误码、版本号、文件路径、命令与 API 名
|
|
43
|
+
(`AppID`、`Kubernetes`、`GPU`、`RuntimeError`、`v2.1.3`、`oauth`)——翻译它们只会损害匹配。
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
## Team Knowledge Recall (teamai)
|
|
2
|
+
|
|
3
|
+
**Before** starting a task that involves code changes, debugging,
|
|
4
|
+
or design decisions, you **SHOULD** search the team knowledge base
|
|
5
|
+
(learnings, docs, skills, rules and the codebase wiki) by running:
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
teamai recall "<3-6 high-signal keywords from the task>"
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
unless one of these skip conditions applies:
|
|
12
|
+
|
|
13
|
+
1. **User already provided context** — the user referenced specific files,
|
|
14
|
+
gave a solution, or said "the answer is in this directory/file".
|
|
15
|
+
2. **Local files have the answer** — the task info is directly available
|
|
16
|
+
from the current workspace (e.g. fixing an obvious bug in the current file).
|
|
17
|
+
3. **Trivial/local change** — small modifications to known files (typo fix,
|
|
18
|
+
parameter tweak, formatting) that need no additional knowledge.
|
|
19
|
+
4. **Task domain is outside team knowledge coverage** — the task is
|
|
20
|
+
unrelated to this team's systems/workflows. `teamai recall --check "<keywords>"`
|
|
21
|
+
answers `RELEVANT` or `NOT_RELEVANT` without reading anything.
|
|
22
|
+
|
|
23
|
+
Matching is lexical: give each domain term in every language the team
|
|
24
|
+
writes in, and keep names, identifiers, error codes and paths as they are.
|
|
25
|
+
Read the files recall returns for their full content. If its output contains
|
|
26
|
+
`Nothing was searched:`, show that line to the user instead of concluding the
|
|
27
|
+
team has no knowledge on the topic.
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
## Team Knowledge Recall (teamai)
|
|
2
|
+
|
|
3
|
+
> **Self-exemption (must read first):** If you ARE the `teamai-recall` subagent yourself, this rule does NOT apply to you — do not invoke `teamai-recall` (or any recall) again. Proceed directly to performing the knowledge search that is your task. This prevents infinite subagent recursion in tools (e.g. Cursor) whose always-apply rules leak into subagent sessions.
|
|
4
|
+
|
|
5
|
+
**Before** starting a task that involves code changes, debugging,
|
|
6
|
+
or design decisions, you **SHOULD** invoke the `teamai-recall`
|
|
7
|
+
subagent via the Agent tool with a concise natural-language
|
|
8
|
+
description of the task — unless one of these skip conditions applies:
|
|
9
|
+
|
|
10
|
+
1. **User already provided context** — the user referenced specific files,
|
|
11
|
+
gave a solution, or said "the answer is in this directory/file".
|
|
12
|
+
2. **Local files have the answer** — the task info is directly available
|
|
13
|
+
from the current workspace (e.g. fixing an obvious bug in the current file).
|
|
14
|
+
3. **Trivial/local change** — small modifications to known files (typo fix,
|
|
15
|
+
parameter tweak, formatting) that need no additional knowledge.
|
|
16
|
+
4. **Task domain is outside team knowledge coverage** — the task is
|
|
17
|
+
unrelated to this team's systems/workflows (e.g. generic language
|
|
18
|
+
questions, pure frontend styling with no team-specific context).
|
|
19
|
+
The recall subagent also runs a relevance precheck and returns fast
|
|
20
|
+
for unrelated tasks, but skipping outright saves a subagent round-trip.
|
|
21
|
+
|
|
22
|
+
The subagent will return a compact summary of relevant team knowledge
|
|
23
|
+
(skills, learnings, docs, rules) without polluting this conversation
|
|
24
|
+
with raw content. For **feature/large tasks**, recall returns a
|
|
25
|
+
"Candidate change files" list — check your planned changes cover all
|
|
26
|
+
listed files before starting. For **bugfix/small tasks**, recall runs
|
|
27
|
+
a lighter pass and you may skip it entirely per condition 2–3 above.
|
|
28
|
+
|
|
29
|
+
**Important constraints on agent sequencing (when recall is invoked):**
|
|
30
|
+
1. Invoke `teamai-recall` subagent **first and alone** — never
|
|
31
|
+
launch it in parallel with Explore or other research agents.
|
|
32
|
+
2. After recall returns results, use Read to get full content of the
|
|
33
|
+
returned files if you need more detail. Do NOT launch Explore agents
|
|
34
|
+
to search for the same topics — recall results + Read is the complete
|
|
35
|
+
workflow for accessing team knowledge.
|
|
36
|
+
3. Explore/research agents have their own scope and must NOT overlap
|
|
37
|
+
with recall:
|
|
38
|
+
- **recall subagent covers:** team learnings, codebase docs, skills,
|
|
39
|
+
rules, and anything under `.teamai/`, `learnings/`, `docs/team-codebase/`.
|
|
40
|
+
- **Explore agents cover:** navigating source code in the current
|
|
41
|
+
working directory, and web search for external information.
|
|
42
|
+
- Explore agents must never search paths covered by recall.
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
## Team Knowledge Recall (teamai)
|
|
2
|
+
|
|
3
|
+
> **Self-exemption (must read first):** If you ARE the `teamai-recall` subagent yourself, this rule does NOT apply to you — do not invoke `teamai-recall` (or any recall) again. Proceed directly to performing the knowledge search that is your task. This prevents infinite subagent recursion in tools (e.g. Cursor) whose always-apply rules leak into subagent sessions.
|
|
4
|
+
>
|
|
5
|
+
> **自豁免(务必先读):** 如果你自己就是 `teamai-recall` subagent,本规则对你不适用——不要再调用 `teamai-recall`(或任何 recall),直接执行你本职的知识检索任务。此举防止在(如 Cursor 等)会把 always-apply 规则泄漏进 subagent 会话的工具中发生无限递归。
|
|
6
|
+
|
|
7
|
+
**Before** starting a task that involves code changes, debugging,
|
|
8
|
+
or design decisions, you **SHOULD** invoke the `teamai-recall`
|
|
9
|
+
subagent via the Agent tool with a concise natural-language
|
|
10
|
+
description of the task — unless one of these skip conditions applies:
|
|
11
|
+
|
|
12
|
+
1. **User already provided context** — the user referenced specific files,
|
|
13
|
+
gave a solution, or said "the answer is in this directory/file".
|
|
14
|
+
2. **Local files have the answer** — the task info is directly available
|
|
15
|
+
from the current workspace (e.g. fixing an obvious bug in the current file).
|
|
16
|
+
3. **Trivial/local change** — small modifications to known files (typo fix,
|
|
17
|
+
parameter tweak, formatting) that need no additional knowledge.
|
|
18
|
+
4. **Task domain is outside team knowledge coverage** — the task is
|
|
19
|
+
unrelated to this team's systems/workflows (e.g. generic language
|
|
20
|
+
questions, pure frontend styling with no team-specific context).
|
|
21
|
+
The recall subagent also runs a relevance precheck and returns fast
|
|
22
|
+
for unrelated tasks, but skipping outright saves a subagent round-trip.
|
|
23
|
+
|
|
24
|
+
The subagent will return a compact summary of relevant team knowledge
|
|
25
|
+
(skills, learnings, docs, rules) without polluting this conversation
|
|
26
|
+
with raw content. For **feature/large tasks**, recall returns a
|
|
27
|
+
"Candidate change files" list — check your planned changes cover all
|
|
28
|
+
listed files before starting. For **bugfix/small tasks**, recall runs
|
|
29
|
+
a lighter pass and you may skip it entirely per condition 2–3 above.
|
|
30
|
+
|
|
31
|
+
**Important constraints on agent sequencing (when recall is invoked):**
|
|
32
|
+
1. Invoke `teamai-recall` subagent **first and alone** — never
|
|
33
|
+
launch it in parallel with Explore or other research agents.
|
|
34
|
+
2. After recall returns results, use Read to get full content of the
|
|
35
|
+
returned files if you need more detail. Do NOT launch Explore agents
|
|
36
|
+
to search for the same topics — recall results + Read is the complete
|
|
37
|
+
workflow for accessing team knowledge.
|
|
38
|
+
3. Explore/research agents have their own scope and must NOT overlap
|
|
39
|
+
with recall:
|
|
40
|
+
- **recall subagent covers:** team learnings, codebase docs, skills,
|
|
41
|
+
rules, and anything under `.teamai/`, `learnings/`, `docs/team-codebase/`.
|
|
42
|
+
- **Explore agents cover:** navigating source code in the current
|
|
43
|
+
working directory, and web search for external information.
|
|
44
|
+
- Explore agents must never search paths covered by recall.
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
# teamai's paseo runtime. A team replaces it with runtimes/paseo.yaml, or runtimes/paseo/RUNTIME.yaml with its code.
|
|
2
|
+
protocol: 1
|
|
3
|
+
entry: { bin: teamai-runtime-paseo }
|
|
4
|
+
# It runs no command, so a run that needs no AI tool does not start it. Its init offers can.exec: false too.
|
|
5
|
+
exec: false
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
# teamai's t3 runtime. A team replaces it with runtimes/t3.yaml, or runtimes/t3/RUNTIME.yaml with its code.
|
|
2
|
+
protocol: 1
|
|
3
|
+
entry: { bin: teamai-runtime-t3 }
|
|
4
|
+
# It runs no command, so a run that needs no AI tool does not start it. Its init offers can.exec: false too.
|
|
5
|
+
exec: false
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
# The sandbox a driver's `use: sandbox` runs when its entry names no profile: a Docker Sandboxes (sbx) microVM per
|
|
2
|
+
# attempt, from the template of the step's tool, signed in on the login sbx keeps. A team replaces it with
|
|
3
|
+
# sandboxes/default.yaml, and a member with ~/.teamai/sandboxes/default.yaml.
|
|
4
|
+
provider: sbx
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
# A Docker container per attempt, from an image that holds the tools. Copy this file to sandboxes/<name>.yaml in the
|
|
2
|
+
# team repo and set image: used as it is, it fails naming image.
|
|
3
|
+
provider: docker
|
|
4
|
+
# image: ghcr.io/acme/agent:1
|
|
5
|
+
# warm: { containerfile: ./Containerfile, cache: [package-lock.json] } # in a profile folder, a file of the folder
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
# A Docker Sandboxes (sbx) microVM per attempt. Name it on a driver's entry with sandbox: sbx.
|
|
2
|
+
provider: sbx
|
|
3
|
+
# agent: claude # optional: the template each sandbox starts from; unset, each attempt starts from its own tool's
|
|
4
|
+
# warm: { prepare: npm ci --ignore-scripts, cache: [package-lock.json] } # optional: a saved template with dependencies installed
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
# Default scorers
|
|
2
|
+
|
|
3
|
+
English | [中文](README.zh-CN.md)
|
|
4
|
+
|
|
5
|
+
The rubrics of the questions teamai generates for each item of a judged session. Each `<name>.md` here is a scorer template, and teamai fills in its variables for each item. Its labels and its prompt are in the file. The [guide](https://github.com/Tencent/teamai-cli/blob/main/docs/guide/scorers.md#default-scorers) covers them in full.
|
|
6
|
+
|
|
7
|
+
| Default | Asks | Question name | Variables |
|
|
8
|
+
|---|---|---|---|
|
|
9
|
+
| `teamai-routing.md` | Whether each team skill loaded where the session needed it, and only there | `teamai:routing:<skill>`, or `teamai:routing:<namespace>:<skill>` | `skill.name` |
|
|
10
|
+
| `teamai-adoption.md` | Whether the session used a doc that recall gave it but that it never opened | `teamai:adoption:<hash>` | `doc.id`, `doc.path`, `doc.file` |
|
|
11
|
+
|
|
12
|
+
## Which questions a session gets
|
|
13
|
+
|
|
14
|
+
```mermaid
|
|
15
|
+
flowchart TD
|
|
16
|
+
done([A finished session]) --> judged{"The session policy for its mode is auto, or ask and the person confirmed?"}
|
|
17
|
+
judged -- no --> none([No question])
|
|
18
|
+
judged -- yes --> limit{Under daily_limit?}
|
|
19
|
+
limit -- no --> none
|
|
20
|
+
limit -- yes --> routing{skill_routing on?}
|
|
21
|
+
limit -- yes --> adoption{recall_adoption on?}
|
|
22
|
+
routing -- yes --> skills["One teamai-routing question for each skill in skills.available"]
|
|
23
|
+
adoption -- yes --> docs{"For each doc recall gave the session: the session opened it?"}
|
|
24
|
+
docs -- yes --> credit([Credited, with no judge])
|
|
25
|
+
docs -- no --> q2["One teamai-adoption question"]
|
|
26
|
+
skills & q2 --> judge(["teamai-score judges them. The questions of one default share one judge launch"])
|
|
27
|
+
classDef q fill:#3b6ea5,stroke:#2b5079,color:#fff;
|
|
28
|
+
classDef out fill:#2f8f4f,stroke:#1f6b39,color:#fff;
|
|
29
|
+
classDef skip fill:#6b6b6b,stroke:#4a4a4a,color:#fff;
|
|
30
|
+
class skills,q2 q;
|
|
31
|
+
class judge,credit out;
|
|
32
|
+
class none skip;
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
A session's mode is attended, or unattended in CI, on a cloud VM or with `TEAMAI_MODE=unattended`. On demand, `teamai score --session <id> --scorer teamai:routing:<skill>` asks one question whatever `skill_routing` says.
|
|
36
|
+
|
|
37
|
+
## Which rubric runs
|
|
38
|
+
|
|
39
|
+
```mermaid
|
|
40
|
+
flowchart TD
|
|
41
|
+
pull([teamai pull]) --> has{"The team repo has scorers/teamai-routing.md or scorers/teamai-adoption.md?"}
|
|
42
|
+
has -- no --> tai([teamai's rubric])
|
|
43
|
+
has -- yes --> vars{It reads only the variables its default offers?}
|
|
44
|
+
vars -- no --> warn([teamai's rubric, and pull names the variable])
|
|
45
|
+
vars -- yes --> fills{Filled in, it parses as a scorer?}
|
|
46
|
+
fills -- no --> warn
|
|
47
|
+
fills -- yes --> team([The team's rubric, for every member])
|
|
48
|
+
classDef out fill:#2f8f4f,stroke:#1f6b39,color:#fff;
|
|
49
|
+
classDef warn fill:#b5762f,stroke:#865520,color:#fff;
|
|
50
|
+
class tai,team out;
|
|
51
|
+
class warn warn;
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## Replace one
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
cp "$(npm root -g)/teamai-cli/scorers/teamai-adoption.md" scorers/
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
Then edit the copy, such as adding a judge model to its frontmatter:
|
|
61
|
+
|
|
62
|
+
```yaml
|
|
63
|
+
model: fast # a team alias from models/aliases.yaml
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
Push the file. The next `teamai pull` checks it and gives every member the team's rubric.
|
|
67
|
+
|
|
68
|
+
| Part of the file | Can change | Keep |
|
|
69
|
+
|---|---|---|
|
|
70
|
+
| `labels` | Yes. The values, the scores and the descriptions | Each `{{ … }}` inside a double-quoted string. The values teamai fills in hold quotes, colons and newlines |
|
|
71
|
+
| `passingScore` | Yes | |
|
|
72
|
+
| `model` | Yes, to a model name or a team alias | |
|
|
73
|
+
| The prompt after the frontmatter | Yes | Only the variables of the table above |
|
|
74
|
+
|
|
75
|
+
A changed rubric gives each question a new rubric hash, so the dashboard counts its labels apart from the old ones. The file is no scorer of its own: no step lists it, and `teamai score --scorer teamai-routing` finds nothing.
|
|
76
|
+
|
|
77
|
+
## Requires
|
|
78
|
+
|
|
79
|
+
| Needs | Without it |
|
|
80
|
+
|---|---|
|
|
81
|
+
| A judge, which is a tool and a model that the scorer's `model` resolves to | The judge step waits for a driver that can judge, and `teamai doctor` warns about the scorer |
|
|
82
|
+
| Recall on, for `teamai-adoption` | No session has recalled docs, so no adoption question |
|
|
83
|
+
| Team skills delivered to the session, for `teamai-routing` | No routing question |
|
|
84
|
+
|
|
85
|
+
## Settings that change them
|
|
86
|
+
|
|
87
|
+
| Setting | Team `scorers/scoring.yaml` | Member config | Environment | Effect |
|
|
88
|
+
|---|---|---|---|---|
|
|
89
|
+
| Session judging | `sessions: { attended, unattended }`, each `off`, `ask` or `auto` | `scoring.sessions` | `TEAMAI_MODE` and `CI` pick the mode | Decides which finished sessions get questions |
|
|
90
|
+
| Routing questions | `skill_routing` | `scoring.skill_routing` | | Turns the `teamai-routing` questions on or off |
|
|
91
|
+
| Adoption questions | `recall_adoption` | `scoring.recall_adoption` | | Turns the `teamai-adoption` questions on or off |
|
|
92
|
+
| Daily limit | `daily_limit` | `scoring.daily_limit` | | Caps how many sessions each workspace judges a day |
|
|
93
|
+
| Model alias | `models/aliases.yaml` | | | Maps an alias in `model`, such as `fast`, to each judge tool's model |
|
|
94
|
+
| Recall | `sharing.recall.enabled` in `teamai.yaml` | `recallEnabled` | `TEAMAI_RECALL_DISABLED=1` | When off, no session has recalled docs to ask about |
|
|
95
|
+
|
|
96
|
+
`scorers/<namespace>/scoring.yaml` overrides the root file for the members of an active namespace. When two active namespaces disagree on `sessions` or `daily_limit`, the stricter value wins.
|
|
97
|
+
|
|
98
|
+
| Member config | What it can do |
|
|
99
|
+
|---|---|
|
|
100
|
+
| `~/.teamai/projects/<slug>/config.yaml` | Turn any key on or off, or change it, for that workspace |
|
|
101
|
+
| `~/.teamai/config.yaml`, for every workspace on the machine | Only make judging stricter: turn a mode or a question off, or lower `daily_limit`. A machine never starts judging |
|
|
102
|
+
|
|
103
|
+
See [finished sessions](https://github.com/Tencent/teamai-cli/blob/main/docs/guide/scorers.md#finished-sessions) for the defaults, and [member settings](https://github.com/Tencent/teamai-cli/blob/main/docs/guide/reference.md#member-settings).
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
# 默认评分器
|
|
2
|
+
|
|
3
|
+
[English](README.md) | 中文
|
|
4
|
+
|
|
5
|
+
teamai 为被评判会话的每个条目生成问题,这里是这些问题的评分标准。这里每个 `<name>.md` 是一个评分器模板,teamai 为每个条目填入它的变量。它的标签和提示词在文件里。[指南](https://github.com/Tencent/teamai-cli/blob/main/docs/guide/zh-CN/scorers.md#默认评分器)有完整说明。
|
|
6
|
+
|
|
7
|
+
| 默认评分器 | 询问 | 问题名 | 变量 |
|
|
8
|
+
|---|---|---|---|
|
|
9
|
+
| `teamai-routing.md` | 每个团队 skill 是否在会话需要的地方加载,并且只在那里加载 | `teamai:routing:<skill>` 或 `teamai:routing:<namespace>:<skill>` | `skill.name` |
|
|
10
|
+
| `teamai-adoption.md` | 会话是否用上了 recall 给出、但它从未打开的文档 | `teamai:adoption:<hash>` | `doc.id`、`doc.path`、`doc.file` |
|
|
11
|
+
|
|
12
|
+
## 会话会收到哪些问题
|
|
13
|
+
|
|
14
|
+
```mermaid
|
|
15
|
+
flowchart TD
|
|
16
|
+
done(["一个已结束的会话"]) --> judged{"它所在模式的会话策略是 auto,或是 ask 且本人已确认?"}
|
|
17
|
+
judged -- 否 --> none(["没有问题"])
|
|
18
|
+
judged -- 是 --> limit{"未超过 daily_limit?"}
|
|
19
|
+
limit -- 否 --> none
|
|
20
|
+
limit -- 是 --> routing{"skill_routing 开启?"}
|
|
21
|
+
limit -- 是 --> adoption{"recall_adoption 开启?"}
|
|
22
|
+
routing -- 是 --> skills["skills.available 里的每个 skill 各一个 teamai-routing 问题"]
|
|
23
|
+
adoption -- 是 --> docs{"recall 给会话的每篇文档:会话打开过它?"}
|
|
24
|
+
docs -- 是 --> credit(["记入采纳,不经评审者"])
|
|
25
|
+
docs -- 否 --> q2["一个 teamai-adoption 问题"]
|
|
26
|
+
skills & q2 --> judge(["teamai-score 评判它们。同一个默认评分器的问题共用一次评审者启动"])
|
|
27
|
+
classDef q fill:#3b6ea5,stroke:#2b5079,color:#fff;
|
|
28
|
+
classDef out fill:#2f8f4f,stroke:#1f6b39,color:#fff;
|
|
29
|
+
classDef skip fill:#6b6b6b,stroke:#4a4a4a,color:#fff;
|
|
30
|
+
class skills,q2 q;
|
|
31
|
+
class judge,credit out;
|
|
32
|
+
class none skip;
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
会话的模式是有人值守,或无人值守:在 CI 中、在云虚拟机上,或设置了 `TEAMAI_MODE=unattended`。按需评分时,不管 `skill_routing` 怎么设,`teamai score --session <id> --scorer teamai:routing:<skill>` 都会提出一个问题。
|
|
36
|
+
|
|
37
|
+
## 运行哪份评分标准
|
|
38
|
+
|
|
39
|
+
```mermaid
|
|
40
|
+
flowchart TD
|
|
41
|
+
pull([teamai pull]) --> has{"团队仓库有 scorers/teamai-routing.md 或 scorers/teamai-adoption.md?"}
|
|
42
|
+
has -- 否 --> tai(["teamai 的评分标准"])
|
|
43
|
+
has -- 是 --> vars{"它只读取默认评分器提供的变量?"}
|
|
44
|
+
vars -- 否 --> warn(["teamai 的评分标准,pull 指出是哪个变量"])
|
|
45
|
+
vars -- 是 --> fills{"填入变量后,能解析为评分器?"}
|
|
46
|
+
fills -- 否 --> warn
|
|
47
|
+
fills -- 是 --> team(["团队的评分标准,每个成员都用它"])
|
|
48
|
+
classDef out fill:#2f8f4f,stroke:#1f6b39,color:#fff;
|
|
49
|
+
classDef warn fill:#b5762f,stroke:#865520,color:#fff;
|
|
50
|
+
class tai,team out;
|
|
51
|
+
class warn warn;
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## 替换其中一个
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
cp "$(npm root -g)/teamai-cli/scorers/teamai-adoption.md" scorers/
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
然后编辑副本,例如在 frontmatter 里加上评审模型:
|
|
61
|
+
|
|
62
|
+
```yaml
|
|
63
|
+
model: fast # a team alias from models/aliases.yaml
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
推送这个文件。下一次 `teamai pull` 会检查它,并让每个成员都用团队的评分标准。
|
|
67
|
+
|
|
68
|
+
| 文件的部分 | 能否修改 | 保留 |
|
|
69
|
+
|---|---|---|
|
|
70
|
+
| `labels` | 能。值、分数和描述都能改 | 每个 `{{ … }}` 都放在双引号字符串里。teamai 填入的值含有引号、冒号和换行 |
|
|
71
|
+
| `passingScore` | 能 | |
|
|
72
|
+
| `model` | 能,改为模型名或团队别名 | |
|
|
73
|
+
| frontmatter 之后的提示词 | 能 | 只用上表列出的变量 |
|
|
74
|
+
|
|
75
|
+
评分标准一改,每个问题就有新的评分标准哈希,所以面板把它的标签和旧标签分开计数。这个文件本身不是评分器:没有步骤列出它,`teamai score --scorer teamai-routing` 也找不到它。
|
|
76
|
+
|
|
77
|
+
## 依赖
|
|
78
|
+
|
|
79
|
+
| 需要 | 没有时 |
|
|
80
|
+
|---|---|
|
|
81
|
+
| 评审者,即评分器的 `model` 解析出的工具和模型 | 评判步骤等待一个能评判的驱动,`teamai doctor` 会对这个评分器发出警告 |
|
|
82
|
+
| `teamai-adoption` 需要 recall 开启 | 没有会话有召回的文档,所以没有采纳问题 |
|
|
83
|
+
| `teamai-routing` 需要团队 skill 已交付到会话 | 没有路由问题 |
|
|
84
|
+
|
|
85
|
+
## 影响它们的设置
|
|
86
|
+
|
|
87
|
+
| 设置 | 团队 `scorers/scoring.yaml` | 成员配置 | 环境变量 | 作用 |
|
|
88
|
+
|---|---|---|---|---|
|
|
89
|
+
| 会话评判 | `sessions: { attended, unattended }`,每个取 `off`、`ask` 或 `auto` | `scoring.sessions` | `TEAMAI_MODE` 和 `CI` 决定模式 | 决定哪些已结束的会话收到问题 |
|
|
90
|
+
| 路由问题 | `skill_routing` | `scoring.skill_routing` | | 开启或关闭 `teamai-routing` 问题 |
|
|
91
|
+
| 采纳问题 | `recall_adoption` | `scoring.recall_adoption` | | 开启或关闭 `teamai-adoption` 问题 |
|
|
92
|
+
| 每日上限 | `daily_limit` | `scoring.daily_limit` | | 限制每个工作区每天评判多少个会话 |
|
|
93
|
+
| 模型别名 | `models/aliases.yaml` | | | 把 `model` 里的别名(例如 `fast`)映射到每个评审工具的模型 |
|
|
94
|
+
| Recall | `teamai.yaml` 里的 `sharing.recall.enabled` | `recallEnabled` | `TEAMAI_RECALL_DISABLED=1` | 关闭时,没有会话有召回的文档可以提问 |
|
|
95
|
+
|
|
96
|
+
`scorers/<namespace>/scoring.yaml` 为生效命名空间的成员覆盖根目录的文件。两个生效命名空间在 `sessions` 或 `daily_limit` 上不一致时,更严格的值生效。
|
|
97
|
+
|
|
98
|
+
| 成员配置 | 它能做什么 |
|
|
99
|
+
|---|---|
|
|
100
|
+
| `~/.teamai/projects/<slug>/config.yaml` | 为那个工作区开启、关闭或修改任何键 |
|
|
101
|
+
| `~/.teamai/config.yaml`,作用于本机所有工作区 | 只能让评判更严格:关闭一种模式或一类问题,或降低 `daily_limit`。本机永远不会开启评判 |
|
|
102
|
+
|
|
103
|
+
默认值见[已结束的会话](https://github.com/Tencent/teamai-cli/blob/main/docs/guide/zh-CN/scorers.md#已结束的会话),另见[成员设置](https://github.com/Tencent/teamai-cli/blob/main/docs/guide/zh-CN/reference.md#成员设置)。
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
---
|
|
2
|
+
labels:
|
|
3
|
+
- { value: adopted, score: 1, description: "The session applied, followed or reused what {{ doc.id }} says, even without naming it." }
|
|
4
|
+
- { value: ignored, score: 0, description: "Nothing the session did depends on what {{ doc.id }} says; at most it touched the same topic." }
|
|
5
|
+
passingScore: 1
|
|
6
|
+
sessions: true
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
Judge only the recalled document `{{ doc.id }}` (`{{ doc.path }}`). Its text is in `recalled/{{ doc.file }}` in the evidence.
|
|
10
|
+
Adopted means the final reply or the work reflects that document's specific guidance, snippet or concept. Topical
|
|
11
|
+
overlap alone is not adoption. When unsure, answer ignored.
|