compare-erb-js — community showcase, community, ide skills, Claude Code, Cursor, Windsurf

v1.0.0
GitHub

About this Skill

Perfect for Ruby-focused AI Agents needing precise template output comparison between ERB and JavaScript. Ballroom Dance Showcase Scheduler

rubys rubys
[0]
[0]
Updated: 3/5/2026

Agent Capability Analysis

The compare-erb-js skill by rubys is an open-source community AI agent skill for Claude Code and other IDE workflows, helping agents execute tasks with better context, repeatability, and domain-specific guidance.

Ideal Agent Persona

Perfect for Ruby-focused AI Agents needing precise template output comparison between ERB and JavaScript.

Core Value

Empowers agents to verify matching output between ERB templates and their JavaScript-converted equivalents using Ruby scripts, ensuring consistency for offline scoring SPAs that utilize auto-converted ERB templates with SQLite databases.

Capabilities Granted for compare-erb-js

Comparing heat lists
Validating individual heat outputs
Debugging template conversion discrepancies

! Prerequisites & Limits

  • Requires Ruby environment with bundler
  • SQLite database access needed
  • Specific to ERB and JavaScript template comparison
Labs Demo

Browser Sandbox Environment

⚡️ Ready to unleash?

Experience this Agent in a zero-setup browser environment powered by WebContainers. No installation required.

Boot Container Sandbox

compare-erb-js

Install compare-erb-js, an AI agent skill for AI agent workflows and automation. Works with Claude Code, Cursor, and Windsurf with one-command setup.

SKILL.md
Readonly

Compare ERB vs JavaScript Template Output

Use scripts/render_erb_and_js.rb to verify that ERB templates and their JavaScript-converted equivalents produce matching output. This is essential for the offline scoring SPA which uses auto-converted ERB templates.

Basic Usage

bash
1# Compare heat list 2bundle exec ruby scripts/render_erb_and_js.rb db/2025-barcelona-november.sqlite3 83 3 4# Compare individual heat 5bundle exec ruby scripts/render_erb_and_js.rb db/2025-barcelona-november.sqlite3 83 1 6 7# With style parameter 8bundle exec ruby scripts/render_erb_and_js.rb db/2025-barcelona-november.sqlite3 83 1 radio

Or using environment variable:

bash
1RAILS_APP_DB=2025-barcelona-november bundle exec ruby scripts/render_erb_and_js.rb 83 1

What It Does

  1. Renders the ERB template via Rails routing (extracts <main> content)
  2. Fetches converted JavaScript templates from /templates/scoring.js
  3. Fetches normalized data from /scores/:judge/heats/data
  4. Hydrates the data using heat_hydrator.js (for individual heats)
  5. Renders using the JavaScript template
  6. Compares row counts and saves both outputs for diff analysis

Output Files

All files are saved to /tmp/ for analysis:

  • /tmp/erb_rendered.html - ERB template output (main content only)
  • /tmp/js_rendered.html - JavaScript template output
  • /tmp/scoring_templates.js - Converted templates from /templates/scoring.js
  • /tmp/heats_data.json - Raw normalized data from server
  • /tmp/js_template_data.json - Hydrated data passed to JS template

Analyzing Differences

bash
1# Quick diff 2diff /tmp/erb_rendered.html /tmp/js_rendered.html 3 4# Side-by-side comparison 5diff -y /tmp/erb_rendered.html /tmp/js_rendered.html | less 6 7# Compare specific attributes 8diff <(grep -o 'href="[^"]*"' /tmp/erb_rendered.html | sort) \ 9 <(grep -o 'href="[^"]*"' /tmp/js_rendered.html | sort)

Common Differences

Some differences are expected due to ERB-to-JS conversion limitations:

  • HTML entity encoding: ERB uses &quot; while JS uses "
  • link_to blocks: Block form of link_to may render differently
  • Whitespace: Minor whitespace differences are normal

Architecture

This tool supports the "Server computes, hydration joins, templates filter" principle:

  • Server: Computes derived values and paths (respects RAILS_APP_SCOPE)
  • Hydration: heat_hydrator.js joins normalized data by resolving IDs
  • Templates: ERB and JS templates filter/format data identically

Key Source Files

