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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "teamai-cli",
3
- "version": "0.25.0",
3
+ "version": "0.26.0-beta.1",
4
4
  "description": "TeamAI — Make Every Team AI Native (skill sync + shared knowledge base, powered by Git)",
5
5
  "type": "module",
6
6
  "bin": {
@@ -9,6 +9,9 @@
9
9
  "files": [
10
10
  "dist/**/*.js",
11
11
  "skills",
12
+ "skill-data",
13
+ "!**/__pycache__",
14
+ "!**/*.pyc",
12
15
  "agents",
13
16
  "README.md",
14
17
  "CHANGELOG.md",
@@ -0,0 +1,114 @@
1
+ ---
2
+ name: core
3
+ description: >-
4
+ TeamAI daily workflow: route a /teamai request, sync with pull and push, inspect status,
5
+ diagnose with doctor, and reach the specialized workflows. Loaded by the teamai discovery stub.
6
+ ---
7
+
8
+ # teamai — daily workflow
9
+
10
+ You are guiding a user through TeamAI. **They may not know Git.** You run the
11
+ commands; they only make choices when you ask. Follow the steps literally —
12
+ do not skip, reorder, or invent commands.
13
+
14
+ ## Start here
15
+
16
+ Look at what the user typed after `/teamai`.
17
+
18
+ **If they gave NO scenario** (bare `/teamai`, or only greetings/no task):
19
+ print the menu below **exactly**, then **STOP and wait**. Take no other action —
20
+ do not run any command, do not load another skill yet.
21
+
22
+ ```
23
+ teamai — Team AI Skills & Rules Sync
24
+
25
+ Usage examples (copy one to get started):
26
+
27
+ 🏗️ Admin — set up a new team repo:
28
+ /teamai Help me set up TeamAI for my team from scratch
29
+
30
+ 🤝 Member — join an existing team:
31
+ /teamai Help me join my team's TeamAI, repo URL is https://...
32
+
33
+ 🔧 Admin — daily management (publish & update skills, rules, MCP, env):
34
+ /teamai I already have TeamAI set up, help me manage it
35
+
36
+ 📊 Anyone — open the team dashboard:
37
+ /teamai Open the TeamAI dashboard
38
+
39
+ 💡 Member — share a skill with the team (just ask in plain language):
40
+ /teamai Share this <skill-name> skill with my team
41
+
42
+ 🗑️ Anyone — remove TeamAI from this machine:
43
+ /teamai Uninstall TeamAI
44
+ ```
45
+
46
+ **If they DID describe a scenario**, match it to one row and follow what it loads.
47
+
48
+ | The user wants to… | Load this |
49
+ |-----------------------------------------------------------------------|------------------------------------------------|
50
+ | Set up a team from scratch, join a team, manage one, or uninstall | `teamai skill get setup` |
51
+ | Publish a skill, rule or doc they already have | `{SKILL_DIR}/references/contribute-member.md` |
52
+ | Share what this session taught them | `teamai skill get share` |
53
+ | Understand a large multi-repo codebase, build an architecture wiki | `teamai skill get wiki` |
54
+ | Sync now, see differences, diagnose | `teamai pull` · `teamai status` · `teamai doctor` |
55
+ | Open the team dashboard | `teamai dashboard` — it starts a local server (default port 3721); give the user the URL |
56
+ | Something broke | `{SKILL_DIR}/references/troubleshooting.md` |
57
+
58
+ If the request is ambiguous (e.g. "help me with teamai" with no direction),
59
+ ask ONE short question to pick a row, then proceed.
60
+
61
+ Sharing a session's learnings needs no menu choice: TeamAI prompts on its own at
62
+ the end of a session that produced something worth sharing, and that prompt means
63
+ `teamai skill get share`. (Only when recall is on; it is off by default. The team turns it on with
64
+ `sharing.recall.enabled: true` in `teamai.yaml`, a member with `teamai recall enable`;
65
+ while it is off, `teamai skill get share` says so.)
66
+
67
+ ## Global rules
68
+
69
+ 1. **Reply in the user's language — including every example and hand-off blurb.**
70
+ Answer in whatever language the user used, for the whole conversation. This
71
+ applies to **everything you write**: the invite line you give an admin to
72
+ forward, the one-line explanations, the "what's next" summary — all of it is
73
+ translated before you show it. *Only* commands, flags, URLs, file paths and
74
+ code identifiers stay verbatim (never translate `teamai pull`, `--scope user`,
75
+ `/teamai`, a repo URL).
76
+ 2. **Never teach Git.** Do not mention branches, commits, clone, or push/pull of
77
+ Git itself. TeamAI hides all of that. The user thinks in terms of "my team's
78
+ skills", not repositories.
79
+ 3. **You run the commands.** Only pause to ask the user when you need a web login,
80
+ a value only they know, or a genuine either/or choice. Show each command before
81
+ you run it, in one short line.
82
+ 4. **Detect the current AI tool first.** TeamAI behaves differently per host. Note
83
+ which tool this conversation is running in (Claude Code, Cursor, CodeBuddy,
84
+ WorkBuddy, ChatGPT App, Codex, OpenCode, Kiro, Gemini CLI, …). When you reopen a
85
+ session, use the name of **this** tool — do not assume Claude Code or Cursor.
86
+ Some hosts need extra manual steps for hooks — see the troubleshooting
87
+ reference ("Agent-specific caveats").
88
+
89
+ ## Daily commands
90
+
91
+ ```bash
92
+ teamai pull # Sync team resources into local AI tools now
93
+ teamai push # Publish your local skills/rules/docs to the team
94
+ teamai status # Show local vs team differences
95
+ teamai doctor # Diagnose configuration and hook problems
96
+ teamai list # List resources (skills|rules|docs|env|agents|hooks|mcp)
97
+ teamai recall <q> # Search what the team has already learned
98
+ ```
99
+
100
+ Every other command, every flag, and the flags `--help` hides live in the
101
+ generated reference below. Read it instead of guessing a flag.
102
+
103
+ ## References
104
+
105
+ In the files below, `{SKILL_DIR}` is the directory `teamai skill path core` prints; a reference file you open on its own writes that directory as `SKILL_DIR` in braces.
106
+
107
+ | File | When to load it |
108
+ |---|---|
109
+ | `{SKILL_DIR}/references/commands.md` | Before using any command not in the daily list, or any flag. Generated from the CLI's own command table, so it cannot drift. |
110
+ | `{SKILL_DIR}/references/troubleshooting.md` | A command fails, a hook does not fire, or a host needs manual steps. |
111
+ | `{SKILL_DIR}/references/contribute-member.md` | A member wants to publish a skill, rule or doc they already have. Any member can, not just admins. |
112
+
113
+ `teamai skill get core --full` prints this skill with all three references
114
+ appended. Load a single file above when you only need one.
@@ -0,0 +1,339 @@
1
+ # teamai command reference
2
+
3
+ Every public command the installed CLI accepts, rendered from its own command
4
+ table. Hidden commands are left out: they are hook plumbing the CLI runs itself,
5
+ never something to type. Flags marked `(hidden)` work but are absent from
6
+ `--help`, so treat this file — not `--help` — as the complete list of flags.
7
+
8
+ Generated: do not edit by hand. Regenerate with
9
+ `npx vitest run commands-reference -u` after changing a command or a flag.
10
+
11
+
12
+ ## Global options
13
+
14
+ - `-V, --version` — output the version number
15
+ - `--dry-run` — Preview mode, no changes made
16
+ - `-v, --verbose` — Verbose output
17
+
18
+ ## init
19
+
20
+ - `teamai init [repo]` — Initialize teamai (configure Git provider, clone repo, register member)
21
+ - `--repo <repo>` — Team repo (alias of the positional argument)
22
+ - `--http <url>` — Git-free HTTP team repo (read-only consumer; only needs an API key)
23
+ - `--self` — Single-repo mode: the current git repo is the team repo (equivalent to `teamai init .`). Knowledge lives on main under .teamai/; reports go to the teamai-reports orphan branch.
24
+ - `--token <key>` — API key for HTTP team repo / status reporting (stored 0600, never committed). Also reads TEAMAI_API_TOKEN.
25
+ - `--scope <scope>` — Install scope: project (default, <cwd>/.teamai + <cwd>/.claude) or user (~/.teamai + ~/.claude)
26
+ - `--inherit-user-scope` — In project scope, also sync safe user-scope resources and search its knowledge
27
+ - `--no-inherit-user-scope` — Disable user-scope inheritance for this project
28
+ - `--role <id>` — Primary role ID (e.g. hai_dev) for non-interactive setup
29
+ - `--project <ids>` — Active logical project(s) from manifest/projects.yaml (comma-separated); scopes which project resources and learnings this directory syncs. Pass "all" to activate every project the manifest declares (a snapshot taken now)
30
+ - `--agent <name>` — AI tools to set up (e.g. claude, codex, cursor, codebuddy, workbuddy, dsh). Repeatable or comma-separated. In single-repo mode, selects which tool dirs to create; omit for an interactive picker. Additive on repeated runs.
31
+ - `--force` — Overwrite existing config without confirmation
32
+
33
+ ## push
34
+
35
+ - `teamai push` — Push local resources to team repo
36
+ - `--all` — Push all without confirmation
37
+ - `--skill <path>` — Push a specific skill by path (e.g., ~/.claude/skills/hai/my-skill or skills/hai_dev/my-skill)
38
+ - `--role <id>` — Namespace for new skills, rules and agents (skills/<id>/, rules/<id>/, agents/<id>/)
39
+ - `--project <id>` — Target a project: each new resource goes to that project's namespace for its own type — skills, knowledge for rules, agents (from manifest/projects.yaml)
40
+
41
+ ## pull
42
+
43
+ - `teamai pull` — Pull team resources and inject into local AI tools
44
+ - `--silent` — Silent mode (for hooks)
45
+ - `--force` — Force full sync even if repo is unchanged
46
+
47
+ ## status
48
+
49
+ - `teamai status` — Show local vs team repo diff
50
+ - `--all` — List every project data partition under ~/.teamai/projects (flags stale/orphan ones)
51
+
52
+ ## list
53
+
54
+ - `teamai list [type]` — List resources (skills|rules|docs|env|agents|hooks|mcp). For skills, --source local/all also scans installed AI agent skill directories.
55
+ - `--source <src>` — Where to look for skills: repo | local | all
56
+ - `--agent <name>` — Filter local agents by id (only applies to skills)
57
+ - `--reveal` — Show env values in plaintext (default: masked)
58
+
59
+ ## skill
60
+
61
+ - `teamai skill` — List and inspect skills (default: repo + installed agents, then the CLI-served catalog)
62
+ - `teamai skill list` — List team and installed skills, then the built-in catalog the CLI serves
63
+ - `--json` — Output the CLI-served built-in skill catalog as JSON
64
+ - `teamai skill get [names...]` — Print built-in skill content served by the installed CLI
65
+ - `--full` — Append the skill's references/ and templates/ files
66
+ - `--all` — Print every skill the CLI serves
67
+ - `teamai skill path <name>` — Print the packaged directory of a built-in skill (for scripts and templates)
68
+ - `teamai skill show <name>` — Show skill metadata: source / contributors / installed agents / description
69
+ - `teamai skill exclude` — Manage per-user skill exclusion (skip sync without affecting team repo)
70
+ - `teamai skill exclude list` — List excluded skills
71
+ - `teamai skill exclude add <skills...>` — Add skill(s) to the exclude list
72
+ - `teamai skill exclude remove <skills...>` — Remove skill(s) from the exclude list
73
+
74
+ ## members
75
+
76
+ - `teamai members` — Manage team members
77
+ - `teamai members list` — List team members
78
+
79
+ ## remove
80
+
81
+ - `teamai remove <type> <names...>` — Remove resource(s) from team repo and all local AI tools (type: skills|rules|agents|mcp)
82
+ - `--force` — Skip confirmation prompt
83
+
84
+ ## packages
85
+
86
+ - `teamai packages [target]` — Install team npm packages and Claude plugins declared in teamai.yaml
87
+ - `-g, --global` — Install an npm target globally (for CLI tools)
88
+ - `--registry <url>` — Use a specific npm registry for this target
89
+ - `--npm` — Treat an ambiguous target as an npm package
90
+ - `--claude` — Treat the target as a Claude plugin
91
+ - `teamai packages install [target]` — Install team npm packages and Claude plugins declared in teamai.yaml
92
+ - `-g, --global` — Install an npm target globally (for CLI tools)
93
+ - `--registry <url>` — Use a specific npm registry for this target
94
+ - `--npm` — Treat an ambiguous target as an npm package
95
+ - `--claude` — Treat the target as a Claude plugin
96
+
97
+ ## doctor
98
+
99
+ - `teamai doctor` — Diagnose configuration issues
100
+ - `--json` — Output the report as JSON (suitable for CI)
101
+
102
+ ## roles
103
+
104
+ - `teamai roles` — Manage team roles and resource namespaces
105
+ - `teamai roles init` — Create a roles manifest for the team repo (admin)
106
+ - `teamai roles list` — List all defined roles and your current role
107
+ - `teamai roles set <primary>` — Set your primary role (updates local config)
108
+ - `--add <roles...>` — Additional roles to include
109
+ - `teamai roles add <id>` — Add a new role to the manifest (admin)
110
+ - `--namespaces <ns>` — Comma-separated resource namespaces (e.g. common,hai)
111
+ - `-d, --description <desc>` — Description for the role
112
+ - `teamai roles remove <id>` — Remove a role from the manifest (admin)
113
+ - `teamai roles update <id>` — Update a role in the manifest (admin)
114
+ - `--add-namespaces <ns>` — Comma-separated namespaces to add
115
+ - `--remove-namespaces <ns>` — Comma-separated namespaces to remove
116
+ - `-d, --description <desc>` — New description for the role
117
+
118
+ ## projects
119
+
120
+ - `teamai projects` — Manage multi-project resource distribution (orthogonal to roles)
121
+ - `teamai projects list` — List defined projects and the ones active in this directory
122
+ - `teamai projects set [ids...]` — Set the projects active in this directory (comma-separated or repeated; empty to clear)
123
+ - `teamai projects members <id>` — List members registered for a project
124
+
125
+ ## tags
126
+
127
+ - `teamai tags` — Manage tag-based skill/rule filtering
128
+ - `teamai tags list` — List all available tags and subscription status
129
+ - `teamai tags subscribe <tags...>` — Subscribe to tags (only matching skills/rules will be synced)
130
+ - `teamai tags unsubscribe <tags...>` — Unsubscribe from tags
131
+ - `teamai tags add <type> <name> <tags...>` — Add tags to a skill or rule in tags.yaml (admin)
132
+
133
+ <type> Resource type: "skills" or "rules"
134
+ <name> Name of the skill or rule (directory name)
135
+ <tags> One or more tags to add
136
+
137
+ Examples:
138
+ $ teamai tags add skills hai-deploy hai infra
139
+ $ teamai tags add rules common-coding-style coding best-practices
140
+
141
+ - `teamai tags remove <type> <name> <tags...>` — Remove tags from a skill or rule in tags.yaml (admin)
142
+
143
+ <type> Resource type: "skills" or "rules"
144
+ <name> Name of the skill or rule (directory name)
145
+ <tags> One or more tags to remove
146
+
147
+ Examples:
148
+ $ teamai tags remove skills hai-deploy infra
149
+ $ teamai tags remove rules common-coding-style best-practices
150
+
151
+
152
+ ## source
153
+
154
+ - `teamai source` — Manage cross-team skill sources
155
+ - `teamai source add <repo>` — Add a cross-team source repo
156
+ - `--name <name>` — Alias for this source
157
+ - `teamai source remove <name>` — Remove a source and clean up its skills
158
+ - `teamai source add-http <endpoint>` — Add an HTTP source (report/sync/ack) alongside a git main repo
159
+ - `--token <key>` — API token for the HTTP endpoint (stored 0600, never committed)
160
+ - `--force` — Overwrite an existing HTTP source config
161
+ - `teamai source remove-http` — Remove the HTTP source and clean up its resources
162
+ - `teamai source list` — List all configured sources
163
+ - `teamai source browse <name>` — Browse public skills from a source
164
+
165
+ ## update
166
+
167
+ - `teamai update` — Check for updates and upgrade teamai CLI
168
+ - `--check` — Only check if an update is available, do not install
169
+
170
+ ## uninstall
171
+
172
+ - `teamai uninstall` — Remove all teamai-managed resources and hooks from this machine
173
+ - `--force` — Skip confirmation prompt
174
+ - `--agent <name>` — Only uninstall this agent's resources; shared resources go only if it is the last tool
175
+
176
+ ## env
177
+
178
+ - `teamai env` — Manage team environment variables
179
+ - `--reveal` — Show env variable values in plaintext (default: masked)
180
+ - `teamai env list` — List team environment variables
181
+ - `--reveal` — Show env variable values in plaintext (default: masked)
182
+ - `teamai env add <key> <value>` — Add or update a team environment variable
183
+ - `-d, --description <desc>` — Description for the variable
184
+ - `teamai env remove <key>` — Remove a team environment variable
185
+
186
+ ## hooks
187
+
188
+ - `teamai hooks` — Manage teamai hooks in AI tool settings
189
+ - `teamai hooks list` — List hook install status + effective built-in (A) and team (B) hooks
190
+ - `teamai hooks inject` — Inject teamai hooks into all AI tool settings
191
+ - `--silent` — Silent mode (suppress success message)
192
+ - `teamai hooks remove` — Remove teamai hooks from all AI tool settings
193
+
194
+ ## mcp
195
+
196
+ - `teamai mcp` — Manage team MCP servers across AI tools
197
+ - `teamai mcp list` — List team MCP servers and their per-tool install status
198
+ - `teamai mcp inject` — Inject team MCP servers into all AI tool configs
199
+ - `--dry-run` — Show what would change without writing
200
+ - `--force` — Overwrite servers that collide with user-owned entries
201
+ - `teamai mcp remove` — Remove all teamai-managed MCP servers from AI tool configs
202
+
203
+ ## webhook
204
+
205
+ - `teamai webhook` — Manage webhook integrations for team notifications
206
+ - `teamai webhook list` — List configured webhook endpoints
207
+ - `teamai webhook test` — Send test event to webhook endpoints
208
+ - `--url <url>` — Test specific endpoint URL
209
+
210
+ ## stats
211
+
212
+ - `teamai stats` — Show local skill usage statistics
213
+ - `--by-repo` — Break usage down per repository
214
+ - `--by-time` — Show activity by hour of day
215
+
216
+ ## session
217
+
218
+ - `teamai session` — Record and inspect coding-session summaries
219
+ - `teamai session save` — Record a privacy-scrubbed summary of a coding session to a local monthly log
220
+ - `--session-id <id>` — Session to record (default: most recent, or $CLAUDE_SESSION_ID)
221
+ - `--push` — Also push the summary to the team repo (feeds `teamai digest`)
222
+ - `--force` — Push even if the session is not flagged as valuable
223
+ - `--include-prompt` — Include the redacted first-prompt line in the pushed summary (default: off)
224
+ - `--scope <scope>` — Config scope for --push: user | project (default: auto-detect)
225
+
226
+ ## digest
227
+
228
+ - `teamai digest` — Generate weekly team activity digest
229
+
230
+ ## dashboard
231
+
232
+ - `teamai dashboard` — Start the AI coding session dashboard (Web UI)
233
+ - `-p, --port <port>` — Port number
234
+
235
+ ## bind-project
236
+
237
+ - `teamai bind-project` — Bind the current workspace to a ClawPro project for HTTP local-agent sync
238
+ - `--project-id <id>` — Project ID from /projects/mine
239
+ - `--skip` — Mark current workspace as skipped (never prompt again)
240
+
241
+ ## contribute
242
+
243
+ - `teamai contribute` — Contribute session knowledge to team repo
244
+ - `--file <path>` — Path to the contribution document
245
+ - `--title <title>` — Title for the contribution document
246
+ - `--session-id <id>` — Session ID for dedup tracking
247
+ - `--scope <scope>` — Target scope: user or project
248
+
249
+ ## recall
250
+
251
+ - `teamai recall [query...]` — Search team learnings knowledge base
252
+ - `--depth <level>` — Recall depth: route (entry-points only) | context (module-level, default) | lookup (full graph traversal)
253
+ - `--check` — Relevance precheck only: print RELEVANT/NOT_RELEVANT + top score; no file reads, no upvote
254
+ - `teamai recall disable` — Disable automatic knowledge-base recall
255
+ - `teamai recall enable` — Enable automatic knowledge-base recall
256
+ - `teamai recall status` — Show recall feature status
257
+ - `teamai recall feedback` — Record manual feedback for a recalled document
258
+ - `--positive <docId>` — Upvote a document (marks as actually useful)
259
+ - `--negative <docId>` — Record negative signal for a document
260
+ - `teamai recall maintenance` — Automatic maintenance of team knowledge base
261
+ - `--prune` — Remove low-confidence learnings
262
+ - `--threshold <n>` — Confidence threshold for pruning (default 0.15)
263
+ - `--archive` — Move to archive/ instead of deleting
264
+ - `--confidence-writeback` — Update frontmatter confidence scores
265
+ - `--update-quality` — Find stale docs/rules/skills and suggest updates
266
+ - `--dry-run` — Show what would be done without making changes
267
+ - `teamai recall promote [learningId]` — Promote a high-confidence learning to formal knowledge (docs/skills/rules)
268
+ - `--category <cat>` — Target category: skills | rules | docs
269
+ - `--dry-run` — Show what would be done without making changes
270
+
271
+ ## import
272
+
273
+ - `teamai import` — Import knowledge from local directories, remote repos, organizations, MRs, or iWiki
274
+ - `--dir <path>` — Extract code knowledge from a local directory (same as --from-repo but no clone)
275
+ - `--from-claude` (hidden) — Scan Claude/Cursor rule directories (~/.claude/rules, ~/.cursor/rules)
276
+ - `--from-mr <url>` — Extract learning from merged MR/PR and trigger incremental teamwiki update
277
+ - `--from-iwiki <space-id-or-url>` — Import documents from iWiki Space ID or page URL (requires TAI_PAT_TOKEN)
278
+ - `--resume` (hidden) — Resume an interrupted import session
279
+ - `--all` — Accept all suggestions without interactive confirmation
280
+ - `--output <path>` (hidden) — Write drafts to this directory instead of pushing to team repo
281
+ - `--from-repo <url>` — Clone a remote repo and generate per-repo codebase summary
282
+ - `--ssh` (hidden) — Force SSH clone even if HTTPS token is available
283
+ - `--domain <name>` (hidden) — Skip AI recommendation and assign repo to this domain explicitly
284
+ - `--from-repo-list <path>` — Batch import repos from a YAML whitelist
285
+ - `--concurrency <n>` (hidden) — Concurrent repos for --from-repo-list (default 3)
286
+ - `--incremental` — Use cached clone with fetch+reset (with --from-repo or --from-repo-list)
287
+ - `--skip-enrich` — Skip AI enrichment (only clone + extract + graph, no LLM calls)
288
+ - `--from-org <org>` — List repos under an org and generate a repo whitelist
289
+ - `--max-repos <n>` (hidden) — Cap on repos pulled from --from-org (default 200)
290
+ - `--exclude-archived` (hidden) — Exclude archived repos from --from-org (default true)
291
+ - `--include-pattern <re>` (hidden) — Regex to include repos by full name (used with --from-org)
292
+ - `--exclude-pattern <re>` (hidden) — Regex to exclude repos by full name (used with --from-org)
293
+ - `--skip-import` (hidden) — Only write drafts; skip the actual --from-repo-list run
294
+ - `--iwiki-dual` (hidden) — Enable dual-output mode for --from-iwiki (write codebase sections in addition to learning)
295
+ - `--require-review` (hidden) — Defer codebase section writes to .teamai/pending-review.jsonl for human review
296
+ - `--cache-status` — Show import cache status (repos cached, disk usage)
297
+ - `--cache-gc` — Garbage-collect stale import cache entries
298
+ - `--json` — Output cache status or GC result as JSON
299
+ - `--max-bytes <n>` (hidden) — Override capacity cap for --cache-gc
300
+ - `--stale-days <n>` (hidden) — Threshold for stale-eviction in days (default 30)
301
+
302
+ ## codebase
303
+
304
+ - `teamai codebase` — Inspect and maintain team-codebase outputs
305
+ - `--extract [path]` — Extract code knowledge and build graph from source
306
+ - `--incremental` (hidden) — Only re-extract changed files (requires prior manifest)
307
+ - `--project <name>` (hidden) — Project slug for --extract (defaults to directory name) and required for --deep-enrich
308
+ - `--max-files <n>` (hidden) — Max source files to scan (default: 200)
309
+ - `--upgrade-wiki` (hidden) — Migrate docs/team-codebase/ to teamwiki/ graph format
310
+ - `--lint` — Run global consistency lint over the teamwiki knowledge graph
311
+ - `--reconcile` — Reconcile product and code knowledge in teamwiki
312
+ - `--deep-enrich` — Generate deep knowledge docs from extracted evidence
313
+ - `--fix` (hidden) — Deprecated: teamwiki lint has no autofix; runs lint in report-only mode
314
+ - `--status` — Show knowledge-base git baseline (headSha / repoUrl / branch)
315
+ - `--severity <level>` (hidden) — Minimum severity to report: high|medium|low|info
316
+ - `--json` — Output report as JSON (suitable for CI)
317
+ - `--output <path>` (hidden) — Custom teamwiki output root directory
318
+
319
+ ## review
320
+
321
+ - `teamai review [id]` — Inspect and process .teamai/pending-review.jsonl items
322
+ - `--apply` — Apply the change for the given id (only for codebase-section)
323
+ - `--reject` — Reject the given id without applying
324
+ - `--reason <msg>` — Reason for reject
325
+ - `--all-apply` — Apply all items at or below --max-risk
326
+ - `--max-risk <level>` — Risk ceiling for --all-apply: high|medium|low (default medium)
327
+ - `--json` — Machine-readable output
328
+
329
+ ## ci
330
+
331
+ - `teamai ci` — CI pipeline integration commands
332
+ - `teamai ci extract-mr` — Extract knowledge from MR/PR and post as comment or write to team repo
333
+ - `--url <url>` — MR/PR web URL
334
+ - `--mode <mode>` — Operation mode: comment | write | both
335
+ - `--team-repo <path>` — Team knowledge repo path (required for write mode)
336
+ - `--comment-marker <marker>` — HTML comment anchor for idempotent updates
337
+ - `--write-mode <mode>` — Write strategy: direct | pending-review
338
+ - `--output <dir>` — Write artifacts to directory
339
+ - `--individual-comments` — Post each suggestion as separate comment with reaction/resolve support
@@ -3,23 +3,22 @@
3
3
  Goal: the user turns something they built into team knowledge everyone can pull.
4
4
  **Any member can do this — you do not need to be an admin.** The usual entry point
5
5
  is the user just asking in plain language, e.g. *"share this xxx skill with my
6
- team"* / *"把这个 xxx skill 分享给团队"* — then you run the publish for them.
6
+ team"*, in whatever language they work in — then you run the publish for them.
7
7
 
8
8
  ## Which kind of contribution?
9
9
 
10
10
  - **A learning** (a lesson, a gotcha, how you solved something) → this is
11
- **automatic**: TeamAI prompts at the end of a session worth sharing and the
12
- dedicated **`teamai-share-learnings`** skill takes over (it summarizes the
11
+ **automatic** once recall is on (off by default): TeamAI prompts at the end of a session worth sharing and the
12
+ dedicated `share` workflow (`teamai skill get share`) takes over (it summarizes the
13
13
  session and runs `teamai contribute`). The user does not come through this flow
14
- for it. (Step A below is only a manual fallback for when that skill isn't
15
- available.)
14
+ for it. (Step A below is only a manual fallback for while recall is off.)
16
15
  - **A reusable skill** (a `SKILL.md` others invoke) → author the skill, then
17
16
  `teamai push` (Step B — the main purpose of this reference).
18
17
 
19
18
  ## Step A — Contribute a learning by hand (fallback only)
20
19
 
21
- > Prefer the **`teamai-share-learnings`** skill. Use these manual steps only if it
22
- > is unavailable in the current tool.
20
+ > Prefer the `share` workflow (`teamai skill get share`). Use these manual steps only while
21
+ > it refuses because recall is off.
23
22
 
24
23
  1. Write a short Markdown doc that captures the lesson. Keep it concrete and
25
24
  actionable — a knowledge base, not a diary. Include YAML frontmatter for search
@@ -53,9 +52,8 @@ team"* / *"把这个 xxx skill 分享给团队"* — then you run the publish fo
53
52
  The doc lands in the team's `learnings/` and appears for teammates on their next
54
53
  `teamai pull`. It is also searchable via `teamai recall`.
55
54
 
56
- > Tip: if there is a dedicated learnings skill available in this tool
57
- > (`teamai-share-learnings`), you can use it to auto-summarize the current session
58
- > instead of writing the doc by hand.
55
+ > Tip: while recall is on, `teamai skill get share` auto-summarizes the current
56
+ > session instead of you writing the doc by hand.
59
57
 
60
58
  ## Step B — Contribute a reusable skill
61
59
 
@@ -87,6 +85,11 @@ The doc lands in the team's `learnings/` and appears for teammates on their next
87
85
  ```
88
86
 
89
87
  To publish into a specific role namespace: `teamai push --skill <path> --role <id>`.
88
+ `--role <ns>` / `--project <id>` place every new resource, not only skills: a
89
+ new rule and a new agent land in that namespace too (a project resolves each
90
+ from its own axis — `knowledge` for rules, `agents` for agents). Without one,
91
+ a new resource whose namespace cannot be resolved stays at the shared root and
92
+ reaches the whole team.
90
93
 
91
94
  ## After contributing
92
95
 
@@ -34,6 +34,14 @@ This is the #1 onboarding issue. In order:
34
34
  with `--scope user`.
35
35
  5. **Tool has no hook surface** (e.g. Gemini CLI, JoyCode): there is no auto-sync;
36
36
  run `teamai pull` manually each time.
37
+ 6. **A command reports a broken manifest** (`Invalid roles manifest…`,
38
+ `Invalid projects manifest…`, `Invalid manifests…`, or `…manifest … could not
39
+ be read`). `pull` skips that scope on purpose, since syncing without the
40
+ manifest would deliver every namespace it gates; `push` stops before pushing
41
+ anything, even with `--role`; `status` lists the other resource types. The fix
42
+ belongs in the team repo's `manifest/roles.yaml` or `manifest/projects.yaml`,
43
+ which the error names by entry — tell the user to ask a team admin. Do not
44
+ delete the manifest or edit the local clone to get past it.
37
45
 
38
46
  ## Permission / access denied
39
47
 
@@ -115,7 +123,7 @@ session and verify with `teamai pull` + `teamai list`.
115
123
  The sandbox **does not add hooks automatically** after `teamai init`. The user
116
124
  must **manually edit the config file to register the hook** so auto-sync works.
117
125
  Walk them through opening the tool's config and adding the TeamAI session-start
118
- hook entry; if unsure of the exact config, run `teamai doctor` and `teamai hooks`
126
+ hook entry; if unsure of the exact config, run `teamai doctor` and `teamai hooks list`
119
127
  to see what should be present, then have them replicate it. Until then, they can
120
128
  sync with a manual `teamai pull`.
121
129
 
@@ -0,0 +1,76 @@
1
+ ---
2
+ name: setup
3
+ description: >-
4
+ TeamAI day 0 and repo lifecycle: create a team repo as admin, join an existing team as a member,
5
+ manage members, roles, MCP and env, and uninstall. Loaded on demand by the teamai discovery stub.
6
+ ---
7
+
8
+ # teamai — setup and lifecycle
9
+
10
+ You run the commands; the user only makes choices when you ask. **They may not
11
+ know Git** — never explain branches, commits or clones.
12
+
13
+ ## Before anything
14
+
15
+ ```bash
16
+ node --version # must be >= 20
17
+ teamai --version # install once with: npm install -g teamai-cli
18
+ ```
19
+
20
+ Then pick the flow. A user **setting up a new team** becomes its admin and creates
21
+ the repo; a user **joining an existing team** needs a repo URL from their admin. A
22
+ would-be member without a URL is still the **join** flow — `join-member.md` tells
23
+ them how to ask for it. Do not send them to the create-repo flow because the URL
24
+ is missing.
25
+
26
+ | The user wants to… | Load this |
27
+ |-----------------------------------------------------------------------------|---------------------------------------------|
28
+ | Set up TeamAI for a team from scratch (create the repo) | `{SKILL_DIR}/references/setup-admin.md` |
29
+ | Join their team, with or without a repo URL | `{SKILL_DIR}/references/join-member.md` |
30
+ | Publish or update skills, rules, MCP, env; invite members; manage roles | `{SKILL_DIR}/references/manage-admin.md` |
31
+ | Remove TeamAI from this machine | `{SKILL_DIR}/references/uninstall.md` |
32
+ | Publish one skill or contribute a doc | `"$(teamai skill path core)/references/contribute-member.md"` |
33
+ | Anything that breaks along the way | `"$(teamai skill path core)/references/troubleshooting.md"` |
34
+
35
+ Supported Git providers are Tencent TGit, GitHub, GitLab and CNB;
36
+ `{SKILL_DIR}/references/setup-admin.md` carries the detection probe, the sign-in
37
+ and create-repo URLs, and the per-provider caveats, and points at
38
+ `{SKILL_DIR}/references/provider-tgit.md` for everything TGit-specific.
39
+
40
+ ## Rules for these flows
41
+
42
+ 1. **Always use a full URL** for the team repo (e.g.
43
+ `https://github.com/yourorg/yourrepo`). Never the `owner/repo` short form.
44
+ 2. **Don't limit which AI tools get set up — cover all of them by default.**
45
+ Unless the user names specific tools, do **not** pass `--agent` to restrict the
46
+ install. Let `teamai init` set up every AI tool already installed (omitting
47
+ `--agent` gives an interactive picker; select all detected tools). **After init,
48
+ report which agents were set up** — in the user's language, which tools now
49
+ auto-start TeamAI, and which detected tools were skipped and why (e.g. Codex
50
+ trust-gate, CodeBuddy design). Verify the real per-tool result with
51
+ `teamai doctor` and `teamai hooks list`.
52
+ 3. **After init, resources appear on the NEXT session.** `teamai init` injects a
53
+ session-start hook that auto-runs `teamai pull`. Empty skills/rules directories
54
+ right after init are normal; they fill in when the user opens a fresh session in
55
+ this tool. To sync immediately, run `teamai pull`.
56
+ 4. **Finish with `teamai doctor`.** Every setup or onboarding flow ends by running
57
+ it and resolving what it reports before you call the job done.
58
+
59
+ Every public command and every flag, including the flags `--help` hides, is listed in
60
+ `teamai skill get core --full` under `references/commands.md`. Do not guess a flag:
61
+ there is no member-invite flag, for instance — inviting happens on the Git
62
+ platform's website, as `manage-admin.md` describes.
63
+
64
+ ## References
65
+
66
+ In the files below, `{SKILL_DIR}` is the directory `teamai skill path setup` prints; a reference file you open on its own writes that directory as `SKILL_DIR` in braces.
67
+
68
+ | File | When to load it |
69
+ |---|---|
70
+ | `{SKILL_DIR}/references/setup-admin.md` | Creating a team repo: provider detection, auth, repo creation, first push. |
71
+ | `{SKILL_DIR}/references/join-member.md` | Joining an existing team from a repo URL. |
72
+ | `{SKILL_DIR}/references/manage-admin.md` | Day-to-day admin: publishing resources, roles, projects, MCP, env, members. |
73
+ | `{SKILL_DIR}/references/uninstall.md` | Removing TeamAI from a machine or from one agent. |
74
+ | `{SKILL_DIR}/references/provider-tgit.md` | Tencent TGit: reachability probe, `gf` install and login, repo creation on init. |
75
+
76
+ `teamai skill get setup --full` prints this skill with all five appended.