teamai-cli 0.25.0-beta.6 → 0.26.0-beta.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 (49) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/README.ja.md +26 -227
  3. package/README.ko.md +26 -227
  4. package/README.md +26 -227
  5. package/README.th.md +26 -227
  6. package/README.zh-CN.md +32 -227
  7. package/dist/index.js +5885 -3199
  8. package/package.json +4 -1
  9. package/skill-data/core/SKILL.md +114 -0
  10. package/skill-data/core/references/commands.md +339 -0
  11. package/{skills/teamai → skill-data/core}/references/contribute-member.md +13 -10
  12. package/{skills/teamai → skill-data/core}/references/troubleshooting.md +1 -1
  13. package/skill-data/setup/SKILL.md +76 -0
  14. package/{skills/teamai → skill-data/setup}/references/join-member.md +21 -20
  15. package/{skills/teamai → skill-data/setup}/references/manage-admin.md +8 -6
  16. package/skill-data/setup/references/provider-tgit.md +78 -0
  17. package/{skills/teamai → skill-data/setup}/references/setup-admin.md +49 -93
  18. package/skill-data/share/SKILL.md +70 -0
  19. package/skill-data/share/references/doc-template.md +44 -0
  20. package/skill-data/wiki/SKILL.md +314 -0
  21. package/skill-data/wiki/references/agents/graph-rag-agent.md +344 -0
  22. package/skill-data/wiki/references/agents/kb-doc-generator.md +323 -0
  23. package/skill-data/wiki/references/methodology/phase0-collection.md +54 -0
  24. package/skill-data/wiki/references/methodology/phase1-reverse-engineering.md +89 -0
  25. package/skill-data/wiki/references/methodology/phase2-document-types.md +341 -0
  26. package/skill-data/wiki/references/methodology/phase3-ai-enhancement.md +164 -0
  27. package/skill-data/wiki/references/methodology/phase4-quality.md +232 -0
  28. package/skill-data/wiki/references/overview.md +124 -0
  29. package/skill-data/wiki/references/phases/k1-reverse-engineering.md +118 -0
  30. package/skill-data/wiki/references/phases/k2-documents.md +68 -0
  31. package/skill-data/wiki/references/phases/k3-ai-native.md +121 -0
  32. package/skill-data/wiki/references/phases/k4-quality.md +190 -0
  33. package/skill-data/wiki/references/phases/phase0-init.md +112 -0
  34. package/skill-data/wiki/references/templates/project-overview.md +148 -0
  35. package/{skills/team-wiki-codebase → skill-data/wiki}/scripts/scan_repo.py +52 -52
  36. package/{skills/team-wiki-codebase → skill-data/wiki}/scripts/validate_kb.py +68 -62
  37. package/skills/teamai/SKILL.md +28 -134
  38. package/skills/team-wiki-codebase/README.md +0 -121
  39. package/skills/team-wiki-codebase/SKILL.md +0 -905
  40. package/skills/team-wiki-codebase/references/agents/graph-rag-agent.md +0 -344
  41. package/skills/team-wiki-codebase/references/agents/kb-doc-generator.md +0 -323
  42. package/skills/team-wiki-codebase/references/methodology/phase0-collection.md +0 -54
  43. package/skills/team-wiki-codebase/references/methodology/phase1-reverse-engineering.md +0 -89
  44. package/skills/team-wiki-codebase/references/methodology/phase2-document-types.md +0 -341
  45. package/skills/team-wiki-codebase/references/methodology/phase3-ai-enhancement.md +0 -164
  46. package/skills/team-wiki-codebase/references/methodology/phase4-quality.md +0 -232
  47. package/skills/team-wiki-codebase/references/templates/project-overview.md +0 -148
  48. package/skills/teamai-share-learnings/SKILL.md +0 -87
  49. /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
43
- the `gf … auth login`** (never tell the user to run them). Use the exact
44
- download/verify commands and login step from `setup-admin.md` (Step 3, Tencent
45
- TGit). The user's only action is approving the login URL in their browser / iOA.
46
- No `GITLAB_URL` needed. (Headless only: pre-set `TGIT_TOKEN`.)
42
+ - **`git.woa.com/...`** (Tencent TGit) → **you run both the `gf` install and
43
+ the `gf … auth login`** (never tell the user to run them). Follow
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);
@@ -94,12 +95,11 @@ teamai doctor
94
95
  teamai hooks list # per-tool: which AI tools actually got the hooks
95
96
  ```
96
97
 
97
- Fix anything `doctor` reports. **Do not trust the "Hooks injected into all AI tool
98
- settings" message alone** — it prints even for tools where nothing was written.
99
- Check the real per-tool status with `teamai doctor` / `teamai hooks list`. Only the
100
- tool you set up (e.g. `claude`) is expected to show hooks installed; some tools are
101
- skipped by design or not yet supported (CLI behaviour, not a broken setup). If it
102
- flags hook problems, load `troubleshooting.md` ("Which tools actually get hooks").
98
+ Fix anything `doctor` reports. **Don't trust the "Hooks injected into all AI tool
99
+ settings" message alone** — it prints even for tools where nothing was written;
100
+ `teamai doctor` / `teamai hooks list` show the real per-tool status. If it flags
101
+ hook problems, load the troubleshooting reference (`"$(teamai skill path core)/references/troubleshooting.md"`),
102
+ section "Which tools actually get hooks".
103
103
 
104
104
  ## Step 6 — Confirm the skills actually arrived
105
105
 
@@ -124,8 +124,7 @@ tool names only, on a separate branch of that same repo.)
124
124
  ## Agent-specific note
125
125
 
126
126
  If this conversation is running in **ChatGPT App** or **WorkBuddy**, the hooks
127
- that drive auto-sync need an extra manual step — load `troubleshooting.md`
128
- ("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.
129
128
 
130
129
  ## If something is denied
131
130
 
@@ -140,16 +139,18 @@ Summarize the outcome **in the user's own language** (global rule 1). Cover:
140
139
  tool keeps their team skills up to date; no commands needed.
141
140
  2. **Sharing a session learning is automatic — no command to remember.** When a
142
141
  session produced something worth sharing, TeamAI **prompts them on its own** (at
143
- 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
144
143
  summarize and contribute it. They do **not** invoke `/teamai` for this. (This
145
- prompt only appears if the admin left team sharing enabled — it is on by
146
- 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`.)
147
147
  3. **They can also contribute a skill — just ask in plain language.** A member does
148
148
  not need to be an admin to publish a skill. They tell TeamAI something like
149
- *"share this xxx skill with my team"* / *"把这个 xxx skill 分享给团队"*, and you
150
- 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).
151
152
  4. **How to leave — via the skill, not raw commands.** They can remove TeamAI any
152
153
  time by re-invoking the skill; you'll run it for them:
153
- `/teamai 卸载` / `/teamai Uninstall TeamAI`.
154
+ `/teamai Uninstall TeamAI` (in their language; the `/teamai` prefix stays as-is).
154
155
  One line, in their language: *"This only removes things from your machine; the
155
156
  team repo stays — rejoin any time with `/teamai` and the repo URL."*
@@ -74,7 +74,7 @@ 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
 
@@ -114,21 +114,23 @@ teamai env remove <KEY> # remove
114
114
  ## When sync fails
115
115
 
116
116
  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
117
+ the troubleshooting reference (`"$(teamai skill path core)/references/troubleshooting.md"`). Have the affected member reopen their session; if their tool
118
118
  has no session-start hook, they run `teamai pull` manually.
119
119
 
120
120
  ## Capture a lesson learned
121
121
 
122
- Turning a tricky fix into team knowledge is **automatic**: at the end of a session
122
+ Turning a tricky fix into team knowledge is **automatic** once recall is on for
123
+ the team (`sharing.recall.enabled: true` in `teamai.yaml`, then `teamai push`; it is
124
+ off by default, and `teamai recall enable` turns it on for one machine only): at the end of a session
123
125
  worth sharing, TeamAI prompts the member and the dedicated
124
- **`teamai-share-learnings`** skill summarizes the session and runs
126
+ `share` workflow (`teamai skill get share`) summarizes the session and runs
125
127
  `teamai contribute`. Nobody has to invoke it by hand.
126
128
  (Publishing a **reusable skill** someone authored is a different task — any member
127
- can do it, see `contribute-member.md`.)
129
+ can do it, see `"$(teamai skill path core)/references/contribute-member.md"`.)
128
130
 
129
131
  ### Turn the sharing prompt on or off (admin)
130
132
 
