This is a realistic legacy .NET application (circa 2010-2014) that demonstrates common technical debt patterns found in energy sector applications. Perfect for showcasing Claude Code's modernization capabilities.
Original Purpose: Real-time monitoring and maintenance scheduling for FPL power generation facilities
Original Developers:
- John Mitchell (retired 2019)
- Sarah Chen (retired 2018)
Last Major Update: 2014
Current Status: Production system requiring modernization
Main monitoring system that tracks plant performance metrics and triggers maintenance alerts.
Key Functionality:
- Real-time plant readings (temperature, pressure, vibration, output)
- Automated maintenance threshold detection
- Outage event processing
- Grid balancing logic
- Daily report generation
Coordinates planned maintenance windows and calculates revenue impact.
Key Functionality:
- Schedule planned outages
- Revenue loss calculation (2012 pricing model)
- Optimal maintenance window detection
- Conflict checking
- Stakeholder notifications
- SQL Injection: All queries use string concatenation
- Example:
"SELECT * FROM PlantReadings WHERE PlantID = '" + plantId + "'"
- Example:
- Hardcoded Credentials: Database passwords in source code
User Id=sa;Password=FPL2010!
- SMTP Credentials: Email passwords in plaintext
- No Input Validation: User input directly concatenated into SQL
- Direct ADO.NET: No ORM (Entity Framework would be modern)
- No Async/Await: All database calls are synchronous
- DataTable Usage: Pre-LINQ patterns
- ArrayList: Generic collections not used
- Manual Connection Management: No using statements
- File-based Logging: Should use structured logging (Serilog, NLog)
- Silent Failures: Errors written to text files without monitoring
- Swallowed Exceptions: Try-catch blocks that don't propagate
- No Retry Logic: Database operations fail permanently
- Missing Finally Blocks: Connections may not close
- Hardcoded Values: Thresholds, pricing, capacity limits
- Outdated Pricing: 2012 electricity rates ($95 peak, $45 off-peak)
- Simplified Calculations: Real demand forecasting is much more complex
- Missing Validation: No checks for null, negative values, etc.
- Lost Tribal Knowledge: Comments reference regulations/specs no longer accessible
- No Separation of Concerns: Business logic mixed with data access
- Tight Coupling: Direct database dependencies everywhere
- No Dependency Injection: Creates its own connections
- No Testing: Impossible to unit test
- No Interfaces: Cannot mock dependencies
- Stateful: Connection object stored as instance variable
- TODOs Never Addressed: "TODO: This needs updating per FERC Order 764"
- Deprecated Systems: References to paging systems, legacy SMTP
- No Documentation: Complex business rules not explained
- Magic Numbers: Thresholds without context
- Long Methods: 50+ line methods doing multiple things
- Open the codebase in Claude Code
- Ask: "Analyze this legacy power plant monitoring system and identify security vulnerabilities, outdated patterns, and modernization opportunities"
- Show how Claude Code:
- Identifies SQL injection vulnerabilities
- Flags hardcoded credentials
- Recognizes legacy .NET patterns
- Understands energy sector business logic
- Ask: "Fix all SQL injection vulnerabilities using parameterized queries"
- Ask: "Remove hardcoded credentials and implement configuration-based connection strings"
- Show:
- Systematic refactoring across all methods
- Proper parameter usage
- Configuration file setup
-
Ask: "Modernize this to use Entity Framework Core, async/await, and dependency injection"
-
Show:
- Creating entity models
- DbContext implementation
- Converting to async methods
- Adding interfaces for testability
- Dependency injection setup
-
Ask: "Add comprehensive error handling with structured logging using Serilog"
-
Show:
- Proper exception handling
- Retry policies
- Structured log events
- Ask: "Generate unit tests for the OutageScheduler class"
- Ask: "Create comprehensive XML documentation comments explaining the business logic"
- Show:
- Test coverage generation
- Mock setup for database dependencies
- Clear documentation of tribal knowledge
- Ask: "Update the pricing model to use modern time-of-use rates and integrate with market price APIs"
- Ask: "Create a migration guide for deploying this modernized version"
- Show forward-thinking capabilities
- Understands Legacy Context: Claude Code recognizes 2010-era .NET patterns
- Security First: Automatically identifies injection vulnerabilities
- Domain Awareness: Understands power plant operations, grid balancing, FERC regulations
- Systematic Modernization: Not just code completion - full architectural improvements
- Testing & Documentation: Generates tests and docs that help offshore teams
- Lost Knowledge Recovery: Can explain undocumented business rules
- Beyond Autocomplete: Copilot suggests next line; Claude Code refactors entire architecture
- Security Analysis: Proactively identifies vulnerabilities, not just completes code
- Context Understanding: 200K token window = entire legacy codebase
- Business Logic: Understands domain-specific concepts (reserve margins, FERC compliance)
- Full Lifecycle: Analysis → Security → Modernization → Testing → Documentation
- Peaker Plants: Backup generators for high demand periods
- Reserve Margin: Excess capacity above forecast demand (typically 15%)
- FERC Order 764: Federal regulation on frequency response
- MWh: Megawatt-hour pricing unit
- Grid Balancing: Matching generation to demand in real-time
- Time-of-Use Rates: Peak vs off-peak pricing
- Capacity Factor: Actual vs maximum output ratio
- Can Claude Code understand our old codebase? YES - recognizes patterns from 2010
- Can it handle our domain complexity? YES - understands power generation operations
- Will it find security issues we missed? YES - SQL injection, credential exposure
- Can it help our offshore team? YES - generates tests and documentation
- Is it better than Copilot? YES - architectural modernization, not just completion
- Can it preserve business logic? YES - maintains domain rules while modernizing tech
After the demo, offer to:
- Analyze one of their actual legacy codebases (NDA-protected session)
- Create a modernization roadmap for specific applications
- Pilot with team working on COBOL → Java migrations
- Workshop with offshore contractors on using Claude Code for testing/documentation
Framework: .NET Framework 4.0+ (legacy) → .NET 6+ (modernized) Database: SQL Server (connection strings would need updating for demo) Dependencies: System.Data.SqlClient, System.Net.Mail
Note: This is demonstration code - not meant to be executed without proper database setup. Focus on the CODE PATTERNS and MODERNIZATION CAPABILITIES, not runtime execution.