Migrate Company Operations from Spreadsheets to Database
Problem
GTM Review Sheet and Brainforge Management Operations (Excel) contain critical company data (OKRs, AORs, sales metrics) that is:
- Not traceable (no audit log)
- Not queryable by agents/automation
- Has coarse permissions
- Requires manual copy-paste for WBR/MBR/QBR
Solution Architecture
Two-Track Approach
┌─────────────────────────────────────────────────────────────────────────┐
│ DATA SOURCES │
├─────────────────────────────────────────────────────────────────────────┤
│ GTM Review Sheet ──┐ │
│ Management Ops ────┼──[MIGRATION]──┐ │
│ Partner Tracker ───┘ │ │
│ ▼ │
│ ┌─────────────────┐ │
│ │ Supabase DB │ │
│ │ (internal) │ │
│ │ │ │
│ ┌─────────────────┐ │ • company_okrs │ │
│ │ Snowflake │ │ • company_aors │ ┌─────────────┐│
│ │ │◄────────│ • sales_wbr │────────►│ Rill ││
│ │ • QuickBooks │ │ • partners │ │ Dashboards ││
│ │ • Clockify │ │ • software │ │ (read-only) ││
│ │ • Allocations │ └─────────────────┘ └─────────────┘│
│ └─────────────────┘ │ │
│ ▼ │
│ ┌─────────────────┐ │
│ │ Platform UI │ │
│ │ (/internal/*) │ │
│ │ │ │
│ │ • company-goals │ ← OKRs, AORs │
│ │ • sales-wbr │ ← Weekly Business Rev │
│ │ • software │ ← Tool inventory │
│ │ • partners │ ← Partner tracker │
│ └─────────────────┘ │
│ │ │
│ ▼ │
│ ┌─────────────────┐ │
│ │ Integrations │ │
│ │ │ │
│ │ • Linear API │ ← OKR → Initiative │
│ │ • HubSpot API │ ← Partner → Deal │
│ │ • Notion API │ ← AOR → SOP │
│ └─────────────────┘ │
└─────────────────────────────────────────────────────────────────────────┘
Track 1: Finance/Delivery (Already In Progress)
- Status: Active project via Rill on Snowflake
- Scope: P&L, revenue, costs, margins, utilization, allocation vs actual
- Action: Continue; don’t derail
Track 2: Operational Data (This Plan)
- Scope: OKRs, AORs, sales WBR/MBR, software review, partner tracker
- Destination: Supabase + Platform UI
- Migration: One-time import from Sheets, then retire Sheets
Implementation Phases
Phase 1: Foundation (Week 1-2)
Goal: Database schema, migration scripts, API layer
1.1 Database Schema (Supabase internal)
Table: company_objectives
- id (uuid, pk)
- objective (text)
- why (text)
- exec_focus (text)
- period (text) -- 'Q1 2026', 'Q2 2026', 'FY2026'
- status (enum: 'on_track', 'at_risk', 'completed', 'not_started')
- created_at, updated_at
- created_by, updated_by (for audit)Table: company_okrs
- id (uuid, pk)
- period (text) -- 'Q1 2026', 'Q2 2026'
- okr_type (enum: 'bau', 'aspirational')
- department (text) -- 'Sales', 'Marketing', 'Delivery'
- objective (text)
- key_results (jsonb array)
- owner (uuid -> team table)
- workspace_link (text)
- commentary (text)
- status (enum: 'on_track', 'lagging', 'poor', 'kickoff', 'completed')
- value (text) -- current metric value
- key_update (text)
- next_step (text)
- linear_initiative_id (text) -- link to Linear
- created_at, updated_at, created_by, updated_byTable: company_aors
- id (uuid, pk)
- department (text)
- aor_description (text)
- importance (enum: 'critical', 'high', 'medium')
- dri (uuid -> team table)
- backup (uuid -> team table)
- dri_status (enum: 'active', 'vacant', 'at_risk')
- period (text) -- 'Q1 2026'
- created_at, updated_atTable: sales_wbr (Weekly Business Review)
- id (uuid, pk)
- week_ending (date)
- metric_name (text)
- metric_value (numeric)
- target (numeric)
- vs_target_pct (numeric)
- vs_prior_week_pct (numeric)
- commentary (text)
- owner (uuid -> team table)
- created_at, updated_byTable: software_inventory
- id (uuid, pk)
- tool_name (text)
- owner_department (text)
- sme (uuid -> team table)
- purpose (text)
- expense_type (enum: 'fixed', 'variable')
- billing_cycle (enum: 'monthly', 'quarterly', 'annually')
- renewal_date (date)
- seats_purchased (int)
- seats_active (int)
- cost_per_seat (numeric)
- monthly_cost (numeric)
- annual_cost (numeric)
- seat_optimization_score (int)
- status (enum: 'active', 'inactive', 'evaluating')
- action (text)
- pl_category (text) -- P&L category
- notes (text)
- created_at, updated_atTable: partners
- id (uuid, pk)
- partner_name (text)
- partner_type (text)
- archetype (text)
- hyperscaler (text)
- slack_channel (text)
- origin_story (text)
- last_action_date (date)
- last_action_notes (text)
- next_action_date (date)
- next_action_notes (text)
- blockers (text)
- icp_match (boolean)
- accounts_named (text)
- intro_mechanism (text)
- economics (text)
- goal_90d (text)
- start_90d (date)
- status_90d (enum: 'on_track', 'at_risk', 'delivered', 'failed')
- key_contact_name (text)
- key_contact_role (text)
- relationship_notes (text)
- reps_bringing_deals (int)
- reps_engaged (int)
- leads_generated (int)
- closed_won_deals (int)
- days_since_last_touch (int)
- hubspot_link (text)
- created_at, updated_at1.2 Migration Scripts
scripts/migrate_okrs.ts- Import from GTM Review Sheet + Management Opsscripts/migrate_aors.ts- Import from Management Ops “Q126 AOR” sheetscripts/migrate_software.ts- Import fromsoftware-review-2026-02-28.csvscripts/migrate_partners.ts- Import from Partner Tracker (51 columns)
Data validation:
- Row count matches source
- Required fields populated
- FK references (owner, dri) resolve to team table
1.3 API Layer
New API routes following existing platform pattern:
GET /api/brainforge/company-goals- OKRs + objectivesGET /api/brainforge/company-aors- AORsGET/POST/PATCH/DELETE /api/brainforge/sales-wbr- WBR CRUDGET/POST/PATCH/DELETE /api/brainforge/software- Software inventoryGET/POST/PATCH/DELETE /api/brainforge/partners- Partner tracker
Phase 2: Platform UI (Week 2-3)
Goal: CRUD interfaces for each data type
2.1 Company Goals Page (/internal/company-goals)
Layout:
┌─────────────────────────────────────────────┐
│ Company Goals [+ Add OKR] │
├─────────────────────────────────────────────┤
│ ┌─────────────┐ ┌─────────────┐ │
│ │ Q1 2026 OKRs │ │ Q2 2026 OKRs │ │
│ │ (accordion) │ │ (accordion) │ │
│ └─────────────┘ └─────────────┘ │
├─────────────────────────────────────────────┤
│ Areas of Responsibility (AORs) │
│ [Department] [DRI] [Backup] [Status] │
├─────────────────────────────────────────────┤
│ Company Objectives │
│ • Objective 1 - Why - Exec Focus │
└─────────────────────────────────────────────┘
Components:
OkrCard- Expandable OKR with key results, status, ownerAorTable- Sortable/filterable table of AORsObjectiveBanner- Top-level company objectivesAddOkrModal- Form for new OKREditOkrModal- Form for editing with audit trail
Features:
- Filter by period, department, status
- Link to Linear initiative (if integrated)
- Status history (when status changed, by whom)
- Export to CSV/Print for board meetings
2.2 Sales WBR Page (/internal/sales-wbr)
Layout:
┌─────────────────────────────────────────────┐
│ Weekly Business Review [Week: Mar 24] │
├─────────────────────────────────────────────┤
│ KPIs (header cards) │
│ • Pipeline: $X | Target: $Y | +12% WoW │
│ • New Deals: X | Target: Y | -5% WoW │
│ • Avg Deal Size: $X | +8% WoW │
├─────────────────────────────────────────────┤
│ Commentary │
│ [Rich text area for narrative] │
├─────────────────────────────────────────────┤
│ Historical (table) │
│ Week | Pipeline | Deals | Close Rate │
└─────────────────────────────────────────────┘
Integration: Data from Snowflake (HubSpot deals) populated automatically, commentary added manually.
2.3 Software Review Page (/internal/software)
Layout:
┌─────────────────────────────────────────────┐
│ Software Inventory [+ Add Tool] │
│ Total Monthly: $6,664 | Annual: $77,311 │
├─────────────────────────────────────────────┤
│ Filters: [Status ▼] [Dept ▼] [Renewal ▼] │
├─────────────────────────────────────────────┤
│ ┌─────────────────────────────────────┐ │
│ │ Tool | Owner | Seats | Cost/Mo | │ │
│ │ | Renewal | Status | Action │ │
│ └─────────────────────────────────────┘ │
├─────────────────────────────────────────────┤
│ Alerts │
│ ⚠️ 3 renewals in next 30 days │
│ ⚠️ 5 tools with <50% seat utilization │
└─────────────────────────────────────────────┘
Features:
- Renewal date alerts (30, 60, 90 days)
- Seat optimization score visualization
- P&L category rollups
- Action tracking (cancel, downgrade, annualize)
2.4 Partner Tracker Page (/internal/partners)
Layout:
┌─────────────────────────────────────────────┐
│ Partners [+ Add Partner] │
├─────────────────────────────────────────────┤
│ Views: [All] [90D Test] [Needs Action] │
├─────────────────────────────────────────────┤
│ ┌─────────────────────────────────────┐ │
│ │ Partner | 90D Status | Next Action │ │
│ │ Reps Deals | Leads | Blockers │ │
│ └─────────────────────────────────────┘ │
├─────────────────────────────────────────────┤
│ Daily Action Queue │
│ (Partners with next_action_date < today) │
└─────────────────────────────────────────────┘
Features:
- Filter views: All, 90D On Track/At Risk, Needs Attention
- Daily action queue (from NEXT_ACTION_DATE)
- Quick update: 90D status, rep counts, action notes
- Link to HubSpot for rep-level detail
Phase 3: Integrations (Week 4-5)
Goal: Connect to existing systems
3.1 Linear Integration
- OKR → Initiative: Link OKRs to Linear initiatives/projects
- AOR → Team: Link DRI/backup to actual Linear team members
- Auto-populate: Pull initiative status into OKR status
3.2 HubSpot Integration
- Partner → Deal: Show partner-sourced deals in partner record
- Sales WBR: Populate pipeline/deals metrics from HubSpot
- Rep tracking: Keep rep-level detail in HubSpot, roll up to partner record
3.3 Snowflake Integration
- Sales WBR: Pull actual metrics (deals, pipeline) from Snowflake
- Software costs: Compare actual spend (QuickBooks) vs planned
- Read-only view: Embedded Rill dashboards for deep analytics
3.4 Notion Integration
- AOR → SOP: Link AORs to Notion SOPs
- Backup sync: Keep Notion as fallback, but platform is primary
Phase 4: WBR/MBR Automation (Week 5-6)
Goal: Generate business reviews from live data
4.1 WBR Generation
- Pull metrics from Snowflake (actual)
- Pull commentary from platform (narrative)
- Generate structured WBR document
- Export to Google Slides template
4.2 MBR/QBR Generation
- Roll up weekly data
- Compare to OKR progress
- Flag risks (overdue OKRs, at-risk AORs)
- Generate exec summary
File Structure
apps/platform/
├── src/
│ ├── app/
│ │ ├── api/
│ │ │ └── brainforge/
│ │ │ ├── company-goals/
│ │ │ │ └── route.ts
│ │ │ ├── company-aors/
│ │ │ │ └── route.ts
│ │ │ ├── sales-wbr/
│ │ │ │ └── route.ts
│ │ │ ├── software/
│ │ │ │ └── route.ts
│ │ │ └── partners/
│ │ │ └── route.ts
│ │ └── (main)/
│ │ └── internal/
│ │ ├── company-goals/
│ │ │ └── page.tsx
│ │ ├── sales-wbr/
│ │ │ └── page.tsx
│ │ ├── software/
│ │ │ └── page.tsx
│ │ └── partners/
│ │ └── page.tsx
│ ├── components/
│ │ └── internal/
│ │ ├── okrs/
│ │ │ ├── OkrCard.tsx
│ │ │ ├── OkrTable.tsx
│ │ │ ├── AddOkrModal.tsx
│ │ │ └── EditOkrModal.tsx
│ │ ├── aors/
│ │ │ ├── AorTable.tsx
│ │ │ └── AorCard.tsx
│ │ ├── sales/
│ │ │ ├── WbrDashboard.tsx
│ │ │ └── MetricCard.tsx
│ │ ├── software/
│ │ │ ├── SoftwareTable.tsx
│ │ │ └── RenewalAlert.tsx
│ │ └── partners/
│ │ ├── PartnerTable.tsx
│ │ ├── PartnerCard.tsx
│ │ └── ActionQueue.tsx
│ └── types/
│ └── internal.ts # Shared types for OKRs, AORs, etc.
├── supabase/
│ └── migrations/
│ ├── 010_company_okrs.sql
│ ├── 011_company_aors.sql
│ ├── 012_sales_wbr.sql
│ ├── 013_software_inventory.sql
│ └── 014_partners.sql
└── scripts/
└── migrate/
├── migrate_okrs.ts
├── migrate_aors.ts
├── migrate_software.ts
└── migrate_partners.ts
Success Criteria
- Migration complete: All data from GTM Review, Management Ops, Software CSV, Partner Tracker imported
- UI functional: All CRUD operations work for OKRs, AORs, Software, Partners
- Integrations live: Linear links work, HubSpot sync works, Snowflake read works
- Sheets retired: Source spreadsheets archived (kept for reference but no longer updated)
- WBR automated: Weekly business review generated from live data + platform commentary
- Audit trail: All changes logged (who, what, when)
- Permissions correct: Row-level security appropriate for each data type
Open Questions
- OKR editing permissions: Can anyone edit any OKR, or only owners/department heads?
- WBR frequency: Weekly data entry - who’s responsible for updating?
- Partner tracker sync: Keep HubSpot as source of truth for rep-level, or pull into platform?
- Software review ownership: Who maintains this ongoing - Finance, Ops, or individual owners?
- Historical data: How many quarters of OKR history to migrate vs archive?
Related Documentation
- Company OKRs in Platform Plan - Original phased plan
- Delivery & Finance Analytics Plan - Rill/Snowflake track
- Partner Tracking System - Current partner tracker docs
- GTM Review Sheet Context Skill - How we currently read the sheet