Server-side (Rails)

  • app/controllers/scores_controller.rb

    • heats_data action: Returns normalized JSON data for SPA
    • heat action: Sets instance variables for ERB templates
    • Computes paths: hash with server-computed URLs
  • app/controllers/templates_controller.rb

    • scoring action: Converts ERB templates to JavaScript on-the-fly
    • Defines path helper stubs for JS templates
    • Uses ErbPrismConverter for conversion
  • lib/erb_prism_converter.rb

    • Converts ERB templates to JavaScript functions using Ruby's Prism parser
    • Handles Ruby-to-JS translation (loops, conditionals, method calls)

Client-side (JavaScript)

  • app/javascript/lib/heat_hydrator.js

    • buildLookupTables(): Creates Maps for O(1) entity lookup
    • hydrateHeat(): Resolves IDs to full objects
    • buildHeatTemplateData(): Prepares complete data for templates
  • app/javascript/controllers/heat_app_controller.js

    • Main Stimulus controller for the offline scoring SPA
    • Loads templates and data, handles navigation
    • Manages offline/online state transitions

ERB Templates (source of truth)

  • app/views/scores/heat.html.erb - Main heat view
  • app/views/scores/heatlist.html.erb - Heat list view
  • app/views/scores/_heat_header.html.erb - Heat header partial
  • app/views/scores/_info_box.html.erb - Info box with feedback errors
  • app/views/scores/_navigation_footer.html.erb - Prev/next navigation
  • app/views/scores/_table_heat.html.erb - Standard heat table
  • app/views/scores/_rank_heat.html.erb - Finals ranking view
  • app/views/scores/_solo_heat.html.erb - Solo heat view
  • app/views/scores/_cards_heat.html.erb - Card-based scoring view

Scripts

  • scripts/render_erb_and_js.rb - This comparison tool
  • scripts/hydrate_heats.mjs - Node.js script for hydrating data (used by comparison tool)

FAQ & Installation Steps

These questions and steps mirror the structured data on this page for better search understanding.

? Frequently Asked Questions

What is compare-erb-js?

Perfect for Ruby-focused AI Agents needing precise template output comparison between ERB and JavaScript. Ballroom Dance Showcase Scheduler

How do I install compare-erb-js?

Run the command: npx killer-skills add rubys/showcase. It works with Cursor, Windsurf, VS Code, Claude Code, and 19+ other IDEs.

What are the use cases for compare-erb-js?

Key use cases include: Comparing heat lists, Validating individual heat outputs, Debugging template conversion discrepancies.

Which IDEs are compatible with compare-erb-js?

This skill is compatible with Cursor, Windsurf, VS Code, Trae, Claude Code, OpenClaw, Aider, Codex, OpenCode, Goose, Cline, Roo Code, Kiro, Augment Code, Continue, GitHub Copilot, Sourcegraph Cody, and Amazon Q Developer. Use the Killer-Skills CLI for universal one-command installation.

Are there any limitations for compare-erb-js?

Requires Ruby environment with bundler. SQLite database access needed. Specific to ERB and JavaScript template comparison.

How To Install

  1. 1. Open your terminal

    Open the terminal or command line in your project directory.

  2. 2. Run the install command

    Run: npx killer-skills add rubys/showcase. The CLI will automatically detect your IDE or AI agent and configure the skill.

  3. 3. Start using the skill

    The skill is now active. Your AI agent can use compare-erb-js immediately in the current project.

Related Skills

Looking for an alternative to compare-erb-js or another community skill for your workflow? Explore these related open-source skills.

View All

widget-generator

Logo of f
f

f.k.a. Awesome ChatGPT Prompts. Share, discover, and collect prompts from the community. Free and open source — self-host for your organization with complete privacy.

149.6k
0
AI

flags

Logo of vercel
vercel

flags is a Next.js feature management skill that enables developers to efficiently add or modify framework feature flags, streamlining React application development.

138.4k
0
Browser

zustand

Logo of lobehub
lobehub

The ultimate space for work and life — to find, build, and collaborate with agent teammates that grow with you. We are taking agent harness to the next level — enabling multi-agent collaboration, effortless agent team design, and introducing agents as the unit of work interaction.

72.8k
0
AI

data-fetching

Logo of lobehub
lobehub

The ultimate space for work and life — to find, build, and collaborate with agent teammates that grow with you. We are taking agent harness to the next level — enabling multi-agent collaboration, effortless agent team design, and introducing agents as the unit of work interaction.

72.8k
0
AI