@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.
Files changed (163) hide show
  1. package/CHANGELOG.md +167 -11
  2. package/README.ja.md +32 -29
  3. package/README.ko.md +32 -29
  4. package/README.md +32 -29
  5. package/README.th.md +32 -29
  6. package/README.zh-CN.md +32 -29
  7. package/agents/README.md +68 -0
  8. package/agents/README.zh-CN.md +68 -0
  9. package/agents/teamai-recall.md +10 -9
  10. package/dist/cli.js +210551 -136899
  11. package/dist/index.js +291 -0
  12. package/dist/runtime-paseo.js +27562 -0
  13. package/dist/runtime-sandbox.js +94740 -0
  14. package/dist/runtime-t3.js +41891 -0
  15. package/drivers/teamai-claude.yaml +6 -0
  16. package/drivers/teamai-codex.yaml +6 -0
  17. package/drivers/teamai-local.yaml +5 -0
  18. package/drivers/teamai-opencode.yaml +6 -0
  19. package/drivers/teamai-paseo.yaml +6 -0
  20. package/drivers/teamai-sandbox.yaml +7 -0
  21. package/drivers/teamai-t3.yaml +8 -0
  22. package/hooks/teamai-env-hint/HOOK.yaml +1 -0
  23. package/hooks/teamai-env-hint/README.md +80 -0
  24. package/hooks/teamai-env-hint/README.zh-CN.md +80 -0
  25. package/hooks/teamai-env-hint/exec.md +1 -0
  26. package/hooks/teamai-env-hint/secrets-rule.md +1 -0
  27. package/hooks/teamai-env-hint/secrets.md +1 -0
  28. package/hooks/teamai-env-hint/variables.md +1 -0
  29. package/hooks/teamai-friction-reminder/HOOK.yaml +1 -0
  30. package/hooks/teamai-friction-reminder/README.md +117 -0
  31. package/hooks/teamai-friction-reminder/README.zh-CN.md +117 -0
  32. package/hooks/teamai-friction-reminder/action-gap.md +1 -0
  33. package/hooks/teamai-friction-reminder/action-gap.zh.md +1 -0
  34. package/hooks/teamai-friction-reminder/action-share-learnings.md +1 -0
  35. package/hooks/teamai-friction-reminder/action-share-learnings.zh.md +1 -0
  36. package/hooks/teamai-friction-reminder/action.md +1 -0
  37. package/hooks/teamai-friction-reminder/action.zh.md +1 -0
  38. package/hooks/teamai-friction-reminder/gap-reasons.md +1 -0
  39. package/hooks/teamai-friction-reminder/gap-reasons.zh.md +1 -0
  40. package/hooks/teamai-friction-reminder/gap.md +1 -0
  41. package/hooks/teamai-friction-reminder/gap.zh.md +1 -0
  42. package/hooks/teamai-friction-reminder/params.yaml +12 -0
  43. package/hooks/teamai-friction-reminder/problem-reasons.md +1 -0
  44. package/hooks/teamai-friction-reminder/problem-reasons.zh.md +1 -0
  45. package/hooks/teamai-friction-reminder/problem.md +1 -0
  46. package/hooks/teamai-friction-reminder/problem.zh.md +1 -0
  47. package/hooks/teamai-friction-reminder/reason-correction.md +1 -0
  48. package/hooks/teamai-friction-reminder/reason-correction.zh.md +1 -0
  49. package/hooks/teamai-friction-reminder/reason-interrupt.md +1 -0
  50. package/hooks/teamai-friction-reminder/reason-interrupt.zh.md +1 -0
  51. package/hooks/teamai-friction-reminder/reason-tool-error.md +1 -0
  52. package/hooks/teamai-friction-reminder/reason-tool-error.zh.md +1 -0
  53. package/hooks/teamai-friction-reminder/reason-tool-reject.md +1 -0
  54. package/hooks/teamai-friction-reminder/reason-tool-reject.zh.md +1 -0
  55. package/hooks/teamai-friction-reminder/task.md +1 -0
  56. package/hooks/teamai-friction-reminder/task.zh.md +1 -0
  57. package/hooks/teamai-mr-hint/HOOK.yaml +1 -0
  58. package/hooks/teamai-mr-hint/README.md +81 -0
  59. package/hooks/teamai-mr-hint/README.zh-CN.md +81 -0
  60. package/hooks/teamai-mr-hint/offer-command.en.md +7 -0
  61. package/hooks/teamai-mr-hint/offer-command.md +10 -0
  62. package/hooks/teamai-mr-hint/offer-workflow.en.md +7 -0
  63. package/hooks/teamai-mr-hint/offer-workflow.md +10 -0
  64. package/hooks/teamai-mr-hint/params.yaml +2 -0
  65. package/hooks/teamai-package-hint/HOOK.yaml +1 -0
  66. package/hooks/teamai-package-hint/README.md +64 -0
  67. package/hooks/teamai-package-hint/README.zh-CN.md +64 -0
  68. package/hooks/teamai-package-hint/message.md +3 -0
  69. package/hooks/teamai-todowrite-hint/HOOK.yaml +1 -0
  70. package/hooks/teamai-todowrite-hint/README.md +68 -0
  71. package/hooks/teamai-todowrite-hint/README.zh-CN.md +68 -0
  72. package/hooks/teamai-todowrite-hint/message.en.md +6 -0
  73. package/hooks/teamai-todowrite-hint/message.md +9 -0
  74. package/package.json +41 -14
  75. package/rules/teamai-recall/README.md +78 -0
  76. package/rules/teamai-recall/README.zh-CN.md +78 -0
  77. package/rules/teamai-recall/RULE.en.md +36 -0
  78. package/rules/teamai-recall/RULE.md +43 -0
  79. package/rules/teamai-recall/block-direct.md +27 -0
  80. package/rules/teamai-recall/block.en.md +42 -0
  81. package/rules/teamai-recall/block.md +44 -0
  82. package/runtimes/teamai-paseo.yaml +5 -0
  83. package/runtimes/teamai-sandbox.yaml +3 -0
  84. package/runtimes/teamai-t3.yaml +5 -0
  85. package/sandboxes/teamai-bwrap.yaml +2 -0
  86. package/sandboxes/teamai-default.yaml +4 -0
  87. package/sandboxes/teamai-docker.yaml +5 -0
  88. package/sandboxes/teamai-podman.yaml +4 -0
  89. package/sandboxes/teamai-sbx.yaml +4 -0
  90. package/sandboxes/teamai-seatbelt.yaml +2 -0
  91. package/sandboxes/teamai-vercel.yaml +4 -0
  92. package/scorers/README.md +103 -0
  93. package/scorers/README.zh-CN.md +103 -0
  94. package/scorers/teamai-adoption.md +11 -0
  95. package/scorers/teamai-correctness.md +17 -0
  96. package/scorers/teamai-routing.md +11 -0
  97. package/skill-data/core/SKILL.md +4 -3
  98. package/skill-data/core/references/commands.md +300 -67
  99. package/skill-data/core/references/contribute-member.md +4 -4
  100. package/skill-data/core/references/troubleshooting.md +128 -18
  101. package/skill-data/setup/references/join-member.md +13 -9
  102. package/skill-data/setup/references/manage-admin.md +41 -17
  103. package/skill-data/setup/references/setup-admin.md +2 -2
  104. package/skill-data/setup/references/uninstall.md +30 -9
  105. package/skill-data/share/SKILL.md +17 -12
  106. package/skill-data/share/references/doc-template.md +3 -4
  107. package/skill-data/wiki/SKILL.md +1 -1
  108. package/skill-data/wiki/references/agents/graph-rag-agent.md +5 -1
  109. package/skill-data/workflow/SKILL.md +39 -16
  110. package/skill-data/workflow/references/fleet.md +13 -0
  111. package/skill-data/workflow/references/judging.md +17 -10
  112. package/skill-data/workflow/references/places.md +64 -7
  113. package/skill-data/workflow/references/sandbox.md +3 -3
  114. package/skill-data/workflow/references/session-hosts.md +27 -0
  115. package/skill-data/workflow-local/SKILL.md +4 -3
  116. package/skill-data/workflow-local/references/ci.md +1 -1
  117. package/skills/teamai/SKILL.md +4 -3
  118. package/workflows/README.md +103 -0
  119. package/workflows/README.zh-CN.md +103 -0
  120. package/workflows/teamai-benchmark.yaml +78 -0
  121. package/workflows/teamai-ci-extract-mr.yaml +66 -0
  122. package/workflows/teamai-codebase-deep-enrich/README.md +123 -0
  123. package/workflows/teamai-codebase-deep-enrich/README.zh-CN.md +123 -0
  124. package/workflows/teamai-codebase-deep-enrich/WORKFLOW.yaml +119 -0
  125. package/workflows/teamai-codebase-deep-enrich/architecture.md +30 -0
  126. package/workflows/teamai-codebase-deep-enrich/component.md +30 -0
  127. package/workflows/teamai-codebase-deep-enrich/params.yaml +1 -0
  128. package/workflows/teamai-codebase-deep-enrich/scenarios.md +32 -0
  129. package/workflows/teamai-codebase-enrich.yaml +98 -0
  130. package/workflows/teamai-draft-learning-updates/README.md +116 -0
  131. package/workflows/teamai-draft-learning-updates/README.zh-CN.md +116 -0
  132. package/workflows/teamai-draft-learning-updates/WORKFLOW.yaml +61 -0
  133. package/workflows/teamai-draft-learning-updates/params.yaml +4 -0
  134. package/workflows/teamai-finished-sessions/README.md +101 -0
  135. package/workflows/teamai-finished-sessions/README.zh-CN.md +101 -0
  136. package/workflows/teamai-finished-sessions/WORKFLOW.yaml +43 -0
  137. package/workflows/teamai-finished-sessions/params.yaml +1 -0
  138. package/workflows/teamai-import-from-iwiki.yaml +90 -0
  139. package/workflows/teamai-import-from-mr/README.md +104 -0
  140. package/workflows/teamai-import-from-mr/README.zh-CN.md +104 -0
  141. package/workflows/teamai-import-from-mr/WORKFLOW.yaml +94 -0
  142. package/workflows/teamai-import-from-mr/draft.en.md +48 -0
  143. package/workflows/teamai-import-from-mr/draft.zh.md +48 -0
  144. package/workflows/teamai-import-from-repo/README.md +106 -0
  145. package/workflows/teamai-import-from-repo/README.zh-CN.md +106 -0
  146. package/workflows/teamai-import-from-repo/WORKFLOW.yaml +109 -0
  147. package/workflows/teamai-import-from-repo/narrative.md +83 -0
  148. package/workflows/teamai-import-learnings.yaml +83 -0
  149. package/workflows/teamai-import-rules.yaml +34 -0
  150. package/workflows/teamai-new-scorer.yaml +54 -0
  151. package/workflows/teamai-promote-learning/README.md +122 -0
  152. package/workflows/teamai-promote-learning/README.zh-CN.md +122 -0
  153. package/workflows/teamai-promote-learning/WORKFLOW.yaml +102 -0
  154. package/workflows/teamai-promote-learning/params.yaml +4 -0
  155. package/workflows/teamai-score.yaml +121 -0
  156. package/workflows/teamai-self-improvement.yaml +37 -0
  157. package/workflows/teamai-session-to-task.yaml +69 -0
  158. package/workflows/teamai-sessions-to-tasks.yaml +62 -0
  159. package/workflows/teamai-share-learnings-from-sessions.yaml +36 -0
  160. package/workflows/teamai-share-learnings.yaml +25 -0
  161. package/workflows/teamai-share-session.yaml +21 -0
  162. package/workflows/teamai-try-scorer.yaml +32 -0
  163. package/skill-data/workflow/references/hosts.md +0 -27
@@ -0,0 +1,6 @@
1
+ schemaVersion: v1alpha1
2
+ name: teamai-claude
3
+ description: Run every step on this machine, with prompt steps on Claude Code unless a step or --tools names another tool.
4
+ tool: claude
5
+ runtimes:
6
+ - use: tools
@@ -0,0 +1,6 @@
1
+ schemaVersion: v1alpha1
2
+ name: teamai-codex
3
+ description: Run every step on this machine, with prompt steps on Codex unless a step or --tools names another tool.
4
+ tool: codex
5
+ runtimes:
6
+ - use: tools
@@ -0,0 +1,5 @@
1
+ schemaVersion: v1alpha1
2
+ name: teamai-local
3
+ description: Run every step on this machine, with prompt steps on the tool a step, --tools or workflows.tools names.
4
+ runtimes:
5
+ - use: tools
@@ -0,0 +1,6 @@
1
+ schemaVersion: v1alpha1
2
+ name: teamai-opencode
3
+ description: Run every step on this machine, with prompt steps on OpenCode unless a step or --tools names another tool.
4
+ tool: opencode
5
+ runtimes:
6
+ - use: tools
@@ -0,0 +1,6 @@
1
+ schemaVersion: v1alpha1
2
+ name: teamai-paseo
3
+ description: Run each prompt step as an agent of the Paseo daemon on this machine, in a worktree teamai prepares, and every other step on this machine.
4
+ runtimes:
5
+ - use: paseo
6
+ options: { max_parallel: 4 }
@@ -0,0 +1,7 @@
1
+ schemaVersion: v1alpha1
2
+ name: teamai-sandbox
3
+ description: Run each step in a sandbox of its own, as the sandbox profile default sets it (teamai's is a Docker Sandboxes microVM per attempt, from the template of the step's tool); this machine takes the judge and interactive steps.
4
+ runtimes:
5
+ - use: sandbox # profile default: yours, the team's, else teamai's teamai-default
6
+ options: { max_parallel: 4 }
7
+ - use: tools # takes the judge, which sbx does not offer
@@ -0,0 +1,8 @@
1
+ schemaVersion: v1alpha1
2
+ name: teamai-t3
3
+ description: Run each prompt step as a T3 Code thread of its own, in a worktree teamai prepares, and every other step on this machine.
4
+ runtimes:
5
+ - use: t3
6
+ options:
7
+ environment: local
8
+ max_parallel: 4
@@ -0,0 +1 @@
1
+ description: Name the scope's team env variables and secrets at session start, and how to run commands with them
@@ -0,0 +1,80 @@
1
+ # teamai-env-hint
2
+
3
+ English | [中文](README.zh-CN.md)
4
+
5
+ - **Runs**: At session start
6
+ - **Input**: The team env variables and secrets this scope delivers
7
+ - **Output**: Their names and descriptions, and how to run the commands that need them
8
+ - **Files**: `HOOK.yaml` holds only `description`. Each `.md` file is one text of the hint
9
+
10
+ ## What it prints
11
+
12
+ ```mermaid
13
+ flowchart TD
14
+ start([Session start]) --> any{The scope delivers a variable or a secret?}
15
+ any -- no --> none([No hint])
16
+ any -- yes --> v{Variables?}
17
+ v -- yes --> t1[variables.md]
18
+ v -- no --> s
19
+ t1 --> s{Secrets?}
20
+ s -- yes --> t2[secrets.md]
21
+ s -- no --> t3
22
+ t2 --> t3[exec.md]
23
+ t3 --> s2{Secrets?}
24
+ s2 -- yes --> t4[secrets-rule.md]
25
+ s2 -- no --> done([Hint])
26
+ t4 --> done
27
+ classDef file 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 t1,t2,t3,t4 file;
31
+ class done out;
32
+ class none skip;
33
+ ```
34
+
35
+ teamai joins the texts it prints with a space, in the order above.
36
+
37
+ ## Replace it
38
+
39
+ Put only the files you change in `hooks/teamai-env-hint/` at the root of the team repo. Every other file, `HOOK.yaml` included, stays teamai's and keeps getting teamai's updates.
40
+
41
+ `hooks/teamai-env-hint/exec.md`:
42
+
43
+ ```markdown
44
+ Run every `gh`, `kubectl` and `npm publish` through `teamai env exec -- <command>`. Never export a value yourself.
45
+ ```
46
+
47
+ Push the folder. The next `teamai pull` checks your files with teamai's other files and delivers them together. The hint takes no parameters.
48
+
49
+ ## Texts
50
+
51
+ | File | Variables |
52
+ |---|---|
53
+ | `variables.md` | `{{ variables }}`, such as `API_ENDPOINT (Team API endpoint), LOG_LEVEL` |
54
+ | `secrets.md` | `{{ secrets }}`, in the same form |
55
+ | `exec.md`, `secrets-rule.md` | None |
56
+
57
+ A name has its `description` in parentheses when the team gives one.
58
+
59
+ | `language` in `teamai.yaml` | The file teamai prints |
60
+ |---|---|
61
+ | Unset | `<text>.md` |
62
+ | `en` or `zh` | `<text>.en.md` or `<text>.zh.md` when the folder has it, else `<text>.md` |
63
+
64
+ ## What pull refuses
65
+
66
+ | The replacement | What pull does |
67
+ |---|---|
68
+ | Misses a text, sets a `with:` key, or sets a `command` | Names the field and keeps teamai's folder |
69
+ | Uses a variable its text does not offer | The same |
70
+ | Sits in a namespace, such as `hooks/frontend/teamai-env-hint/` | The same. A replacement goes at the root of the team repo |
71
+
72
+ ## Settings that change it
73
+
74
+ | Setting | Where | Effect |
75
+ |---|---|---|
76
+ | The variables and secrets | `env/env.yaml`, `env/secrets.yaml` and their copies in `env/<namespace>/` in the team repo | Decide what the hint names. A secret counts once `teamai env set` stored it on this machine |
77
+ | The namespaces | The role, project and tags in the member config | Decide which `env/<namespace>/` files this scope delivers |
78
+ | Language | `language` in `teamai.yaml` | Picks the text variant |
79
+
80
+ The member config is `~/.teamai/projects/<slug>/config.yaml` in a workspace, and `~/.teamai/config.yaml` in user scope.
@@ -0,0 +1,80 @@
1
+ # teamai-env-hint
2
+
3
+ [English](README.md) | 中文
4
+
5
+ - **运行时机**: 会话开始时
6
+ - **输入**: 这个 scope 交付的团队环境变量和密钥
7
+ - **输出**: 它们的名字和描述,以及需要它们的命令该怎么运行
8
+ - **文件**: `HOOK.yaml` 里只有 `description`。每个 `.md` 文件是提示的一段文案
9
+
10
+ ## 打印什么
11
+
12
+ ```mermaid
13
+ flowchart TD
14
+ start(["会话开始"]) --> any{"这个 scope 交付了环境变量或密钥?"}
15
+ any -- 否 --> none(["没有提示"])
16
+ any -- 是 --> v{"有环境变量?"}
17
+ v -- 是 --> t1[variables.md]
18
+ v -- 否 --> s
19
+ t1 --> s{"有密钥?"}
20
+ s -- 是 --> t2[secrets.md]
21
+ s -- 否 --> t3
22
+ t2 --> t3[exec.md]
23
+ t3 --> s2{"有密钥?"}
24
+ s2 -- 是 --> t4[secrets-rule.md]
25
+ s2 -- 否 --> done(["提示"])
26
+ t4 --> done
27
+ classDef file 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 t1,t2,t3,t4 file;
31
+ class done out;
32
+ class none skip;
33
+ ```
34
+
35
+ teamai 按上面的顺序,用空格把要打印的文案连起来。
36
+
37
+ ## 替换它
38
+
39
+ 在团队仓库根目录的 `hooks/teamai-env-hint/` 里只放你要改的文件。其他文件(包括 `HOOK.yaml`)仍用 teamai 的,并继续获得 teamai 的更新。
40
+
41
+ `hooks/teamai-env-hint/exec.md`:
42
+
43
+ ```markdown
44
+ Run every `gh`, `kubectl` and `npm publish` through `teamai env exec -- <command>`. Never export a value yourself.
45
+ ```
46
+
47
+ 推送这个文件夹。下一次 `teamai pull` 会把你的文件和 teamai 的其他文件一起检查并交付。这条提示没有参数。
48
+
49
+ ## 文案
50
+
51
+ | 文件 | 变量 |
52
+ |---|---|
53
+ | `variables.md` | `{{ variables }}`,例如 `API_ENDPOINT (Team API endpoint), LOG_LEVEL` |
54
+ | `secrets.md` | `{{ secrets }}`,形式相同 |
55
+ | `exec.md`、`secrets-rule.md` | 无 |
56
+
57
+ 团队给了 `description` 时,名字后面的括号里是它。
58
+
59
+ | `teamai.yaml` 里的 `language` | teamai 打印的文件 |
60
+ |---|---|
61
+ | 未设置 | `<text>.md` |
62
+ | `en` 或 `zh` | 文件夹里有 `<text>.en.md` 或 `<text>.zh.md` 时打印它,否则打印 `<text>.md` |
63
+
64
+ ## pull 拒绝什么
65
+
66
+ | 替换 | pull 怎么做 |
67
+ |---|---|
68
+ | 缺少某段文案、设置了 `with:` 键,或设置了 `command` | 指出是哪个字段,继续使用 teamai 的文件夹 |
69
+ | 使用了文案不提供的变量 | 同上 |
70
+ | 放在命名空间里,例如 `hooks/frontend/teamai-env-hint/` | 同上。替换要放在团队仓库根目录 |
71
+
72
+ ## 影响它的设置
73
+
74
+ | 设置 | 位置 | 作用 |
75
+ |---|---|---|
76
+ | 环境变量和密钥 | 团队仓库里的 `env/env.yaml`、`env/secrets.yaml`,以及它们在 `env/<namespace>/` 里的副本 | 决定提示列出哪些名字。密钥要等 `teamai env set` 把它存到本机后才算数 |
77
+ | 命名空间 | 成员配置里的角色、项目和标签 | 决定这个 scope 交付哪些 `env/<namespace>/` 文件 |
78
+ | 语言 | `teamai.yaml` 里的 `language` | 选择文案版本 |
79
+
80
+ 成员配置在工作区里是 `~/.teamai/projects/<slug>/config.yaml`,在 user scope 里是 `~/.teamai/config.yaml`。
@@ -0,0 +1 @@
1
+ Run the commands that need them through `teamai env exec -- <command>` so they get this directory's team values.
@@ -0,0 +1 @@
1
+ Never ask for, read or print a secret value; if one is missing, ask the member to run `teamai env set KEY` in their own terminal.
@@ -0,0 +1 @@
1
+ Team secrets in this scope: {{ secrets }}.
@@ -0,0 +1 @@
1
+ Team env variables in this scope: {{ variables }}.
@@ -0,0 +1 @@
1
+ description: Suggest sharing what a session with friction taught
@@ -0,0 +1,117 @@
1
+ # teamai-friction-reminder
2
+
3
+ English | [中文](README.zh-CN.md)
4
+
5
+ - **Runs**: At Stop
6
+ - **Input**: The session's tool calls, interruptions, refusals, corrections, failing retries and recall hits
7
+ - **Output**: A reminder to share what the session taught
8
+ - **Files**: `params.yaml` holds teamai's thresholds and weights. Each `.md` file is one text of the reminder
9
+
10
+ ## When it reminds
11
+
12
+ ```mermaid
13
+ flowchart TD
14
+ stop([Stop]) --> on{Recall on and the reminder on?}
15
+ on -- no --> none([No reminder])
16
+ on -- yes --> once{Already shared or reminded in this session?}
17
+ once -- yes --> none
18
+ once -- no --> tools{Tool calls reach min_tools?}
19
+ tools -- no --> none
20
+ tools -- yes --> score{Friction score reaches min_score?}
21
+ score -- no --> none
22
+ score -- yes --> remind([Reminder])
23
+ classDef out fill:#2f8f4f,stroke:#1f6b39,color:#fff;
24
+ classDef skip fill:#6b6b6b,stroke:#4a4a4a,color:#fff;
25
+ class remind out;
26
+ class none skip;
27
+ ```
28
+
29
+ The score adds the points that the [parameters](#parameters) give. For example, two interruptions and one refused call add `2 × weights.interrupt + weights.reject`.
30
+
31
+ ## Which texts it prints
32
+
33
+ The reminder is a headline, the task line, and an action, with a blank line between each.
34
+
35
+ ```mermaid
36
+ flowchart TD
37
+ gap{Recall found nothing, or only weak matches?}
38
+ gap -- yes --> gr{Friction to name?}
39
+ gap -- no --> pr{Friction to name?}
40
+ gr -- yes --> t1[gap-reasons.md]
41
+ gr -- no --> t2[gap.md]
42
+ pr -- yes --> t3[problem-reasons.md]
43
+ pr -- no --> t4[problem.md]
44
+ t1 & t2 & t3 & t4 --> task{The session has a first prompt?}
45
+ task -- yes --> t5[task.md]
46
+ task -- no --> act
47
+ t5 --> act{The agent can start teamai-share-learnings?}
48
+ act -- yes --> a1[action-share-learnings.md]
49
+ act -- no --> agap{Recall found nothing, or only weak matches?}
50
+ agap -- yes --> a2[action-gap.md]
51
+ agap -- no --> a3[action.md]
52
+ classDef file fill:#3b6ea5,stroke:#2b5079,color:#fff;
53
+ class t1,t2,t3,t4,t5,a1,a2,a3 file;
54
+ ```
55
+
56
+ ## Replace it
57
+
58
+ Put only the files you change in `hooks/teamai-friction-reminder/` at the root of the team repo. Every other file, `params.yaml` included, stays teamai's and keeps getting teamai's updates.
59
+
60
+ ```yaml
61
+ # hooks/teamai-friction-reminder/params.yaml
62
+ min_tools: 30
63
+ weights: { reject: 30 } # interrupt and correction keep teamai's values
64
+ ```
65
+
66
+ Push the folder. The next `teamai pull` checks your files with teamai's other files and delivers them together. A key you leave out of `params.yaml` keeps teamai's value from its `params.yaml`.
67
+
68
+ ## Parameters
69
+
70
+ | Key | Range | What it sets |
71
+ |---|---|---|
72
+ | `min_tools` | 1-1000 | The tool calls a session needs before it can get the reminder |
73
+ | `min_score` | 1-1000 | The friction score a session needs |
74
+ | `weights.interrupt` | 0-100 | Points for each time the person stopped the agent |
75
+ | `weights.reject` | 0-100 | Points for each refused tool call |
76
+ | `weights.correction` | 0-100 | Points for each prompt that corrected the agent |
77
+ | `tool_error_tiers` | 1 to 5 tiers. `min` is 1-1000, in strictly descending order. `points` is 0-100 | Points for failing tool calls the agent retried. The first tier whose `min` the count reaches gives its points |
78
+ | `skill_bonus` | 0-100 | Points when the session used a skill |
79
+ | `diversity_bonus_max` | 0-100 | The most points for using many different tools |
80
+ | `knowledge_gap_bonus` | 0-100 | Points when recall found nothing |
81
+ | `low_quality_bonus` | 0-100 | Points when recall found only weak matches |
82
+ | `low_quality_threshold` | 0-100 | A match whose recall score is under this value is weak |
83
+
84
+ ## Texts
85
+
86
+ | File | Variables |
87
+ |---|---|
88
+ | `problem.md`, `gap.md`, `action.md`, `action-gap.md` | None |
89
+ | `problem-reasons.md`, `gap-reasons.md` | `{{ reasons }}`, the reason texts of the signals the session had, joined with commas, such as `you interrupted the AI twice, you rejected 1 tool call` |
90
+ | `reason-interrupt.md`, `reason-correction.md`, `reason-tool-error.md` | `{{ count }}`, such as `2`, and `{{ times }}`, such as `twice`, or `2 次` in a `.zh.md` file |
91
+ | `reason-tool-reject.md` | `{{ count }}`, `{{ times }}`, and `{{ tool_calls }}`, such as `1 tool call`, or `1 次工具调用` in a `.zh.md` file |
92
+ | `task.md` | `{{ task }}`, the first prompt on one line, with secrets redacted and long prompts cut |
93
+ | `action-share-learnings.md` | `{{ command }}`, the command that describes `teamai-share-learnings` |
94
+
95
+ | `language` in `teamai.yaml` | The file teamai prints |
96
+ |---|---|
97
+ | Unset | `<text>.md` |
98
+ | `en` or `zh` | `<text>.en.md` or `<text>.zh.md` when the folder has it, else `<text>.md` |
99
+
100
+ ## What pull refuses
101
+
102
+ | The replacement | What pull does |
103
+ |---|---|
104
+ | Misses a text, sets a value out of range, sets a key the table above does not list, keeps `with:` in `HOOK.yaml`, or sets a `command` | Names the field and keeps teamai's folder |
105
+ | Uses a variable its text does not offer | The same |
106
+ | Sits in a namespace, such as `hooks/frontend/teamai-friction-reminder/` | The same. A replacement goes at the root of the team repo |
107
+
108
+ ## Settings that change it
109
+
110
+ | Setting | Team `teamai.yaml` | Member config | Environment | Effect |
111
+ |---|---|---|---|---|
112
+ | The reminder | `sharing.contributeHint.enabled` | `contributeHintEnabled` | `TEAMAI_CONTRIBUTE_HINT_DISABLED=1` | When off, no session gets the reminder |
113
+ | Recall | `sharing.recall.enabled` | `recallEnabled` | `TEAMAI_RECALL_DISABLED=1` | When off, no session gets the reminder |
114
+ | Correction words | `sharing.intervention.correctionKeywords` | | | Adds words, beside teamai's, that make a prompt a correction |
115
+ | Language | `language` | | | Picks the text variant |
116
+
117
+ 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,117 @@
1
+ # teamai-friction-reminder
2
+
3
+ [English](README.md) | 中文
4
+
5
+ - **运行时机**: Stop 时
6
+ - **输入**: 会话的工具调用、打断、拒绝、纠正、失败后的重试和 recall 命中
7
+ - **输出**: 提醒分享这次会话学到的东西
8
+ - **文件**: `params.yaml` 保存 teamai 的阈值和权重。每个 `.md` 文件是提醒的一段文案
9
+
10
+ ## 何时提醒
11
+
12
+ ```mermaid
13
+ flowchart TD
14
+ stop([Stop]) --> on{"recall 开启,且提醒开启?"}
15
+ on -- 否 --> none(["不提醒"])
16
+ on -- 是 --> once{"这次会话已经分享过或提醒过?"}
17
+ once -- 是 --> none
18
+ once -- 否 --> tools{"工具调用次数达到 min_tools?"}
19
+ tools -- 否 --> none
20
+ tools -- 是 --> score{"摩擦分达到 min_score?"}
21
+ score -- 否 --> none
22
+ score -- 是 --> remind(["提醒"])
23
+ classDef out fill:#2f8f4f,stroke:#1f6b39,color:#fff;
24
+ classDef skip fill:#6b6b6b,stroke:#4a4a4a,color:#fff;
25
+ class remind out;
26
+ class none skip;
27
+ ```
28
+
29
+ 分数是[参数](#参数)给出的分相加。例如两次打断和一次被拒绝的调用,加 `2 × weights.interrupt + weights.reject`。
30
+
31
+ ## 打印哪些文案
32
+
33
+ 提醒由标题、任务行和行动组成,每两部分之间空一行。
34
+
35
+ ```mermaid
36
+ flowchart TD
37
+ gap{"recall 什么都没找到,或只找到弱匹配?"}
38
+ gap -- 是 --> gr{"有要点出的摩擦?"}
39
+ gap -- 否 --> pr{"有要点出的摩擦?"}
40
+ gr -- 是 --> t1[gap-reasons.md]
41
+ gr -- 否 --> t2[gap.md]
42
+ pr -- 是 --> t3[problem-reasons.md]
43
+ pr -- 否 --> t4[problem.md]
44
+ t1 & t2 & t3 & t4 --> task{"会话有第一条提示?"}
45
+ task -- 是 --> t5[task.md]
46
+ task -- 否 --> act
47
+ t5 --> act{"agent 能启动 teamai-share-learnings?"}
48
+ act -- 是 --> a1[action-share-learnings.md]
49
+ act -- 否 --> agap{"recall 什么都没找到,或只找到弱匹配?"}
50
+ agap -- 是 --> a2[action-gap.md]
51
+ agap -- 否 --> a3[action.md]
52
+ classDef file fill:#3b6ea5,stroke:#2b5079,color:#fff;
53
+ class t1,t2,t3,t4,t5,a1,a2,a3 file;
54
+ ```
55
+
56
+ ## 替换它
57
+
58
+ 在团队仓库根目录的 `hooks/teamai-friction-reminder/` 里只放你要改的文件。其他文件(包括 `params.yaml`)仍用 teamai 的,并继续获得 teamai 的更新。
59
+
60
+ ```yaml
61
+ # hooks/teamai-friction-reminder/params.yaml
62
+ min_tools: 30
63
+ weights: { reject: 30 } # interrupt and correction keep teamai's values
64
+ ```
65
+
66
+ 推送这个文件夹。下一次 `teamai pull` 会把你的文件和 teamai 的其他文件一起检查并交付。`params.yaml` 里没写的键,沿用 teamai 的 `params.yaml` 里的值。
67
+
68
+ ## 参数
69
+
70
+ | 键 | 范围 | 设置什么 |
71
+ |---|---|---|
72
+ | `min_tools` | 1-1000 | 会话拿到提醒前需要的工具调用次数 |
73
+ | `min_score` | 1-1000 | 会话需要达到的摩擦分 |
74
+ | `weights.interrupt` | 0-100 | 用户每次打断 agent 加的分 |
75
+ | `weights.reject` | 0-100 | 每次被拒绝的工具调用加的分 |
76
+ | `weights.correction` | 0-100 | 每条纠正 agent 的提示加的分 |
77
+ | `tool_error_tiers` | 1 到 5 档。`min` 为 1-1000,严格递减。`points` 为 0-100 | agent 重试过的失败工具调用加的分。次数达到的第一档 `min` 给出该档的分 |
78
+ | `skill_bonus` | 0-100 | 会话用到 skill 时加的分 |
79
+ | `diversity_bonus_max` | 0-100 | 用到很多不同工具时最多加的分 |
80
+ | `knowledge_gap_bonus` | 0-100 | recall 什么都没找到时加的分 |
81
+ | `low_quality_bonus` | 0-100 | recall 只找到弱匹配时加的分 |
82
+ | `low_quality_threshold` | 0-100 | recall 分数低于这个值的匹配算作弱匹配 |
83
+
84
+ ## 文案
85
+
86
+ | 文件 | 变量 |
87
+ |---|---|
88
+ | `problem.md`、`gap.md`、`action.md`、`action-gap.md` | 无 |
89
+ | `problem-reasons.md`、`gap-reasons.md` | `{{ reasons }}`,会话出现的各个信号的原因文本,用逗号连接,例如 `你打断了 AI 2 次,你拒绝了 1 次工具调用` |
90
+ | `reason-interrupt.md`、`reason-correction.md`、`reason-tool-error.md` | `{{ count }}`,例如 `2`;`{{ times }}`,`.zh.md` 文件中例如 `2 次`,英文文件中例如 `twice` |
91
+ | `reason-tool-reject.md` | `{{ count }}`、`{{ times }}`,以及 `{{ tool_calls }}`,`.zh.md` 文件中例如 `1 次工具调用`,英文文件中例如 `1 tool call` |
92
+ | `task.md` | `{{ task }}`,第一条提示压成一行,密钥已打码,过长的提示会截断 |
93
+ | `action-share-learnings.md` | `{{ command }}`,描述 `teamai-share-learnings` 的命令 |
94
+
95
+ | `teamai.yaml` 里的 `language` | teamai 打印的文件 |
96
+ |---|---|
97
+ | 未设置 | `<text>.md` |
98
+ | `en` 或 `zh` | 文件夹里有 `<text>.en.md` 或 `<text>.zh.md` 时打印它,否则打印 `<text>.md` |
99
+
100
+ ## pull 拒绝什么
101
+
102
+ | 替换 | pull 怎么做 |
103
+ |---|---|
104
+ | 缺少某段文案、设置了超出范围的值、设置了上表没有列出的键、在 `HOOK.yaml` 里保留了 `with:`,或设置了 `command` | 指出是哪个字段,继续使用 teamai 的文件夹 |
105
+ | 使用了文案不提供的变量 | 同上 |
106
+ | 放在命名空间里,例如 `hooks/frontend/teamai-friction-reminder/` | 同上。替换要放在团队仓库根目录 |
107
+
108
+ ## 影响它的设置
109
+
110
+ | 设置 | 团队 `teamai.yaml` | 成员配置 | 环境变量 | 作用 |
111
+ |---|---|---|---|---|
112
+ | 提醒 | `sharing.contributeHint.enabled` | `contributeHintEnabled` | `TEAMAI_CONTRIBUTE_HINT_DISABLED=1` | 关闭时,没有会话收到提醒 |
113
+ | Recall | `sharing.recall.enabled` | `recallEnabled` | `TEAMAI_RECALL_DISABLED=1` | 关闭时,没有会话收到提醒 |
114
+ | 纠正词 | `sharing.intervention.correctionKeywords` | | | 在 teamai 自带的词之外,再加一些让提示算作纠正的词 |
115
+ | 语言 | `language` | | | 选择文案版本 |
116
+
117
+ 成员配置在工作区里是 `~/.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 @@
1
+ Consider running `/teamai share what this session taught me` to summarize what you learned, share it with your team, and fill the knowledge gap (or run `teamai skill get share`).
@@ -0,0 +1 @@
1
+ 可以运行 `/teamai share what this session taught me`,总结这次会话学到的东西,分享给团队,补上知识库的这块空白(也可以运行 `teamai skill get share`)。
@@ -0,0 +1 @@
1
+ Offer the person the teamai-share-learnings workflow: run `{{ command }}` and start it with the inputs it proposes, once the person confirms them.
@@ -0,0 +1 @@
1
+ 向用户提议使用 teamai-share-learnings 工作流:运行 `{{ command }}`,等用户确认它建议的输入后,用这些输入启动它。
@@ -0,0 +1 @@
1
+ Consider running `/teamai share what this session taught me` to summarize what you learned and share it with your team (or run `teamai skill get share`).
@@ -0,0 +1 @@
1
+ 可以运行 `/teamai share what this session taught me`,总结这次会话学到的东西并分享给团队(也可以运行 `teamai skill get share`)。
@@ -0,0 +1 @@
1
+ [teamai] The current task is not covered by the team knowledge base, and this session had signs of friction: {{ reasons }}.
@@ -0,0 +1 @@
1
+ [teamai] 团队知识库还没有覆盖当前任务,而且这次会话有不顺利的迹象:{{ reasons }}。
@@ -0,0 +1 @@
1
+ [teamai] The current task is not covered by the team knowledge base.
@@ -0,0 +1 @@
1
+ [teamai] 团队知识库还没有覆盖当前任务。
@@ -0,0 +1,12 @@
1
+ min_tools: 15
2
+ min_score: 20
3
+ weights: { interrupt: 20, reject: 20, correction: 20 }
4
+ tool_error_tiers:
5
+ - { min: 8, points: 25 }
6
+ - { min: 5, points: 18 }
7
+ - { min: 3, points: 10 }
8
+ skill_bonus: 5
9
+ diversity_bonus_max: 5
10
+ knowledge_gap_bonus: 20
11
+ low_quality_bonus: 10
12
+ low_quality_threshold: 5.0
@@ -0,0 +1 @@
1
+ [teamai] This session may contain a problem worth documenting: {{ reasons }}.
@@ -0,0 +1 @@
1
+ [teamai] 这次会话可能有值得记录下来的问题:{{ reasons }}。
@@ -0,0 +1 @@
1
+ [teamai] This session may contain a problem worth documenting.
@@ -0,0 +1 @@
1
+ [teamai] 这次会话可能有值得记录下来的问题。
@@ -0,0 +1 @@
1
+ you corrected the AI {{ times }}
@@ -0,0 +1 @@
1
+ 你纠正了 AI {{ times }}
@@ -0,0 +1 @@
1
+ you interrupted the AI {{ times }}
@@ -0,0 +1 @@
1
+ 你打断了 AI {{ times }}
@@ -0,0 +1 @@
1
+ the AI retried failing tools {{ times }}
@@ -0,0 +1 @@
1
+ AI 重试失败的工具 {{ times }}
@@ -0,0 +1 @@
1
+ you rejected {{ tool_calls }}
@@ -0,0 +1 @@
1
+ 你拒绝了 {{ tool_calls }}
@@ -0,0 +1 @@
1
+ Task: {{ task }}
@@ -0,0 +1 @@
1
+ 任务:{{ task }}
@@ -0,0 +1 @@
1
+ description: Offer to turn recently merged MRs into learnings at session start