Skip to content

libz-renlab-ai/TeamBrain

Repository files navigation

TeamAgent

自进化 AI 规则引擎 | Self-evolving AI rule engine for Claude Code

让团队踩过的坑只踩一次——TeamAgent 自动学习你的错误,在下次犯错前实时拦截。

Automatically learns from your mistakes and intercepts them in real time — so your team only falls into each pitfall once.

npm version Node ≥22 License: MIT


快速开始 / Quick Start

# 1. 安装 / Install
npm install -g teamagent

# 2. 进入你的项目 / Go to your project
cd your-project

# 3. 初始化 / Initialize
teamagent init

# 4.(可选)一次性装团队标配插件 / (Optional) install team-standard plugins
teamagent install-plugins

# 5. 重启 Claude Code,开始使用 / Restart Claude Code — hooks + plugins are now active

团队标配插件 / Team-Standard Plugins

teamagent install-plugins 注册并启用 4 个团队标配插件(通过 claude plugin CLI):

  • superpowers — TDD / debugging / brainstorming 等工作流 skills
  • caveman — 超紧凑对话模式, 省 ~75% token
  • sales — 销售场景工作流
  • playground — 交互 HTML 实验场

写入 ~/.claude/settings.json(用户全局, 不是项目级), 所以从 init 里单独拎出, 要显式 opt-in。一次装完跨所有项目生效。

Registers 4 team-standard plugins via the claude plugin CLI. Opt-in because it writes to ~/.claude/settings.json (user-global, not project-local) — a separate scope from the rest of init.

验证安装 / Verify Installation

teamagent doctor

All 8 checks should show ✅. If any fail, follow the fix hint shown.


它能做什么 / What it does

  • 自动学习错误 — Claude Code 每次被纠正,TeamAgent 提取规则并学习
  • 实时拦截 — 下次 Claude 要犯同样错误时,Hook 在执行前发出警告或阻止
  • 越用越准 — Calibrator v2 用 Wilson Score 评分,误报规则自动降权

Learns from corrections → extracts rules → intercepts before the mistake repeats. Confidence scoring filters out false positives over time.


主要命令 / Commands

命令 说明
teamagent init 初始化到当前项目
teamagent init --install-plugins 初始化 + 同时装团队标配插件
teamagent install-plugins 独立装/重装团队标配插件
teamagent doctor 诊断安装环境
teamagent stats 查看知识库统计
teamagent analyze --commit 分析最新会话并提取规则
teamagent compile 重新编译 CLAUDE.md
teamagent pitfall 手动记录一条经验
teamagent review 复核最近添加的规则
teamagent uninstall 卸载(保留数据)

运行 teamagent --help 查看完整命令列表。 Run teamagent --help for the full command list.


常见问题 / FAQ

Node 版本不够 / Node version too old

nvm install 22 && nvm use 22

sqlite-vec 加载失败 / sqlite-vec fails to load

teamagent doctor --fix

装完没反应 / Hook not working after install

必须重启 Claude Code(不是刷新页面,是完全退出重开)。 You must fully restart Claude Code (quit and reopen, not just refresh).

Windows 下 Hook 不工作 / Hook not working on Windows

需要 Git Bash。PowerShell / CMD 不支持。 Requires Git Bash. PowerShell and CMD are not supported.

插件没装上 / Plugins not installed

teamagent install-plugins 会 shell out 到 claude plugin marketplace add + claude plugin install。如果失败:

  • 确认 claude 命令在 PATH 中(claude --version)
  • 有些 marketplace 是 GitHub 仓库, 需要你机器能访问 GitHub(SSH 或 HTTPS)
  • 失败行会打印原始 claude CLI 输出, 看那里排查

install-plugins shells out to claude plugin CLI. Ensure claude is in PATH and your machine can reach GitHub. Failure lines print raw CLI output for debugging.

如何卸载 / How to uninstall

teamagent uninstall --delete-data
npm uninstall -g teamagent
# Plugins installed via install-plugins stay put — use `claude plugin uninstall <name>` to remove them.

系统要求 / Requirements

  • Node.js ≥ 22
  • Claude Code ≥ 1.0
  • macOS / Linux / Windows (Git Bash)

License

MIT

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors