Scenario: You need to build a user authentication system with registration, login, and password reset.Without Schaltwerk: Work on one feature at a time, or risk merge conflicts if working in parallel.With Schaltwerk:
Scenario: Your test suite has 15 failing tests across different modules.Without Schaltwerk: Fix bugs one at a time, or juggle multiple branches manually.With Schaltwerk:
1
Identify bugs
bun run test 2>&1 | grep "FAIL"# Output:# FAIL auth/login.test.ts# FAIL api/users.test.ts# FAIL ui/ProfilePage.test.ts# ... 12 more
2
Create specs
Create one spec per bug with test output, stack trace, and affected files
3
Assign agents
Start sessions for each bug:
fix-auth-login → Claude Code
fix-api-users → Codex
fix-ui-profile → OpenCode
Continue for remaining bugs
4
Verify fixes
# In each session's bottom terminalbun run test -- auth/login.test.ts# Verify specific test passes
5
Merge passing fixes
Mark sessions as reviewed after tests pass
Merge fixes one by one
Re-run full suite after each merge
Result: 15 bugs fixed in parallel, each tested in isolation, zero regressions.
Scenario: Legacy payment module needs refactoring to use Strategy pattern for different payment providers.Without Schaltwerk: Refactor on main branch and hope tests catch issues, or create complex branch structure manually.With Schaltwerk:
1
Create refactoring spec
# Refactor Payment Module## GoalExtract payment provider logic into Strategy pattern## Current State- Single PaymentProcessor class with if/else for providers- Stripe, PayPal, Square logic mixed together- Hard to test, hard to add new providers## Target State- PaymentStrategy interface- StripeStrategy, PayPalStrategy, SquareStrategy- PaymentProcessor uses strategy pattern- Each provider independently testable## Constraints- All existing tests must pass- No breaking API changes- Maintain current functionality
2
Start refactoring session
Agent works in isolated worktree, can’t break main branch
3
Incremental approach
1. Extract PaymentStrategy interface2. Create StripeStrategy (test)3. Create PayPalStrategy (test)4. Create SquareStrategy (test)5. Update PaymentProcessor to use strategies (test)6. Remove old if/else logic (test)7. Update all call sites (test)
4
Validate thoroughly
# Run full test suitebun run test# Run integration testsbun run test:integration# Check code coveragebun run coverage# Performance benchmarksbun run benchmark
5
Review changes
Inspect every file in diff view
Verify no functionality changed
Check performance metrics
Mark as reviewed only when confident
Result: Major refactoring completed safely, tested thoroughly, zero downtime.
Scenario: Need to implement a caching layer, but not sure about the best approach.Without Schaltwerk: Implement one solution, hope it’s optimal, or spend time prototyping manually.With Schaltwerk:
1
Create identical specs
# Implement Caching Layer## Requirements- Cache API responses- Configurable TTL- LRU eviction policy- Metrics for hit/miss rates- Thread-safe## Acceptance Criteria- Sub-10ms cache hits- 90%+ hit rate for repeated queries- Memory usage under 100MB- Pass all existing tests
2
Launch multiple agents
Session 1: Claude Code → Redis-based cache
Session 2: Codex → In-memory LRU cache
Session 3: OpenCode → Memcached-based cache
3
Compare implementations
## Redis Approach (Claude Code)Pros:- Distributed caching- Persistence- Advanced data structuresCons:- Extra dependency- Network latency- More complex setup## In-Memory LRU (Codex)Pros:- Fastest (no network)- Simple implementation- No external dependenciesCons:- Not distributed- Lost on restart- Limited by single machine memory## Memcached (OpenCode)Pros:- Distributed- Fast- Battle-testedCons:- External dependency- Network latency- No persistence
4
Benchmark all three
# Run benchmarks in each sessionbun run benchmark -- cache# Compare resultsRedis: 5ms avg, 98% hit rate, 50MB memoryLRU: 2ms avg, 95% hit rate, 80MB memoryMemcached: 4ms avg, 97% hit rate, 40MB memory
Scenario: Exploring different UI frameworks for a new feature.Without Schaltwerk: Create branches manually, switch between them, cleanup after.With Schaltwerk:
## Security Issues- Line 45: SQL injection vulnerability## Performance Concerns- Line 102: N+1 query problem## Best Practices- Line 67: Consider extracting to separate function- Line 89: Missing error handling## Tests- Missing tests for edge case: null input- Integration tests needed for API changes
4
Manual review
Use AI feedback as starting point for your own review
Result: Faster, more thorough code reviews with AI assistance.
Scenario: New issues are filed daily, need to be triaged and assigned.Without Schaltwerk: Manually create branches, assign developers, track progress.With Schaltwerk: