teamai-cli 0.25.0 → 0.26.0-beta.1

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 (45) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/README.zh-CN.md +6 -0
  3. package/dist/index.js +6147 -3346
  4. package/package.json +4 -1
  5. package/skill-data/core/SKILL.md +114 -0
  6. package/skill-data/core/references/commands.md +339 -0
  7. package/{skills/teamai → skill-data/core}/references/contribute-member.md +13 -10
  8. package/{skills/teamai → skill-data/core}/references/troubleshooting.md +9 -1
  9. package/skill-data/setup/SKILL.md +76 -0
  10. package/{skills/teamai → skill-data/setup}/references/join-member.md +17 -14
  11. package/{skills/teamai → skill-data/setup}/references/manage-admin.md +18 -6
  12. package/{skills/teamai → skill-data/setup}/references/provider-tgit.md +9 -6
  13. package/{skills/teamai → skill-data/setup}/references/setup-admin.md +41 -35
  14. package/skill-data/share/SKILL.md +70 -0
  15. package/skill-data/share/references/doc-template.md +44 -0
  16. package/skill-data/wiki/SKILL.md +314 -0
  17. package/skill-data/wiki/references/agents/graph-rag-agent.md +344 -0
  18. package/skill-data/wiki/references/agents/kb-doc-generator.md +323 -0
  19. package/skill-data/wiki/references/methodology/phase0-collection.md +54 -0
  20. package/skill-data/wiki/references/methodology/phase1-reverse-engineering.md +89 -0
  21. package/skill-data/wiki/references/methodology/phase2-document-types.md +341 -0
  22. package/skill-data/wiki/references/methodology/phase3-ai-enhancement.md +164 -0
  23. package/skill-data/wiki/references/methodology/phase4-quality.md +232 -0
  24. package/skill-data/wiki/references/overview.md +124 -0
  25. package/skill-data/wiki/references/phases/k1-reverse-engineering.md +118 -0
  26. package/skill-data/wiki/references/phases/k2-documents.md +68 -0
  27. package/skill-data/wiki/references/phases/k3-ai-native.md +121 -0
  28. package/skill-data/wiki/references/phases/k4-quality.md +190 -0
  29. package/skill-data/wiki/references/phases/phase0-init.md +112 -0
  30. package/skill-data/wiki/references/templates/project-overview.md +148 -0
  31. package/{skills/team-wiki-codebase → skill-data/wiki}/scripts/scan_repo.py +52 -52
  32. package/{skills/team-wiki-codebase → skill-data/wiki}/scripts/validate_kb.py +68 -62
  33. package/skills/teamai/SKILL.md +28 -128
  34. package/skills/team-wiki-codebase/README.md +0 -121
  35. package/skills/team-wiki-codebase/SKILL.md +0 -905
  36. package/skills/team-wiki-codebase/references/agents/graph-rag-agent.md +0 -344
  37. package/skills/team-wiki-codebase/references/agents/kb-doc-generator.md +0 -323
  38. package/skills/team-wiki-codebase/references/methodology/phase0-collection.md +0 -54
  39. package/skills/team-wiki-codebase/references/methodology/phase1-reverse-engineering.md +0 -89
  40. package/skills/team-wiki-codebase/references/methodology/phase2-document-types.md +0 -341
  41. package/skills/team-wiki-codebase/references/methodology/phase3-ai-enhancement.md +0 -164
  42. package/skills/team-wiki-codebase/references/methodology/phase4-quality.md +0 -232
  43. package/skills/team-wiki-codebase/references/templates/project-overview.md +0 -148
  44. package/skills/teamai-share-learnings/SKILL.md +0 -87
  45. /package/{skills/teamai → skill-data/setup}/references/uninstall.md +0 -0
@@ -19,7 +19,7 @@ platforms, and — most importantly — **do not create a new repo.** Tell the u
19
19
  *"Ask your team's TeamAI admin for the repository URL, then come back and paste it
20
20
  here."* A member without a repo URL cannot continue; creating one would fork the
