Skip to content

Commit 9788d8e

Browse files
priyanshu92Copilot
andcommitted
Require deploy for EDM migration metadata
- Add initial deploy gate to hydrate .powerpages-site - Require metadata verification before final migration handoff - Document metadata-dependent auth, permission, and site-setting work Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent a940ded commit 9788d8e

2 files changed

Lines changed: 53 additions & 11 deletions

File tree

plugins/power-pages/skills/migrate-edm-to-spa/SKILL.md

Lines changed: 49 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ Migrate a classic Enhanced Data Model (EDM) Power Pages website to a modern stat
2424
- **Explain every inference**: Each migrated route, component, data dependency, permission, and unsupported feature must trace back to static evidence, runtime evidence, or both.
2525
- **Preserve user control**: Ask before downloading a site, logging in through the browser, testing destructive form actions, writing SPA files, or invoking follow-up skills.
2626
- **Use existing Power Pages skills**: Reuse `/create-site`, `/integrate-webapi`, `/setup-auth`, `/create-webroles`, `/test-site`, and `/deploy-site` instead of duplicating their implementation logic.
27+
- **Deploy to hydrate metadata**: Deploy the scaffolded SPA before metadata-dependent migration work is finalized. `/deploy-site` creates the `.powerpages-site` metadata folder that follow-up skills and migration steps need for table permissions, web roles, site settings, server logic, and related YAML.
2728
- **Static SPA only**: Supported target frameworks are React, Vue, Angular, and Astro. Do not generate Next.js, Nuxt, Remix, SvelteKit, Liquid, or server-rendered output.
2829

2930
**Initial request:** $ARGUMENTS
@@ -45,7 +46,7 @@ Migrate a classic Enhanced Data Model (EDM) Power Pages website to a modern stat
4546
4. **Runtime Discovery** — Use Playwright to crawl routes, observe auth transitions, capture network calls, and identify hidden behavior.
4647
5. **Build Migration Model** — Combine static and runtime evidence into a confidence-scored canonical site model.
4748
6. **Review Migration Plan** — Present the SPA route/component/data/security plan and get user approval before writing files.
48-
7. **Scaffold and Migrate SPA** — Create or reuse the target SPA project and re-author pages, components, services, and configuration.
49+
7. **Scaffold, Deploy, and Migrate SPA** — Create or reuse the target SPA project, deploy once to hydrate `.powerpages-site`, then re-author pages, components, services, and metadata.
4950
8. **Verify Migration** — Build and browse-test the SPA, compare against EDM evidence, and produce a drift report.
5051
9. **Summarize and Hand Off** — Record skill usage, summarize output, and recommend focused next skills.
5152

@@ -490,9 +491,9 @@ If the user requests revisions, update the model and plan artifacts, then ask ag
490491

491492
---
492493

493-
## Phase 7: Scaffold and Migrate SPA
494+
## Phase 7: Scaffold, Deploy, and Migrate SPA
494495

495-
**Goal:** Create or update the target SPA code site according to the approved migration plan.
496+
**Goal:** Create or update the target SPA code site, deploy it once to create `.powerpages-site`, and then complete metadata-aware migration work according to the approved plan.
496497

497498
### Actions
498499

@@ -509,7 +510,30 @@ If the target project already exists, verify:
509510

510511
If the target exists and is not empty, ask before overwriting or replacing files.
511512

