Eko Monorepo Assessment Report v4

Assessment Date: 2025-12-19 Assessed By: Claude Code (Senior Monorepo Assessment Agent) Repository: Eko Stack Summary: Bun 1.1.0, Turbo 2.6.3, TypeScript 5.9.3, Next.js 16.0.10, React 19.2.3, Supabase, Upstash Redis, Playwright 1.57.0, Biome 2.3.9, Vitest 4.0.16 Version: v4.0


Executive Summary

AreaScore (0-100)GradeChangeNotes
Repository Structure & Organization98A+=UI registry adds structured metadata
Build System & Tooling95A+1Registry drift check in CI
Code Quality & Standards90A-=No pre-commit hooks still
Type System Configuration94A=Strict mode maintained
Testing Infrastructure82B+4New env-guard tests (160 LOC)
Documentation98A++1UI registry docs + CSV exports
Backend / Data Layer98A++2vNext migration (1,125 lines)
UI / Design System93A+1UI element registry with drift detection
CI/CD & DevOps89B++1Registry check added to pipeline
Security85B=Still missing dependency scanning
FINAL SCORE92A-+1vNext architecture + UI registry

Grade Legend

  • A+: 97-100 (Exceptional)
  • A: 93-96 (Production-ready)
  • A-: 90-92
  • B+: 87-89
  • B: 83-86
  • C+: 80-82
  • <80: Needs intervention

Key Changes Since Last Assessment (2025-12-18)

Major Improvements

  1. vNext Global URL Library Migration - New 0007_global-url-library-vnext.sql with 1,125 lines implementing:

    • Global urls table with canonical_url uniqueness (replacing per-user model)
    • Global url_observations, url_change_events, url_change_summaries
    • user_url_library with history gating for subscription-based access
    • URL submission workflow with policy enforcement (url_submissions, policy_logs)
    • Trend foundation tables (trends, trend_data_points)
    • Billing/invoicing tables (invoices, invoice_line_items)
    • Onboarding extensions (user_onboarding_progress)
    • Write-through triggers syncing V1 → vNext automatically
    • Complete data backfill from V1 tables (idempotent)
  2. UI Element Registry System - New structured metadata for UI/data mapping:

    • packages/shared/src/ui-registry/ui-element-registry.json (272 lines)
    • scripts/generate-ui-registry.ts (682 lines) - Generates registry from codebase
    • scripts/check-ui-registry.ts (60 lines) - CI drift detection
    • scripts/export-ui-registry.ts (134 lines) - CSV export for spreadsheets
    • docs/spreadsheets/csvs/ - 24 screen-specific CSV exports
    • docs/product/ui-element-registry.md - Registry documentation
  3. Testing Improvements - New packages/config/src/env-guard.test.ts (160 lines):

    • Tests for environment variable validation
    • Zod schema edge cases covered
    • First package-level unit tests in config package
  4. Shared Package Expansion - 1,740 LOC (119% growth from v3):

    • New ui-registry/ directory with JSON schema
    • Enhanced type definitions for vNext tables
  5. CI Pipeline Enhancement:

    • Added registry:check job to lint workflow
    • Detects drift between codebase and registry JSON

Metrics Changes

Metricv3v4Change
Migrations67+1 (major)
Migration LOC~31 KB~72 KB+132%
Agent files1717=
Turbo cache24 MB / 592 files33 MB / 744 files+38% / +26%
node_modules699 MB699 MB=
bun.lock lines1,3041,304=
Shared package~795 LOC~1,740 LOC+119%
Test files12+1
Test LOC18178+889%
Script files14+3

1. Repository Structure & Organization

Score: 98 (A+) (unchanged)

Current Structure

eko/
├── .claude/                 17 specialized agents
│   ├── agents/             Agent specifications
│   └── settings.local.json Local agent settings
├── .notes/                  Development planning docs
├── apps/                    5 deployable applications
│   ├── web/                Next.js public app (port 3000)
│   ├── admin/              Next.js admin panel (port 3001)
│   ├── storybook/          Component documentation (port 6006)
│   ├── worker-render/      Playwright rendering service
│   └── worker-tracker/     URL tracking worker
├── packages/                7 shared libraries
│   ├── ai/                 OpenAI integration
│   ├── config/             Zod-validated env config [+TESTS]
│   ├── db/                 Supabase client & queries
│   ├── observability/      Logging utilities
│   ├── queue/              Upstash Redis queue
│   ├── shared/             Types, schemas, UI registry [EXPANDED]
│   │   └── src/ui-registry/ [NEW] Screen-entity mapping
│   └── ui/                 Shared UI components (20 components)
├── docs/                    Comprehensive documentation
│   ├── assessments/        Assessment reports
│   ├── specs/              V1 specifications (7 files)
│   ├── spreadsheets/       [NEW] CSV exports for screen data
│   └── schema-reference.md Full schema reference
├── infra/                   Docker, fly.toml configs
└── scripts/                 4 TypeScript scripts [+3]
    ├── agents-routing-check.ts
    ├── check-ui-registry.ts    [NEW]
    ├── export-ui-registry.ts   [NEW]
    └── generate-ui-registry.ts [NEW]

Strengths

  • @eko/* package scope consistently applied across all workspaces
  • Clear separation: apps deploy, packages share
  • New ui-registry provides structured metadata for UI/data relationships
  • Agent routing validation in CI
  • Registry scripts enable automation and exports

Weaknesses

  • .notes/ directory still not in .gitignore

2. Build System & Tooling

Score: 95 (A) (+1 from v3)

Turbo Configuration

{
  "tasks": {
    "build": { "dependsOn": ["^build"], "outputs": [".next/**", "dist/**", "storybook-static/**"] },
    "dev": { "cache": false, "persistent": true },
    "lint": { "dependsOn": ["^build"] },
    "typecheck": { "dependsOn": ["^build"] },
    "test": { "dependsOn": ["^build"] }
  }
}

Metrics

MetricValue
Local Turbo cache33 MB (744 artifacts)
Web app .next build37 MB
Storybook static8.6 MB
node_modules699 MB
bun.lock lines1,304

Strengths

  • Turbo task graph correctly models dependencies with ^build
  • Bun provides fast install and execution (1.1.0)
  • Local caching working effectively (+38% cache growth indicates active development)
  • TypeScript incremental builds enabled
  • New registry:check script integrated into CI
  • All dependencies locked to specific versions

Weaknesses

  • No remote caching configured (Vercel Remote Cache or custom)
  • Each CI job re-installs dependencies from scratch

3. Code Quality & Standards

Score: 90 (A-) (unchanged)

Biome Configuration (v2.3.9)

{
  "linter": {
    "rules": {
      "noUnusedImports": "error",
      "noUnusedVariables": "error",
      "noExplicitAny": "warn",
      "noNonNullAssertion": "off"
    }
  },
  "formatter": {
    "indentStyle": "space",
    "indentWidth": 2,
    "lineWidth": 100,
    "quoteStyle": "single"
  }
}

Strengths

  • Single tool (Biome) eliminates config drift between lint/format
  • Strict on unused code (errors, not warnings)
  • CSS modules and Tailwind directives supported
  • Import organization automated
  • .editorconfig present for cross-editor consistency

Weaknesses

  • No pre-commit hooks (husky/lefthook not configured)
  • noExplicitAny is "warn" not "error"
  • noNonNullAssertion disabled
  • Quality enforcement relies entirely on CI

4. Type System Configuration

Score: 94 (A) (unchanged)

Base Config (tsconfig.base.json)

{
  "compilerOptions": {
    "target": "ES2022",
    "module": "ESNext",
    "moduleResolution": "bundler",
    "strict": true,
    "noEmit": true,
    "isolatedModules": true,
    "declaration": true,
    "declarationMap": true,
    "incremental": true
  }
}

Inheritance Pattern

  • All 12 workspaces extend ../../tsconfig.base.json
  • Next.js apps add next plugin for App Router types
  • Packages specify outDir/rootDir for build isolation
  • UI package adds jsx: "react-jsx" and path aliases

Strengths

  • strict: true globally enforced
  • Modern bundler resolution (Node 16+)
  • Declaration maps enable source navigation
  • isolatedModules ensures transpiler safety

Weaknesses

  • noUncheckedIndexedAccess not enabled
  • exactOptionalPropertyTypes not enabled
  • useUnknownInCatchVariables not enabled

5. Testing Infrastructure

Score: 82 (B) (+4 from v3)

Test Framework: Vitest 4.0.16

WorkspaceConfigTest Files
apps/webNode env0
apps/adminNode env0
apps/storybookDefault0
apps/worker-renderNode env0
apps/worker-trackerNode env0
packages/aiNode env0
packages/configNode env1 (env-guard.test.ts, 160 LOC) [NEW]
packages/dbNode env0
packages/observabilityNode env0
packages/queueNode env0
packages/sharedNode env1 (smoke.test.ts, 18 LOC)
packages/uiNo tests0

Total Test LOC: 178 (+889% from v3)

Strengths

  • Vitest workspace configured across all workspaces
  • E2E smoke test covers critical render pipeline (e2e:render-smoke)
  • New env-guard tests validate environment config edge cases
  • Test failures block CI build
  • Consistent vitest run pattern

Weaknesses

  • Still only 2 test files across 12 workspaces
  • No coverage reporting configured or tracked
  • passWithNoTests: true masks missing tests
  • No component tests for UI library
  • No visual regression testing

6. Documentation

Score: 98 (A+) (+1 from v3)

Documentation Structure

docs/
├── README.md               Index with V1 spec links
├── CONVENTIONS.md          Standards & front-matter rules
├── glossary.md             Terminology (updated with V1 terms)
├── schema-reference.md     Full schema reference (49 KB)
├── architecture/           7 files + schema-naming-contracts.md
├── assessments/            Assessment reports
├── dev/                    9 files + observability.md, migration-coexistence.md
├── runbooks/               7 files + scheduling.md
├── policies/               AI safety, fair use
├── product/                PRD, user guide, v1-execution-contract.md
│   └── ui-element-registry.md [NEW] Registry documentation
├── spreadsheets/           [NEW] CSV exports directory
│   └── csvs/               24 screen-specific CSV files
└── specs/                  7 specification documents

New Documentation

  • docs/product/ui-element-registry.md - Registry format and usage guide
  • docs/spreadsheets/csvs/ - 24 CSV exports for screen-entity mapping:
    • account-home.csv, add-url-flow.csv, admin-brand-url-moderation.csv
    • admin-review-url-policy.csv, billing-overview.csv, brand-index.csv
    • And 18 more screen exports...

Strengths

  • Enforced front-matter with CI validation (scripts/docs-lint.sh)
  • Agent routing validation in CI
  • Comprehensive runbooks for each subsystem
  • Clear onboarding in dev/local-development.md
  • V1 specifications are production-ready
  • UI registry enables structured data exports

Weaknesses

  • No API documentation generation (TypeDoc)
  • No auto-generated component docs from Storybook

7. Backend / Data Layer

Score: 98 (A+) (+2 from v3)

Schema (7 migrations)

packages/db/migrations/
├── 0001_init.sql                    Core schema + RLS (7.6 KB)
├── 0002_renders.sql                 url_renders table (1.9 KB)
├── 0003_storage_renders_bucket.sql  Storage bucket (2.5 KB)
├── 0004_user_note_and_checked_day.sql User annotations (1.2 KB)
├── 0005_brand_library_v1.sql        Brand library (5.8 KB)
├── 0006_v1_contracts.sql            V1 contracts (11.7 KB)
└── 0007_global-url-library-vnext.sql [NEW] vNext architecture (41 KB, 1,125 lines)

New Tables (0007 - vNext Global URL Library)

TablePurpose
urlsGlobal URL registry with canonical uniqueness
url_observationsCheck results per URL per day
url_change_eventsDetected changes between observations
url_change_summariesAI summaries for changes
url_render_artifactsPlaywright screenshots and renders
user_url_libraryUser-URL relationships with history gating
url_submissionsURL submission workflow
url_policiesURL-specific policy overrides
policy_logsPolicy decision audit trail
trendsTrend definitions
trend_data_pointsTime-series trend data
invoicesStripe-aligned invoicing
invoice_line_itemsInvoice detail lines
user_onboarding_progressOnboarding step tracking

New Features (0007)

  • Global URL model (shared observations across users)
  • History gating (subscription-based access control)
  • Policy enforcement workflow (allow/block/review)
  • Write-through triggers (V1 → vNext automatic sync)
  • Idempotent backfill procedures
  • 11 new ENUMs for type safety

Row-Level Security - All 26+ tables protected with principle of least privilege

Strengths

  • Clean normalized schema with proper FK constraints
  • RLS policies follow principle of least privilege
  • Global URL model eliminates duplicate observations
  • History gating is data-driven (not hardcoded)
  • Write-through triggers enable gradual migration
  • Backfill procedures are idempotent

Weaknesses

  • No explicit rollback migrations
  • No migration tests

8. UI / Design System

Score: 93 (A) (+1 from v3)

Storybook (apps/storybook)

  • Version: 10.1.9
  • Framework: React + Vite 7.3.0
  • Addons: docs, themes
  • Stories: 19 files covering all components
  • Dark/light mode toggle in preview

Shared UI Library (packages/ui)

ComponentSub-componentsDark Mode
AlertDialog11Yes
Avatar3Yes
Badge4 variantsYes
Button6 variants, 6 sizesYes
Card6Yes
Checkbox1Yes
Dialog10Yes
DropdownMenu14Yes
Input1Yes
Label1Yes
Popover4Yes
RadioGroup2Yes
Select11Yes
Separator1Yes
Skeleton1Yes
Switch1Yes
Tabs4Yes
Textarea1Yes
Tooltip4Yes

UI Element Registry (NEW)

  • ui-element-registry.json (272 lines)
  • Maps screens → routes → database entities
  • Enables automated drift detection in CI
  • Exports to CSV for product/design collaboration

Technology Stack

  • Radix UI primitives (14 packages) for accessibility
  • class-variance-authority (CVA) for variant management
  • Tailwind CSS v4 with CSS variables
  • cn() utility (clsx + tailwind-merge)
  • Lucide React for icons

Strengths

  • 20 components with 60+ sub-components
  • Full dark mode via CSS custom properties
  • All components documented in Storybook
  • Accessibility built-in via Radix
  • shadcn/ui "New York" style
  • UI registry provides structured screen metadata

Weaknesses

  • No README in packages/ui
  • No accessibility testing (axe, pa11y)
  • No component unit tests

9. CI/CD & DevOps

Score: 89 (B+) (+1 from v3)

GitHub Actions Pipeline

Triggers: push/PR to main/dev

Jobs (Parallel):
1. docs-lint      - Validates markdown front-matter
2. agents-routing - Validates agent ownership
3. lint           - Biome check + registry:check [NEW]
4. typecheck      - tsc
5. test           - Vitest

Job (Sequential):
6. build          - Depends on all above

New in v4

  • registry:check added to lint job
  • Detects drift between codebase and registry JSON

Strengths

  • Full quality gate (docs, agents, lint, types, tests, build)
  • Parallel execution for independent jobs
  • Build blocked until all checks pass
  • --frozen-lockfile ensures determinism
  • Agent routing validation prevents ownership conflicts
  • Registry drift detection prevents stale metadata

Weaknesses

  • No remote caching (each run installs fresh)
  • No preview environments on PRs
  • No deployment automation
  • No GitHub Actions dependency caching

10. Security

Score: 85 (B) (unchanged)

Strengths

AreaStatus
RLS PoliciesStrong - all 26+ tables protected
Env ValidationStrong - Zod schemas at runtime + tests
Secret ExclusionGood - .gitignore configured
Auth SeparationGood - anon vs service role clients
Worker SecurityGood - proper cleanup, timeouts
Security PolicyPresent - SECURITY.md with scope
URL Cap EnforcementDatabase-level plan limits
Policy Enforcement[NEW] URL submission workflow with allow/block/review

Weaknesses

AreaStatusPriority
Dependency ScanningMissing (no Dependabot)P1
Secret ScanningMissing (no GitHub scanning)P1
SSRF PreventionMissing (no private IP blocking)P2
Rate LimitingMissing (no per-user limits)P2
Admin AuthorizationIncomplete (run_now disabled)P2

Recommendations

  1. Add .github/dependabot.yml for npm vulnerability scanning
  2. Enable GitHub secret scanning in repository settings
  3. Add isAllowedUrl() validation to block private IPs and metadata endpoints
  4. Complete admin authorization feature

Risk Assessment

Risk AreaLevelChangeMitigation
Build stabilityLow=Turbo graph + lockfile ensure reproducibility
Data integrityLow=RLS + FK constraints + triggers
SecurityMedium=Add dependency/secret scanning urgently
Team velocityLow=Clear structure, good docs, fast tooling
UI consistencyLow-1UI registry + Storybook + shared components
V1 readinessLow=Specs complete, schema ready, entitlements defined
vNext readinessLowNEWMigration complete, triggers active, backfill done

P0 - Critical

  • None (no blocking issues for production)

P1 - High Priority

  • Add Dependabot for dependency vulnerability scanning
  • Enable GitHub secret scanning
  • Add pre-commit hooks (husky + lint-staged)
  • Configure coverage reporting and set minimum thresholds
  • Add unit tests for entitlements logic

P2 - Medium Priority

  • Add SSRF prevention (private IP blocklist)
  • Enable Turbo remote caching for CI speedup
  • Add GitHub Actions dependency caching
  • Add unit tests for UI components
  • Enable noUncheckedIndexedAccess in TypeScript

P3 - Long-Term

  • Add visual regression testing (Chromatic)
  • Add load testing infrastructure
  • Create migration rollback procedures
  • Add TypeDoc for API documentation
  • Add accessibility testing (axe-core)

Readiness Scorecard

TargetPreviousCurrentGap
Production ready91%92%Testing coverage, dependency scanning
V1 launch ready95%96%Entitlements tests, notification worker
vNext ready-85%API layer, history gating UI
Scale ready80%82%Remote caching, rate limiting
Team onboarding97%98%Excellent docs, registry exports
Design system92%93%Component tests, accessibility

Assessment Metadata

  • Assessment Date: 2025-12-19
  • Previous Assessment: 2025-12-18 (v3)
  • Assessed By: Claude Code (Senior Monorepo Assessment Agent)
  • Repository: Eko
  • Stack Summary: Bun 1.1.0, Turbo 2.6.3, TypeScript 5.9.3, Next.js 16.0.10, React 19.2.3, Supabase, Upstash Redis, Playwright 1.57.0, Biome 2.3.9, Vitest 4.0.16
  • Version: v4.0

This assessment reflects the state of the Eko monorepo as of December 19, 2025. Scores are based on industry best practices for production-grade TypeScript monorepos.