自进化 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.
# 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 activeteamagent 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.
teamagent doctorAll 8 checks should show ✅. If any fail, follow the fix hint shown.
- 自动学习错误 — 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.
| 命令 | 说明 |
|---|---|
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.
Node 版本不够 / Node version too old
nvm install 22 && nvm use 22sqlite-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)
- 失败行会打印原始
claudeCLI 输出, 看那里排查
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.- Node.js ≥ 22
- Claude Code ≥ 1.0
- macOS / Linux / Windows (Git Bash)
MIT