intermediate⏱45 minLesson 6 of 6

Team Collaboration Workflows

Set up OpenCode for team use. Learn configuration sharing, role-based access, collaborative patterns, and how to maintain consistency across your development team.

Team Collaboration Workflows

Why Team Configuration?

BenefitDescription
ConsistencySame behavior across team
Knowledge sharingShared skills and prompts
SecurityControlled permissions
AuditabilityTrack AI usage

Configuration Sharing

Version Control Strategy

your-project/ β”œβ”€β”€ .opencode/ β”‚ β”œβ”€β”€ config.json # βœ… Commit (team config) β”‚ β”œβ”€β”€ skills/ # βœ… Commit (shared skills) β”‚ └── memory/ # ❌ Don't commit (personal) β”œβ”€β”€ opencode.json # βœ… Commit (legacy format) └── .env # ❌ Don't commit (secrets)

.gitignore

gitignore
# OpenCode .env .opencode/memory/ .opencode/sessions/ *.log

Shared Configuration

Create .opencode/config.json:

json
{ "$schema": "https://opencode.ai/config.json", "agents": { "default": { "model": "gpt-4o", "description": "Team coding assistant" } }, "permissions": [ { "tool": "bash", "allow": ["npm *", "git *", "pytest *"], "deny": ["sudo *", "rm -rf /"] } ], "skills": { "code-review": { "manifest": ".opencode/skills/code-review/skill.yaml" } } }

Role-Based Configuration

Different Roles, Different Configs

Create role-specific config files:

bash
.config/ β”œβ”€β”€ opencode-developer.json β”œβ”€β”€ opencode-reviewer.json └── opencode-lead.json

Usage

bash
# Developer mode opencode --config .config/opencode-developer.json # Reviewer mode opencode --config .config/opencode-reviewer.json

Shared Skills

Create Team Skills

.opencode/skills/ β”œβ”€β”€ code-review/ β”‚ β”œβ”€β”€ skill.yaml β”‚ └── skill.md β”œβ”€β”€ api-design/ β”‚ β”œβ”€β”€ skill.yaml β”‚ └── skill.md └── testing/ β”œβ”€β”€ skill.yaml └── skill.md

Share via Git

bash
git add .opencode/skills/ git commit -m "Add team skills" git push

Collaborative Patterns

Code Review Workflow

100%

Pair Programming

> Switch to pair mode > Load shared project context > Let's work on the authentication module together

Knowledge Transfer

> Summarize our architecture decisions into a memory file > Create a guide for new developers

Security Best Practices

Permission Isolation

json
{ "permissions": [ { "tool": "bash", "allow": ["npm test", "npm run lint"], "deny": ["npm publish", "git push --force"] }, { "tool": "write", "allow": ["src/**", "tests/**"], "deny": [".env", "secrets/**", "*.key"] } ] }

Secrets Management

PracticeImplementation
Use environment variables${API_KEY} in config
Never commit secretsAdd .env to .gitignore
Rotate regularlyUpdate keys monthly
Audit accessLog all API calls

Monitoring and Auditing

Enable Logging

json
{ "logging": { "enabled": true, "level": "info", "file": "opencode-audit.log" } }

Track Usage

bash
# View audit log tail -f opencode-audit.log # Search for specific actions grep "bash" opencode-audit.log

Onboarding New Team Members

Checklist

  1. Clone repository
  2. Install OpenCode
  3. Copy .env.example to .env
  4. Add API keys
  5. Run opencode to verify

Documentation

Create docs/opencode-setup.md:

markdown
# OpenCode Setup ## Prerequisites - Node.js 18+ - API key from OpenAI or Anthropic ## Setup 1. npm install -g opencode 2. cp .env.example .env 3. Add your API key to .env 4. opencode --version ## Usage - `opencode` - Start interactive session - `opencode run "task"` - Run single prompt

Practice Questions

Practice Question

Which files should be committed to version control?

Practice Question

How do you share skills with your team?

Practice Question

What is the benefit of role-based configuration?

Practice Question

How do you prevent accidental deletion of production data?

Practice Question

What should you do when onboarding a new team member?


βœ…Success

Key Takeaways

  • Version control shared configuration and skills, but not secrets
  • Role-based configuration provides appropriate permissions for each team member
  • Shared skills in .opencode/skills/ ensure consistent behavior
  • Deny rules prevent dangerous operations like force push or data deletion
  • Enable logging for audit trails and usage tracking
  • Document setup procedures for new team members
  • Personal memory files should not be committed to version control
Progress100%