{"slug":"documentation/2026-08-07-complete-domain-shells","title":"Complete Domain Shells Implementation Plan","section":"documentation","sectionLabel":"Documentation","status":"unclassified","type":"document","path":"documentation/2026-08-07-complete-domain-shells.mdx","bytes":6704,"description":null,"updated":null,"source":"integratewise/Integratewise-docs-wiki","content":"\n> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.\n\n**Goal:** Make `apps/web` render complete, differentiated domain shells for every SpineWorkspace projection using the existing donor applications as the view inventory while preserving PR #127 routing and the Gateway → Projection Engine → Spine boundary.\n\n**Architecture:** Keep `apps/web` as the single authenticated SpineWorkspace runtime. Extend the PR #127 projection registry with donor provenance and complete view inventories, then route every projection view through one reusable `DomainViewShell` that supports dashboard, table, board, calendar, feed, canvas, signals, and execution-preview surfaces. Donor auth, direct Supabase/API calls, and independent app shells are not migrated.\n\n**Tech Stack:** Next.js 16, React 19, TypeScript, Tailwind v4, shadcn/Radix primitives already present in `apps/web`, Vitest.\n\n## Global Constraints\n\n- Preserve PR #127 hostname → `ProjectionId` routing and `apps/web` common shell.\n- Do not deploy donor applications independently.\n- Do not import donor auth, Supabase clients, provider SDKs, or direct database access.\n- Keep real runtime data behind Gateway → Projection Engine → Spine.\n- This pass completes domain shells and view/canvas coverage; skills/agents/workflows render as declarative execution previews only.\n- Demo content must be deterministic, typed, visibly non-persistent, and safe for preview use.\n- Preserve accessibility and responsive behavior.\n\n---\n\n### Task 1: Projection completion contract\n\n**Files:**\n\n- Modify: `apps/web/lib/projection-registry/types.ts`\n- Create: `apps/web/lib/projection-registry/donor-catalog.ts`\n- Create: `apps/web/lib/projection-registry/complete-manifest.ts`\n- Modify: `apps/web/lib/projection-registry/registry.ts`\n- Test: `apps/web/lib/projection-registry/completion.test.ts`\n\n**Interfaces:**\n\n- Consumes: existing `ProjectionManifest`, `ViewManifest`, `PROJECTION_REGISTRY`.\n- Produces: `DonorSource`, richer `ViewManifest` metadata, `completeProjectionManifest(base)`, and a registry where every projection has a donor-derived view inventory.\n\n- [ ] Write failing tests asserting all 18 projections have unique paths, donor provenance, and materially complete view counts; assert key Account Success, TAS, BI, Marketing, Sales, Book of Records, and Brandstore views exist.\n- [ ] Verify the tests fail against PR #127's shallow manifests.\n- [ ] Add typed donor provenance and shell metadata to `ViewManifest` without changing the existing skills/agents/workflows contract.\n- [ ] Add donor-derived view catalogs and manifest completion logic that merges existing PR #127 views with donor inventories.\n- [ ] Update `registry.ts` so consumers receive completed manifests.\n- [ ] Re-run projection tests.\n\n### Task 2: Deterministic domain view model\n\n**Files:**\n\n- Create: `apps/web/lib/projection-registry/view-model.ts`\n- Test: `apps/web/lib/projection-registry/view-model.test.ts`\n\n**Interfaces:**\n\n- Consumes: `ProjectionManifest`, `ViewManifest`.\n- Produces: `buildDomainViewModel(projection, view)` with metrics, rows/cards, signals, timeline, canvas blocks, and action labels.\n\n- [ ] Write failing tests for deterministic output, correct entity labels, stable metric values, and view-kind-specific surfaces.\n- [ ] Verify failing behavior.\n- [ ] Implement a deterministic preview model seeded from projection/view IDs and explicit manifest metadata.\n- [ ] Re-run view-model tests.\n\n### Task 3: Complete reusable domain shell\n\n**Files:**\n\n- Create: `apps/web/components/projections/domain-view-shell.tsx`\n- Create: `apps/web/components/projections/domain-surface.tsx`\n- Create: `apps/web/components/projections/execution-preview.tsx`\n\n**Interfaces:**\n\n- Consumes: completed `ProjectionManifest`, `ViewManifest`, `buildDomainViewModel()`.\n- Produces: a responsive operational shell with `View`, `Canvas`, and `Execution` modes.\n\n- [ ] Implement accessible header, provenance, KPI strip, filters/actions, and non-persistent preview state.\n- [ ] Render differentiated table/board/dashboard/calendar/feed/canvas surfaces using existing shadcn primitives.\n- [ ] Add Signals/Attention panel and donor provenance.\n- [ ] Add Skills/Agents/Workflows execution preview with explicit `Shell preview` state and no external calls.\n- [ ] Verify mobile layout uses stacked panels and horizontal overflow only where required.\n\n### Task 4: Bind PR #127 routing to real shells\n\n**Files:**\n\n- Modify: `apps/web/app/(workspace)/[...view]/page.tsx`\n\n**Interfaces:**\n\n- Consumes: `useDepartment()`, completed projection registry, `DomainViewShell`.\n- Produces: actual domain shells at `https://<projection>.spineworkspace.com/<view>` instead of the current manifest-inspection placeholder.\n\n- [ ] Replace the metadata-card placeholder with `DomainViewShell`.\n- [ ] Preserve No Projection Context and View Not Found states.\n- [ ] Keep hostname-derived projection context authoritative.\n\n### Task 5: Donor coverage normalization\n\n**Files:**\n\n- Modify: `apps/web/lib/projection-registry/donor-catalog.ts`\n- Test: `apps/web/lib/projection-registry/completion.test.ts`\n\n**Interfaces:**\n\n- Consumes donor inventories from:\n  - uploaded `technical-accountsuccess-main.zip`\n  - uploaded `account-success-main.zip`\n  - uploaded `real_next.zip`\n  - `integratewise/iw-spine-network-mcp` L1 domain views\n  - `NirmalPrinceJ/Business_Intelligence`\n  - `integratewise/org-mem.bookofprojects-integratewise`\n- Produces canonical first-pass view inventories for all 18 projections.\n\n- [ ] Map Account Success, TAS, BI, Marketing, Campaigns, Sales, CS, RevOps, Finance, Operations, Product, Engineering, Support, Founder, Knowledge Management, Ops, Brandstore, and Book of Records.\n- [ ] Keep overlapping donor views once under the strongest canonical name.\n- [ ] Mark donor provenance for later Keep/Adapt/Merge/Retire migration work.\n- [ ] Ensure every projection has at least one dashboard/home view, operational entity views, an analytical view, and a canvas-capable view where appropriate.\n\n### Task 6: Verification\n\n**Files:**\n\n- No new production files.\n\n- [ ] Run `pnpm --filter my-v0-project test` or the repository-equivalent `apps/web` Vitest command.\n- [ ] Run `pnpm --filter my-v0-project typecheck`.\n- [ ] Run `pnpm --filter my-v0-project build`.\n- [ ] Inspect PR checks and distinguish code failures from the repository's pre-existing blocked Vercel deployments.\n- [ ] Confirm no donor auth/Supabase imports were introduced into the new shell files.\n"}