一键导入
compare-and-refine
Compare migrated modern page against the classic original using structural extraction, score quality, and refine until coverage is acceptable.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Compare migrated modern page against the classic original using structural extraction, score quality, and refine until coverage is acceptable.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
Extract classic SharePoint pages and build a CIM (Canonical Intermediate Model) for migration.
Orchestrate bulk classic-to-modern SharePoint page migration for an entire site. Supports plan, migrate, and refine modes.
Transform classic page content into modern web parts, assemble canvas layout, and create/update the modern page.
Supplementary reference for PnP selector functions, Community Script Editor, Quick Links layouts, and JavaScript alternatives. Read on-demand for deeper migration details.
基于 SOC 职业分类
| name | compare-and-refine |
| description | Compare migrated modern page against the classic original using structural extraction, score quality, and refine until coverage is acceptable. |
| model | sonnet |
Compare the migrated modern page against the classic original using automated structural extraction, score migration quality, and iterate until coverage is acceptable.
For incremental fixes, use update_modern_page directly. For major rework (wrong layout, missing sections), re-run transform-and-create.
Read all files in <git_repo_path>/.claude/knowledge/*.md for known migration patterns. Use this knowledge when:
Use the automated comparison tool for objective quality assessment:
Extract the modern page: Call extract_page_data on the modern destination page to get structural data (headings, links, images, text).
Build classic page data: extract_page_data only works on modern pages — it returns "No content container found" on classic wiki/publishing pages. Instead, construct the classic comparison data from the extract_classic_page bundle you already have from Phase 1:
wikiHtml / PublishingPageContent to extract headings, links, images, and textwebParts[].resolvedHtml if presentextract_page_data output schema: {headings, links, images, imageCount, linkCount, textLength, textPreview, ...}Call compare_migration_quality with both JSON results (classicData from step 2, modernData from step 1).
Review the comparison report:
Cross-reference findings against knowledge files:
If coverage < 80% or issues found:
build_canvas_layout and update via update_modern_pagetake_page_screenshot may fail with "Execution context was destroyed" due to browser navigation or auth session timeouts.migrate_assets was called during the transform phase and all assets uploaded successfully. If any failed, re-run migrate_assets for the failed items.rewrite_urls was applied to all content — check that no source-tenant URLs remain in the modern page HTML.extract_page_data extracts content from the rendered DOM. SPFx web parts (Quick Links, Hero, Highlighted Content, etc.) render via React/JavaScript and may not produce standard <a>, <img>, or heading tags in the DOM.compare_migration_quality may report 0 links and 0 images for a page that actually has all content present inside SPFx components — producing misleadingly low coverage scores.textPreview), a low link/image count is likely a false negative, not actual content loss.textPreview contains all expected titles/labels and missingPhrases is empty, the content is likely present even if links/images show as missing.| Tool | Purpose |
|---|---|
extract_page_data(pageUrl) | Extract structural data from a modern page (fails on classic pages — see Troubleshooting) |
compare_migration_quality(classicData, modernData) | Compare extracted data and produce a quality score and gap report |
take_page_screenshot(pageUrl, fullPage?, filePath?) | Take a screenshot using authenticated Playwright browser |
get_comparison_extraction_script | Get the JavaScript extraction script (fallback if extract_page_data unavailable) |
get_page_rendering_urls(pageUrl, renderMode) | Get classic/modern rendering URLs for visual comparison |
| Tool | Purpose |
|---|---|
build_text_webpart(innerHtml, sourceUrl?) | Rich text web part (use for table tiles, formatted content) |
build_quick_links_webpart(links[], layoutId) | Quick Links web part |
build_image_webpart(imageUrl, altText?, captionText?, linkUrl?) | Image web part |
build_canvas_layout(sections[]) | Assemble page layout with validation |
update_modern_page(siteUrl, pageId, canvasLayout?, title?, titleArea?, useBetaApi?) | Update existing draft to fix content gaps |