131
- The auto-share prompt is **on by default**. To disable it team-wide, set this in
133
+ The auto-share prompt is **on by default once recall is on**. To disable it team-wide, set this in
132
134
  `teamai.yaml` and `teamai push`:
133
135
 
134
136
  ```yaml
@@ -0,0 +1,78 @@
1
+ # Provider: Tencent TGit
2
+
3
+ git.woa.com is **Tencent-internal only**. TeamAI supports it natively as the `tgit`
4
+ provider — it recognizes the host on its own, so you **never** set `GITLAB_URL`.
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.
8
+
9
+ ## Probe reachability (setup flow only)
10
+
11
+ When an admin is choosing a platform and hasn't named one, check whether this
12
+ machine can reach TGit. A request to git.woa.com that returns the header
13
+ `x-env: tgit` means TGit is reachable — plain reachability is not enough,
14
+ the header is what confirms it:
15
+
16
+ ```bash
17
+ 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"
18
+ ```
19
+
20
+ If it prints `tgit: OK`, **prefer TGit** and list it first among the choices — it
21
+ is the Tencent-internal default. Choose by account + reachability only, never by
22
+ region. (A member joining an existing `git.woa.com` URL skips the probe — the URL
23
+ already fixes the platform.)
24
+
25
+ ## Log in: install `gf`, then `gf auth login` — YOU run both
26
+
27
+ TeamAI drives the TGit CLI (`gf`) on the user's behalf. **Run every command in this
28
+ section yourself — both the install and the login. Never tell the user to run a
29
+ `gf` command.** The user's only action is approving the login in their browser /
30
+ iOA when it opens.
31
+
32
+ ### 1. Install `gf` (you run this)
33
+
34
+ Use the **same source, path, and check teamai uses** — do not invent your own URL.
35
+ `${TEAMAI_HOME}` is `~/.teamai` unless overridden:
36
+
37
+ ```bash
38
+ # pick the tarball for this machine's OS/arch (darwin|linux × x64|arm64)
39
+ os=$(uname -s | tr '[:upper:]' '[:lower:]') # darwin | linux
40
+ arch=$(uname -m); [ "$arch" = "x86_64" ] && arch=x64; [ "$arch" = "aarch64" ] && arch=arm64
41
+ dir="${TEAMAI_HOME:-$HOME/.teamai}/gf"
42
+
43
+ # download + extract from the Tencent-internal mirror (same URL teamai uses)
44
+ mkdir -p "$dir"
45
+ curl -fsSL "http://mirrors.tencent.com/repository/generic/gongfeng-cli/files/channels/stable/gf-${os}-${arch}.tar.gz" | tar xz -C "$dir"
46
+
47
+ # verify exactly as teamai does: the binary exists and is executable
48
+ test -x "$dir/gf/bin/gf" && echo "gf installed OK" || echo "gf install FAILED"
49
+ ```
50
+
51
+ Only macOS and Linux, on x64 or arm64, are supported.
52
+
53
+ ### 2. Log in (you run this too — don't hand it to the user)
54
+
55
+ ```bash
56
+ "${TEAMAI_HOME:-$HOME/.teamai}/gf/gf/bin/gf" auth login
57
+ ```
58
+
59
+ `gf auth login` starts an interactive flow offering three ways to sign in — iOA, a
60
+ browser device code, or pasting a token. Pick the browser/iOA option, relay
61
+ whatever URL / device code it prints to the user, and ask them to approve it in
62
+ their browser — that approval is the *only* thing they do; the command finishes on
63
+ its own once they do. Confirm with
64
+ `"${TEAMAI_HOME:-$HOME/.teamai}/gf/gf/bin/gf" auth whoami` before continuing.
65
+
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.
70
+
71
+ ## When you `teamai init` on TGit
72
+
73
+ Because `gf` and login are already done, `init` goes straight to creating/cloning —
74
+ no browser step. When the repo doesn't exist, **accept the create prompt and init
75
+ creates it via the API.** Prefer this over sending the user to the browser first.
76
+
77
+ It only falls back to https://git.woa.com/projects/new if the group/namespace
78
+ doesn't exist or you lack create permission there. No `GITLAB_URL` is ever needed.
@@ -24,21 +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 this machine is on the
28
- Tencent corporate network — a request to `git.woa.com` that returns the header
29
- `x-env: tgit` means Tencent TGit (工蜂) is reachable:
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
+ 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)?"*
30
32
 
31
- ```bash
32
- 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"
33
- ```
34
-
35
- If it prints `tgit: OK`, **list Tencent TGit (工蜂) first** and prefer it —
36
- TeamAI supports it natively as the `tgit` provider (it detects `git.woa.com` on
37
- its own; you install `gf` and log in in Step 3). Then ask:
38
- *"Have you heard of / do you have an account on any of these — Tencent TGit
39
- (工蜂), GitHub, GitLab, or CNB (cnb.cool)?"*
40
-
41
- - **Tencent TGit (工蜂)** — https://git.woa.com (Tencent-internal only; shown
33
+ - **Tencent TGit** — https://git.woa.com (Tencent-internal only; shown
42
34
  first when the probe above says `tgit: OK`)
43
35
  - **GitHub** — https://github.com
44
36
  - **GitLab** — https://gitlab.com (or a self-hosted company GitLab)
@@ -49,7 +41,8 @@ If they name one, use that platform and go to sub-step 2c.
49
41
  ### 2b — If they've heard of NONE, auto-probe reachability
50
42
 
51
43
  Test which sites this network can actually reach (probe each, ~3s timeout each).
52
- The TGit probe checks the `x-env: tgit` header, not just reachability:
44
+ The TGit probe checks the `x-env: tgit` header, not just reachability (see
45
+ `{SKILL_DIR}/references/provider-tgit.md`); the others just check reachability:
53
46
 
54
47
  ```bash
