SEO
AuraScore 87/100

Micro-Frontend Canonical Link and OpenGraph Automation Script

Generate a robust Node.js auditing script to validate canonical URLs and dynamic OpenGraph tags across distributed micro-frontend routing layers.

Use this template when deploying complex multi-framework web applications where client-side rendering and edge routing risk canonical tag duplication or missing metadata. It produces a production-ready CI/CD verification script with automated failure alerting.

Template

Role: Lead Technical SEO Architect and Full-Stack Code Auditor specializing in enterprise distributed systems.

Context

  • Target repository or build artifact path: {{repository_path}}
  • Static routing manifest location: {{crawl_manifest_path}}
  • Canonical production root domain: {{canonical_domain_root}}
  • Edge redirect routing table: {{edge_routing_rules}}
  • CI/CD execution runtime: {{target_ci_environment}}
  • Notification alert webhook: {{alert_webhook_url}}

Task

Write an asynchronous Node.js verification script that parses compiled micro-frontend route files, validates canonical and OpenGraph meta tag parity against the edge routing matrix, and outputs structured test results to prevent SEO regressions in automated deployment pipelines.

Method

  1. Initialize a TypeScript-compatible Node.js script using native file system operations and an HTML AST parser (such as Cheerio or Parse5).
  2. Load and parse the route mappings from {{crawl_manifest_path}} and normalize URLs against {{canonical_domain_root}}.
  3. Ingest {{edge_routing_rules}} to account for server-side redirects, trailing slash standards, and localized route permutations.
  4. Traverse static HTML build outputs located in {{repository_path}}, extracting <link rel="canonical">, <meta property="og:url">, and essential title/description tags.
  5. Compare extracted values against computed expected values derived from the route manifest and redirect rules.
  6. Flag anomalies including mismatched protocol/host, missing self-referential canonicals, relative paths, and conflicting OpenGraph tags.
  7. Structure failure payloads with file path, line number, detected tag, expected tag, and route parameters.
  8. Configure automated exit codes and webhook notifications to {{alert_webhook_url}} based on {{target_ci_environment}} execution.

Constraints

  • The script MUST compile and run as standalone TypeScript or modern ES Modules without external runtime dependencies beyond Cheerio.
  • The script MUST NOT suppress unhandled promise rejections or silently pass on missing files.
  • Hardcoded URLs outside of {{canonical_domain_root}} must be flagged as critical errors.
  • Include explicit error boundaries and memory management for large repositories exceeding 5,000 generated HTML documents.

Output format

Provide the response in the following sequence:

  1. Architecture Overview (100-150 words summarizing script logic).
  2. Complete Executable Script (single code block containing complete imports, interfaces, parsing logic, validation runner, and reporting handler).
  3. CI/CD Integration Guide (YAML snippet for pipeline setup and command execution).

Self-review

  • Confirm all 6 context variables are actively utilized within the script logic or configuration.
  • Verify that AST parsing handles both SSR-rendered static HTML and pre-rendered hydration tags correctly.
  • Check that exit codes strictly return 1 on critical validation errors and 0 on clean runs.
AuraScore breakdown
87/100Provisional
Instruction clarity15/15 · Strong

Explicit role, a named task, and discrete steps the model can follow.

Context architecture12/12 · Strong

Background, inputs and variables the model needs before it starts.

Constraint engineering10/12 · Adequate

Hard boundaries — what the model must and must not do.

Output specification14/14 · Strong

A named, field-level shape for the response.

Reasoning structure10/10 · Strong

Ordered work items that force analysis before an answer.

Model compatibility10/10 · Strong

Length and structure that travel across frontier models.

Token efficiency5/10 · Thin

Signal density — instruction weight without padding.

Reusability7/7 · Strong

Documented variables so the scaffold adapts to new inputs.

Robustness3/5 · Adequate

Quality bar, assumptions and behaviour when inputs are thin.

Observed performance1/5 · Thin

How much real usage the template has behind it.

marketing
marketing-seo
software-engineering-debugging
seo
micro-frontends
typescript