# Rebrand Plan — VivaCareUSA → LumisCare

# Plan: LumisCare Rebrand — VivaCareUSA → LumisCare

**Architect:** Petter Graff (Team Lead)
**Date:** 2026-04-05
**Estimated execution:** 1 working day

---

## Research Summary

### Golden Commit
`c80a3637` — "ALL TESTS GREEN: Element 100%, CEO 100%, Flow PASS" (2026-01-25)
This is the autocoder Day 1 commit: full project skeleton + 500 features registered in features.db.
No VivaCareUSA-branded code built yet — cleanest possible rebrand starting point.
411 commits of autocoder feature builds come after this. We rebrand the skeleton, then rerun autocoder.

### What Needs Rebranding
- **106 files** with VCC/vivacare references
- **~238 occurrences** across .ts, .tsx, .js files
- Key areas:
  - HTTP headers: `X-VCC-Organization-Id`, `X-VCC-User-Id` → `X-LC-Organization-Id`, `X-LC-User-Id`
  - ENV vars: `VITE_VCC_ORGANIZATION_ID` → `VITE_LC_ORGANIZATION_ID`
  - Mock emails: `@vivacare.com` → `@lumiscare.com`
  - CSS comments: `VivaCareUSA Color System` → `LumisCare Color System`
  - Azure DevOps script: `azureProject: 'VCC'` → `azureProject: 'LumisCare'`
  - CSS legacy vars: `--color-vcc-*` → `--color-lc-*`

### Design Tokens — Already Correct
`index.css` already has the right colors (Jade Green, Neon Blue, Mint Green).
Only comments and legacy var names need updating.

### Infrastructure — Already Exists
Azure Container Apps, Static Web Apps, Bicep IaC all deployed.
`deploy-frontends.sh` + `deploy-demo.sh` exist and work.

### The Core Problem
10 days of localStorage migrations, BFF wiring, header standardization —
none of it was requested. The golden commit worked. We restore it, rebrand it, ship it.

---

## Objective

Branch off `c80a3637` (project skeleton, 500 features in DB, zero built code),
rebrand all skeleton files (VivaCareUSA/VCC → LumisCare/LC),
then run AutoCoder to rebuild all 500 features with LumisCare branding from day 1.
No migrations. No patching. Clean rebuild.

---

## Team Orchestration

### Team Members

| ID | Name | Role | Agent |
|----|------|------|-------|
| B1 | branch-builder | Create clean rebrand branch from golden commit | builder |
| V1 | branch-validator | Verify branch is clean and builds | validator |
| B2 | rebrand-builder | Execute mechanical find-replace rebrand | codecraft |
| V2 | rebrand-validator | Verify zero VCC references remain, app builds | validator |
| B3 | design-builder | Update CSS legacy var names + comments only | builder |
| V3 | design-validator | Verify design tokens are correct, no visual regression | validator |
| B4 | deploy-builder | Deploy to Azure dev environment | flowforge |
| V4 | deploy-validator | Playwright smoke test on deployed URL | sentinel-tester |

---

## Step-by-Step Tasks

### Phase 1: Restore Golden State

**Task 1.1 — Create rebrand branch from c80a3637 skeleton**
- Owner: B1 (builder)
- BlockedBy: none
- Command:
  ```bash
  cd ~/projects/client/lumiscare
  git checkout c80a3637 -b rebrand/lumiscare-clean
  git push origin rebrand/lumiscare-clean
  ```
- Acceptance:
  - [ ] Branch `rebrand/lumiscare-clean` exists on origin
  - [ ] `git log -1` shows commit `c80a3637`
  - [ ] Project skeleton files present (frontend/, backend/, infrastructure/)
  - [ ] features.db contains 500 features with passes=0

**Task 1.2 — Validate skeleton compiles**
- Owner: V1 (validator)
- BlockedBy: 1.1
- Commands:
  ```bash
  cd ~/projects/client/lumiscare/frontend/web && yarn install && yarn type-check
  sqlite3 features.db "SELECT COUNT(*) FROM features WHERE passes=0;"
  # Expected: 500
  ```
- Acceptance:
  - [ ] TypeScript exits 0 (or known baseline errors only)
  - [ ] 500 features in DB, all passes=0 (ready for autocoder)
  - [ ] No built feature code — only skeleton

---

### Phase 2: Mechanical Rebrand

**Task 2.1 — Execute find-replace rebrand**
- Owner: B2 (codecraft)
- BlockedBy: 1.2
- Replacements (exact, case-sensitive where needed):

  | Find | Replace | Scope |
  |------|---------|-------|
  | `VivaCareUSA` | `LumisCare` | all src files |
  | `VivaCare USA` | `LumisCare` | all src files |
  | `vivacareusa` | `lumiscare` | all src files |
  | `vivacare.com` | `lumiscare.com` | all src files |
  | `X-VCC-Organization-Id` | `X-LC-Organization-Id` | .ts/.tsx |
  | `X-VCC-User-Id` | `X-LC-User-Id` | .ts/.tsx |
  | `VITE_VCC_ORGANIZATION_ID` | `VITE_LC_ORGANIZATION_ID` | .ts/.tsx/.env |
  | `VITE_VCC_USER_ID` | `VITE_LC_USER_ID` | .ts/.tsx/.env |
  | `lumiscare-organization-id` | `lumiscare-organization-id` | NO CHANGE (already correct) |
  | `--color-vcc-` | `--color-lc-` | .css files |
  | `VCC Green` | `LC Green` | comments |
  | `VCC Blue` | `LC Blue` | comments |
  | `azureProject: 'VCC'` | `azureProject: 'LumisCare'` | scripts |

