Single source of truth via assemble.sh splicer#2
Open
jtotty wants to merge 1 commit into
Open
Conversation
Replace the hand-synced inline theme copies with a zero-install splice step. Templates become marker skeletons (<!-- @core:css --> / <!-- @core:js -->); assemble.sh stamps the canonical core.css/core.js into each draft at generation time, so the theme lives in exactly one place and can't drift. - Add skills/visual-explainer-core/scripts/assemble.sh (awk/bash, no Node/Python) - Strip the inlined core from both templates, preserving the comparison skill's domain <style>; re-assembly round-trips byte-identical to the prior output - Update core/software/comparison SKILL.md, CLAUDE.md, README to describe the one-step assembly and drop the now-removed "manual sync" discipline Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
The locked theme now lives in exactly one place and is stamped into each explainer at generation time, instead of being hand-pasted (and kept in sync by discipline) inside every template.
templates/template.htmldrops its ~580-line inlinecore.cssand ~160-line inlinecore.js, keeping the structure, component markup, the Mermaid + Prism CDN tags, and two markers:<!-- @core:css -->/<!-- @core:js -->.skills/visual-explainer-core/scripts/assemble.shsplices the canonicalcore.css/core.jsinto a filled draft at the markers to produce the final self-contained HTML. Zero install —awk+bashonly, no Node/Python, no toolchain.How it works
The script self-locates
core.css/core.jsrelative to itself, reads them verbatim viaawkgetline(byte-exact, no regex-escaping of CSS), and fails loudly if a marker is missing or{{…}}placeholders are left unfilled.Verification
assemble.shreproduces the previous output exactly (diff→ identical) for both skills.code-option-comparisonhas a second, comparison-specific<style>block; only the core block was stripped — its domain styles are untouched.Docs
visual-explainer-core/software-visual-explainer/code-option-comparisonSKILL.md,CLAUDE.md, andREADME.mdupdated to describe the one-step assembly and to remove the now-obsolete "manual sync" discipline.Trade-offs (unchanged by design)
Each explainer is a self-contained snapshot — editing the theme later doesn't retroactively change already-generated files. Output still loads Mermaid + Prism from CDN at view time (same as before).
🤖 Generated with Claude Code