بنقرة واحدة
generate-release-screenshots
// Generate PNG screenshots for release notes using the repository's HtmlRenderer and ScreenshotGenerator tools. Use when asked to add screenshots to release notes or documentation.
// Generate PNG screenshots for release notes using the repository's HtmlRenderer and ScreenshotGenerator tools. Use when asked to add screenshots to release notes or documentation.
Minimum-requirements checklist for any change — code or docs-only. Run this before every PR creation or push to avoid CI failures on the first attempt.
Determine the next available issue number across all change types (feature, fix, workflow) by checking both local docs and remote branches, then reserve it by pushing an empty branch.
Convert the mermaid diagram in docs/agents.md to a blueprint-styled SVG for the website. Use when the workflow diagram in agents.md is updated and needs to be reflected on the website.
Run a focused accessibility pass for website changes (WCAG 2.1 AA-oriented).
Create and update interactive examples for the Eleventy website using page entrypoints and src/examples fragments.
Use browser tools to inspect rendering and troubleshoot website issues with the Maintainer.
| name | generate-release-screenshots |
| description | Generate PNG screenshots for release notes using the repository's HtmlRenderer and ScreenshotGenerator tools. Use when asked to add screenshots to release notes or documentation. |
Provide clear, actionable guidance for generating actual PNG screenshot files for release notes and documentation, preventing common mistakes like creating markdown links to source files or referencing non-existent images.
dotnet build src/tools/Oocx.TfPlan2Md.ScreenshotGenerator/), then install the browser via pwsh src/tools/Oocx.TfPlan2Md.ScreenshotGenerator/bin/Debug/net10.0/playwright.ps1 install chromium --with-deps. Do NOT use npx playwright install — the npm version differs from the .NET package version.scripts/generate-release-screenshots.sh for release note screenshots (includes retry logic and error reporting).scripts/generate-screenshot.sh for individual screenshots with full control (light/dark themes, DPI, crops).*-crop*.png files in release notes, or generate single screenshots using the release wrapper.raw.githubusercontent.com URLs in release notes — relative paths like ./image.png do NOT work in GitHub Release pages. Use format: https://raw.githubusercontent.com/oocx/tfplan2md/v{VERSION}/docs/{path}/image.png where {VERSION} is the release tag.--details open so resource details blocks are expanded in screenshots — unless you specifically want to capture a collapsed resource.<!-- release-screenshot: selector="..." ; focus="..." --> or target-resource-id="..." so PR validation can confirm the capture intent. syntax to markdown before verifying the PNG file exists.[View in file.md (lines X-Y)])../image.png) in release notes — they break in GitHub Release pages.# Generate focused screenshots for release notes
scripts/generate-release-screenshots.sh \
--plan examples/comprehensive-demo/plan.json \
--output-prefix feature-name \
--output-dir docs/features/NNN-feature-slug/ \
--selector "details:has(summary:has-text('resource_name'))"
# This script:
# - Includes retry logic (3 attempts with 5-second delays)
# - Provides detailed error reporting and troubleshooting guidance
# - Generates focused crop screenshots suitable for release notes
scripts/generate-release-screenshots.sh \
--markdown-file artifacts/comprehensive-demo.md \
--output-prefix demo-screenshot \
--output-dir docs/features/NNN-feature-slug/ \
--target-resource-id "azurerm_firewall_network_rule_collection"
# Generate with light/dark themes, DPI options, and custom crops
scripts/generate-screenshot.sh \
--plan examples/comprehensive-demo/plan.json \
--output-prefix feature-name \
--selector "details:has(summary:has-text('resource_name'))" \
--thumbnail-width 580 --thumbnail-height 400 \
--lightbox-width 1200 --lightbox-height 900 \
--render-target azdo \
--open-details-selector "details"
# This generates 12 variants:
# - Thumbnail and lightbox crops
# - Light and dark themes
# - 1x and 2x DPI versions
Before any screenshot generation, ensure the correct Chromium browser is installed for the .NET Playwright package:
# 1. Build the ScreenshotGenerator project first
dotnet build src/tools/Oocx.TfPlan2Md.ScreenshotGenerator/
# 2. Install Chromium using the .NET project's Playwright script
pwsh src/tools/Oocx.TfPlan2Md.ScreenshotGenerator/bin/Debug/net10.0/playwright.ps1 install chromium --with-deps
⚠️ Do NOT use npx playwright install — the npm Playwright version differs from the .NET Microsoft.Playwright NuGet package version, causing browser version mismatches (e.g., the .NET package expects chromium_headless_shell-1200 but npm installs chromium_headless_shell-1208). Always use the .NET project's playwright.ps1 script to ensure version compatibility.
Clarify with the user:
For release notes: Use scripts/generate-release-screenshots.sh
For full control: Use scripts/generate-screenshot.sh
Run the chosen script with appropriate parameters:
--plan or --markdown-file)--details open so resource attribute tables are visible in the screenshot — unless you specifically want to capture a collapsed resourceBefore proceeding:
Only after verification, use absolute URLs for release notes:
<!-- release-screenshot: selector="summary:has-text('resource_type.resource_name')"; focus="Shows the changed summary line" -->

