S207 Handoff Prompt

Documentation for Handoffs

S207: Complete Platform Generation Pipeline + ESM SDK

Context

Session 206 fixed the platform generation pipeline. Here's what exists:

What's Done (S206)

  1. GitLab base template at gograbspace/platform-base-template — 33+ gspace1 libs, builds with 0 errors

    • Branch before-changes has the original state for comparison
    • Branch main has the S206 fixes (NGXS removed, real libs added, all build errors fixed)
    • Local clone at /Users/fguijarro/developer/repos-gspace/repo-templates/platform-base-template
  2. Pipeline changes in gspace1 (4 files modified, UNCOMMITTED on session-206.2 branch):

    • APIs/backend-vitto-api/src/app/studio/universe-git.service.ts — added initializeFromTemplate() that forks from template repo
    • APIs/backend-vitto-api/src/app/module-generation/phases/module-gen-phase.executor.ts — PRE-FLIGHT uses template; CI uses yarn
    • APIs/backend-vitto-api/src/app/module-generation/generators/app-shell-generator.service.ts — generates provideApiConfig(), providePlatformBootstrap(), extends tsconfig.base.json
    • APIs/backend-ai-api/src/app/workflow/templates/template-registry.service.ts — CRUD templates use UniverseDataCrudService instead of raw HttpClient
  3. New files in template (already pushed to GitLab):

    • PlatformBootstrapService — seeds SpaceService + UniverseContextService from environment.ts
    • UniverseDataCrudService — adapter wrapping UniverseDataService, composable-compatible
    • seedForPlatform() method on SpaceService
  4. Env vars already set: GITLAB_TEMPLATE_REPO=gograbspace/platform-base-template in .env.local + Railway

Architecture Decisions (logged to MCP intelligence)


Your Tasks (in order)

Task 1: Commit S206 Pipeline Changes

The 4 modified files in gspace1 are uncommitted. Commit them:

git add APIs/backend-ai-api/src/app/workflow/templates/template-registry.service.ts \
       APIs/backend-vitto-api/src/app/module-generation/generators/app-shell-generator.service.ts \
       APIs/backend-vitto-api/src/app/module-generation/phases/module-gen-phase.executor.ts \
       APIs/backend-vitto-api/src/app/studio/universe-git.service.ts

Also commit the docs:

git add docs/english/GoGrab-Space/platform-generation/S206-PROGRESS-REPORT.md \
       docs/english/GoGrab-Space/platform-generation/S207-PLAN.md

Commit message: [S206.3] feat: pipeline uses base template, UniverseDataCrudService, providePlatformBootstrap

Task 2: End-to-End Generation Test

  1. Start backends: yarn serve:backend-api (3000), yarn serve:backend-ai (3001), yarn serve:backend-vitto (3003)
  2. Trigger a platform generation via Vitto Studio (or API directly)
  3. Clone the generated repo from GitLab
  4. Run yarn install && yarn ng build {slug} --configuration development
  5. If it builds: serve it and test CRUD operations
  6. If it fails: fix the errors (likely proxy config, schema timing, or missing imports)

Task 3: Port gmodules1 Composables

Port these from /Users/fguijarro/developer/repos-gspace/gmodules1/libs/core/module-base/src/lib/crud/composables/:

Target: /Users/fguijarro/developer/repos-gspace/repo-templates/platform-base-template/libs/core/module-base/src/lib/crud/composables/

Key: These composables call apiService.getList(), getById(), create(), update(), delete() — which UniverseDataCrudService already implements. The composables should work as-is with minimal type adaptation. The types CrudPaginatedResult and PaginationRequest are already in the template's crud.types.ts and @libs-core/shared-models.

After porting, update the CRUD templates in template-registry.service.ts to use composables in generated components.

Task 4: ESM SDK on Cloudflare (if time permits)

See the full plan at docs/english/GoGrab-Space/platform-generation/S207-PLAN.md — Phases 2-5.

Key steps:

  1. Build script using ng-packagr to compile template libs into ESM bundles
  2. Generate AI-ready manifest.json cataloging all 137 gspace1 libraries
  3. Upload to Cloudflare R2 bucket
  4. Update app-shell-generator to support import-map mode

Key Files Reference

File Purpose
APIs/backend-vitto-api/src/app/studio/universe-git.service.ts initializeFromTemplate() — forks from template
APIs/backend-vitto-api/src/app/module-generation/phases/module-gen-phase.executor.ts Pipeline orchestrator — 8 phases
APIs/backend-vitto-api/src/app/module-generation/generators/app-shell-generator.service.ts Generates app.config.ts, routes, environments
APIs/backend-ai-api/src/app/workflow/templates/template-registry.service.ts CRUD/dashboard/analytics module templates
APIs/backend-vitto-api/src/app/module-generation/phases/backend-setup.phase.ts Auto-registers entity schemas in MongoDB
libs/libs-foundational/core-angular/src/lib/services/universe-data.service.ts Full CRUD with caching, offline, optimistic updates
libs/libs-foundational/core-angular/src/lib/services/platform-bootstrap.service.ts Seeds context from environment.ts

Conventions to Follow