team-coordination
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseTeam Coordination Skill
团队协作Skill
Load with: base.md
Purpose: Enable multiple Claude Code sessions across a team to coordinate and work together without conflicts. Manages shared state, todo claiming, decision syncing, and session awareness.
加载方式:base.md
用途: 支持团队内多个Claude Code会话无冲突地协作。管理共享状态、待办认领、决策同步和会话感知。
Core Philosophy
核心理念
┌─────────────────────────────────────────────────────────────────┐
│ TEAM CLAUDE CODE │
│ ───────────────────────────────────────────────────────────── │
│ Multiple devs, multiple Claude sessions, one codebase. │
│ Coordination > Speed. Communication > Assumptions. │
│ │
│ Before you start: Check who's working on what. │
│ Before you claim: Make sure nobody else has it. │
│ Before you decide: Check if it's already decided. │
│ Before you push: Pull and sync state. │
└─────────────────────────────────────────────────────────────────┘┌─────────────────────────────────────────────────────────────────┐
│ TEAM CLAUDE CODE │
│ ───────────────────────────────────────────────────────────── │
│ 多人开发者,多个Claude会话,一个代码库。 │
│ 协作>速度。沟通>假设。 │
│ │
│ 开始前:查看谁在做什么。 │
│ 认领前:确保没人已认领。 │
│ 决策前:检查是否已有决策。 │
│ 推送前:拉取并同步状态。 │
└─────────────────────────────────────────────────────────────────┘Team State Structure
团队状态结构
When a project becomes multi-person, create this structure:
_project_specs/
├── team/
│ ├── state.md # Who's working on what right now
│ ├── contributors.md # Team members and their focus areas
│ └── handoffs/ # Notes when passing work to others
│ └── [feature]-handoff.md
├── session/
│ ├── current-state.md # YOUR session state (personal)
│ ├── decisions.md # SHARED - architectural decisions
│ └── code-landmarks.md # SHARED - important code locations
└── todos/
├── active.md # SHARED - with claim annotations
├── backlog.md # SHARED
└── completed.md # SHARED当项目变为多人协作时,创建以下结构:
_project_specs/
├── team/
│ ├── state.md # 当前谁在做什么
│ ├── contributors.md # 团队成员及其专注领域
│ └── handoffs/ # 工作交接说明
│ └── [feature]-handoff.md
├── session/
│ ├── current-state.md # 你的个人会话状态
│ ├── decisions.md # 共享 - 架构决策
│ └── code-landmarks.md # 共享 - 重要代码位置
└── todos/
├── active.md # 共享 - 包含认领标注
├── backlog.md # 共享
└── completed.md # 共享Team State File
团队状态文件
_project_specs/team/state.mdmarkdown
undefined_project_specs/team/state.mdmarkdown
undefinedTeam State
团队状态
Last synced: [timestamp]
最后同步时间:[时间戳]
Active Sessions
活跃会话
| Contributor | Working On | Started | Files Touched | Status |
|---|---|---|---|---|
| @alice | TODO-042: Add auth | 2024-01-15 10:30 | src/auth/* | 🟢 Active |
| @bob | TODO-038: Fix checkout | 2024-01-15 09:00 | src/cart/* | 🟡 Paused |
| - | - | - | - | - |
| 贡献者 | 正在处理的工作 | 开始时间 | 涉及文件 | 状态 |
|---|---|---|---|---|
| @alice | TODO-042: 添加认证功能 | 2024-01-15 10:30 | src/auth/* | 🟢 活跃 |
| @bob | TODO-038: 修复结账问题 | 2024-01-15 09:00 | src/cart/* | 🟡 暂停 |
| - | - | - | - | - |
Claimed Todos
已认领待办
| Todo | Claimed By | Since | ETA |
|---|---|---|---|
| TODO-042 | @alice | 2024-01-15 | Today |
| TODO-038 | @bob | 2024-01-14 | Tomorrow |
| 待办事项 | 认领人 | 认领时间 | 预计完成时间 |
|---|---|---|---|
| TODO-042 | @alice | 2024-01-15 | 今日 |
| TODO-038 | @bob | 2024-01-14 | 明日 |
Recently Completed (Last 48h)
近期完成(过去48小时)
| Todo | Completed By | When | PR |
|---|---|---|---|
| TODO-037 | @alice | 2024-01-14 | #123 |
| 待办事项 | 完成人 | 完成时间 | PR编号 |
|---|---|---|---|
| TODO-037 | @alice | 2024-01-14 | #123 |
Conflicts to Watch
需要关注的冲突
| Area | Contributors | Notes |
|---|---|---|
| src/auth/* | @alice, @carol | Carol needs auth for TODO-045, coordinate |
| 领域 | 涉及贡献者 | 说明 |
|---|---|---|
| src/auth/* | @alice, @carol | Carol需要为TODO-045使用认证功能,需协调 |
Announcements
公告
- [2024-01-15] @alice: Refactoring auth module, avoid touching until EOD
- [2024-01-14] @bob: New env var required: STRIPE_WEBHOOK_SECRET
---- [2024-01-15] @alice: 正在重构认证模块,今日下班前请勿修改相关内容
- [2024-01-14] @bob: 需要新增环境变量:STRIPE_WEBHOOK_SECRET
---Contributors File
贡献者文件
_project_specs/team/contributors.mdmarkdown
undefined_project_specs/team/contributors.mdmarkdown
undefinedContributors
贡献者
Team Members
团队成员
| Handle | Name | Focus Areas | Timezone | Status |
|---|---|---|---|---|
| @alice | Alice Smith | Backend, Auth | EST | Active |
| @bob | Bob Jones | Frontend, Payments | PST | Active |
| @carol | Carol White | DevOps, Infra | GMT | Part-time |
| 标识 | 姓名 | 专注领域 | 时区 | 状态 |
|---|---|---|---|---|
| @alice | Alice Smith | 后端、认证 | EST | 活跃 |
| @bob | Bob Jones | 前端、支付 | PST | 活跃 |
| @carol | Carol White | DevOps、基础设施 | GMT | 兼职 |
Ownership
职责归属
| Area | Primary | Backup | Notes |
|---|---|---|---|
| Authentication | @alice | @bob | All auth changes need @alice review |
| Payments | @bob | @alice | Stripe integration |
| Infrastructure | @carol | @alice | Deploy scripts, CI/CD |
| Database | @alice | @carol | Migrations need sign-off |
| 领域 | 主要负责人 | 备份负责人 | 说明 |
|---|---|---|---|
| 认证 | @alice | @bob | 所有认证变更需经@alice审核 |
| 支付 | @bob | @alice | Stripe集成 |
| 基础设施 | @carol | @alice | 部署脚本、CI/CD |
| 数据库 | @alice | @carol | 迁移需要签字确认 |
Communication
沟通方式
- Slack: #project-name
- PRs: Always tag area owner for review
- Urgent: DM on Slack
- Slack:#project-name
- PR:务必标记领域负责人进行审核
- 紧急情况:Slack直接私信
Working Hours Overlap
工作时间重叠
EST: |████████████████████|
PST: | ████████████████████|
GMT: |████████████|
6am 12pm 6pm 12am EST
Best overlap: 9am-12pm EST (all three)
---EST: |████████████████████|
PST: | ████████████████████|
GMT: |████████████|
6am 12pm 6pm 12am EST
最佳重叠时间:EST时间9am-12pm(三人都在线)
---Workflow
工作流程
Starting a Session
开始会话
┌─────────────────────────────────────────────────────────────────┐
│ START SESSION CHECKLIST │
│ ───────────────────────────────────────────────────────────── │
│ 1. git pull origin main │
│ 2. Read _project_specs/team/state.md │
│ 3. Check claimed todos - don't take what's claimed │
│ 4. Claim your todo in active.md │
│ 5. Update state.md with your session │
│ 6. Push state changes before starting work │
│ 7. Start working │
└─────────────────────────────────────────────────────────────────┘┌─────────────────────────────────────────────────────────────────┐
│ 会话开始检查清单 │
│ ───────────────────────────────────────────────────────────── │
│ 1. git pull origin main │
│ 2. 阅读 _project_specs/team/state.md │
│ 3. 检查已认领的待办事项 - 不要认领已被占有的 │
│ 4. 在active.md中认领你的待办 │
│ 5. 在state.md中更新你的会话信息 │
│ 6. 开始工作前推送状态变更 │
│ 7. 开始工作 │
└─────────────────────────────────────────────────────────────────┘Claiming a Todo
认领待办事项
In , add claim annotation:
active.mdmarkdown
undefined在中,添加认领标注:
active.mdmarkdown
undefined[TODO-042] Add email validation
[TODO-042] 添加邮箱验证
Status: in-progress
Claimed: @alice (2024-01-15 10:30 EST)
ETA: Today
...
undefined状态: 进行中
认领人: @alice (2024-01-15 10:30 EST)
预计完成时间: 今日
...
undefinedDuring Work
工作期间
- Update if you touch new files
state.md - Check before making architectural choices
decisions.md - If you make a decision, add it to immediately
decisions.md - Push state updates every 1-2 hours (keeps team in sync)
- 若修改新文件,更新state.md
- 进行架构决策前查看decisions.md
- 若做出决策,立即添加至decisions.md
- 每1-2小时推送一次状态更新(保持团队同步)
Ending a Session
结束会话
┌─────────────────────────────────────────────────────────────────┐
│ END SESSION CHECKLIST │
│ ───────────────────────────────────────────────────────────── │
│ 1. Commit your work (even if WIP) │
│ 2. Update your current-state.md │
│ 3. Update team state.md (status → Paused or Done) │
│ 4. If passing to someone: create handoff note │
│ 5. Unclaim todo if abandoning │
│ 6. Push everything │
└─────────────────────────────────────────────────────────────────┘┌─────────────────────────────────────────────────────────────────┐
│ 会话结束检查清单 │
│ ───────────────────────────────────────────────────────────── │
│ 1. 提交工作内容(即使是未完成的) │
│ 2. 更新你的current-state.md │
│ 3. 更新团队state.md(状态→暂停或完成) │
│ 4. 若交接给他人:创建工作交接说明 │
│ 5. 若放弃任务,取消待办认领 │
│ 6. 推送所有变更 │
└─────────────────────────────────────────────────────────────────┘Creating a Handoff
创建工作交接
When passing work to another team member, create:
_project_specs/team/handoffs/auth-feature-handoff.mdmarkdown
undefined当将工作交接给其他团队成员时,创建:
_project_specs/team/handoffs/auth-feature-handoff.mdmarkdown
undefinedHandoff: Auth Feature (TODO-042)
工作交接:认证功能(TODO-042)
From: @alice
To: @bob
Date: 2024-01-15
交接人: @alice
接收人: @bob
日期: 2024-01-15
Status
状态
70% complete. Core auth flow works, need to add:
- Password reset flow
- Email verification
完成70%。核心认证流程可用,需添加:
- 密码重置流程
- 邮箱验证
What's Done
已完成内容
- Login/logout working
- JWT tokens implemented
- Session management done
- 登录/登出功能正常
- 已实现JWT令牌
- 会话管理完成
What's Left
剩余工作
- Password reset - see src/auth/reset.ts (skeleton exists)
- Email verification - need to integrate SendGrid
- 密码重置 - 查看src/auth/reset.ts(已有框架)
- 邮箱验证 - 需要集成SendGrid
Key Decisions Made
已做出的关键决策
- Using JWT not sessions (see decisions.md)
- Tokens expire in 7 days
- Refresh tokens stored in httpOnly cookies
- 使用JWT而非会话(见decisions.md)
- 令牌7天后过期
- 刷新令牌存储在httpOnly cookies中
Watch Out For
需要注意的问题
- The function has a weird edge case with expired tokens
validateToken - Don't touch - it's fragile rn
authMiddleware.ts
- 函数在处理过期令牌时有特殊边界情况
validateToken - 不要修改- 当前该文件不稳定
authMiddleware.ts
Files to Start With
起始文件
- src/auth/reset.ts - password reset
- src/email/verification.ts - email flow
- tests/auth.test.ts - add tests here
- src/auth/reset.ts - 密码重置
- src/email/verification.ts - 邮箱流程
- tests/auth.test.ts - 在此添加测试
Questions?
疑问?
Slack me @alice if stuck
---遇到问题请在Slack上@alice
---Conflict Prevention
冲突预防
File-Level Awareness
文件级感知
Before modifying a file, check state.md for who's touching what:
markdown
undefined修改文件前,查看state.md中谁在处理相关内容:
markdown
undefinedActive Sessions
活跃会话
| Contributor | Working On | Started | Files Touched | Status |
|---|---|---|---|---|
| @alice | TODO-042 | ... | src/auth/, src/middleware/ | 🟢 Active |
If you need to touch `src/auth/*` and Alice is working there:
1. Check if it's truly conflicting (same file? same functions?)
2. Coordinate via Slack before proceeding
3. Add a note to "Conflicts to Watch" section| 贡献者 | 正在处理的工作 | 开始时间 | 涉及文件 | 状态 |
|---|---|---|---|---|
| @alice | TODO-042 | ... | src/auth/, src/middleware/ | 🟢 活跃 |
如果你需要修改`src/auth/*`且Alice正在处理该领域:
1. 检查是否真的存在冲突(同一文件?同一函数?)
2. 先通过Slack协调
3. 在"需要关注的冲突"部分添加说明Pre-Push Check
推送前检查
Before pushing, always:
bash
git pull origin main推送前,务必执行:
bash
git pull origin mainResolve any conflicts
解决所有冲突
git push
undefinedgit push
undefinedPR Tagging
PR标记
Always tag area owners in PRs:
markdown
undefinedPR中务必标记领域负责人:
markdown
undefinedPR: Add password reset flow
PR:添加密码重置流程
Implements TODO-042
cc: @alice (auth owner), @bob (reviewer)
实现TODO-042
抄送:@alice(认证负责人),@bob(审核人)
Changes
变更内容
- Added password reset endpoint
- Added email templates
- 添加了密码重置端点
- 添加了邮箱模板
Testing
测试
- Unit tests pass
- Manual testing done
---- 单元测试通过
- 手动测试完成
---Decision Syncing
决策同步
Before Making a Decision
决策前
- Pull latest
decisions.md - Check if decision already exists
- If similar decision exists, follow it (consistency > preference)
- If new decision needed, add it and push immediately
- 拉取最新的
decisions.md - 检查是否已有相同决策
- 若存在类似决策,遵循该决策(一致性>偏好)
- 若需要新决策,添加后立即推送
Decision Format
决策格式
markdown
undefinedmarkdown
undefined[2024-01-15] JWT vs Sessions for Auth (@alice)
[2024-01-15] 认证使用JWT还是会话 (@alice)
Decision: Use JWT tokens
Context: Need auth for API and mobile app
Options:
- Sessions - simpler, server-side state
- JWT - stateless, works for mobile Choice: JWT Reasoning: Mobile app needs stateless auth, JWT works across platforms Trade-offs: Token revocation is harder, need refresh token strategy Approved by: @bob, @carol
---决策: 使用JWT令牌
背景: API和移动应用需要认证
选项:
- 会话 - 更简单,服务端状态
- JWT - 无状态,适用于移动应用 选择: JWT 理由: 移动应用需要无状态认证,JWT跨平台可用 权衡: 令牌撤销更困难,需要刷新令牌策略 批准人: @bob, @carol
---Commands
命令
Check Team State
查看团队状态
bash
undefinedbash
undefinedSee who's working on what
查看谁在做什么
cat _project_specs/team/state.md
cat _project_specs/team/state.md
Quick active sessions check
快速查看活跃会话
grep "🟢 Active" _project_specs/team/state.md
undefinedgrep "🟢 Active" _project_specs/team/state.md
undefinedClaim a Todo
认领待办
- Edit
_project_specs/todos/active.md - Add claim annotation to todo
- Update
_project_specs/team/state.md - Commit and push
- 编辑
_project_specs/todos/active.md - 为待办事项添加认领标注
- 更新
_project_specs/team/state.md - 提交并推送
Release a Claim
释放认领
- Remove claim annotation from todo
- Update state.md (remove from Claimed Todos)
- Commit and push
- 从待办事项中移除认领标注
- 更新state.md(从已认领待办中移除)
- 提交并推送
Git Hooks for Teams
团队Git钩子
Pre-Push Hook Addition
添加推送前钩子
Add team state sync check to pre-push:
bash
undefined在推送前钩子中添加团队状态同步检查:
bash
undefinedIn .git/hooks/pre-push (add to existing)
在.git/hooks/pre-push中添加(追加到现有内容)
Check if team state is current
检查团队状态是否为最新
echo "🔄 Checking team state..."
git fetch origin main --quiet
LOCAL_STATE=$(git show HEAD:_project_specs/team/state.md 2>/dev/null | md5)
REMOTE_STATE=$(git show origin/main:_project_specs/team/state.md 2>/dev/null | md5)
if [ "$LOCAL_STATE" != "$REMOTE_STATE" ]; then
echo "⚠️ Team state has changed on remote!"
echo " Run: git pull origin main"
echo " Then check _project_specs/team/state.md for updates"
# Warning only, don't block
fi
---echo "🔄 检查团队状态..."
git fetch origin main --quiet
LOCAL_STATE=$(git show HEAD:_project_specs/team/state.md 2>/dev/null | md5)
REMOTE_STATE=$(git show origin/main:_project_specs/team/state.md 2>/dev/null | md5)
if [ "$LOCAL_STATE" != "$REMOTE_STATE" ]; then
echo "⚠️ 远程团队状态已变更!"
echo " 执行:git pull origin main"
echo " 然后查看_project_specs/team/state.md获取更新"
# 仅警告,不阻止推送
fi
---Claude Instructions
Claude指令
At Session Start
会话开始时
When user starts a session in a team project:
-
Check for
_project_specs/team/state.md -
If exists, read it and report:
- Who's currently active
- What todos are claimed
- Any conflicts to watch
- Recent announcements
-
Ask what they want to work on
-
Check if it's already claimed
-
Help them claim and update state
当用户在团队项目中开始会话时:
-
检查是否存在
_project_specs/team/state.md -
若存在,读取并报告:
- 当前活跃的成员
- 已认领的待办事项
- 需要关注的冲突
- 近期公告
-
询问用户想要处理的内容
-
检查该内容是否已被认领
-
帮助用户认领并更新状态
During Session
会话期间
- Before touching files, check if someone else is working there
- Before making decisions, check decisions.md
- Remind user to update state periodically
- 修改文件前,检查是否有其他人在处理相关内容
- 决策前,查看decisions.md
- 提醒用户定期更新状态
At Session End
会话结束时
- Prompt user to update state.md
- Ask if they need to create a handoff
- Remind them to push state changes
- 提示用户更新state.md
- 询问是否需要创建工作交接说明
- 提醒用户推送状态变更
Single → Multi-Person Conversion
单人→多人项目转换
When a project needs team coordination:
- Run
/check-contributors - Create structure
_project_specs/team/ - Initialize and
state.mdcontributors.md - Add claim annotations to active todos
- Update CLAUDE.md to reference team-coordination.md skill
当项目需要团队协作时:
- 运行
/check-contributors - 创建结构
_project_specs/team/ - 初始化和
state.mdcontributors.md - 为活跃待办事项添加认领标注
- 更新CLAUDE.md以引用team-coordination.md技能
Quick Reference
快速参考
Status Icons
状态图标
🟢 Active - Currently working
🟡 Paused - Stepped away, will return
🔴 Blocked - Needs help/waiting on something
⚪ Offline - Not working today🟢 活跃 - 当前正在工作
🟡 暂停 - 暂时离开,会返回
🔴 阻塞 - 需要帮助/等待相关内容
⚪ 离线 - 今日不工作Claim Format
认领格式
markdown
**Claimed:** @handle (YYYY-MM-DD HH:MM TZ)markdown
**认领人:** @标识 (YYYY-MM-DD HH:MM 时区)Daily Standup Template
每日站会模板
markdown
undefinedmarkdown
undefinedStandup [DATE]
站会 [日期]
@alice
@alice
- Yesterday: Finished TODO-042 auth flow
- Today: Starting TODO-045 password reset
- Blockers: None
- 昨日:完成TODO-042认证流程
- 今日:开始处理TODO-045密码重置
- 阻塞项:无
@bob
@bob
- Yesterday: Fixed checkout bug
- Today: Payment webhook integration
- Blockers: Need STRIPE_WEBHOOK_SECRET from @carol
---- 昨日:修复结账bug
- 今日:支付webhook集成
- 阻塞项:需要从@carol获取STRIPE_WEBHOOK_SECRET
---Checklist
检查清单
Starting Work
开始工作
-
git pull origin main - Read
team/state.md - Check todo not claimed
- Claim todo in
active.md - Update
state.md - Push state changes
-
git pull origin main - 阅读
team/state.md - 检查待办事项未被认领
- 在中认领待办
active.md - 更新
state.md - 推送状态变更
Ending Work
结束工作
- Commit all changes
- Update
current-state.md - Update
team/state.md - Create handoff if needed
- Push everything
- 提交所有变更
- 更新
current-state.md - 更新
team/state.md - 如有需要创建工作交接说明
- 推送所有内容