55
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"
@@ -58,12 +51,12 @@ curl -sSf -m 3 -o /dev/null https://gitlab.com && echo "gitlab: OK" || echo "g
58
51
  curl -sSf -m 3 -o /dev/null https://cnb.cool && echo "cnb: OK" || echo "cnb: unreachable"
59
52
  ```
60
53
 
61
- - **TGit reachable (`tgit: OK`)** → prefer Tencent TGit (工蜂); it is the
54
+ - **TGit reachable (`tgit: OK`)** → prefer Tencent TGit; it is the
62
55
  Tencent-internal default.
63
56
  - **Exactly one reachable** → use that one.
64
57
  - **Several reachable** → list them (TGit first when present) and let the user pick.
65
58
  - **None reachable** → stop. Tell the user to ask their own admin for a ready-made
66
- repo URL, then switch to `join-member.md`.
59
+ repo URL, then switch to `{SKILL_DIR}/references/join-member.md`.
67
60
 
68
61
  Choose by **account + reachability only — never by region**.
69
62
 
@@ -74,17 +67,14 @@ the repository, then continue to the next step:
74
67
 
75
68
  | Platform | Sign in / sign up | Create a new repo (do this) |
76
69
  |----------|------------------------------|------------------------------------|
77
- | 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 |
78
71
  | GitHub | https://github.com/login | https://github.com/new |
79
72
  | GitLab | https://gitlab.com/users/sign_in | https://gitlab.com/projects/new |
80
73
  | CNB | https://cnb.cool | https://cnb.cool/new/repos (org first: https://cnb.cool/new/groups) |
81
74
 
82
- > **Tencent TGit (工蜂):** **prefer letting `teamai init` create the repo for you**
83
- > in Step 5 — don't send the user to the browser first. Once you are logged in
84
- > (Step 3), init creates the repo under the chosen owner via the API. Only fall
85
- > back to https://git.woa.com/projects/new if init reports it can't (e.g. the
86
- > group/namespace doesn't exist, or you lack create permission). git.woa.com is
87
- > Tencent-internal only.
75
+ > **Tencent TGit:** don't send the user to the browser to create the repo —
76
+ > prefer letting `teamai init` create it via the API in Step 5. See
77
+ > `{SKILL_DIR}/references/provider-tgit.md` ("When you `teamai init` on TGit").
88
78
 
89
79
  Tell the user to sign in, create an **empty** repo (suggested name
90
80
  `TeamAi-<team-name>`), and give you the resulting repo URL. Explain in one
@@ -101,48 +91,11 @@ computer only holds a synced copy — you never put business code in it."*
101
91
  Signing in on the website (Step 2c) is not enough — `teamai init` also needs the
102
92
  platform's CLI credentials. Have the user complete the matching CLI login:
103
93
 
104
- ### Tencent TGit (工蜂) — YOU run gf install and login; user only clicks approve
105
-
106
- TeamAI supports git.woa.com natively as the `tgit` provider (it recognizes the
107
- host on its own — no `GITLAB_URL` needed). **Run every command below yourself** —
108
- both the install and the login. **Never tell the user to run a `gf` command.** The
109
- user's only action is approving the login in their browser / iOA when it opens.
110
-
111
- **1. Install `gf` (you run this)** using the **same source, path, and check teamai
112
- uses** — do not invent your own URL. `${TEAMAI_HOME}` is `~/.teamai` unless
113
- overridden:
114
-
115
- ```bash
116
- # pick the tarball for this machine's OS/arch (darwin|linux × x64|arm64)
117
- os=$(uname -s | tr '[:upper:]' '[:lower:]') # darwin | linux
118
- arch=$(uname -m); [ "$arch" = "x86_64" ] && arch=x64; [ "$arch" = "aarch64" ] && arch=arm64
119
- dir="${TEAMAI_HOME:-$HOME/.teamai}/gf"
120
-
121
- # download + extract from the Tencent-internal mirror (same URL teamai uses)
122
- mkdir -p "$dir"
123
- curl -fsSL "http://mirrors.tencent.com/repository/generic/gongfeng-cli/files/channels/stable/gf-${os}-${arch}.tar.gz" | tar xz -C "$dir"
124
-
125
- # verify exactly as teamai does: the binary exists and is executable
126
- test -x "$dir/gf/bin/gf" && echo "gf installed OK" || echo "gf install FAILED"
127
- ```
128
-
129
- Only macOS and Linux, on x64 or arm64, are supported.
130
-
131
- **2. Log in (you run this too — don't hand it to the user):**
132
-
133
- ```bash
134
- "${TEAMAI_HOME:-$HOME/.teamai}/gf/gf/bin/gf" auth login
135
- ```
136
-
137
- `gf auth login` starts an interactive flow offering three ways to sign in — iOA, a
138
- browser device code, or pasting a token. Pick the browser/iOA option, relay
139
- whatever URL / device code it prints to the user, and ask them to approve it in
140
- their browser — that approval is the *only* thing they do; the command finishes on
141
- its own once they do. Confirm with
142
- `"${TEAMAI_HOME:-$HOME/.teamai}/gf/gf/bin/gf" auth whoami` before continuing.
94
+ ### Tencent TGit
143
95
 
144
- (Headless/CI only: skip the interactive login and pre-set `TGIT_TOKEN` — a
145
- git.woa.com Personal Access Token — instead.)
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
+ Then return here for Step 4.
146
99
 
147
100
  ### CNB — install the CLI, authorize, then read the repo (in this order)
148
101
 
@@ -219,11 +172,9 @@ teamai init https://<platform>/<org>/<repo-name> --scope user
219
172
 
220
173
  If the repo does not exist yet, `init` offers to create it — accept the prompt.
221
174
 
222
- - **Tencent TGit (工蜂):** `gf` and login are already done (Step 3), so init goes
223
- straight to creating/cloning. When the repo doesn't exist, **accept the create
224
- prompt and init creates it via the API** — no browser needed. It only sends you
225
- to https://git.woa.com/projects/new if the group/namespace is missing or you
226
- lack create permission. No `GITLAB_URL`.
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").
227
178
  - **CNB caveat:** a `cnb login` token **cannot create** an org or repo — that is
228
179
  exactly why the CNB flow has the user create the repo on the website first
229
180
  (Step 2c). If the org/repo is still missing here, `init` prints web links
@@ -237,7 +188,11 @@ If the repo does not exist yet, `init` offers to create it — accept the prompt
237
188
  `GITLAB_URL` + `GITLAB_TOKEN`, then retry.
238
189
 
239
190
  If the repo has roles enabled, `init` may ask for a primary role — pick one with
240
- 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).
241
196
 
242
197
  **Which AI tools to set up — all of them by default (global rule 9).** Do not add
243
198
  `--agent` to restrict the install unless the user explicitly said to (e.g. "only
@@ -245,7 +200,7 @@ Claude Code"). Omitting `--agent` gives an interactive picker — select **every
245
200
  tool already installed** on the machine. Then **report back which agents were set
246
201
  up**, in the user's language: name the tools that will now auto-start TeamAI, and
247
202
  any detected tool that was skipped and why (e.g. Codex trust-gate,
248
- CodeBuddy/WorkBuddy by design — see `troubleshooting.md`).
203
+ CodeBuddy/WorkBuddy by design — see the troubleshooting reference, `"$(teamai skill path core)/references/troubleshooting.md"`).
249
204
 
250
205
  ## Step 6 — Verify with doctor
251
206
 
@@ -256,13 +211,12 @@ teamai hooks list # per-tool: which AI tools actually got the hooks
256
211
 
257
212
  Resolve everything `doctor` flags before continuing.
258
213
 
259
- **Do not trust the "Hooks injected into all AI tool settings" message on its own.**
260
- That line prints even for tools where nothing was written. Use `teamai doctor` /
261
- `teamai hooks list` to see the real per-tool status. It is expected that only the
262
- tool you set up with `--agent` (e.g. `claude`) shows the hooks installed; several
263
- other tools are skipped by design or not yet supported — this is CLI behaviour, not
264
- a broken setup. See `troubleshooting.md` ("Which tools actually get hooks") before
265
- worrying about a tool that shows as missing.
214
+ **Don't trust the "Hooks injected into all AI tool settings" message on its own** —
215
+ it prints even for tools where nothing was written. `teamai doctor` / `teamai hooks
216
+ list` show the real per-tool status. Only the tool you set up (e.g. `claude`) is
217
+ expected to show hooks installed; others are skipped by design or not yet supported,
218
+ which is normal. Full table in the troubleshooting reference
219
+ (`"$(teamai skill path core)/references/troubleshooting.md"`), section "Which tools actually get hooks".
266
220
 
267
221
  ## Step 7 — Grant members repo access (required before they can join)
268
222
 
@@ -273,7 +227,7 @@ read/write access to it on the platform website**, or their `teamai init` / `pul
273
227
 
274
228
  Tell the admin (in their language) to add every member on the repo's website:
275
229
 
276
- - **Tencent TGit (工蜂):** repo → 成员管理 / Members → add each member with at
230
+ - **Tencent TGit:** repo → Members → add each member with at
277
231
  least **Developer** (read/write) access.
278
232
  - **GitHub:** repo → Settings → Collaborators → add with **Write**.
279
233
  - **GitLab:** repo → Settings → Members → add with **Developer** or above.
@@ -295,10 +249,8 @@ carries counts + tool names only, on a separate branch of that same repo.)
295
249
 
296
250
  1. Give the user their **repo web URL** to share.
297
251
  2. Give them a ready-to-forward invite line **written in their language**, with the
298
- URL filled in. The `/teamai` prefix stays as-is; translate the rest. For a
299
- Chinese-speaking user, that is:
300
- `/teamai 帮我加入团队的 TeamAI,仓库地址是 <URL>`
301
- (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>`
302
254
  Tell them to send the URL + this line to each member.
303
255
  3. Remind them (in their language): **new resources appear only after opening a
304
256
  fresh session** in the AI tool. Right after init the skills folder may look
@@ -312,14 +264,18 @@ The user may not be comfortable with the command line, so **don't just hand them
312
264
  list of `teamai …` commands.** Instead, point them back to *this skill* for
313
265
  day-to-day work — they can keep letting the AI run things for them:
314
266
 
315
- - To manage the team later, they run:
316
- `/teamai 我已经装好了,帮我管理` (Chinese) /
317
- `/teamai I already have TeamAI set up, help me manage it` (English) — this loads
318
- 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
319
270
  members, roles / packages / env.
320
- - To share something they learned:
321
- `/teamai 我想把学到的经验分享给团队` /
322
- `/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`.)
323
279
 
324
280
  Mention the underlying commands (`teamai push`, `teamai roles`, …) only as a note
325
281
  for users who *do* want them — the primary path is re-invoking `/teamai`.
@@ -330,10 +286,10 @@ Finish by telling the user, **in their language**, that they can remove TeamAI a
330
286
  time — and that they don't need the command line to do it. They just re-invoke the
331
287
  skill and you'll handle it:
332
288
 
333
- `/teamai 卸载` (Chinese) / `/teamai Uninstall TeamAI` (English)
289
+ `/teamai Uninstall TeamAI` (in their language; the `/teamai` prefix stays as-is)
334
290
 
335
291
  One line, in their language: *"That removes the hooks and synced resources from
336
292
  your machine; your team repo on the website is untouched — you can rejoin any time
337
293
  with `/teamai` and the repo URL."*
338
294
 
339
- (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