Never use relative paths in release notes — they break in GitHub Release pages.
If screenshot generation fails:
The selector determines which part of the rendered HTML page is captured. Choosing the wrong selector is a common mistake that results in screenshots showing irrelevant content.
--selector captures the bounding box of all matching elements--target-terraform-resource-id finds the <details> block for a specific Terraform resource and captures its full content (attribute tables, body changes, etc.)| What changed | What to show | Recommended selector |
|---|---|---|
| Summary line (emoji, spacing, icons in collapsed view) | The <summary> element showing the change | --selector "summary:has-text('resource_type.resource_name')" |
| Resource details (attribute rendering, body layout) | The expanded <details> block | --target-terraform-resource-id "resource_type.resource_name" |
| Section header (module icons, heading format) | The heading element | --selector "h3:has-text('Module:')" or --selector "h4:has-text('Section Name')" |
| Tags rendering | The tags section within a resource | --selector "p:has-text('Tags:')" |
| Table formatting | A specific table | --selector "table:near(summary:has-text('resource'))" |
| Multiple elements (before/after, several fixes) | Wider section containing all changes | --selector "article" or use a parent container |
--target-terraform-resource-id for summary-line changesIf a fix only changes the collapsed <summary> line (e.g., emoji spacing like 2 🔧), do NOT use --target-terraform-resource-id — this captures the entire expanded resource details block, which shows attribute tables instead of the summary where the fix is visible.
# To capture wrench icon spacing fix in summary:
--selector "summary:has-text('azurerm_network_security_group')"
# To capture tags emoji addition:
--selector "p:has-text('🏷️ Tags:')"
# To capture module icon fix:
--selector "h3:has-text('📦 Module:')"


Relative paths work when browsing the file in the GitHub repository, but GitHub Release pages render the markdown body without a file context, so relative paths produce broken images.

Use the release tag (e.g., v1.20.0) in the URL. Since the release notes are committed before the tag exists, use the tag that will be created by the release pipeline. The format is:
https://raw.githubusercontent.com/oocx/tfplan2md/v{VERSION}/docs/{work-item-folder}/{filename}.png
Important: The release notes file is committed to main before the tag is created. The release workflow copies release-notes.md as the GitHub Release body. Since the tag is created by Versionize on the same commit, the file will be accessible at the tag URL.
# Release notes created first

# Then trying to generate the screenshot
# Result: Broken link if generation fails
# 1. Generate the screenshot
scripts/generate-release-screenshots.sh --plan ... --output-prefix feature-name
# 2. Verify it exists
ls -lh docs/features/NNN/feature-name-crop-light-1x.png
# 3. Then add the metadata + markdown reference
cat >> release-notes.md <<'EOF'
<!-- release-screenshot: selector="summary:has-text('resource_type.resource_name')"; focus="Shows the updated summary line" -->

EOF
See the changes in [comprehensive-demo.md (lines 45-67)](comprehensive-demo.md#L45-L67)
<!-- release-screenshot: target-resource-id="azurerm_network_security_group.example"; focus="Shows the rendered resource details that changed" -->


# But the actual file is named "nsg-rules.png", not "before-screenshot.png"
# 1. Generate screenshots
scripts/generate-release-screenshots.sh --plan ... --output-prefix nsg-rules --output-dir docs/features/072/
# 2. List actual generated files
ls docs/features/072/*.png
# 3. Use the exact filename in markdown with targeting metadata
# Output: docs/features/072/nsg-rules.png
# Wrong: Skipping installation entirely
scripts/generate-release-screenshots.sh --plan ... --output-prefix feature ...
# Result: "Browser not found" error
# Wrong: Using npx (version mismatch with .NET Playwright package)
npx playwright install chromium --with-deps
scripts/generate-release-screenshots.sh --plan ... --output-prefix feature ...
# Result: "Executable doesn't exist at chromium_headless_shell-1200" (npm installed -1208)
dotnet build src/tools/Oocx.TfPlan2Md.ScreenshotGenerator/
pwsh src/tools/Oocx.TfPlan2Md.ScreenshotGenerator/bin/Debug/net10.0/playwright.ps1 install chromium --with-deps
scripts/generate-release-screenshots.sh --plan ... --output-prefix feature ...
src/tools/Oocx.TfPlan2Md.HtmlRenderer renders markdown to HTMLsrc/tools/Oocx.TfPlan2Md.ScreenshotGenerator (Playwright) captures PNG screenshotsUse the website-visual-assets skill (.github/skills/website-visual-assets/SKILL.md) for:
website/_memory/screenshots.md)website/assets/screenshots/)scripts/generate-release-screenshots.sh, scripts/generate-screenshot.shsrc/tools/Oocx.TfPlan2Md.HtmlRenderer, src/tools/Oocx.TfPlan2Md.ScreenshotGenerator.github/skills/website-visual-assets/SKILL.md (for website screenshots)