Shell
Partner-Ready Codebase Improvements
Executive Summary
Make the codebase impressive to a Sr Dev and Founder doing technical due diligence. Focus on quick wins + medium effort improvements that show engineering maturity.
Current State Assessment
| Area | Status | Partner Impression |
|---|---|---|
| Test Coverage | 2,555 tests, 115 suites | Excellent |
| E2E Tests | 310+ Playwright tests | Excellent |
| Error Monitoring | Sentry integrated | Good |
TypeScript any |
721 instances | Needs work |
| Large Files | 6 files >1500 lines | Needs work |
| Structured Logging | Console only (2039 statements) | Needs work |
| API Documentation | Missing | Needs work |
Phase 1: Quick Wins (1-2 days)
1.1 Fix Top TypeScript any Offenders
Impact: 40% reduction (290 instances)
Create 3 type definition files:
src/types/
├── migration-adapter-types.ts → fixes 60 instances
├── database-types.ts → fixes 12 instances
├── event-types.ts → fixes 25 instances
1.2 Add Missing Accessibility E2E Test
File: e2e/accessibility-audit.spec.ts
Phase 2: Medium Effort - File Splitting (3-4 days)
2.1 Split document-store.ts (2,770 → 8 files)
src/stores/
├── document-store.ts (orchestrator)
├── slices/
│ ├── document-core.ts
│ ├── document-persistence.ts
│ ├── document-structure.ts
│ ├── panel-canvas.ts
│ ├── panel-source.ts
│ ├── panel-layout.ts
│ └── document-history.ts
└── types/document-types.ts
2.2 Split use-migration-adapter.ts (2,951 → 5 files)
2.3 Split content-service.ts (1,393 → 12 files)
Phase 3: Structured Logging (2 days)
Replace 2,039 console.* statements with Pino logger.
Phase 4: API Documentation (1 day)
Add OpenAPI/Swagger for API routes.
Implementation Order
| Order | Task | Effort | Impact |
|---|---|---|---|
| 1 | Create migration-adapter-types.ts | 2h | High |
| 2 | Create database-types.ts | 1h | Medium |
| 3 | Create event-types.ts | 2h | Medium |
| 4 | Add accessibility E2E test | 1h | Quick win |
| 5 | Split document-store.ts | 4h | High |
| 6 | Split use-migration-adapter.ts | 3h | High |
| 7 | Split content-service.ts | 2h | Medium |
| 8 | Add Pino logging | 3h | Medium |
| 9 | Add API documentation | 3h | Medium |
Total: ~21 hours (3-4 focused days)
Success Metrics
| Metric | Before | After |
|---|---|---|
TypeScript any warnings |
721 | ~430 (40% reduction) |
| Files >1500 lines | 6 | 1 |
| Largest code file | 2,951 lines | <500 lines |
| Structured logging | No | Yes |
| API documentation | None | OpenAPI |