21
21
  team into a second, empty repo. (Setting up a brand-new team repo is the admin
22
- flow — see `setup-admin.md` — not this one.)
22
+ flow — see `{SKILL_DIR}/references/setup-admin.md` — not this one.)
23
23
 
24
24
  ## Step 1 — Install and verify
25
25
 
@@ -39,11 +39,12 @@ If it fails, Node.js ≥ 20 is missing — have them install Node 20+ first.
39
39
 
40
40
  Match the login to the URL's host (do NOT create a second repo):
41
41
 
42
- - **`git.woa.com/...`** (Tencent TGit / 工蜂) → **you run both the `gf` install and
42
+ - **`git.woa.com/...`** (Tencent TGit) → **you run both the `gf` install and
43
43
  the `gf … auth login`** (never tell the user to run them). Follow
44
- `provider-tgit.md` ("Log in"); the user's only action is approving the login URL
45
- in their browser / iOA. No `GITLAB_URL` needed. (Headless only: pre-set
46
- `TGIT_TOKEN`.)
44
+ `{SKILL_DIR}/references/provider-tgit.md` ("Log in"); the user's only action is
45
+ approving the login URL in their browser / iOA. No `GITLAB_URL` needed. (No headless
46
+ shortcut: `TGIT_TOKEN` is REST-API-only and cannot clone, so the login has to be run
47
+ once on the machine.)
47
48
  - **`cnb.cool/...`** → install the CNB CLI, then authorize, in this order:
48
49
  1. `npm install -g @cnbcool/cnb-cli`
49
50
  2. `cnb login` — have the user approve it in the browser (OAuth2 device flow);
@@ -97,7 +98,8 @@ teamai hooks list # per-tool: which AI tools actually got the hooks
97
98
  Fix anything `doctor` reports. **Don't trust the "Hooks injected into all AI tool
98
99
  settings" message alone** — it prints even for tools where nothing was written;
99
100
  `teamai doctor` / `teamai hooks list` show the real per-tool status. If it flags
100
- hook problems, load `troubleshooting.md` ("Which tools actually get hooks").
101
+ hook problems, load the troubleshooting reference (`"$(teamai skill path core)/references/troubleshooting.md"`),
102
+ section "Which tools actually get hooks".
101
103
 
102
104
  ## Step 6 — Confirm the skills actually arrived
103
105
 
@@ -122,8 +124,7 @@ tool names only, on a separate branch of that same repo.)
122
124
  ## Agent-specific note
123
125
 
124
126
  If this conversation is running in **ChatGPT App** or **WorkBuddy**, the hooks
125
- that drive auto-sync need an extra manual step — load `troubleshooting.md`
126
- ("Agent-specific caveats") and walk the user through it before finishing.
127
+ that drive auto-sync need an extra manual step — load the troubleshooting reference (`"$(teamai skill path core)/references/troubleshooting.md"`), section "Agent-specific caveats" and walk the user through it before finishing.
127
128
 
128
129
  ## If something is denied
129
130
 
@@ -138,16 +139,18 @@ Summarize the outcome **in the user's own language** (global rule 1). Cover:
138
139
  tool keeps their team skills up to date; no commands needed.
139
140
  2. **Sharing a session learning is automatic — no command to remember.** When a
140
141
  session produced something worth sharing, TeamAI **prompts them on its own** (at
141
- the end of the session) and the `teamai-share-learnings` skill takes over to
142
+ the end of the session) and the `share` workflow (`teamai skill get share`) takes over to
142
143
  summarize and contribute it. They do **not** invoke `/teamai` for this. (This
143
- prompt only appears if the admin left team sharing enabled — it is on by
144
- default; the admin can turn it off in `teamai.yaml`.)
144
+ prompt only appears when recall is on — it is off by default; the admin turns it
145
+ on in `teamai.yaml` (`sharing.recall.enabled`), a member with `teamai recall enable` — and the admin has not switched the
146
+ reminder off in `teamai.yaml`.)
145
147
  3. **They can also contribute a skill — just ask in plain language.** A member does