512-
#### 7.2 Establish Migration Traceability
513+
#### 7.2 Build and Deploy Once to Hydrate Metadata
514+
515+
After the target SPA scaffold exists and before finalizing table permissions, web roles, site settings, server logic, or Web API settings:
516+
517+
1. Run the target project's build command, usually:
518+
519+
```bash
520+
npm run build
521+
```
522+
523+
2. Fix build failures before deployment.
524+
3. Ask the user to approve the required first deployment:
525+
526+
| Question | Options |
527+
|----------|---------|
528+
| The migrated SPA needs an initial deployment so Power Pages creates `.powerpages-site` metadata. Deploy now? | Deploy now (Required for metadata migration), Stop and deploy later |
529+
530+
4. If approved, invoke `/deploy-site` for `TARGET_PROJECT_ROOT`.
531+
5. After deployment completes, verify `.powerpages-site/` exists in the target project.
532+
6. If `.powerpages-site/` is still missing, stop metadata-dependent work and report that table permissions, web roles, site settings, server logic, and tracking cannot be finalized until deployment creates it.
533+
534+
This deployment is not optional for migrations that include metadata-dependent functionality. It hydrates the target code site metadata so the migration can create or update YAML through existing Power Pages skill patterns.
535+
536+
#### 7.3 Establish Migration Traceability
513537

514538
For each generated route/component/service, record its source in `migration-artifacts/migration-traceability.json`:
515539

