Skip to content
Open
Show file tree
Hide file tree
Changes from 28 commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
340bed6
Added migrate-sdm-to-edm skill for SDM to EDM site migration
sparrow1303 Apr 10, 2026
be22e9c
Add EDM migration report templates, generation script, and environmen…
sparrow1303 Apr 20, 2026
316d9e4
Added customization sample report and design doc
sparrow1303 Apr 29, 2026
924b774
[Pages] Restructure SDM-to-EDM skill into 12-phase re-entrant flow
sparrow1303 May 12, 2026
76378d8
[Pages] SDM-to-EDM: support all templates including D365 portals
sparrow1303 May 12, 2026
a5f758e
Restructures Phase 9 (Customization Remediation) so it actually fixes
sparrow1303 May 13, 2026
2a41692
[Pages] SDM-to-EDM: 4-phase structure + path-handling fixes
sparrow1303 May 22, 2026
a39612c
Merge branch 'main' into users/ashwanikumar/migrate-sdm-to-edm-skill
sparrow1303 May 22, 2026
4877781
Auto-add plugin version check to SKILL.md files
github-actions[bot] May 22, 2026
c5ce267
[Pages] SDM-to-EDM: augmented prompts for plugin + DME remediation
sparrow1303 May 22, 2026
443753e
[Pages] SDM-to-EDM: sample HTML reports for live-updating execution r…
sparrow1303 May 26, 2026
83891df
[Pages] SDM-to-EDM: live execution-report renderer + state CLI
sparrow1303 May 26, 2026
d4ca3bc
[Pages] SDM-to-EDM: wire SKILL.md to live execution-report state CLI
sparrow1303 May 26, 2026
7a37425
[Pages] SDM-to-EDM: data-validation phase via snapshot + diff
sparrow1303 May 26, 2026
065931b
[Pages] SDM-to-EDM: rename Phase 1 to "Site Discovery & Pre-checks"
sparrow1303 May 26, 2026
202bbec
[Pages] SDM-to-EDM: track-based branching for Phase 2 + Phase 3
sparrow1303 May 27, 2026
694675a
[Pages] SDM-to-EDM: fix stale phase names in Progress Tracking table
sparrow1303 May 27, 2026
f7ee4ca
[Pages] SDM-to-EDM: unify Phase 3 across tracks + Fluent UI restyle
sparrow1303 May 28, 2026
d82780c
[Pages] SDM-to-EDM: differentiated Phase 3 + open-the-report callouts
sparrow1303 May 29, 2026
402d013
[Pages] SDM-to-EDM: prefer pac application install for V2 packages
sparrow1303 Jun 1, 2026
217eca2
[Pages] SDM-to-EDM: fix 3 issues found in session 967ad544 testing
sparrow1303 Jun 1, 2026
c9642fc
[Pages] SDM-to-EDM: clarify step 2.1 output for older PAC builds
sparrow1303 Jun 1, 2026
f712efd
[Pages] SDM-to-EDM: fix 4 hiccups from session dc0d7db8 testing
sparrow1303 Jun 1, 2026
4fbf64e
[Pages] SDM-to-EDM: split Phase 4 into 3 sub-steps; elevate /test-sit…
sparrow1303 Jun 1, 2026
30b2da7
Added vscode uri to import customization remediation diff json
sparrow1303 Jun 12, 2026
fd40ba6
Merge branch 'main' into users/ashwanikumar/migrate-sdm-to-edm-skill
sparrow1303 Jun 12, 2026
c28b9d1
Corrected diff view left pane will show current content and right pan…
sparrow1303 Jun 16, 2026
ece8974
power-pages: add legacy remediation-diff website aliases for importer…
sparrow1303 Jul 28, 2026
ab6a521
Users/gokulrg/migrate sdm edm skill (#209)
gokulraj-g Aug 6, 2026
9d955e1
refactor(power-pages): rename migrate-sdm-to-edm skill to migrate-dat…
sparrow1303 Aug 13, 2026
bfff370
Merge branch 'main' into users/ashwanikumar/migrate-sdm-to-edm-skill
sparrow1303 Aug 13, 2026
c1d6dcd
chore(power-pages): bump to 2.7.0 and add ALM gate marker for migrate…
sparrow1303 Aug 13, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ If the tracking script creates or updates site setting YAML files, include those
| add-cloud-flow | AddCloudFlow | Site/AI/Skills/AddCloudFlow |
| add-ai-webapi | AddAiWebapi | Site/AI/Skills/AddAiWebapi |
| integrate-backend | IntegrateBackend | Site/AI/Skills/IntegrateBackend |
| migrate-sdm-to-edm | MigrateSdmToEdm | Site/AI/Skills/MigrateSdmToEdm |
| scan-site | ScanSite | Site/AI/Skills/ScanSite |
| manage-headers | ManageHeaders | Site/AI/Skills/ManageHeaders |
| manage-firewall | ManageFirewall | Site/AI/Skills/ManageFirewall |
Expand Down
Binary file not shown.
442 changes: 442 additions & 0 deletions plugins/power-pages/skills/migrate-sdm-to-edm/DESIGN.md

Large diffs are not rendered by default.

Binary file not shown.
310 changes: 310 additions & 0 deletions plugins/power-pages/skills/migrate-sdm-to-edm/REPORTS_INTEGRATION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,310 @@
# HTML Reports Integration Guide

This document explains how to integrate the HTML report templates and generation scripts into the `migrate-sdm-to-edm` skill workflow.

## Folder Structure

```
plugins/power-pages/skills/migrate-sdm-to-edm/
├── assets/
│ ├── customization-report.html # Template for customization report
│ ├── skill-execution-report.html # Template for execution report
│ └── README.md # Template documentation
├── scripts/
│ └── generate-migration-reports.js # Utility to generate reports from data
├── SKILL.md
└── DESIGN.md
```

## Workflow Integration

### Phase 8: Customization Report & Analysis

**Current flow (SKILL.md):**

1. Download customization report via PAC CLI
2. Parse and categorize findings
3. Generate HTML report
4. Present findings to user

**Implementation:**

```bash
# Phase 8 step 1: Download Customization Report
pac pages migrate-datamodel --webSiteId "<WEBSITE_ID>" --siteCustomizationReportPath "./migration-report"

# Phase 8 step 2: Parse findings
# ... parsing logic ...

# Phase 8 step 3: Generate HTML report
node "${CLAUDE_PLUGIN_ROOT}/skills/migrate-sdm-to-edm/scripts/generate-migration-reports.js" \
--customization-report "./migration-report/SiteCustomization.csv" \
--site-name "<SITE_NAME>" \
--website-id "<WEBSITE_ID>" \
--template-name "<TEMPLATE_NAME>" \
--output-dir "./migration-reports"

# Share with user
echo "Customization report: file://$(pwd)/migration-reports/customization-report.html"
```

### Phase 9: Automated Remediation (subset)

For automatable fixes (Data Model Extensions only), the same script is invoked with `--automate` and `--env-url`:

```bash
node "${CLAUDE_PLUGIN_ROOT}/skills/migrate-sdm-to-edm/scripts/generate-migration-reports.js" \
--site-name "<SITE_NAME>" \
--website-id "<WEBSITE_ID>" \
--siteCustomizationReportPath "./migration-report/SiteCustomization.csv" \
--env-url "https://org.crm.dynamics.com" \
--automate \
--environment-type "<ENV_TYPE>" \
--output-dir "./migration-reports"
```

The script creates missing string attributes via Dataverse Web API and logs results into the execution report. All other customization types (Liquid, FetchXML, plugins, workflows) are flagged as manual.

### Phase 12: Execution Report & Summary

**Current flow (SKILL.md):**

1. Present validation checklist
2. Run rollback (if needed)
3. Generate execution report
4. Present final summary

**Implementation:**

```bash
# During Phases 1–11: skill collects timing and results
# Track all commands, results, and timing

# At end of Phase 12: generate execution report
node "${CLAUDE_PLUGIN_ROOT}/skills/migrate-sdm-to-edm/scripts/generate-migration-reports.js" \
--site-name "<SITE_NAME>" \
--website-id "<WEBSITE_ID>" \
--portal-id "<PORTAL_ID>" \
--template-name "<TEMPLATE_NAME>" \
--execution-data "phase1,phase2,phase3,phase4,phase5,phase6,phase7,phase8,phase9,phase10,phase11,phase12" \
--output-dir "./migration-reports"

# Share with user
echo "Execution report: file://$(pwd)/migration-reports/skill-execution-report.html"
```

## Data Structures

### Customization Report CSV (from PAC CLI)

The CSV contains:
- **Type of customization** — Category (Liquid, Data Model Extension, Plugin, etc.)
- **Guidance** — Microsoft link to remediation docs
- **Snippet** — Code snippet or detail
- **Location** — File path or table name

Example:
```
Liquid contains adx references,https://go.microsoft.com/fwlink/?linkid=2247170,"{% assign homeurl = website.adx_partialurl %}","web-templates/header/Header.webtemplate.source.html"
Data Model Extension,https://go.microsoft.com/fwlink/?linkid=2247170,"Table name : adx_ad Column name : mspp_websiteid","Table name : adx_ad"
```

### Execution Data Structure (to be tracked by skill)

During skill execution, collect:

```json
{
"siteName": "Contoso Portal",
"websiteId": "076bf556-9ae6-ee11-a203-6045bdf0328e",
"portalId": "07f35d71-c45a-4a05-9702-8f127559e48e",
"templateName": "Starter layout 1",
"startTime": "2024-04-20T10:30:00Z",
"prerequisites": [
{
"name": "PAC CLI Version",
"required": "1.31.6 or higher",
"actual": "1.32.1",
"status": "success"
}
],
"pacCommands": [
{
"step": 1,
"description": "Verify Authentication",
"command": "pac auth who",
"status": "success",
"output": "Authenticated to https://org12345.crm.dynamics.com"
},
{
"step": 2,
"description": "List Available Sites",
"command": "pac pages list",
"status": "success",
"output": "Found 3 websites"
}
],
"phases": [
{
"number": 1,
"title": "Verify Prerequisites",
"status": "completed",
"results": [
{
"type": "success",
"title": "PAC CLI Verified",
"description": "PAC CLI version 1.32.1 meets minimum requirement"
}
]
}
],
"customizations": {
"liquidReferences": 8,
"dataModelExtensions": 15,
"pluginsRegistered": 2,
"customWorkflows": 1
},
"remediationRequired": true,
"remediationSteps": [
{
"type": "Liquid References",
"count": 8,
"guidance": "Replace adx_* Liquid objects with powerpagecomponent equivalents"
}
],
"endTime": "2024-04-20T10:45:00Z"
}
```

## Integration Points in SKILL.md

### Phase 8: Customization Report Generation

The skill calls the script after parsing the CSV from PAC CLI:

```powershell
node "${CLAUDE_PLUGIN_ROOT}/skills/migrate-sdm-to-edm/scripts/generate-migration-reports.js" `
--customization-report "<REPORT_PATH>" `
--site-name "<SITE_NAME>" `
--website-id "<WEBSITE_ID>" `
--template-name "<TEMPLATE_NAME>" `
--output-dir "<OUTPUT_DIR>"
```

Open the generated HTML report in your browser: `file://<OUTPUT_DIR>/customization-report.html`

### Phase 9: Automated Remediation

The same script runs with `--automate` to apply safe fixes via Dataverse API (Data Model Extensions only):

```powershell
node "${CLAUDE_PLUGIN_ROOT}/skills/migrate-sdm-to-edm/scripts/generate-migration-reports.js" `
--site-name "<SITE_NAME>" `
--website-id "<WEBSITE_ID>" `
--siteCustomizationReportPath "<REPORT_PATH>" `
--env-url "<ENV_URL>" `
--automate `
--environment-type "<ENV_TYPE>" `
--output-dir "<OUTPUT_DIR>"
```

### Phase 12: Final Execution Report

At the end of post-migration validation:

```powershell
node "${CLAUDE_PLUGIN_ROOT}/skills/migrate-sdm-to-edm/scripts/generate-migration-reports.js" `
--site-name "<SITE_NAME>" `
--website-id "<WEBSITE_ID>" `
--portal-id "<PORTAL_ID>" `
--template-name "<TEMPLATE_NAME>" `
--output-dir "<OUTPUT_DIR>"
```

The execution report includes:

- All PAC commands executed and their results
- Prerequisite verification status
- Migration phase details
- Customization analysis summary
- Remediation guidance
- Post-migration validation checklist
- Next steps

Open the report in your browser: `file://<OUTPUT_DIR>/skill-execution-report.html`

## Using `browser_navigate` to Open Reports

In the Claude skill, after generating reports, use Playwright to open them in the user's browser:

```javascript
// Open customization report
await browser_navigate(`file://${path.resolve('./migration-reports/customization-report.html')}`);

// Take accessibility snapshot
const snapshot = await browser_snapshot();
console.log('Report loaded successfully');
```

Or inform the user of the file path for manual opening:

```
I've generated two detailed reports in the `migration-reports` folder:

1. **Customization Report**: Shows all customizations found
Open: file://${pwd}/migration-reports/customization-report.html

2. **Execution Report**: Shows all migration steps and results
Open: file://${pwd}/migration-reports/skill-execution-report.html

You can open these files in your browser to review the details.
```

## Development Notes

### Template Customization

If you need to modify the templates:

1. Edit `customization-report.html` or `skill-execution-report.html` in the `assets/` folder
2. Update the placeholder documentation in `assets/README.md`
3. Update the placeholder replacement logic in `generate-migration-reports.js`

### Adding New Customization Types

To add a new customization type badge:

1. Add the CSS class in the template (e.g., `.badge-newtype { ... }`)
2. Update the `badgeMap` in `generate-migration-reports.js`
3. Update the documentation

### CSV Parsing

The script uses a built-in CSV parser (no npm dependency) — see `parseCSV()` in `generate-migration-reports.js`. It handles quoted values, embedded quotes (`""` → `"`), and `\r\n` line endings.

### Dependencies

The script imports only:

- Node stdlib: `fs`, `path`
- The plugin-shared validation helpers at `plugins/power-pages/scripts/lib/validation-helpers.js` (provides `getAuthToken`, `makeRequest`, `getEnvironmentUrl`)

No `npm install` is required to run the script.

## Sample Output

After running the generation script:

```
✓ Customization report generated: C:\path\to\migration-reports\customization-report.html
✓ Execution report generated: C:\path\to\migration-reports\skill-execution-report.html

Reports generated successfully!
Open in browser: file:///C:/path/to/migration-reports/customization-report.html
```

Both HTML files are self-contained (no external dependencies) and can be:
- Opened directly in any modern browser
- Saved for later reference
- Included in documentation
- Shared with stakeholders
Loading
Loading