DevOps Mastery
Production-grade software engineering protocols for building scalable, secure, high-performance applications.
Core Workflow
ANALYZE → DIAGNOSE → OPTIMIZE → VALIDATE
Every technical task follows this sequence:
- Analyze (30%): Read code, map dependencies, identify patterns, assess constraints
- Diagnose (20%): Trace execution, reproduce issues, profile metrics, find root cause
- Optimize (30%): Design solutions, evaluate trade-offs, implement with best practices
- Validate (20%): Write tests, verify edge cases, run quality checks, document
Execution Protocols
Protocol A: Bug Fixes
1. REPRODUCE → Write failing test
2. ISOLATE → Find minimal code path
3. FIX → Apply minimal change
4. VERIFY → Ensure tests pass
5. DOCUMENT → Explain WHY (not just what)
Protocol B: New Features
1. DESIGN → Define types/interfaces FIRST
2. TEST → Write comprehensive tests
3. IMPLEMENT → Build incrementally
4. INTEGRATE → Ensure compatibility
5. OPTIMIZE → Refactor for quality
Protocol C: Refactoring
1. BASELINE → Run ALL tests
2. EXTRACT → Identify refactor target
3. TRANSFORM → Small, safe steps
4. VALIDATE → Re-run tests after EACH change
5. POLISH → Improve naming, docs, types
Protocol D: Performance
1. MEASURE → Profile with real data
2. HYPOTHESIS → Form theories
3. EXPERIMENT → Try optimizations
4. BENCHMARK → Measure improvement (2x+ target)
5. MONITOR → Check for regressions
Technical Standards
Code Quality
- TypeScript: Zero
any, strict mode enabled
- Testing: >80% coverage for business logic
- Performance: Lighthouse >90 for web apps
- Security: Zero critical CVEs, OWASP Top 10 compliance
- Architecture: SOLID principles, design patterns
Security Checklist
- Authentication: OAuth2/JWT with MFA
- Authorization: RBAC with least privilege
- Encryption: TLS 1.3, AES-256 at rest
- Input Validation: Sanitize ALL user inputs
- Secrets: Never commit, use environment variables
- Dependencies: Regular security audits
Performance Targets
- API Response: <100ms (p50), <500ms (p99)
- Database Queries: <50ms, proper indexing
- Bundle Size: <250KB initial, code-split routes
- Caching: Redis for hot data, CDN for static assets
Quality Gates
Before ANY code ships:
- ✅ All tests pass (unit + integration)
- ✅ TypeScript compiles with zero errors
- ✅ Linting passes with zero warnings
- ✅ Security scan shows no critical issues
- ✅ Performance benchmarks meet targets
Architecture Patterns
API Design
- RESTful endpoints with semantic versioning
- Rate limiting and request throttling
- Comprehensive error handling with proper status codes
- API documentation (OpenAPI/Swagger)
- Request/response validation schemas
Database Design
- Normalized schema (3NF minimum)
- Strategic indexes on foreign keys and query fields
- Connection pooling and query optimization
- Migration strategy with rollback capability
- Backup and disaster recovery plan
Deployment Strategy
- Docker multi-stage builds for minimal images
- Kubernetes for orchestration and autoscaling
- Blue-green deployments for zero downtime
- Infrastructure as Code (Terraform preferred)
- Monitoring with Prometheus/Grafana
Debugging Strategy
- Reproduce: Create minimal failing test case
- Isolate: Remove unrelated variables
- Hypothesize: Form theory about root cause
- Validate: Test hypothesis with evidence
- Fix: Apply minimal necessary change
- Verify: Confirm fix + no regressions
References
For detailed guidance on specific topics:
- API patterns:
references/api-patterns.md
- Security standards:
references/security.md
- Performance optimization:
references/performance.md
- Testing strategies:
references/testing.md
Scripts
Quality automation tools:
scripts/quality-check.sh: Run all quality gates
scripts/security-scan.sh: Dependency vulnerability scan
scripts/performance-profile.sh: Benchmark key operations
1---2name: devops-mastery3description: Elite software engineering toolkit for building production-grade applications. Use when developing, debugging, optimizing, or deploying code—especially for API development, database design, performance tuning, security hardening, CI/CD pipelines, and architectural decisions. Triggers on requests for code review, testing strategies, deployment automation, security audits, performance optimization, or technical architecture guidance.4---56# DevOps Mastery78Production-grade software engineering protocols for building scalable, secure, high-performance applications.910## Core Workflow1112**ANALYZE → DIAGNOSE → OPTIMIZE → VALIDATE**1314Every technical task follows this sequence:15161. **Analyze** (30%): Read code, map dependencies, identify patterns, assess constraints172. **Diagnose** (20%): Trace execution, reproduce issues, profile metrics, find root cause183. **Optimize** (30%): Design solutions, evaluate trade-offs, implement with best practices194. **Validate** (20%): Write tests, verify edge cases, run quality checks, document2021## Execution Protocols2223### Protocol A: Bug Fixes24```251. REPRODUCE → Write failing test262. ISOLATE → Find minimal code path273. FIX → Apply minimal change284. VERIFY → Ensure tests pass295. DOCUMENT → Explain WHY (not just what)30```3132### Protocol B: New Features33```341. DESIGN → Define types/interfaces FIRST352. TEST → Write comprehensive tests363. IMPLEMENT → Build incrementally374. INTEGRATE → Ensure compatibility385. OPTIMIZE → Refactor for quality39```4041### Protocol C: Refactoring42```431. BASELINE → Run ALL tests442. EXTRACT → Identify refactor target453. TRANSFORM → Small, safe steps464. VALIDATE → Re-run tests after EACH change475. POLISH → Improve naming, docs, types48```4950### Protocol D: Performance51```521. MEASURE → Profile with real data532. HYPOTHESIS → Form theories543. EXPERIMENT → Try optimizations554. BENCHMARK → Measure improvement (2x+ target)565. MONITOR → Check for regressions57```5859## Technical Standards6061### Code Quality62- **TypeScript**: Zero `any`, strict mode enabled63- **Testing**: >80% coverage for business logic64- **Performance**: Lighthouse >90 for web apps65- **Security**: Zero critical CVEs, OWASP Top 10 compliance66- **Architecture**: SOLID principles, design patterns6768### Security Checklist69- Authentication: OAuth2/JWT with MFA70- Authorization: RBAC with least privilege71- Encryption: TLS 1.3, AES-256 at rest72- Input Validation: Sanitize ALL user inputs73- Secrets: Never commit, use environment variables74- Dependencies: Regular security audits7576### Performance Targets77- API Response: <100ms (p50), <500ms (p99)78- Database Queries: <50ms, proper indexing79- Bundle Size: <250KB initial, code-split routes80- Caching: Redis for hot data, CDN for static assets8182## Quality Gates8384Before ANY code ships:85- ✅ All tests pass (unit + integration)86- ✅ TypeScript compiles with zero errors87- ✅ Linting passes with zero warnings88- ✅ Security scan shows no critical issues89- ✅ Performance benchmarks meet targets9091## Architecture Patterns9293### API Design94- RESTful endpoints with semantic versioning95- Rate limiting and request throttling96- Comprehensive error handling with proper status codes97- API documentation (OpenAPI/Swagger)98- Request/response validation schemas99100### Database Design101- Normalized schema (3NF minimum)102- Strategic indexes on foreign keys and query fields103- Connection pooling and query optimization104- Migration strategy with rollback capability105- Backup and disaster recovery plan106107### Deployment Strategy108- Docker multi-stage builds for minimal images109- Kubernetes for orchestration and autoscaling110- Blue-green deployments for zero downtime111- Infrastructure as Code (Terraform preferred)112- Monitoring with Prometheus/Grafana113114## Debugging Strategy1151161. **Reproduce**: Create minimal failing test case1172. **Isolate**: Remove unrelated variables1183. **Hypothesize**: Form theory about root cause1194. **Validate**: Test hypothesis with evidence1205. **Fix**: Apply minimal necessary change1216. **Verify**: Confirm fix + no regressions122123## References124125For detailed guidance on specific topics:126- API patterns: `references/api-patterns.md`127- Security standards: `references/security.md`128- Performance optimization: `references/performance.md`129- Testing strategies: `references/testing.md`130131## Scripts132133Quality automation tools:134- `scripts/quality-check.sh`: Run all quality gates135- `scripts/security-scan.sh`: Dependency vulnerability scan136- `scripts/performance-profile.sh`: Benchmark key operations