- Acceptance:
  - [ ] `grep -r "VivaCareUSA\|vivacareusa\|vivacare.com\|X-VCC-\|VITE_VCC_" frontend/web/src` returns 0 results
  - [ ] `yarn build` still passes after replacements

**Task 2.2 — Validate zero VCC references**
- Owner: V2 (validator)
- BlockedBy: 2.1
- Commands:
  ```bash
  grep -rn "VivaCareUSA\|VivaCare USA\|vivacareusa\|vivacare\.com\|X-VCC-\|VITE_VCC_" \
    ~/projects/client/lumiscare/frontend/web/src/ | wc -l
  # Must return 0
  grep -rn "--color-vcc-" ~/projects/client/lumiscare/frontend/web/src/ | wc -l
  # Must return 0
  ```
- Acceptance:
  - [ ] VCC references = 0
  - [ ] vivacare references = 0
  - [ ] Build passes

---

### Phase 3: Design Token Cleanup

**Task 3.1 — Update CSS comments and legacy var names**
- Owner: B3 (builder)
- BlockedBy: 2.2
- Files:
  - `frontend/web/src/index.css` — update comment header only
  - Any remaining `--color-vcc-*` → `--color-lc-*` (if V2 missed any)
- Acceptance:
  - [ ] `index.css` comment says `LumisCare Color System`
  - [ ] No `VCC` in any CSS file
  - [ ] Colors unchanged (Jade Green #35b276, Neon Blue #516df2, Mint #73ffd3)

**Task 3.2 — Validate design tokens**
- Owner: V3 (validator)
- BlockedBy: 3.1
- Acceptance:
  - [ ] `--color-jade-500: #35b276` present
  - [ ] `--color-blue-500: #516df2` present
  - [ ] `--color-mint-500: #73ffd3` present
  - [ ] No VCC color names remain

---

### Phase 4: Deploy

**Task 4.1 — Deploy to Azure dev environment**
- Owner: B4 (flowforge)
- BlockedBy: 3.2
- Commands:
  ```bash
  cd ~/projects/client/lumiscare
  # Push rebrand branch → triggers Azure Static Web Apps auto-deploy
  git push origin rebrand/lumiscare-clean
  # OR run manual deploy script
  bash infrastructure/deploy-frontends.sh dev
  ```
- Acceptance:
  - [ ] Frontend deployed to Azure Static Web Apps (dev)
  - [ ] HTTP 200 on all 3 portal URLs
  - [ ] No build errors in Azure DevOps pipeline

**Task 4.2 — Smoke test deployed app**
- Owner: V4 (sentinel-tester)
- BlockedBy: 4.1
- Test the 3 portals:
  - Backoffice: login, dashboard load, clients list
  - Admin: organizations page, users page
  - Family Portal: dashboard, care plan
- Acceptance:
  - [ ] All 3 portals load without JS errors
  - [ ] Login flow works (or mock auth works in dev)
  - [ ] No "VivaCare" or "VCC" text visible in UI
  - [ ] "LumisCare" branding visible throughout

---

## Validation Commands (Final)

```bash
# 1. Zero VCC references in frontend
grep -rn "VCC\|VivaCare\|vivacare" ~/projects/client/lumiscare/frontend/web/src/ \
  | grep -v "//\|node_modules" | wc -l
# Expected: 0

# 2. Build passes
cd ~/projects/client/lumiscare/frontend/web && yarn build && yarn type-check

# 3. Portal URLs return 200
curl -s -o /dev/null -w "%{http_code}" https://jolly-bay-01cfa3003.6.azurestaticapps.net
curl -s -o /dev/null -w "%{http_code}" https://zealous-hill-097d4b803.6.azurestaticapps.net
curl -s -o /dev/null -w "%{http_code}" https://white-island-07c0e4c03.4.azurestaticapps.net
```

---

## What This Plan Does NOT Do

- No localStorage migrations (P2-28 through P2-32 stay in MC for later)
- No new features
- No backend changes
- No BFF wiring changes
- No architectural refactoring

**Restore → Rebrand → Deploy. That's it.**

---

## Risk

| Risk | Mitigation |
|------|-----------|
| Azure DevOps pipeline still named "VCC" | Rename pipeline display name only — do NOT touch infra resource names (breaking change) |
| Backend services still use `X-VCC-*` headers | Frontend and backend header rename must be done in same PR, or keep old header names and only rename in comments |
| `8b0effdc` missing some later fixes | V1 task verifies build — if broken, use next clean commit after `8b0effdc` |

**Note on headers:** `X-VCC-Organization-Id` is sent by frontend AND read by backend services. If we rename on frontend only, backend breaks. Either rename both simultaneously, or leave headers as-is (they're internal API headers, not user-visible branding).

---

## Execution

Run `/build-plan` to execute with agent teams.