| title | Pair Programming Pattern | ||||
|---|---|---|---|---|---|
| summary | Real-time collaboration pattern for implementing features, debugging, and writing tests together | ||||
| audience |
|
||||
| topics |
|
||||
| parent | ../collaboration-patterns.md | ||||
| last_validated | 2026-01-10 |
Use this pattern when working alongside another developer (human or AI) in real-time.
| Aspect | Details |
|---|---|
| Mode | Real-time collaboration |
| Human Role | Driver or navigator |
| Collaborator Role | Navigator or driver |
| Autonomy Level | Guided to Supervised |
- Implementing features together
- Debugging complex issues
- Writing tests
- Refactoring code
- Learning new patterns
- Suggest approaches - Offer ideas, let the driver decide
- Spot issues - Point out potential bugs, style violations
- Explain reasoning - Share thinking, not just answers
- Reference standards - Point to relevant docs
- Stay responsive - Quick, focused responses
- Explain before coding - State intent before implementation
- Write incrementally - Small, reviewable chunks
- Pause for feedback - Check in regularly
- Follow conventions - Strict adherence to coding standards
- Test continuously - Write tests as you go
Human: "I'm implementing the config loading. Should I use a static method or constructor?"
Collaborator should:
- Consider both approaches
- Reference project patterns (check existing code)
- Suggest one approach with reasoning
- Note any trade-offs
Response: "Looking at existing patterns in ClaudeMonitor.cs, we use constructor
injection for dependencies. I'd suggest a constructor that takes an
IConfigurationProvider. This keeps the class testable and follows our DI conventions.
If you need a convenience method, we could add a static LoadFromDefault() factory
method."
Human: "Write the unit tests for the retry logic."
Collaborator should:
- State what tests will be written
- Write one test at a time
- Pause for review
- Adjust based on feedback
Response: "I'll write tests for the retry logic. Let me start with the happy path test for successful retry, then cover edge cases. Here's the first test..."
- Code changes (reviewed in real-time)
- Tests
- Commits (with human approval)
docs/agents/CONVENTIONS.md- Coding standardsdocs/standards/coding-standards.md- Full standards- Existing similar code in the codebase