146
148
  not need to be an admin to publish a skill. They tell TeamAI something like
147
- *"share this xxx skill with my team"* / *"把这个 xxx skill 分享给团队"*, and you
148
- run the publish for them (see `contribute-member.md`).
149
+ *"share this xxx skill with my team"*, in their own language, and you
150
+ run the publish for them (see `"$(teamai skill path core)/references/contribute-member.md"`;
151
+ it needs no recall).
149
152
  4. **How to leave — via the skill, not raw commands.** They can remove TeamAI any
150
153
  time by re-invoking the skill; you'll run it for them:
151
- `/teamai 卸载` / `/teamai Uninstall TeamAI`.
154
+ `/teamai Uninstall TeamAI` (in their language; the `/teamai` prefix stays as-is).
152
155
  One line, in their language: *"This only removes things from your machine; the
153
156
  team repo stays — rejoin any time with `/teamai` and the repo URL."*
@@ -74,13 +74,22 @@ repo per project:
74
74
 
75
75
  ```bash
76
76
  teamai projects list # projects defined + the ones active in this directory
77
- teamai projects set <id> # set the active project(s) for this directory
77
+ teamai projects set [ids...] # set the active project(s) for this directory
78
78
  teamai projects members <id> # who is registered on a project
79
79
  ```
80
80
 
81
81
  A member gets the union of their role resources and their active project's
82
82
  resources. Admins declare projects in `manifest/projects.yaml`, then `teamai push`.
83
83
 
84
+ Every namespace that names a directory — `knowledge`, `skills` and `agents` in
85
+ either manifest, and `learnings` in `projects.yaml` (a role's `learnings:` is
86
+ ignored and unchecked) — must be a single path segment: no `/`, `\`, `:` or control character, no trailing
87
+ `.` or space, and not a Windows device name (`CON`, `NUL`, `COM1`, …). Two
88
+ namespaces of one resource type may not differ only by case, across both
89
+ manifests. A manifest that breaks this, does not parse, or is empty stops
90
+ members' pull for that scope until it is fixed; the error names the entry. Fix
91
+ it rather than deleting it — with no `roles.yaml`, delivery is unfiltered.
92
+
84
93
  ## Team dashboard (web UI)
85
94
 
86
95
  ```bash
@@ -114,21 +123,24 @@ teamai env remove <KEY> # remove
114
123
  ## When sync fails
115
124
 
116
125
  Run `teamai doctor` first. If it reports hook or path problems, load
117
- `troubleshooting.md`. Have the affected member reopen their session; if their tool
126
+ the troubleshooting reference (`"$(teamai skill path core)/references/troubleshooting.md"`). Have the affected member reopen their session; if their tool
118
127
  has no session-start hook, they run `teamai pull` manually.
119
128
 
120
129
  ## Capture a lesson learned
121
130
 
122
- Turning a tricky fix into team knowledge is **automatic**: at the end of a session
131
+ Turning a tricky fix into team knowledge is **automatic** once recall is on for
132
+ the team (`sharing.recall.enabled: true` in `teamai.yaml`, then `teamai push`; it is
133
+ off by default, and `teamai recall enable` turns it on for one machine only): at the end of a session
123
134
  worth sharing, TeamAI prompts the member and the dedicated
124
- **`teamai-share-learnings`** skill summarizes the session and runs
135
+ `share` workflow (`teamai skill get share`) summarizes the session and runs
125
136
  `teamai contribute`. Nobody has to invoke it by hand.
126
137
  (Publishing a **reusable skill** someone authored is a different task — any member
127
- can do it, see `contribute-member.md`.)
138
+ can do it, see `"$(teamai skill path core)/references/contribute-member.md"`.)
128
139
 
129
140
  ### Turn the sharing prompt on or off (admin)
130
141
 
131
- The auto-share prompt is **on by default**. To disable it team-wide, set this in
142
+ The auto-share prompt is **on by default once recall is on**, and only shows in directories set up
143
+ with teamai. To disable it team-wide, set this in
132
144
  `teamai.yaml` and `teamai push`:
133
145
 
134
146
  ```yaml
@@ -1,15 +1,16 @@
1
- # Provider: Tencent TGit (工蜂)
1
+ # Provider: Tencent TGit
2
2
 
3
3
  git.woa.com is **Tencent-internal only**. TeamAI supports it natively as the `tgit`
4
4
  provider — it recognizes the host on its own, so you **never** set `GITLAB_URL`.
5
- Both `setup-admin.md` and `join-member.md` point here for the reachability probe
6
- and the `gf` login; follow the relevant section for whichever flow you are in.
5
+ Both `{SKILL_DIR}/references/setup-admin.md` and
6
+ `{SKILL_DIR}/references/join-member.md` point here for the reachability probe and
7
+ the `gf` login; follow the relevant section for whichever flow you are in.
7
8
 
8
9
  ## Probe reachability (setup flow only)
9
10
 
10
11
  When an admin is choosing a platform and hasn't named one, check whether this
11
12
  machine can reach TGit. A request to git.woa.com that returns the header
12
- `x-env: tgit` means TGit (工蜂) is reachable — plain reachability is not enough,
13
+ `x-env: tgit` means TGit is reachable — plain reachability is not enough,
13
14
  the header is what confirms it:
14
15
 
15
16
  ```bash
@@ -62,8 +63,10 @@ their browser — that approval is the *only* thing they do; the command finishe
62
63
  its own once they do. Confirm with
63
64
  `"${TEAMAI_HOME:-$HOME/.teamai}/gf/gf/bin/gf" auth whoami` before continuing.
64
65
 
65
- (Headless/CI only: skip the interactive login and pre-set `TGIT_TOKEN` — a
66
- git.woa.com Personal Access Token — instead.)
66
+ There is no headless substitute for this step: a `TGIT_TOKEN` Personal Access
67
+ Token reaches the git.woa.com REST API only, and the git endpoint rejects it, so
68
+ `init` cannot clone with it. Run the login once on the machine (interactively);
69
+ later unattended runs reuse the credential it stores.
67
70
 
68
71
  ## When you `teamai init` on TGit
69
72
 
@@ -24,13 +24,13 @@ through these sub-steps **in order**:
24
24
 
25
25
  ### 2a — Ask which platform they know
26
26
 
27
- **Tencent-internal first:** before asking, probe whether TGit (工蜂) is reachable
28
- on this machine — see `provider-tgit.md` ("Probe reachability") for the one-line
29
- `x-env: tgit` check. If it says `tgit: OK`, **list Tencent TGit (工蜂) first** and
27
+ **Tencent-internal first:** before asking, probe whether TGit is reachable
28
+ on this machine — see `{SKILL_DIR}/references/provider-tgit.md` ("Probe
29
+ reachability") for the one-line `x-env: tgit` check. If it says `tgit: OK`, **list Tencent TGit first** and
30
30
  prefer it. Then ask: *"Have you heard of / do you have an account on any of these —
31
- Tencent TGit (工蜂), GitHub, GitLab, or CNB (cnb.cool)?"*
31
+ Tencent TGit, GitHub, GitLab, or CNB (cnb.cool)?"*
32
32
 
33
- - **Tencent TGit (工蜂)** — https://git.woa.com (Tencent-internal only; shown
33
+ - **Tencent TGit** — https://git.woa.com (Tencent-internal only; shown
34
34
  first when the probe above says `tgit: OK`)
35
35
  - **GitHub** — https://github.com
36
36
  - **GitLab** — https://gitlab.com (or a self-hosted company GitLab)
@@ -42,7 +42,7 @@ If they name one, use that platform and go to sub-step 2c.
42
42
 
43
43
  Test which sites this network can actually reach (probe each, ~3s timeout each).
44
44
  The TGit probe checks the `x-env: tgit` header, not just reachability (see
45
- `provider-tgit.md`); the others just check reachability:
45
+ `{SKILL_DIR}/references/provider-tgit.md`); the others just check reachability:
46
46
 
