Onboarding
Welcome to the Warcraft II Notifications Plugin for OpenCode! This guide will help you get up to speed quickly, whether you’re a new contributor, maintainer, or team member.
Table of Contents
Section titled “Table of Contents”First Day
Section titled “First Day”Hour 1: Environment Setup
Section titled “Hour 1: Environment Setup”1. Clone and Install
Section titled “1. Clone and Install”# Clone the repositorygit clone https://github.com/pantheon-org/opencode-warcraft-notifications.gitcd opencode-warcraft-notifications
# Install dependenciesbun install
# Verify installationbun test2. Verify Your Environment
Section titled “2. Verify Your Environment”# Check Bun version (should be 1.0.0+)bun --version
# Check Node version (should be 18.0.0+)node --version
# Check Git configurationgit config --list | grep user3. IDE Setup
Section titled “3. IDE Setup”Visual Studio Code (Recommended):
# Install recommended extensionscode --install-extension dbaeumer.vscode-eslintcode --install-extension esbenp.prettier-vscodecode --install-extension oven.bun-vscode
# Open the projectcode .Settings (.vscode/settings.json - already configured):
- Auto-format on save
- ESLint auto-fix
- TypeScript support
Hour 2: Explore the Codebase
Section titled “Hour 2: Explore the Codebase”Project Structure Overview
Section titled “Project Structure Overview”opencode-warcraft-notifications/├── src/ # Source code│ ├── notification.ts # Main plugin logic│ ├── plugin-config.ts # Configuration management│ ├── sounds.ts # Sound selection│ ├── bundled-sounds.ts # Sound installation│ └── sound-data/ # Sound metadata├── data/ # Bundled WAV files│ ├── alliance/ # Alliance sounds│ └── horde/ # Horde sounds├── docs/ # Documentation├── .github/workflows/ # CI/CD automation└── index.ts # Plugin entry pointKey Files to Read
Section titled “Key Files to Read”- README.md - Project overview and quick start
- docs/ARCHITECTURE.md - System design and components
- docs/DEVELOPMENT.md - Development workflow
- src/notification.ts - Core plugin logic
- package.json - Dependencies and scripts
Run Your First Tests
Section titled “Run Your First Tests”# Run all testsbun test
# Run tests in watch modebun test --watch
# Run tests with coveragebun test --coverage
# Run type checkingbun run type-check
# Run lintingbun run lintHour 3: Make Your First Change
Section titled “Hour 3: Make Your First Change”Exercise: Add a Debug Log
Section titled “Exercise: Add a Debug Log”- Open
src/notification.ts - Find the
session.idleevent handler (around line 83) - Add a debug log:
if (event.type === 'session.idle') { if (process.env.DEBUG_OPENCODE) { console.log('[Warcraft Plugin] Session idle detected'); } const summary = getIdleSummary(lastMessage?.text) ?? 'Idle'; // ... rest of the code}- Test your change:
# Run testsbun test src/notification.test.ts
# Test with debug modeDEBUG_OPENCODE=1 bun test src/notification.test.ts- Verify code quality:
# Format codebun run format
# Check lintingbun run lint
# Type checkbun run type-checkHour 4: Test the Plugin Locally
Section titled “Hour 4: Test the Plugin Locally”Install Plugin Locally
Section titled “Install Plugin Locally”- Link the plugin to OpenCode:
# Build the pluginbun run build
# Create a test projectmkdir ~/test-warcraft-plugincd ~/test-warcraft-plugin
# Create OpenCode configcat > .opencode/opencode.json << 'EOF'{ "$schema": "https://opencode.ai/config.json", "plugin": ["@pantheon-ai/opencode-warcraft-notifications"]}EOF
# Create plugin configcat > .opencode/plugin.json << 'EOF'{ "@pantheon-ai/opencode-warcraft-notifications": { "faction": "alliance" }}EOF- Test the plugin:
# Start OpenCodeopencode
# Wait for idle event (or trigger manually)# You should hear Warcraft II sounds!Troubleshooting
Section titled “Troubleshooting”No sound playing?
# Check if sounds are installedls ~/.local/share/opencode/storage/plugin/@pantheon-ai/opencode-warcraft-notifications/sounds/
# Enable debug modeDEBUG_OPENCODE=1 opencode
# Check audio on macOSafplay /System/Library/Sounds/Glass.aiff
# Check audio on Linuxcanberra-gtk-play --id=messagePlugin not loading?
# Check OpenCode logstail -f ~/.cache/opencode/logs/opencode.log
# Verify plugin installationls ~/.cache/opencode/node_modules/@pantheon-ai/First Week
Section titled “First Week”Day 1-2: Deep Dive into Architecture
Section titled “Day 1-2: Deep Dive into Architecture”Study the Architecture
Section titled “Study the Architecture”Read these documents in order:
-
- System architecture overview
- Component architecture
- Data flow diagrams
- Platform integration
-
- Plugin entry point
- Notification module
- Configuration module
- Sound manager
- Bundled sounds module
Understand the Data Flow
Section titled “Understand the Data Flow”Key Concepts to Master
Section titled “Key Concepts to Master”-
Plugin Lifecycle
- Initialization
- Event handling
- Configuration loading
- Sound installation
-
Configuration Precedence
- Environment variables
- Project-specific config
- Global config
- Default values
-
Sound Management
- Bundled sounds
- Faction-based selection
- File system operations
- Platform-specific playback
-
Testing Strategy
- Unit tests
- Integration tests
- Edge case tests
- Mock strategies
Day 3-4: Explore CI/CD Pipeline
Section titled “Day 3-4: Explore CI/CD Pipeline”Study the Pipeline
Section titled “Study the Pipeline”Read these documents:
- Pipeline Documentation - Complete technical reference
- GitHub Workflows - Setup guides
- Deployment Guide - Operations
Understand the Workflows
Section titled “Understand the Workflows”The project uses 8 automated workflows:
Key Workflows
Section titled “Key Workflows”-
PR Validation (
pr-validation.yml)- Runs tests, linting, type checking
- Validates documentation
- Checks repository configuration
-
Smart Version Bump (
smart-version-bump.yml)- AI-powered version determination
- Analyzes commit messages
- Creates version bump PRs
-
Release & Publish (
release-publish.yml)- Creates GitHub releases
- Publishes to npm
- Generates release notes
-
Auto-Merge Bot (
auto-merge-bot.yml)- Automatically merges approved PRs
- Handles version bump PRs
- Prevents merge conflicts
Try It Yourself
Section titled “Try It Yourself”- Create a test PR:
# Create a feature branchgit checkout -b test/onboarding-exercise
# Make a small changeecho "// Test comment" >> src/notification.ts
# Commit and pushgit add src/notification.tsgit commit -m "test: Add onboarding exercise comment"git push origin test/onboarding-exercise
# Create PR (use GitHub CLI or web interface)gh pr create --title "test: Onboarding exercise" --body "Testing the CI/CD pipeline"-
Watch the workflows:
- Go to GitHub Actions tab
- Watch PR Validation run
- See test results
- Observe auto-merge (if approved)
-
Clean up:
# Close the PRgh pr close test/onboarding-exercise
# Delete the branchgit branch -D test/onboarding-exercisegit push origin --delete test/onboarding-exerciseDay 5: Contribute Your First Feature
Section titled “Day 5: Contribute Your First Feature”Choose a Starter Issue
Section titled “Choose a Starter Issue”Look for issues labeled:
good first issuehelp wanteddocumentationenhancement
Example: Add a New Sound Category
Section titled “Example: Add a New Sound Category”Let’s add a “rare” sound category that plays occasionally:
- Create a feature branch:
git checkout -b feature/rare-sounds- Add rare sounds to sound data:
export const allianceSounds = [ // ... existing sounds ... { filename: 'jobs_done.wav', category: 'rare', // Add this faction: 'alliance', },];- Update sound selection logic:
export const getRandomSoundFromFaction = ( faction: Faction, includeRare: boolean = false,): string => { const factionSounds = getSoundsByFaction(faction);
// Filter out rare sounds unless explicitly requested const availableSounds = includeRare ? factionSounds : factionSounds.filter((s) => s.category !== 'rare');
return availableSounds[Math.floor(Math.random() * availableSounds.length)];};- Add tests:
describe('getRandomSoundFromFaction', () => { it('should exclude rare sounds by default', () => { const sound = getRandomSoundFromFaction('alliance'); expect(sound.category).not.toBe('rare'); });
it('should include rare sounds when requested', () => { const sounds = Array.from({ length: 100 }, () => getRandomSoundFromFaction('alliance', true)); const hasRare = sounds.some((s) => s.category === 'rare'); expect(hasRare).toBe(true); });});- Update documentation:
### Rare Sounds
The plugin includes special "rare" sounds that play occasionally:
- `jobs_done.wav` - Peasant work completion- `orc_work_completed.wav` - Orc work completion
To enable rare sounds:
\`\`\`json{"@pantheon-ai/opencode-warcraft-notifications": {"faction": "both","includeRare": true}}\`\`\`- Submit your PR:
# Run testsbun test
# Format and lintbun run formatbun run lint
# Commit changesgit add .git commit -m "feat: Add rare sound category with optional inclusion"
# Push and create PRgit push origin feature/rare-soundsgh pr create --title "feat: Add rare sound category" \ --body "Adds a rare sound category that can be optionally enabled"First Month
Section titled “First Month”Week 1-2: Master the Codebase
Section titled “Week 1-2: Master the Codebase”Complete Understanding
Section titled “Complete Understanding”By the end of week 2, you should be able to:
- Explain the plugin lifecycle
- Describe the configuration precedence
- Implement a new sound category
- Add comprehensive tests
- Update documentation
- Navigate the CI/CD pipeline
- Review PRs effectively
Advanced Topics
Section titled “Advanced Topics”-
Testing Strategies
- Mock file system operations
- Test platform-specific code
- Edge case coverage
- Performance testing
-
Configuration Management
- Schema validation
- Environment variable handling
- Cross-platform paths
- Default value resolution
-
Sound Management
- Bundled sound installation
- File system operations
- Error handling
- Fallback strategies
Week 3-4: Contribute Meaningfully
Section titled “Week 3-4: Contribute Meaningfully”Take Ownership
Section titled “Take Ownership”Choose an area to specialize in:
-
Core Plugin Logic
- Event handling
- Sound selection
- Notification delivery
- Error handling
-
Configuration System
- Schema validation
- Configuration loading
- Default resolution
- Documentation
-
CI/CD Pipeline
- Workflow optimization
- Version management
- Release automation
- Documentation deployment
-
Documentation
- User guides
- API documentation
- Architecture diagrams
- Troubleshooting guides
Mentor Others
Section titled “Mentor Others”- Review PRs from other contributors
- Answer questions in discussions
- Improve onboarding documentation
- Create tutorial content
Key Resources
Section titled “Key Resources”Documentation
Section titled “Documentation”- README - Project overview
- User Guide - End-user documentation
- Development Guide - Development workflow
- API Documentation - Technical reference
- Architecture - System design
- Deployment Guide - Operations
- Pipeline Documentation - CI/CD reference
External Resources
Section titled “External Resources”- OpenCode Plugin Documentation - Official plugin guide
- Bun Documentation - Bun runtime
- TypeScript Handbook - TypeScript guide
- GitHub Actions Documentation - CI/CD
- Bun - JavaScript runtime and toolkit
- TypeScript - Type-safe JavaScript
- ESLint - Linting
- Prettier - Code formatting
- GitHub CLI - GitHub command-line tool
Team Structure
Section titled “Team Structure”Maintainers
Section titled “Maintainers”- Review and merge PRs
- Manage releases
- Set project direction
- Mentor contributors
Contributors
Section titled “Contributors”- Submit PRs
- Fix bugs
- Add features
- Improve documentation
Community Members
Section titled “Community Members”- Report issues
- Suggest features
- Answer questions
- Share feedback
Current Team
Section titled “Current Team”- @thoroc - Project Lead & Maintainer
- Pantheon AI Team - Core Contributors
Communication
Section titled “Communication”Channels
Section titled “Channels”GitHub Issues
Section titled “GitHub Issues”Use for:
- Bug reports
- Feature requests
- Technical questions
- Documentation improvements
Template:
**Description**: Clear description of the issue
**Steps to Reproduce**:
1. Step one2. Step two3. Step three
**Expected Behavior**: What should happen
**Actual Behavior**: What actually happens
**Environment**:
- OS: macOS/Linux- OpenCode version: X.X.X- Plugin version: X.X.XGitHub Discussions
Section titled “GitHub Discussions”Use for:
- General questions
- Feature ideas
- Best practices
- Community chat
Pull Requests
Section titled “Pull Requests”Use for:
- Code changes
- Documentation updates
- Bug fixes
- New features
PR Template:
## Description
Brief description of changes
## Type of Change
- [ ] Bug fix- [ ] New feature- [ ] Documentation update- [ ] Refactoring
## Testing
- [ ] Tests added/updated- [ ] All tests passing- [ ] Manual testing completed
## Documentation
- [ ] Documentation updated- [ ] CHANGELOG updated (if applicable)Response Times
Section titled “Response Times”- Issues: 24-48 hours for initial response
- PRs: 48-72 hours for initial review
- Discussions: Best effort, community-driven
Getting Help
Section titled “Getting Help”Stuck on Something?
Section titled “Stuck on Something?”-
Check Documentation
- Search the docs for your question
- Check the FAQ in User Guide
- Review troubleshooting sections
-
Search Existing Issues
- Someone may have had the same problem
- Check closed issues too
- Look for similar PRs
-
Ask in Discussions
- Describe your problem clearly
- Include relevant code/logs
- Mention what you’ve tried
-
Create an Issue
- Use the issue template
- Provide reproduction steps
- Include environment details
Common Questions
Section titled “Common Questions””How do I test my changes locally?"
Section titled “”How do I test my changes locally?"”# Run testsbun test
# Test with debug modeDEBUG_OPENCODE=1 bun test
# Test specific filebun test src/notification.test.ts
# Test with coveragebun test --coverage"How do I add a new sound?”
Section titled “"How do I add a new sound?””- Add WAV file to
data/alliance/ordata/horde/ - Update sound metadata in
src/sound-data/ - Add tests in
src/sounds.test.ts - Update documentation in
docs/USER_GUIDE.md
”How do I update documentation?”
Section titled “”How do I update documentation?””- Edit markdown files in
docs/ - Use Mermaid for diagrams
- Test locally with GitHub Pages preview
- Submit PR with documentation changes
”How does the CI/CD pipeline work?”
Section titled “”How does the CI/CD pipeline work?””See the Pipeline Documentation for complete details.
Next Steps
Section titled “Next Steps”After Onboarding
Section titled “After Onboarding”-
Join the Community
- Star the repository
- Watch for updates
- Participate in discussions
-
Make Regular Contributions
- Fix bugs
- Add features
- Improve documentation
- Review PRs
-
Share Your Experience
- Write blog posts
- Create tutorials
- Give talks
- Mentor others
Career Growth
Section titled “Career Growth”Contributing to this project helps you:
- Learn OpenCode Plugin Development
- Master TypeScript and Bun
- Understand CI/CD Automation
- Practice Code Review
- Build Your Portfolio
Feedback
Section titled “Feedback”Improve This Guide
Section titled “Improve This Guide”Found something unclear? Have suggestions?
- Create an issue: GitHub Issues
- Start a discussion: GitHub Discussions
- Submit a PR: Improve this document directly
Welcome to the team! We’re excited to have you here.
“Work complete!” - Warcraft II Peasant
”Zug zug!” - Warcraft II Orc
Document Version: 1.0
Last Updated: 2025-11-10
Maintained By: Pantheon AI Team