compare-erb-js

Compare ERB templates with JavaScript-converted outputs to identify HTML parity gaps.

36|6|Updated Apr 6, 2022
One-click install
npx skills add https://github.com/rubys/showcase --skill compare-erb-js
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: compare-erb-js
Source: https://github.com/rubys/showcase/tree/main/.claude/skills/compare-erb-js
Command: npx skills add https://github.com/rubys/showcase --skill compare-erb-js

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

This Skill automates the tedious process of ensuring that ERB templates and their JavaScript-converted equivalents produce identical HTML output. It's essential for the offline scoring SPA, helping you quickly identify and resolve discrepancies, saving hours of manual comparison and debugging.

Core Features & Use Cases

  • Automated Template Comparison: Renders both ERB and JS templates for a given page/heat and highlights differences, ensuring visual and functional parity.
  • Detailed Output Files: Saves ERB HTML, JS HTML, raw data, and hydrated data to /tmp/ for in-depth analysis and debugging.
  • Diff Analysis Guidance: Provides commands for quick and side-by-side diffing, along with explanations of common expected differences due to conversion limitations.
  • Use Case: When making changes to a scoring view, use this skill to automatically compare the ERB and JavaScript outputs, ensuring that the offline SPA behaves identically to the server-rendered version and quickly identifying any discrepancies before deployment.

Quick Start

Use the compare-erb-js skill to compare the ERB and JavaScript template outputs for heat 1 of event 83 in the '2025-barcelona-november' database.

Frequently Asked Questions about compare-erb-js

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I verify that ERB and JavaScript templates produce identical output?

Template parity comparison identifies differences between ERB-rendered and JS-converted HTML. This Skill automates the comparison by rendering both versions, performing diffs, and highlighting discrepancies to ensure server-rendered and client-rendered views match exactly.

When should I compare ERB and JavaScript template outputs?

Compare templates during ERB-to-JS conversion workflows, when debugging template parity issues, and before deploying offline-scoring SPAs. It's essential after making changes to scoring views to confirm the JavaScript version behaves identically to the server-rendered version.

What does the comparison process generate for debugging?

The Skill outputs ERB HTML, JavaScript HTML, raw data, and hydrated data files to /tmp/ for in-depth analysis. It also provides diff commands and explanations of expected differences from conversion limitations.

Can I use this for Rails applications with offline SPAs?

Yes. This Skill is designed for Rails offline-scoring SPAs. It loads Rails routes, renders ERB templates, fetches converted JS templates, hydrates data with heat_hydrator.js, and compares outputs to validate rendering parity across server and client.

What are the limitations of template conversion I should expect?

Some differences between ERB and JavaScript outputs are expected due to conversion limitations. The Skill identifies actual discrepancies requiring fixes versus acceptable differences and documents both in analysis output.