Contribute — 分享 Session 经验到团队知识库
总结本次 AI 编码 session 中学到的经验,推送到团队知识库。
【重要】所有生成的文档必须使用中文撰写。
When to Use
- When teamai suggests this session has valuable content worth sharing
- When you've solved a tricky problem and want to document the solution
- When you've discovered a useful workflow or pattern
- After a long session with diverse tool usage
How It Works
- 总结:回顾本次 session 的工具使用、解决的问题、发现的模式
- 生成文档:用中文撰写 Markdown 文档,涵盖:
- 任务/问题是什么
- 关键决策及原因
- 解决方案、变通方法或发现的模式
- 哪些工具/skill 特别有用
- 踩坑点和注意事项
- 保存临时文件:写入临时文件
- 推送到团队:运行
teamai contribute --file <path> --title "<title>"
Document Template
【必须】文档必须包含 YAML frontmatter,用于搜索索引和知识发现。
---
title: "<简短标题,描述核心问题或发现>"
author: <username>
date: <YYYY-MM-DD>
tags: [tag1, tag2, tag3]
---
## 背景
在做什么?遇到了什么问题?
## 解决方案
怎么解决的?关键步骤是什么?
## 经验总结
- 经验 1
- 经验 2
## 相关 Skills
- skill-name-1
- skill-name-2
Frontmatter 字段说明
| 字段 |
必须 |
说明 |
示例 |
| title |
✅ |
简短标题(<60 字符) |
"K8s Pod OOM 排查指南" |
| author |
✅ |
贡献者用户名 |
jeffyxu |
| date |
✅ |
日期 YYYY-MM-DD |
2026-03-28 |
| tags |
✅ |
2-5 个关键标签 |
[k8s, oom, troubleshooting] |
Tags 选择建议
从以下类别中选择 2-5 个:
- 技术栈: python, typescript, go, k8s, docker, sglang, cuda
- 问题类型: troubleshooting, performance, deployment, config, api
- 模式: workflow, pattern, tool-usage, best-practice
- 场景: debugging, testing, monitoring, security
Example
# AI 生成总结文档到 /tmp/session-summary.md 后
teamai contribute --file /tmp/session-summary.md --title "K8s pod 启动超时排查"
Important
- Run this as a sub-agent (Agent tool) to avoid polluting the main session's context
- The document is pushed directly to master in the team repo's
learnings/ directory
- Team members will see it on their next
teamai pull
- Keep summaries concise and actionable — this is a knowledge base, not a diary
1---2name: teamai-share-learnings3description: Contribute — 分享 Session 经验到团队知识库4---56# Contribute — 分享 Session 经验到团队知识库78总结本次 AI 编码 session 中学到的经验,推送到团队知识库。910**【重要】所有生成的文档必须使用中文撰写。**1112## When to Use1314- When teamai suggests this session has valuable content worth sharing15- When you've solved a tricky problem and want to document the solution16- When you've discovered a useful workflow or pattern17- After a long session with diverse tool usage1819## How It Works20211. **总结**:回顾本次 session 的工具使用、解决的问题、发现的模式222. **生成文档**:用中文撰写 Markdown 文档,涵盖:23 - 任务/问题是什么24 - 关键决策及原因25 - 解决方案、变通方法或发现的模式26 - 哪些工具/skill 特别有用27 - 踩坑点和注意事项283. **保存临时文件**:写入临时文件294. **推送到团队**:运行 `teamai contribute --file <path> --title "<title>"`3031## Document Template3233**【必须】文档必须包含 YAML frontmatter,用于搜索索引和知识发现。**3435```markdown36---37title: "<简短标题,描述核心问题或发现>"38author: <username>39date: <YYYY-MM-DD>40tags: [tag1, tag2, tag3]41---4243## 背景44在做什么?遇到了什么问题?4546## 解决方案47怎么解决的?关键步骤是什么?4849## 经验总结50- 经验 151- 经验 25253## 相关 Skills54- skill-name-155- skill-name-256```5758### Frontmatter 字段说明5960| 字段 | 必须 | 说明 | 示例 |61|------|------|------|------|62| title | ✅ | 简短标题(<60 字符) | "K8s Pod OOM 排查指南" |63| author | ✅ | 贡献者用户名 | jeffyxu |64| date | ✅ | 日期 YYYY-MM-DD | 2026-03-28 |65| tags | ✅ | 2-5 个关键标签 | [k8s, oom, troubleshooting] |6667### Tags 选择建议6869从以下类别中选择 2-5 个:70- **技术栈**: python, typescript, go, k8s, docker, sglang, cuda71- **问题类型**: troubleshooting, performance, deployment, config, api72- **模式**: workflow, pattern, tool-usage, best-practice73- **场景**: debugging, testing, monitoring, security7475## Example7677```bash78# AI 生成总结文档到 /tmp/session-summary.md 后79teamai contribute --file /tmp/session-summary.md --title "K8s pod 启动超时排查"80```8182## Important8384- Run this as a **sub-agent** (Agent tool) to avoid polluting the main session's context85- The document is pushed directly to master in the team repo's `learnings/` directory86- Team members will see it on their next `teamai pull`87- Keep summaries concise and actionable — this is a knowledge base, not a diary