47
47
  ```bash
48
48
  curl -sS -m 3 -D - -o /dev/null https://git.woa.com 2>/dev/null | grep -qi '^x-env:[[:space:]]*tgit' && echo "tgit: OK" || echo "tgit: unreachable"
@@ -51,12 +51,12 @@ curl -sSf -m 3 -o /dev/null https://gitlab.com && echo "gitlab: OK" || echo "g
51
51
  curl -sSf -m 3 -o /dev/null https://cnb.cool && echo "cnb: OK" || echo "cnb: unreachable"
52
52
  ```
53
53
 
54
- - **TGit reachable (`tgit: OK`)** → prefer Tencent TGit (工蜂); it is the
54
+ - **TGit reachable (`tgit: OK`)** → prefer Tencent TGit; it is the
55
55
  Tencent-internal default.
56
56
  - **Exactly one reachable** → use that one.
57
57
  - **Several reachable** → list them (TGit first when present) and let the user pick.
58
58
  - **None reachable** → stop. Tell the user to ask their own admin for a ready-made
59
- repo URL, then switch to `join-member.md`.
59
+ repo URL, then switch to `{SKILL_DIR}/references/join-member.md`.
60
60
 
61
61
  Choose by **account + reachability only — never by region**.
62
62
 
@@ -67,14 +67,14 @@ the repository, then continue to the next step:
67
67
 
68
68
  | Platform | Sign in / sign up | Create a new repo (do this) |
69
69
  |----------|------------------------------|------------------------------------|
70
- | Tencent TGit (工蜂) | https://git.woa.com | https://git.woa.com/projects/new |
70
+ | Tencent TGit | https://git.woa.com | https://git.woa.com/projects/new |
71
71
  | GitHub | https://github.com/login | https://github.com/new |
72
72
  | GitLab | https://gitlab.com/users/sign_in | https://gitlab.com/projects/new |
73
73
  | CNB | https://cnb.cool | https://cnb.cool/new/repos (org first: https://cnb.cool/new/groups) |
74
74
 
75
- > **Tencent TGit (工蜂):** don't send the user to the browser to create the repo —
75
+ > **Tencent TGit:** don't send the user to the browser to create the repo —
76
76
  > prefer letting `teamai init` create it via the API in Step 5. See
77
- > `provider-tgit.md` ("When you `teamai init` on TGit").
77
+ > `{SKILL_DIR}/references/provider-tgit.md` ("When you `teamai init` on TGit").
78
78
 
79
79
  Tell the user to sign in, create an **empty** repo (suggested name
80
80
  `TeamAi-<team-name>`), and give you the resulting repo URL. Explain in one
@@ -91,10 +91,10 @@ computer only holds a synced copy — you never put business code in it."*
91
91
  Signing in on the website (Step 2c) is not enough — `teamai init` also needs the
92
92
  platform's CLI credentials. Have the user complete the matching CLI login:
93
93
 
94
- ### Tencent TGit (工蜂)
94
+ ### Tencent TGit
95
95
 
96
- See `provider-tgit.md` ("Log in") — you install `gf` and run `gf auth login`
97
- yourself; the user only approves in the browser / iOA. No `GITLAB_URL` needed.
96
+ See `{SKILL_DIR}/references/provider-tgit.md` ("Log in") — you install `gf` and
97
+ run `gf auth login` yourself; the user only approves in the browser / iOA. No `GITLAB_URL` needed.
98
98
  Then return here for Step 4.
99
99
 
100
100
  ### CNB — install the CLI, authorize, then read the repo (in this order)
@@ -172,9 +172,9 @@ teamai init https://<platform>/<org>/<repo-name> --scope user
172
172
 
173
173
  If the repo does not exist yet, `init` offers to create it — accept the prompt.
174
174
 