@@ -518,7 +542,7 @@ For each generated route/component/service, record its source in `migration-arti
518542

519543
Use concise comments only when they help future maintainers understand non-obvious EDM mappings.
520544

521-
#### 7.3 Implement Routes and Layout
545+
#### 7.4 Implement Routes and Layout
522546

523547
Create the SPA route structure from the approved model:
524548

@@ -528,7 +552,7 @@ Create the SPA route structure from the approved model:
528552
- Shared header/footer/navigation based on web templates, web link sets, and snippets.
529553
- Framework-appropriate routing conventions.
530554

531-
#### 7.4 Implement Components and Content
555+
#### 7.5 Implement Components and Content
532556

533557
Map:
534558

@@ -540,7 +564,7 @@ Map:
540564

541565
Do not leave placeholder-only pages for routes marked in scope. For manual gaps, create explicit TODO sections that explain the missing EDM behavior and link to `migration-gap-log.md`.
542566

543-
#### 7.5 Implement Data, Forms, and Auth Boundaries
567+
#### 7.6 Implement Data, Forms, Auth, and Metadata Boundaries
544568

545569
For tables that require Web API integration, either:
546570

@@ -554,7 +578,16 @@ For auth and role-based UI, either:
554578

555579
Never bypass table permissions or imply that client-side role checks enforce data security.
556580

557-
#### 7.6 Build and Commit Milestones
581+
When `.powerpages-site/` exists, use the approved model to migrate or create metadata through existing deterministic scripts and skills:
582+
583+
- Table permissions and Web API site settings via `/integrate-webapi` or approved permission/settings scripts.
584+
- Web roles via `/create-webroles` when missing.
585+
- Auth-related site settings via `/setup-auth` when login/role UX is in scope.
586+
- Server logic only through `/add-server-logic` when an EDM behavior cannot be safely represented client-side.
587+
588+
If a metadata item from the EDM source cannot be confidently mapped to the new SPA site, put it in `migration-gap-log.md` instead of copying it silently.
589+
590+
#### 7.7 Build and Commit Milestones
558591

559592
Run the project build after meaningful implementation chunks:
560593

@@ -567,6 +600,8 @@ Fix build errors before proceeding. Commit after significant milestones when wor
567600
### Output
568601

569602
- Migrated SPA files created or updated.
603+
- Initial deployment completed and `.powerpages-site/` verified for metadata-dependent migrations.
604+
- Metadata-dependent artifacts created or explicitly logged as gaps.
570605
- Traceability artifacts saved.
571606
- Build passes before verification.
572607

@@ -582,6 +617,8 @@ Fix build errors before proceeding. Commit after significant milestones when wor
582617

583618
Confirm the expected routes, components, services, assets, and migration artifacts exist. Compare against the approved plan.
584619

620+
Confirm `.powerpages-site/` exists when the approved migration includes table permissions, web roles, site settings, server logic, or Web API settings. If it is missing, mark metadata verification as failed and direct the user to run `/deploy-site`.
621+
585622
#### 8.2 Verify Build
586623

587624
Run:
@@ -655,6 +692,7 @@ Include:
655692
| Routes migrated | `<count and notable routes>` |
656693
| Data/API work | `<completed / pending>` |
657694
| Auth/security work | `<completed / pending>` |
695+
| Metadata hydration | `<.powerpages-site present / missing>` |
658696
| Manual gaps | `<count and highest-risk items>` |
659697
| Verification | `<build/browser/drift status>` |
660698
| Key artifacts | `<migration-artifacts paths>` |
@@ -668,7 +706,7 @@ Recommend only what fits the migration result:
668706
| Dataverse tables still need frontend API work | `/integrate-webapi` |
669707
| Auth or role behavior is incomplete | `/setup-auth` or `/create-webroles` |
670708
| Permissions need review | `/audit-permissions` |
671-
| The SPA should be deployed | `/deploy-site` |
709+
| `.powerpages-site` is missing or metadata hydration failed | `/deploy-site` |
672710
| Deployed runtime parity should be checked | `/test-site` |
673711

674712
### Output
@@ -684,7 +722,7 @@ Recommend only what fits the migration result:
684722
2. **Phase 2**: Continue, narrow, or stop if high-risk EDM patterns are found.
685723
3. **Phase 4**: Confirm before authenticated browsing or interactions that may create/modify data.
686724
4. **Phase 6**: Approve the migration plan before writing SPA files.
687-
5. **Phase 7**: Confirm before invoking follow-up skills, overwriting an existing target project, or deferring Web API/auth work.
725+
5. **Phase 7**: Confirm before invoking follow-up skills, overwriting an existing target project, or stopping before the required first deployment that creates `.powerpages-site`.
688726
6. **Phase 8**: Confirm whether unexpected drift should be fixed, accepted, or moved to manual gaps.
689727

690728
---
@@ -699,7 +737,7 @@ Recommend only what fits the migration result:
699737
| Discover runtime behavior | Discovering runtime | Crawl the live site with Playwright, capture routes, auth transitions, network calls, and hidden behavior |
700738
| Build migration model | Building model | Combine static and runtime evidence into a confidence-scored canonical site model |
701739
| Review migration plan | Reviewing plan | Present SPA route/component/data/security mapping and get user approval |
702-
| Migrate SPA implementation | Migrating SPA | Scaffold or update the SPA and create routes, components, services, assets, and traceability artifacts |
740+
| Migrate SPA implementation | Migrating SPA | Scaffold or update the SPA, deploy once to hydrate `.powerpages-site`, and create routes, components, services, metadata, assets, and traceability artifacts |
703741
| Verify migrated SPA | Verifying migration | Build and browser-test the SPA, compare against EDM evidence, and document drift |
704742
| Summarize migration | Summarizing migration | Record usage, summarize outputs and gaps, and recommend focused next skills |
705743

plugins/power-pages/skills/migrate-edm-to-spa/references/edm-to-spa-patterns.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,8 @@ Do not copy jQuery code directly into a framework component unless it is explici
156156

157157
Power Pages security is server-side. The SPA can improve UX by hiding or showing UI, but table permissions and web roles enforce access.
158158

159+
For a new SPA code site, deploy the scaffold once before finalizing security metadata. `/deploy-site` creates `.powerpages-site/`, which is required before the migration can reliably create or update table permissions, web roles, site settings, server logic metadata, and skill tracking YAML.
160+
159161
Map:
160162

161163
- `webrole.yml` to role names and UX gates.
@@ -187,6 +189,8 @@ Classify site settings:
187189

188190
Do not assume every EDM site setting has a direct SPA equivalent.
189191

192+
Do not copy or create target site-setting YAML until `.powerpages-site/site-settings/` exists. If deployment has not hydrated the metadata folder, keep site-setting work in the migration plan or gap log and require `/deploy-site` before finalization.
193+
190194
## Unsupported or Manual-Gap Candidates
191195

192196
These often require manual design or a separate skill:

0 commit comments

Comments
 (0)