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?
| Benefit | Description |
|---|---|
| Consistency | Same behavior across team |
| Knowledge sharing | Shared skills and prompts |
| Security | Controlled permissions |
| Auditability | Track 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/
*.logShared 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.jsonUsage
bash
# Developer mode
opencode --config .config/opencode-developer.json
# Reviewer mode
opencode --config .config/opencode-reviewer.jsonShared 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 pushCollaborative Patterns
Code Review Workflow
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
| Practice | Implementation |
|---|---|
| Use environment variables | ${API_KEY} in config |
| Never commit secrets | Add .env to .gitignore |
| Rotate regularly | Update keys monthly |
| Audit access | Log 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.logOnboarding New Team Members
Checklist
- Clone repository
- Install OpenCode
- Copy
.env.exampleto.env - Add API keys
- Run
opencodeto 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 promptPractice 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%