175
- - **Tencent TGit (工蜂):** `gf` and login are already done, so init creates the
176
- repo via the API when it's missing — see `provider-tgit.md` ("When you
177
- `teamai init` on TGit").
175
+ - **Tencent TGit:** `gf` and login are already done, so init creates the
176
+ repo via the API when it's missing — see
177
+ `{SKILL_DIR}/references/provider-tgit.md` ("When you `teamai init` on TGit").
178
178
  - **CNB caveat:** a `cnb login` token **cannot create** an org or repo — that is
179
179
  exactly why the CNB flow has the user create the repo on the website first
180
180
  (Step 2c). If the org/repo is still missing here, `init` prints web links
@@ -188,7 +188,11 @@ If the repo does not exist yet, `init` offers to create it — accept the prompt
188
188
  `GITLAB_URL` + `GITLAB_TOKEN`, then retry.
189
189
 
190
190
  If the repo has roles enabled, `init` may ask for a primary role — pick one with
191
- the user, or pass `--role <id>` for a non-interactive run.
191
+ the user, or pass `--role <id>` for a non-interactive run. Without a terminal
192
+ (or with `CI` / `TEAMAI_NONINTERACTIVE` set) `init` never waits: a provider that
193
+ would need a browser login fails at once and names the credential to prepare —
194
+ a token for GitHub / CNB / GitLab / GitCode, and for TGit a prior `gf auth
195
+ login` run in an interactive shell (see Step 3).
192
196
 
193
197
  **Which AI tools to set up — all of them by default (global rule 9).** Do not add
194
198
  `--agent` to restrict the install unless the user explicitly said to (e.g. "only
@@ -196,7 +200,7 @@ Claude Code"). Omitting `--agent` gives an interactive picker — select **every
196
200
  tool already installed** on the machine. Then **report back which agents were set
197
201
  up**, in the user's language: name the tools that will now auto-start TeamAI, and
198
202
  any detected tool that was skipped and why (e.g. Codex trust-gate,
199
- CodeBuddy/WorkBuddy by design — see `troubleshooting.md`).
203
+ CodeBuddy/WorkBuddy by design — see the troubleshooting reference, `"$(teamai skill path core)/references/troubleshooting.md"`).
200
204
 
201
205
  ## Step 6 — Verify with doctor
202
206
 
@@ -211,8 +215,8 @@ Resolve everything `doctor` flags before continuing.
211
215
  it prints even for tools where nothing was written. `teamai doctor` / `teamai hooks
212
216
  list` show the real per-tool status. Only the tool you set up (e.g. `claude`) is
213
217
  expected to show hooks installed; others are skipped by design or not yet supported,
214
- which is normal. Full table in `troubleshooting.md` ("Which tools actually get
215
- hooks").
218
+ which is normal. Full table in the troubleshooting reference
219
+ (`"$(teamai skill path core)/references/troubleshooting.md"`), section "Which tools actually get hooks".
216
220
 
217
221
  ## Step 7 — Grant members repo access (required before they can join)
218
222
 
@@ -223,7 +227,7 @@ read/write access to it on the platform website**, or their `teamai init` / `pul
223
227
 
224
228
  Tell the admin (in their language) to add every member on the repo's website:
225
229
 
226
- - **Tencent TGit (工蜂):** repo → 成员管理 / Members → add each member with at
230
+ - **Tencent TGit:** repo → Members → add each member with at
227
231
  least **Developer** (read/write) access.
228
232
  - **GitHub:** repo → Settings → Collaborators → add with **Write**.
229
233
  - **GitLab:** repo → Settings → Members → add with **Developer** or above.
@@ -245,10 +249,8 @@ carries counts + tool names only, on a separate branch of that same repo.)
245
249
 
246
250
  1. Give the user their **repo web URL** to share.
247
251
  2. Give them a ready-to-forward invite line **written in their language**, with the
248
- URL filled in. The `/teamai` prefix stays as-is; translate the rest. For a
249
- Chinese-speaking user, that is:
250
- `/teamai 帮我加入团队的 TeamAI,仓库地址是 <URL>`
251
- (English user: `/teamai Help me join my team's TeamAI, repo URL is <URL>`.)
252
+ URL filled in. The `/teamai` prefix stays as-is; translate the rest:
253
+ `/teamai Help me join my team's TeamAI, repo URL is <URL>`
252
254
  Tell them to send the URL + this line to each member.
253
255
  3. Remind them (in their language): **new resources appear only after opening a
254
256
  fresh session** in the AI tool. Right after init the skills folder may look
@@ -262,14 +264,18 @@ The user may not be comfortable with the command line, so **don't just hand them
262
264
  list of `teamai …` commands.** Instead, point them back to *this skill* for
263
265
  day-to-day work — they can keep letting the AI run things for them:
264
266
 
265
- - To manage the team later, they run:
266
- `/teamai 我已经装好了,帮我管理` (Chinese) /
267
- `/teamai I already have TeamAI set up, help me manage it` (English) — this loads
268
- the daily-management flow (`manage-admin.md`): publishing skills, inviting
267
+ - To manage the team later, they run (in their language):
268
+ `/teamai I already have TeamAI set up, help me manage it` — this loads
269
+ the daily-management flow (`{SKILL_DIR}/references/manage-admin.md`): publishing skills, inviting
269
270
  members, roles / packages / env.
270
- - To share something they learned:
271
- `/teamai 我想把学到的经验分享给团队` /
272
- `/teamai I want to contribute what I learned to my team`.
271
+ - To share a reusable skill with the team, they run (in their language):
272
+ `/teamai Share this <skill-name> skill with my team` — see
273
+ `"$(teamai skill path core)/references/contribute-member.md"`.
274
+ - Sharing a **session's learnings** needs no command from them: TeamAI prompts on
275
+ its own at the end of a session worth sharing, and the `share` workflow
276
+ (`teamai skill get share`) takes over. (Only once recall is on — off by default;
277
+ turn it on team-wide with `sharing.recall.enabled: true` in `teamai.yaml`, then
278
+ `teamai push`.)
273
279
 
274
280
  Mention the underlying commands (`teamai push`, `teamai roles`, …) only as a note
275
281
  for users who *do* want them — the primary path is re-invoking `/teamai`.
@@ -280,10 +286,10 @@ Finish by telling the user, **in their language**, that they can remove TeamAI a
280
286
  time — and that they don't need the command line to do it. They just re-invoke the
281
287
  skill and you'll handle it:
282
288
 
283
- `/teamai 卸载` (Chinese) / `/teamai Uninstall TeamAI` (English)
289
+ `/teamai Uninstall TeamAI` (in their language; the `/teamai` prefix stays as-is)
284
290
 
285
291
  One line, in their language: *"That removes the hooks and synced resources from
286
292
  your machine; your team repo on the website is untouched — you can rejoin any time
287
293
  with `/teamai` and the repo URL."*
288
294
 
289
- (If they ask right now, load `uninstall.md` and run it for them.)
295
+ (If they ask right now, load `{SKILL_DIR}/references/uninstall.md` and run it for them.)
@@ -0,0 +1,70 @@
1
+ ---
2
+ name: share
3
+ description: >-
4
+ Turn a session into a team learning: summarize what was solved, discovered or worked around,
5
+ and publish it to the team knowledge base with `teamai contribute`. Loaded on demand by the
6
+ teamai discovery stub, and by the friction reminder that ends a session worth sharing.
7
+ ---
8
+
9
+ # Contribute — share what a session taught you with the team
10
+
11
+ Summarize what this AI coding session taught you and push it to the team knowledge base.
12
+
13
+ **Write the document in Simplified Chinese**, as earlier releases required. Commands, flags,
14
+ URLs, paths and code identifiers stay as they are.
15
+
16
+ ## When to Use
17
+
18
+ - When teamai suggests this session has valuable content worth sharing
19
+ - When you've solved a tricky problem and want to document the solution
20
+ - When you've discovered a useful workflow or pattern
21
+ - After a long session with diverse tool usage
22
+
23
+ ## How It Works
24
+
25
+ 1. **Summarize**: review the tools used, the problems solved and the patterns found in this session
26
+ 2. **Write the document**: a Markdown document (language as above) covering:
27
+ - What the task or problem was
28
+ - The key decisions and why they were made
29
+ - The solution, workaround or pattern discovered
30
+ - Which tools or skills proved especially useful
31
+ - Pitfalls and things to watch out for
32
+ 3. **Save it**: write the document to a temporary file
33
+ 4. **Push it to the team**: run `teamai contribute --file <path> --title "<title>"`
34
+
35
+ ## Document Template
36
+
37
+ Copy the template, the frontmatter field table and the tag taxonomy from
38
+ `{SKILL_DIR}/references/doc-template.md`. The frontmatter is required: it is what
39
+ makes the document searchable.
40
+
41
+ ## Example
42
+
43
+ ```bash
44
+ # After writing the summary to /tmp/session-summary.md
45
+ teamai contribute --file /tmp/session-summary.md --title "Debugging K8s pod startup timeouts"
46
+ ```
47
+
48
+ ## Important
49
+
50
+ - Run this as a **sub-agent** (Agent tool) to avoid polluting the main session's context
51
+ - The document is pushed to the team repo's `teamai-learnings` branch, under `learnings/`, with no pull request
52
+ - Team members will see it on their next `teamai pull`
53
+ - Keep summaries concise and actionable — this is a knowledge base, not a diary
54
+
55
+ ## Publishing a reusable skill instead
56
+
57
+ A member asking to publish a skill ("share this xxx skill with my team") is a
58
+ different flow, and it does not need recall: it lives in the `core` skill, at
59
+ `"$(teamai skill path core)/references/contribute-member.md"`. This file
60
+ is for turning a *session* into a learning.
61
+
62
+ ## References
63
+
64
+ In the files below, `{SKILL_DIR}` is the directory `teamai skill path share` prints; a reference file you open on its own writes that directory as `SKILL_DIR` in braces.
65
+
66
+ | File | When to load it |
67
+ |---|---|
68
+ | `{SKILL_DIR}/references/doc-template.md` | Writing the learning document: template, frontmatter fields, tag taxonomy. |
69
+
70
+ `teamai skill get share --full` prints this skill with its reference appended.
@@ -0,0 +1,44 @@
1
+ # Learning document template
2
+
3
+ **Required: the document must start with YAML frontmatter.** It feeds the search index
4
+ and is how other members discover the learning.
5
+
6
+ ```markdown
7
+ ---
8
+ title: "<short title naming the core problem or finding>"
9
+ author: <username>
10
+ date: <YYYY-MM-DD>
11
+ tags: [tag1, tag2, tag3]
12
+ ---
13
+
14
+ ## Context
15
+ What were you doing? What problem did you hit?
16
+
17
+ ## Solution
18
+ How did you solve it? What were the key steps?
19
+
20
+ ## Lessons
21
+ - Lesson 1
22
+ - Lesson 2
23
+
24
+ ## Related Skills
25
+ - skill-name-1
26
+ - skill-name-2
27
+ ```
28
+
29
+ ### Frontmatter fields
30
+
31
+ | Field | Required | Meaning | Example |
32
+ |------|------|------|------|
33
+ | title | yes | Short title (under 60 characters) | "Diagnosing K8s Pod OOM kills" |
34
+ | author | yes | Contributor's username | jeffyxu |
35
+ | date | yes | Date as YYYY-MM-DD | 2026-03-28 |
36
+ | tags | yes | 2-5 key tags | [k8s, oom, troubleshooting] |
37
+
38
+ ### Choosing tags
39
+
40
+ Pick 2-5 from these categories:
41
+ - **Stack**: python, typescript, go, k8s, docker, sglang, cuda
42
+ - **Problem type**: troubleshooting, performance, deployment, config, api
43
+ - **Pattern**: workflow, pattern, tool-usage, best-practice
44
+ - **Scenario**: debugging, testing, monitoring, security