// Multi-agent orchestration for comprehensive frontend + backend improvements. Use when user requests "improve the app", "optimize functionality", "make it perfect", or "enhance the system". Deploys specialized agents for parallel analysis and implementation.
| name | full-stack-optimizer |
| description | Multi-agent orchestration for comprehensive frontend + backend improvements. Use when user requests "improve the app", "optimize functionality", "make it perfect", or "enhance the system". Deploys specialized agents for parallel analysis and implementation. |
| version | 1.0.0 |
| allowed-tools | ["Task","Bash","Read","Write","Edit","Glob","Grep"] |
Multi-agent orchestration for comprehensive application improvement
This skill deploys 5 specialized agents in parallel for comprehensive analysis:
Focus: UI/UX, performance, accessibility, user experience Tasks:
/publicOutput: /.claude/reports/frontend-analysis.md
Focus: API efficiency, error handling, database queries Tasks:
/src/controllers)/src/services)Output: /.claude/reports/backend-analysis.md
Focus: Security vulnerabilities, input validation, auth Tasks:
Output: /.claude/reports/security-audit.md
Focus: Database optimization, caching, query performance Tasks:
/src/models)Output: /.claude/reports/database-optimization.md
Focus: Code organization, TypeScript usage, patterns Tasks:
any types (anti-pattern)Output: /.claude/reports/code-quality.md
# Deploy all 5 agents in parallel (single message, multiple Task calls)
Task(subagent_type="general-purpose", description="Frontend analysis", ...)
Task(subagent_type="general-purpose", description="Backend optimization", ...)
Task(subagent_type="general-purpose", description="Security audit", ...)
Task(subagent_type="general-purpose", description="Database optimization", ...)
Task(subagent_type="general-purpose", description="Code quality review", ...)
Estimated Time: 5-10 minutes (parallel execution)
After all agents complete:
/.claude/reports/Output: /.claude/reports/UNIFIED_IMPROVEMENT_PLAN.md
Deploy implementation agents based on priority:
Round 1: P0 Critical Fixes (Deploy immediately)
Round 2: P1 High-Impact Improvements (Deploy after P0 complete)
Round 3: P2 Code Quality (Deploy after P1 complete)
Round 4: P3 Polish (Optional, user approval)
After each implementation round:
npm testnpm run lintnpm run typecheck (if available)npm run buildnpm run test:render-ready## Task
Analyze all frontend code in /public directory for performance, UX, and accessibility improvements.
## Steps
1. Use Glob to find all HTML files: `public/**/*.html`
2. Use Glob to find all JS files: `public/**/*.js`
3. Use Glob to find all CSS files: `public/**/*.css`
4. For each file:
- Read file contents
- Check for performance issues:
* Large inline scripts (>1000 lines)
* Duplicate code across files
* Unoptimized images/assets
* Missing compression/minification
- Check for UX issues:
* Poor error messages
* Confusing navigation
* Inconsistent styling
* Missing loading states
- Check for accessibility:
* Missing ARIA labels
* Poor semantic HTML
* Missing alt text
* Keyboard navigation issues
5. Test for console errors:
- grep for `console.error`, `console.warn`
- Check for deprecated APIs
6. Analyze bundle size (estimate):
- Sum total file sizes
- Identify largest files
- Suggest code splitting opportunities
## Output Format
Create /.claude/reports/frontend-analysis.md with:
- Executive Summary (3-5 bullets)
- Performance Issues (with file paths and line numbers)
- UX Issues (with screenshots or descriptions)
- Accessibility Issues (with WCAG guidelines)
- Quick Wins (easy improvements with high impact)
- Long-term Recommendations
## Success Criteria
- All HTML/JS/CSS files analyzed
- Issues categorized by severity (P0-P3)
- Specific line numbers and file paths provided
- Actionable recommendations (not vague suggestions)
## Task
Analyze backend API code for efficiency, error handling, and optimization opportunities.
## Steps
1. Use Glob to find all controllers: `src/controllers/**/*.ts`
2. Use Glob to find all services: `src/services/**/*.ts`
3. For each file:
- Read file contents
- Check for performance issues:
* N+1 query patterns
* Missing pagination
* Inefficient loops
* Blocking operations
- Check for error handling:
* Unhandled promise rejections
* Missing try/catch blocks
* Poor error messages
* Inconsistent error formats
- Check for code quality:
* Duplicate logic
* Long functions (>50 lines)
* High complexity (nested ifs)
* Usage of `any` types
4. Analyze API response times:
- grep for slow operations (database queries, external calls)
- Identify endpoints without caching
5. Check for proper async patterns:
- grep for callback hell
- Check for proper async/await usage
## Output Format
Create /.claude/reports/backend-analysis.md with:
- Executive Summary
- Performance Bottlenecks (with endpoints and response times)
- Error Handling Issues (with file paths)
- Refactoring Opportunities (with code samples)
- Caching Recommendations
- Quick Wins
## Success Criteria
- All controllers and services analyzed
- Specific performance metrics provided
- Code samples for issues
- Prioritized recommendations
## Task
Audit entire codebase for security vulnerabilities and input validation issues.
## Steps
1. Scan for common vulnerabilities:
- SQL injection: grep for raw SQL queries without parameterization
- XSS: grep for `innerHTML`, `dangerouslySetInnerHTML`
- CSRF: check for CSRF tokens in forms
- Exposed secrets: grep for `password`, `api_key`, `secret`
2. Review authentication:
- Check JWT implementation
- Validate session management
- Check for proper password hashing
3. Review authorization:
- Check RBAC implementation
- Validate role checks on sensitive endpoints
4. Check input validation:
- grep for `express-validator` usage
- Check for missing validation on POST/PUT endpoints
5. Review middleware:
- Check helmet configuration
- Validate CORS settings
- Check rate limiting
## Output Format
Create /.claude/reports/security-audit.md with:
- Executive Summary (risk level: Low/Medium/High/Critical)
- Critical Vulnerabilities (P0 - fix immediately)
- High-Risk Issues (P1 - fix soon)
- Medium-Risk Issues (P2 - fix in next sprint)
- Compliance Checklist (OWASP Top 10)
- Remediation Steps (specific code changes)
## Success Criteria
- All security risks identified and categorized
- OWASP Top 10 checklist completed
- Specific remediation code provided
- Risk levels assigned
## Task
Optimize database schema, queries, and caching strategy.
## Steps
1. Review database schema:
- Read all model files in /src/models
- Check for missing indexes
- Validate foreign key relationships
- Check for proper normalization
2. Analyze query patterns:
- grep for `db.query`, `pool.query`
- Identify N+1 queries
- Check for SELECT *
- Look for missing WHERE clauses
3. Review caching:
- Check Redis usage in services
- Identify cacheable endpoints
- Validate cache invalidation logic
4. Check connection pooling:
- Review pool configuration
- Check for connection leaks
5. Analyze transaction usage:
- grep for BEGIN/COMMIT/ROLLBACK
- Check for proper error handling in transactions
## Output Format
Create /.claude/reports/database-optimization.md with:
- Executive Summary
- Schema Issues (missing indexes, normalization problems)
- Query Optimization (slow queries with alternatives)
- Caching Strategy (what to cache, TTLs)
- Connection Pool Tuning
- Transaction Improvements
- Quick Wins
## Success Criteria
- All models and queries analyzed
- Specific index recommendations
- Query rewrites provided
- Caching strategy documented
## Task
Review code organization, TypeScript usage, and architectural patterns.
## Steps
1. Run linter:
- Execute: npm run lint
- Capture output and categorize violations
2. Check TypeScript compliance:
- grep for `any` types (anti-pattern)
- Check for `@ts-ignore` comments
- Validate strict mode compliance
3. Review file organization:
- Check module boundaries
- Identify circular dependencies
- Validate separation of concerns
4. Check naming conventions:
- Validate camelCase, PascalCase usage
- Check for consistent file naming
5. Review error handling:
- Check for custom error classes
- Validate error propagation
6. Check documentation:
- grep for JSDoc comments
- Identify undocumented functions
## Output Format
Create /.claude/reports/code-quality.md with:
- Executive Summary
- TypeScript Issues (any usage, strict mode violations)
- Linting Violations (categorized by rule)
- Architectural Issues (module boundaries, circular deps)
- Documentation Gaps
- Refactoring Opportunities
- Quick Wins
## Success Criteria
- Lint report analyzed
- All `any` usages catalogued
- Architectural issues documented
- Specific refactoring steps provided
When this skill is invoked, use this template:
๐ **Full-Stack Optimization Initiated**
I'm deploying 5 specialized agents in parallel to comprehensively analyze and improve the application:
1. ๐จ **Frontend Performance Analyzer** - UI/UX, accessibility, performance
2. โ๏ธ **Backend API Optimizer** - API efficiency, error handling, queries
3. ๐ **Security & Validation Auditor** - Vulnerabilities, input validation
4. ๐๏ธ **Database & Performance Expert** - Schema, queries, caching
5. ๐ **Code Quality & Architecture Reviewer** - TypeScript, patterns, organization
**Estimated Time**: 5-10 minutes for analysis phase
I'll keep you updated as each agent completes their analysis...
โ
**All 5 agents have completed their analysis!**
## Summary of Findings
**Frontend**: [X issues found - Y critical, Z high-priority]
**Backend**: [X issues found - Y critical, Z high-priority]
**Security**: [Risk Level: Low/Medium/High/Critical]
**Database**: [X optimization opportunities]
**Code Quality**: [X violations, Y refactoring opportunities]
## Unified Improvement Plan
I've synthesized all findings into a prioritized plan:
### ๐ด P0 - Critical (Fix Immediately)
[List critical issues from all agents]
### ๐ P1 - High Priority (Fix This Sprint)
[List high-priority issues]
### ๐ก P2 - Medium Priority (Next Sprint)
[List medium-priority issues]
### ๐ข P3 - Low Priority (Nice to Have)
[List low-priority improvements]
## Next Steps
Would you like me to:
1. **Start implementing P0 critical fixes** (recommended)
2. **Review the full reports** (/.claude/reports/) before proceeding
3. **Deploy implementation agents for specific priorities**
4. **Focus on a specific area** (frontend, backend, security, database, or code quality)
I can deploy implementation agents in parallel to fix multiple issues simultaneously.
After each implementation round, verify:
npm testnpm run lintnpm run buildnpm run typecheck (if available)npm run test:render-readycurl http://localhost:3000/api/healthTrack improvement over time:
any types eliminatedAfter first optimization pass:
/.claude/reports/METRICS_BASELINE.md# Generate all reports (run agents manually)
npm run optimize:analyze
# Implement specific priority
npm run optimize:implement P0 # Critical fixes
npm run optimize:implement P1 # High priority
npm run optimize:implement P2 # Medium priority
# Full optimization cycle
npm run optimize:full # Analyze โ Synthesize โ Implement โ Validate
# View reports
npm run optimize:reports
This skill works with:
This skill improves with use:
/.claude/learning/optimization-lessons.mdNote: This skill represents a significant time investment (1-2 hours for full cycle). Use for:
For smaller improvements, use individual agents directly.